12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Interaction Between Callbacks and <strong>ILOG</strong> <strong>CPLEX</strong> Parallel OptimizersWhen you use callback routines, and invoke the parallel implementation of <strong>ILOG</strong> <strong>CPLEX</strong>optimizers, you need to be aware that the <strong>ILOG</strong> <strong>CPLEX</strong> environment passed to the callbackroutine corresponds to an individual <strong>ILOG</strong> <strong>CPLEX</strong> thread rather than to the originalenvironment created. <strong>ILOG</strong> <strong>CPLEX</strong> frees this environment when finished with the thread.This does not affect most uses of the callback function. However, keep in mind that<strong>ILOG</strong> <strong>CPLEX</strong> associates problem objects, parameter settings, and message channels withthe environment that specifies them. <strong>ILOG</strong> <strong>CPLEX</strong> therefore frees these items when itremoves that environment; if the callback uses routines like CPXcreateprob,CPXcloneprob, or CPXgetchannels, those objects remain allocated only as long as theassociated environment does. (You should not change parameters from within a callback.)So, applications that access <strong>ILOG</strong> <strong>CPLEX</strong> objects in the callback should use the originalenvironment you created if they need to access these objects outside the scope of thecallback function.Return Values for CallbacksA user-written callback should return a nonzero value if the user wishes to stop theoptimization and a value of zero otherwise.For LP, QP, or QCP problems, if the callback returns a nonzero value, the solution processwill terminate. If the process was not terminated during the presolve process, the statusreturned by the function IloCplex::getStatus or the routines CPXsolution orCPXgetstat will be CPX_STAT_ABORT_USER.For both LP, QP, QCP, and MIP problems, if the LP/QP/QCP callback returns a nonzerovalue during preprocessing, the optimizer will return the value CPXERR_PRESLV_ABORT,and no solution information will be available.For MIP problems, if the callback returns a nonzero value, the solution process willterminate and the status returned by IloCplex::getStatus or CPXgetstat will be oneof the values in Table 30.4.Table 30.4 Status of Nonzero Callbacks for MIPsSymbolic constantCPXMIP_ABORT_FEASCPXMIP_ABORT_INFEASMeaningcurrent solution integer feasibleno integer feasible solution found<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 467

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!