parallel mode switch
Sets the parallel optimization mode. Possible modes are automatic, deterministic, and opportunistic.
Purpose
Parallel mode switch
|
Description
Sets the parallel optimization mode. Possible modes are automatic, deterministic, and opportunistic.
In this context, deterministic means that multiple runs with the same model at the same parameter settings on the same platform will reproduce the same solution path and results. In contrast, opportunistic implies that even slight differences in timing among threads or in the order in which tasks are executed in different threads may produce a different solution path and consequently different timings or different solution vectors during optimization executed in parallel threads. In multithreaded applications, the opportunistic setting entails less synchronization between threads and consequently may provide better performance.
By default, CPLEX applies as much parallelism as possible while still achieving deterministic results. That is, when you run the same model twice on the same platform with the same parameter settings, you will see the same solution and optimization run. This condition is referred to as the deterministic mode.
More opportunities to exploit parallelism are available if you do not require determinism. In other words, CPLEX can find more possibilities for parallelism if you do not require an invariant, repeatable solution path and precisely the same solution vector. To use all available parallelism, you need to select the opportunistic parallel mode. In this mode, CPLEX will use all opportunities for parallelism in order to achieve best performance.
However, in opportunistic mode, the actual optimization may differ from run to run, including the solution time itself and the path traveled in the search.
Deterministic and sequential optimization
Parallel MIP optimization can be opportunistic or deterministic.
Parallel barrier optimization is only deterministic.
Concurrent optimization can be opportunistic or deterministic. In either mode, when six or more threads are available, concurrent optimization launches primal simplex, dual simplex, and barrier optimizers by default. If ten threads are available to CPLEX, concurrent optimization launches primal simplex, dual simplex, barrier, and sifting (if sifting is applicable to the current type of problem).
Callbacks and MIP optimization
If legacy or generic callbacks are used for solving a MIP, in a parallel MIP optimization the order in which the callbacks are executed from different threads can be non-deterministic, even in deterministic parallel mode. It is then your responsibility to make sure that your callbacks do not perform operations that could lead to opportunistic behavior and are implemented in a thread-safe way.
For a description of legacy callbacks see Using legacy optimization callbacks and Advanced MIP control interface (legacy) in the CPLEX User’s Manual.
For a description of generic callbacks, see the topic Generic callbacks in the CPLEX User’s Manual.
Determinism versus opportunism
This parameter also allows you to turn off this default setting by choosing value -1 (minus one). Cases where you might wish to turn off deterministic search include situations where you want to take advantage of possibly faster performance of opportunistic parallel MIP optimization in multiple threads after you have confirmed that deterministic parallel MIP optimization produced the results you expected.
Value | Symbolic Constant Callable Library |
Symbolic Constant Concert Technology |
Meaning |
---|---|---|---|
-1 | CPX_PARALLEL_OPPORTUNISTIC |
Opportunistic |
Enable opportunistic parallel search mode |
0 | CPX_PARALLEL_AUTO |
AutoParallel |
Automatic: let CPLEX decide whether to invoke deterministic or opportunistic search; default |
1 | CPX_PARALLEL_DETERMINISTIC |
Deterministic |
Enable deterministic parallel search mode |
See also: global thread count: CPX_PARAM_THREADS
, Threads