Control callbacks and parallel search
Describes control callbacks as compatible with parallel search.
Parallel search is compatible with control callbacks. However, in those situations, users must
pay particular attention to their callback functions in order to obtain a deterministic search
procedure. For that reason, CPLEX disables parallel MIP search by default when any callback other
than an informational callback is present in the user’s application, and automatically switches to
sequential MIP search. Note, however, that this is not entirely equivalent to setting the global
thread count, global thread count
(CPX_PARAM_THREADS, Threads), to 1 (one), as the continuous
relaxation of the problem will still be solved in a parallel fashion.
If you want to enforce parallel behavior
in the presence of control callbacks, you can override the default
behavior of CPLEX by means of the
global thread count
(CPX_PARAM_THREADS, Threads);
set its value to a nonzero positive number greater than 1 (one).
However, even if you turn on parallel search in this way, the order in which your callbacks are executed from different threads can be nondeterministic even in deterministic parallel mode. Your application can safely interact with the CPLEX environment and with the problem object passed to the callback, but side effects that your callback produces on other data is nondeterministic. Thus, if you base the algorithmic decisions inside your control callback on such data, the resulting algorithm can be nondeterministic, even if you have selected deterministic parallel mode.
For more information about deterministic and opportunistic parallel MIP optimization, see Determinism of results and Parallel MIP optimizer.