The Decomposition Algorithm

Example 15.10 ATM Cash Management in Distributed Mode

This section illustrates how you can use PROC OPTMODEL and the decomposition algorithm in distributed mode. The problem is the same as the one described in Example 15.9 for managing the cash flow of an ATM network. The only difference between single-machine and distributed mode is that the PERFORMANCE statement specifies the number of threads to be used in single-machine mode or the number of threads and nodes to be used in distributed mode.

The following statement changes the operating mode to distributed mode:

   /* set the number of nodes and threads and get performance details */
   performance details nodes=5 nthreads=4;

The performance information is displayed in Output 15.10.1. When you specify NODES=5 and NTHREADS=4 in the PERFORMANCE statement in distributed mode, each grid node processes up to four threads simultaneously.

Output 15.10.1: Performance Information

Performance Information
   
Host Node << your grid host >
Execution Mode Distributed
Number of Compute Nodes 5
Number of Threads per Node 4



The solution summary and procedure task timing tables are displayed in Output 15.10.2.

Output 15.10.2: Performance Information, Solution Summary, and Task Timing Tables

Solution Summary
Solver MILP
Algorithm Decomposition
Objective Function CashFlowDiff
Solution Status Optimal within Relative Gap
Objective Value 2463561.0129
   
Relative Gap 6.3403263E-6
Absolute Gap 15.619681743
Primal Infeasibility 7.944436E-10
Bound Infeasibility 3.4861E-14
Integer Infeasibility 2.027267E-13
   
Best Bound 2463545.3932
Nodes 9
Iterations 16
Presolve Time 1.03
Solution Time 46.22

Procedure Task Timing
Task Time
(sec.)
% Time
Problem Generation 0.04 0.09%
Solver Initialization 0.23 0.50%
Code Generation 0.00 0.00%
Solver 46.22 98.82%
Solver Postprocessing 0.28 0.59%

Performance Information
   
Host Node << your grid host >
Execution Mode Distributed
Number of Compute Nodes 5
Number of Threads per Node 4



The iteration log, which contains the problem statistics, the progress of the solution, and the optimal objective value, is shown in Output 15.10.3.

Output 15.10.3: Log

NOTE: There were 100 observations read from the data set WORK.BUDGET_DATA.                      
NOTE: There were 20 observations read from the data set WORK.CASHOUT_DATA.                      
NOTE: There were 2000 observations read from the data set WORK.POLYFIT_DATA.                    
NOTE: Problem generation will use 4 threads.                                                    
NOTE: The problem has 6480 variables (0 free, 0 fixed).                                         
NOTE: The problem has 2220 binary and 0 integer variables.                                      
NOTE: The problem has 4380 linear constraints (2340 LE, 2040 EQ, 0 GE, 0 range).                
NOTE: The problem has 58878 linear constraint coefficients.                                     
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).                      
NOTE: The MILP presolver value AUTOMATIC is applied.                                            
NOTE: The MILP presolver removed 553 variables and 385 constraints.                             
NOTE: The MILP presolver removed 1303 constraint coefficients.                                  
NOTE: The MILP presolver modified 0 constraint coefficients.                                    
NOTE: The presolved problem has 5927 variables, 3995 constraints, and 57575 constraint          
      coefficients.                                                                             
NOTE: The MILP solver is called.                                                                
NOTE: The Decomposition algorithm is used.                                                      
NOTE: The Decomposition algorithm is executing in the distributed computing environment with 5  
      worker nodes.                                                                             
NOTE: The DECOMP method value USER is applied.                                                  
NOTE: The problem has a decomposable structure with 20 blocks. The largest block covers 5.13%   
      of the constraints in the problem.                                                        
NOTE: The decomposition subproblems cover 5927 (100.00%) variables and 3895 (97.50%)            
      constraints.                                                                              
NOTE: The deterministic parallel mode is enabled.                                               
NOTE: The Decomposition algorithm is using up to 4 threads.                                     
      Iter         Best       Master         Best       LP       IP Real                        
                  Bound    Objective      Integer      Gap      Gap Time                        
NOTE: Starting phase 1.                                                                         
         1       0.0000       1.1767            . 1.18e+00        .    6                        
         2       0.0000       0.0000            .    0.00%        .    6                        
NOTE: Starting phase 2.                                                                         
         .   2.4432e+06   2.6909e+06   2.8092e+06   10.14%   14.98%    7                        
         4   2.4526e+06   2.4878e+06   2.8092e+06    1.44%   14.54%   19                        
         5   2.4630e+06   2.4642e+06   2.8092e+06    0.05%   14.06%   22                        
NOTE: The Decomposition algorithm stopped on the continuous RELOBJGAP= option.                  
         .   2.4630e+06   2.4632e+06   2.4701e+06    0.01%    0.29%   22                        
NOTE: Starting branch and bound.                                                                
         Node  Active   Sols         Best         Best      Gap   Real                          
                                  Integer        Bound            Time                          
            0       1      2   2.4701e+06   2.4630e+06    0.29%     22                          
            8       2      3   2.4636e+06   2.4635e+06    0.00%     43                          
NOTE: The Decomposition algorithm used 4 threads.                                               
NOTE: The Decomposition algorithm time is 43.19 seconds.                                        
NOTE: Optimal within relative gap.                                                              
NOTE: Objective = 2463561.0129.                                                                 
NOTE: The data set WORK.PERFINFO has 4 observations and 3 variables.                            



Notice how this iteration log differs from the iteration log from single-machine mode in Example 15.9. In distributed mode, the processing is done on multiple grid machines, as opposed to being done on one client machine in single-machine mode. In this example, the grid machines and the client machine have different operating systems, and some numerical rounding off leads to different paths in the search space. When you compare two runs on different operating systems (or that use different compilers), this behavior is expected.