parallel mode switch

Sets the parallel optimization mode. Possible modes are automatic, deterministic, and opportunistic.

Purpose

Parallel mode switch

API Parameter Name Name prior to V12.6.0
C CPXPARAM_Parallel CPX_PARAM_PARALLELMODE
C++ IloCplex::Param::Parallel ParallelMode (int)
Java IloCplex.Param.Parallel ParallelMode (int)
.NET Cplex.Param.Parallel ParallelMode (int)
OPL parallelmode
Python parameters.parallel parallel
MATLAB Cplex.Param.parallel parallel
Interactive parallel parallel
Identifier 1109 1109

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).

Tip: This parallel mode parameter also applies to distributed parallel MIP optimization. That is, you can instruct CPLEX to execute distributed parallel MIP optimization either opportunistically or deterministically.

Callbacks and MIP optimization

If callbacks other than informational callbacks are used for solving a MIP, the order in which the callbacks are called cannot be guaranteed to remain deterministic, not even in deterministic mode. Thus, to make sure of deterministic runs when the parallel mode parameter and the global default thread count parameter are at their default settings, CPLEX reverts to sequential solving of the MIP in the presence of query callbacks, diagnostic callbacks, or control callbacks.

Consequently, if your application invokes query, diagnostic, or control callbacks, and you still prefer deterministic parallel search, you can choose value 1 (one), overriding the automatic setting and turning on deterministic parallel search. 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. To meet these conditions, your application must not store and must not update any information in the callbacks.

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.

Table 1. Values
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