implementation of concurrent solver interface for SCIP
Definition in file concsolver_scip.c.
#include "blockmemshell/memory.h"#include "scip/boundstore.h"#include "scip/concsolver.h"#include "scip/concsolver_scip.h"#include "scip/concurrent.h"#include "scip/pub_disp.h"#include "scip/pub_event.h"#include "scip/pub_heur.h"#include "scip/pub_message.h"#include "scip/pub_misc.h"#include "scip/pub_paramset.h"#include "scip/pub_sol.h"#include "scip/pub_var.h"#include "scip/scip_concurrent.h"#include "scip/scip_copy.h"#include "scip/scip_event.h"#include "scip/scip_general.h"#include "scip/scip_heur.h"#include "scip/scip_mem.h"#include "scip/scip_message.h"#include "scip/scip_numerics.h"#include "scip/scip_param.h"#include "scip/scip_prob.h"#include "scip/scip_sol.h"#include "scip/scip_solve.h"#include "scip/scip_solvingstats.h"#include "scip/scip_timing.h"#include "scip/syncstore.h"#include <string.h>Go to the source code of this file.
Macros | |
| #define | EVENTHDLR_NAME "sync" |
| #define | EVENTHDLR_DESC "event handler for synchronization of concurrent scip solvers" |
| #define EVENTHDLR_NAME "sync" |
Definition at line 68 of file concsolver_scip.c.
Definition at line 69 of file concsolver_scip.c.
Referenced by executeLNSHeuristic(), includeEventHdlrSync(), SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXEC(), SCIPapplyProximity(), SCIPconflictstoreCreate(), SCIPcreateEventHdlrBestsol(), SCIPcreateProbColoring(), SCIPincludeConshdlrAnd(), SCIPincludeConshdlrBounddisjunction(), SCIPincludeConshdlrCardinality(), SCIPincludeConshdlrCumulative(), SCIPincludeConshdlrExactLinear(), SCIPincludeConshdlrKnapsack(), SCIPincludeConshdlrLinear(), SCIPincludeConshdlrLinking(), SCIPincludeConshdlrLogicor(), SCIPincludeConshdlrOr(), SCIPincludeConshdlrRpa(), SCIPincludeConshdlrSetppc(), SCIPincludeConshdlrSOS1(), SCIPincludeConshdlrSOS2(), SCIPincludeConshdlrVarbound(), SCIPincludeConshdlrXor(), SCIPincludeEventHdlrBestsol(), SCIPincludeEventHdlrBoundwriting(), SCIPincludeEventHdlrEstim(), SCIPincludeEventHdlrGlobalbnd(), SCIPincludeEventHdlrLPsol(), SCIPincludeEventHdlrNewsol(), SCIPincludeEventHdlrShadowTree(), SCIPincludeEventHdlrSofttimelimit(), SCIPincludeEventHdlrSolvingphase(), SCIPincludeHeurNlpdiving(), SCIPincludeHeurShiftandpropagate(), SCIPincludeOrbitopalReduction(), SCIPincludePropGenvbounds(), SCIPincludePropPseudoobj(), SCIPincludePropVbounds(), SCIPincludeSepaIntobj(), SCIPnlpInclude(), SCIPprobdataCreate(), SCIPreoptCreate(), setupAndSolve(), setupAndSolve(), setupAndSolveSubscip(), setupAndSolveSubscipCrossover(), setupAndSolveSubscipLocalbranching(), setupAndSolveSubscipTrustregion(), solveSubscipLpface(), wrapperDins(), and wrapperRins().
|
static |
destructor of event handler to free user data (called when SCIP is exiting)
Definition at line 87 of file concsolver_scip.c.
References assert(), EVENTHDLR_NAME, NULL, SCIP_OKAY, SCIPeventhdlrGetData(), SCIPeventhdlrGetName(), SCIPeventhdlrSetData(), and SCIPfreeBlockMemory.
|
static |
initialization method of event handler (called after problem was transformed)
Definition at line 107 of file concsolver_scip.c.
References assert(), EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_EVENTTYPE_SYNC, SCIP_OKAY, SCIPcatchEvent(), SCIPeventhdlrGetData(), SCIPeventhdlrGetName(), SCIPgetSyncstore(), and SCIPsyncstoreIsInitialized().
|
static |
deinitialization method of event handler (called before transformed problem is freed)
Definition at line 133 of file concsolver_scip.c.
References assert(), EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_EVENTTYPE_SYNC, SCIP_OKAY, SCIPdropEvent(), SCIPeventhdlrGetData(), and SCIPeventhdlrGetName().
|
static |
execution method of event handler
Definition at line 156 of file concsolver_scip.c.
References assert(), EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPeventhdlrGetName(), and SCIPsynchronize().
|
static |
includes event handler for synchronization found
Definition at line 171 of file concsolver_scip.c.
References assert(), EVENTHDLR_DESC, EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPincludeEventhdlrBasic(), SCIPsetEventhdlrExit(), SCIPsetEventhdlrFree(), and SCIPsetEventhdlrInit().
Referenced by SCIP_DECL_CONCSOLVERCREATEINST().
|
static |
Disable dual reductions that might cut off optimal solutions. Although they keep at least one optimal solution intact, communicating these bounds may cut off all optimal solutions, if different optimal solutions were kept in different concurrent solvers.
Definition at line 211 of file concsolver_scip.c.
References FALSE, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPgetBoolParam(), and SCIPsetBoolParam().
Referenced by SCIP_DECL_CONCSOLVERCREATEINST().
|
static |
sets the child selection rule based on the index of the concurrent solver
| concsolver | the concurrent solver |
Definition at line 229 of file concsolver_scip.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverGetData(), SCIPconcsolverGetIdx(), and SCIPsetCharParam().
Referenced by SCIP_DECL_CONCSOLVERCREATEINST().
|
static |
initialize the concurrent SCIP solver, i.e., setup the copy of the problem and the mapping of the variables
Definition at line 249 of file concsolver_scip.c.
References assert(), FALSE, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddSolFree(), SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPblkmem(), SCIPconcsolverGetData(), SCIPconcsolverGetName(), SCIPcopyConsCompression(), SCIPcreate(), SCIPcreateConcurrent(), SCIPcreateSol(), SCIPdebugMessage, SCIPfreeBufferArray, SCIPgetBestSol(), SCIPgetFixedVars(), SCIPgetMessagehdlr(), SCIPgetNFixedVars(), SCIPgetNOrigVars(), SCIPgetNSols(), SCIPgetNVars(), SCIPgetSolVal(), SCIPgetVars(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPmessagehdlrIsQuiet(), SCIPsetBoolParam(), SCIPsetMessagehdlrQuiet(), SCIPsetSolVal(), SCIPvarGetProbindex(), TRUE, valid, and var.
Referenced by SCIP_DECL_CONCSOLVERCREATEINST().
|
static |
creates an instance of a concurrent SCIP solver
Definition at line 393 of file concsolver_scip.c.
References assert(), BMSallocMemory, disableConflictingDualReductions(), FALSE, i, includeEventHdlrSync(), initConcsolver(), NULL, paramname, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_CLOCKTYPE_WALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_VERBLEVEL_FULL, SCIPallocBufferArray, SCIPconcsolverGetIdx(), SCIPconcsolverGetName(), SCIPconcsolverSetData(), SCIPconcsolverTypeGetData(), SCIPfileExists(), SCIPfixParam(), SCIPfreeBufferArray, SCIPgetBoolParam(), SCIPgetNParams(), SCIPgetParams(), SCIPgetStringParam(), SCIPinfoMessage(), SCIPparamGetName(), SCIPreadParams(), SCIPsetBoolParam(), SCIPsetEmphasis(), SCIPsetIntParam(), SCIPsnprintf(), SCIPunfixParam(), SCIPverbMessage(), setChildSelRule(), and TRUE.
|
static |
destroys an instance of a concurrent SCIP solver
Definition at line 500 of file concsolver_scip.c.
References assert(), BMSfreeMemory, NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverGetData(), SCIPconcsolverSetData(), SCIPfree(), and SCIPfreeBlockMemoryArray.
|
static |
frees the data of a concurrent solver type
Definition at line 523 of file concsolver_scip.c.
References assert(), BMSfreeMemory, and NULL.
|
static |
initializes the random and permutation seeds and enables permutation of constraints and variables
Definition at line 531 of file concsolver_scip.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverGetData(), SCIPconcsolverGetName(), SCIPinfoMessage(), SCIPsetBoolParam(), SCIPsetIntParam(), and TRUE.
|
static |
extracts solving status of this concurrent solver and the solving statistics into the given SCIP instance
Definition at line 554 of file concsolver_scip.c.
References assert(), FALSE, i, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddSolFree(), SCIPallocBufferArray, SCIPcheckSol(), SCIPconcsolverGetData(), SCIPcopyConcurrentSolvingStats(), SCIPcopySolStats(), SCIPcreateSol(), SCIPfindHeur(), SCIPfreeBufferArray, SCIPgetNSols(), SCIPgetNVars(), SCIPgetSols(), SCIPgetSolVals(), SCIPgetVars(), SCIPheurGetName(), SCIPsetSolVals(), SCIPsolGetHeur(), and TRUE.
|
static |
execution method of SCIP concsolver solver
Start solving the problem until the solving reaches a limit, gets interrupted, or just finished successfully.
Definition at line 630 of file concsolver_scip.c.
References assert(), nlpiterations, nnodes, NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverGetData(), SCIPconcsolverGetName(), SCIPdispTime(), SCIPgetMessagehdlr(), SCIPgetNLPIterations(), SCIPgetNNodes(), SCIPgetSolvingTime(), SCIPinfoMessage(), SCIPprintStatus(), and SCIPsolve().
|
static |
stops the concurrent solver as soon as possible
Definition at line 666 of file concsolver_scip.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverGetData(), and SCIPinterruptSolve().
|
static |
writes new solutions and global boundchanges to the given synchronization data
Definition at line 682 of file concsolver_scip.c.
References assert(), i, MIN, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_STATUS_UNKNOWN, SCIPconcsolverGetData(), SCIPconcsolverGetIdx(), SCIPconcsolverGetName(), SCIPdebugMessage, SCIPgetConcurrentGlobalBoundChanges(), SCIPgetDualbound(), SCIPgetMemTotal(), SCIPgetNSols(), SCIPgetPrimalbound(), SCIPgetSolOrigObj(), SCIPgetSols(), SCIPgetSolVals(), SCIPgetStatus(), SCIPIsConcurrentSolNew(), SCIPsyncdataAddBoundChanges(), SCIPsyncdataAddMemTotal(), SCIPsyncdataGetSolutionBuffer(), SCIPsyncdataGetStatus(), SCIPsyncdataSetLowerbound(), SCIPsyncdataSetStatus(), and SCIPsyncdataSetUpperbound().
|
static |
reads the solutions and bounds from the given synchronization data
Definition at line 763 of file concsolver_scip.c.
References assert(), FALSE, i, NULL, nvars, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIPaddConcurrentBndchg(), SCIPaddConcurrentSol(), SCIPboundstoreGetChgType(), SCIPboundstoreGetChgVal(), SCIPboundstoreGetChgVaridx(), SCIPboundstoreGetNChgs(), SCIPcheckSol(), SCIPconcsolverGetData(), SCIPconcsolverGetIdx(), SCIPconcsolverGetName(), SCIPcreateOrigSol(), SCIPdebugMessage, SCIPisGE(), SCIPisLE(), SCIPsetSolVals(), SCIPsyncdataGetBoundChgs(), SCIPsyncdataGetSolutions(), SCIPvarGetLbGlobal(), SCIPvarGetProbvarBound(), SCIPvarGetStatus(), SCIPvarGetUbGlobal(), SCIPvarIsNonimpliedIntegral(), TRUE, and var.
| SCIP_RETCODE SCIPincludeConcurrentScipSolvers | ( | SCIP * | scip | ) |
creates the concurrent SCIP solver plugins and includes them in SCIP
Definition at line 860 of file concsolver_scip.c.
References assert(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PARAMEMPHASIS_COUNTER, SCIP_PARAMEMPHASIS_CPSOLVER, SCIP_PARAMEMPHASIS_DEFAULT, SCIP_PARAMEMPHASIS_EASYCIP, SCIP_PARAMEMPHASIS_FEASIBILITY, SCIP_PARAMEMPHASIS_HARDLP, SCIP_PARAMEMPHASIS_OPTIMALITY, SCIPallocMemory, SCIPincludeConcsolverType(), and TRUE.
Referenced by SCIPincludeDefaultPlugins().