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 use in single-machine mode or the number of threads and nodes to use 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
The solution summary and procedure task timing tables are displayed in Output 15.10.2.
Output 15.10.2: Solution Summary and Task Timing Tables
Solution Summary | |
---|---|
Solver | MILP |
Algorithm | Decomposition |
Objective Function | CashFlowDiff |
Solution Status | Optimal within Relative Gap |
Objective Value | 2477152.1046 |
Relative Gap | 0.0057620003 |
Absolute Gap | 14191.57937 |
Primal Infeasibility | 2.50111E-12 |
Bound Infeasibility | 2.442491E-15 |
Integer Infeasibility | 2.442491E-15 |
Best Bound | 2462960.5253 |
Nodes | 1 |
Iterations | 6 |
Presolve Time | 0.30 |
Solution Time | 16.93 |
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 308 variables and 209 constraints. |
NOTE: The MILP presolver removed 726 constraint coefficients. |
NOTE: The MILP presolver modified 0 constraint coefficients. |
NOTE: The presolved problem has 6172 variables, 4171 constraints, and 58152 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.131% |
of the constraints in the problem. |
NOTE: The decomposition subproblems cover 6172 (100%) variables and 4071 (97.6%) 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. |
3 2.4432e+06 2.5891e+06 . 5.97% . 9 |
4 2.4550e+06 2.4794e+06 . 1.00% . 12 |
5 2.4630e+06 2.4642e+06 . 0.05% . 14 |
NOTE: The Decomposition algorithm stopped on the continuous RELOBJGAP= option. |
. 2.4630e+06 2.4632e+06 2.4772e+06 0.01% 0.58% 14 |
NOTE: The Decomposition algorithm stopped on the integer RELOBJGAP= option. |
Node Active Sols Best Best Gap Real |
Integer Bound Time |
0 0 1 2.4772e+06 2.4630e+06 0.58% 14 |
NOTE: The Decomposition algorithm used 4 threads. |
NOTE: The Decomposition algorithm time is 14.08 seconds. |
NOTE: Optimal within relative gap. |
NOTE: Objective = 2477152.1046. |
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.