Query callbacks and parallel search

Describes query callbacks with respect to parallel search and thread safety.

Query or diagnostic callbacks provide additional information about the optimization not available from informational callbacks. Query or diagnostic callbacks are compatible with deterministic parallel search, but , in contrast to informational callbacks, the order in which CPLEX calls query or diagnostic callbacks is nondeterministic. Therefore, determinism of the runs is sure only if the query callback uses output obtained only by specific methods or functions in the callback API designed to provide information. If the callback examines any additional information, such as data passed to the callback from the user, information from system calls, information based on the history of callback invocations, or other accesses or changes to shared data, determinism of consecutive runs may be compromised.

In order to make sure of thread safety, CPLEX locks the query callbacks when they are used with either mode of parallel search.

For more information about deterministic and opportunistic parallel MIP optimization, see Determinism of results and Parallel MIP optimizer.