CPLEX Parallel Mode

From TomWiki
Jump to navigationJump to search

Notice.png

This page is part of the CPLEX Manual. See CPLEX.

Sets the parallel optimization mode (PARALLELMODE in CPLEX Parameter Table). 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 pro- duce 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 opportunities for parallelism if you do not require and invariant, repeatable solution path and pre- cisely the same solution vector. To use all available parallelism, you need to select the opportunistic parallel mode. In this mode, CPLEX will utilize 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.

Deterministic and Sequential Optimization

A truly parallel deterministic algorithm is available only for MIP optimization.

Only opportunistic parallel algorithms (barrier and concurrent optimizers) are available for continuous models. (Each of the simplex algorithms runs sequentially on a continuous model.)

Consequently, when parallel mode is set to deterministic, both barrier and concurrent optimizers are restricted to run only sequentially, not in parallel.

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 is at its default setting, CPLEX will revert 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 search, you can choose value 1 (one), overriding the automatic setting and turning on deterministic search. It is then your responsibility to make sure that your callbacks do not perform operations that could lead to opportunis- tic 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 vs Opportunism in Development and Deployment

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. For example, you may want to develop your application in deterministic mode, taking advantage of the invariance and repeatability of the solution path and results until you verify that your model and application behave as expected; then you might want to turn off default deterministic mode and run your application in opportunistic mode to see whether your particular model and application benefit from possible performance improvements; if so, you might choose to deploy your application in opportunistic mode.

Interaction with Threads Parameter

Settings of this parallel mode parameter interact with settings of the thread parameter (THREADS).

The default (automatic) setting of the parallel mode parameter allows CPLEX to choose between deterministic and opportunistic mode depending on the threads parameter. If the threads parameter is set to its automatic setting (the default), CPLEX chooses deterministic mode.

Otherwise, if the threads parameter is set to a value greater than one, CPLEX chooses opportunistic mode