68#define EVENTHDLR_NAME "sync"
69#define EVENTHDLR_DESC "event handler for synchronization of concurrent scip solvers"
76struct SCIP_EventhdlrData
145 if( eventhdlrdata->filterpos >= 0 )
148 eventhdlrdata->filterpos = -1;
179 eventhdlrdata->filterpos = -1;
193struct SCIP_ConcSolverTypeData
200struct SCIP_ConcSolverData
234 static const char childsel[] = {
'h',
'i',
'p',
'r',
'l',
'd',
'u' };
313 for( v = 0; v < nmainvars; v++ )
324 assert(varperm[idx] == 0);
328 mainallvars[v] = mainvars[v];
334 for( v = 0; v < nmainfixedvars; v++ )
347 data->vars[cnt] =
var;
348 assert(varperm[idx] == 0);
352 mainallvars[cnt] = mainfixedvars[v];
357 assert( cnt == data->nvars );
368 for( v = 0; v < data->nvars; ++v )
413 if( typedata->loademphasis )
427 for(
i = 0;
i < nparams; ++
i )
433 if( strncmp(
paramname,
"limits/", 7) == 0 ||
434 strncmp(
paramname,
"numerics/", 9) == 0 ||
436 strncmp(
paramname,
"concurrent/sync/", 16) == 0 ||
437 strncmp(
paramname,
"heuristics/sync/", 16) == 0 ||
438 strncmp(
paramname,
"propagating/sync/", 17) == 0 )
440 fixedparams[nfixedparams++] = params[
i];
447 for(
i = 0;
i < nfixedparams; ++
i )
585 for(
i = 0;
i < nsols; ++
i )
602#ifdef SCIP_CHECK_MAINSCIP_SOLUTION
699 if ( maxcandsols <= 0 )
719 nsols =
MIN(nsols, maxcandsols);
722 for(
i = 0;
i < nsols; ++
i )
737 if( solvals ==
NULL )
744 if( *nsolsshared == maxsharedsols )
751 if( boundstore !=
NULL )
790 for(
i = 0;
i < nsols; ++
i )
796 if( concsolverids[
i] == concsolverid )
816 *ntighterintbnds = 0;
820 for(
i = 0;
i < nbndchgs; ++
i )
829 var = data->vars[idx];
850 ++(*ntighterintbnds);
873 data->loademphasis =
FALSE;
875 concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
876 concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
879 data->loademphasis =
TRUE;
882 concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
883 concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
886 data->loademphasis =
TRUE;
889 concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
890 concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
893 data->loademphasis =
TRUE;
896 concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
897 concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
900 data->loademphasis =
TRUE;
903 concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
904 concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
907 data->loademphasis =
TRUE;
910 concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
911 concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
914 data->loademphasis =
TRUE;
917 concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
918 concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
921 data->loademphasis =
TRUE;
924 concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
925 concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
SCIP_Real SCIPboundstoreGetChgVal(SCIP_BOUNDSTORE *boundstore, int i)
SCIP_BOUNDTYPE SCIPboundstoreGetChgType(SCIP_BOUNDSTORE *boundstore, int i)
int SCIPboundstoreGetChgVaridx(SCIP_BOUNDSTORE *boundstore, int i)
int SCIPboundstoreGetNChgs(SCIP_BOUNDSTORE *boundstore)
the interface of the bound store data structure
SCIP_CONCSOLVERDATA * SCIPconcsolverGetData(SCIP_CONCSOLVER *concsolver)
void SCIPconcsolverSetData(SCIP_CONCSOLVER *concsolver, SCIP_CONCSOLVERDATA *data)
int SCIPconcsolverGetIdx(SCIP_CONCSOLVER *concsolver)
char * SCIPconcsolverGetName(SCIP_CONCSOLVER *concsolver)
SCIP_CONCSOLVERTYPEDATA * SCIPconcsolverTypeGetData(SCIP_CONCSOLVERTYPE *concsolvertype)
data structures for concurrent solvers
static SCIP_RETCODE initConcsolver(SCIP *scip, SCIP_CONCSOLVER *concsolver)
SCIP_RETCODE SCIPincludeConcurrentScipSolvers(SCIP *scip)
static SCIP_RETCODE disableConflictingDualReductions(SCIP *scip)
static SCIP_RETCODE setChildSelRule(SCIP_CONCSOLVER *concsolver)
static SCIP_RETCODE includeEventHdlrSync(SCIP *scip)
implementation of concurrent solver interface for SCIP
SCIP_RETCODE SCIPcreateConcurrent(SCIP *scip, SCIP_CONCSOLVER *concsolver, int *varperm, int nvars)
SCIP_RETCODE SCIPsynchronize(SCIP *scip)
SCIP_RETCODE SCIPaddConcurrentBndchg(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE bndtype)
SCIP_RETCODE SCIPcopySolStats(SCIP_SOL *source, SCIP_SOL *target)
SCIP_BOUNDSTORE * SCIPgetConcurrentGlobalBoundChanges(SCIP *scip)
SCIP_Bool SCIPIsConcurrentSolNew(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPcopyConcurrentSolvingStats(SCIP *source, SCIP *target)
SCIP_RETCODE SCIPaddConcurrentSol(SCIP *scip, SCIP_SOL *sol)
helper functions for concurrent scip solvers
SCIP_RETCODE SCIPcopyConsCompression(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool threadsafe, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
SCIP_Bool SCIPfileExists(const char *filename)
SCIP_RETCODE SCIPprintStatus(SCIP *scip, FILE *file)
SCIP_RETCODE SCIPfree(SCIP **scip)
SCIP_RETCODE SCIPcreate(SCIP **scip)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIPgetNOrigVars(SCIP *scip)
int SCIPgetNFixedVars(SCIP *scip)
SCIP_VAR ** SCIPgetFixedVars(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
void SCIPsetMessagehdlrQuiet(SCIP *scip, SCIP_Bool quiet)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
int SCIPgetNParams(SCIP *scip)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPreadParams(SCIP *scip, const char *filename)
SCIP_RETCODE SCIPunfixParam(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetEmphasis(SCIP *scip, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
SCIP_RETCODE SCIPgetStringParam(SCIP *scip, const char *name, char **value)
SCIP_PARAM ** SCIPgetParams(SCIP *scip)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
SCIP_RETCODE SCIPfixParam(SCIP *scip, const char *name)
SCIP_RETCODE SCIPincludeConcsolverType(SCIP *scip, const char *name, SCIP_Real prefpriodefault, SCIP_DECL_CONCSOLVERCREATEINST((*concsolvercreateinst)), SCIP_DECL_CONCSOLVERDESTROYINST((*concsolverdestroyinst)), SCIP_DECL_CONCSOLVERINITSEEDS((*concsolverinitseeds)), SCIP_DECL_CONCSOLVEREXEC((*concsolverexec)), SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA((*concsolvercopysolvdata)), SCIP_DECL_CONCSOLVERSTOP((*concsolverstop)), SCIP_DECL_CONCSOLVERSYNCWRITE((*concsolversyncwrite)), SCIP_DECL_CONCSOLVERSYNCREAD((*concsolversyncread)), SCIP_DECL_CONCSOLVERTYPEFREEDATA((*concsolvertypefreedata)), SCIP_CONCSOLVERTYPEDATA *data)
void SCIPdispTime(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, SCIP_Real val, int width)
SCIP_RETCODE SCIPsetEventhdlrFree(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_RETCODE SCIPsetEventhdlrExit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPsetEventhdlrInit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
void SCIPeventhdlrSetData(SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
const char * SCIPheurGetName(SCIP_HEUR *heur)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPallocClearBufferArray(scip, ptr, num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPallocMemory(scip, ptr)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_Longint SCIPgetMemTotal(SCIP *scip)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_RETCODE SCIPaddSolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool *stored)
int SCIPgetNSols(SCIP *scip)
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
SCIP_RETCODE SCIPcreateOrigSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_SOL ** SCIPgetSols(SCIP *scip)
SCIP_RETCODE SCIPcheckSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *feasible)
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
SCIP_RETCODE SCIPsolve(SCIP *scip)
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetDualbound(SCIP *scip)
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPvarGetProbvarBound(SCIP_VAR **var, SCIP_Real *bound, SCIP_BOUNDTYPE *boundtype)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNonimpliedIntegral(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIPcreateSol(scip, &heurdata->sol, heur))
assert(minobj< SCIPgetCutoffbound(scip))
static const char * paramname[]
memory allocation routines
#define BMSfreeMemory(ptr)
#define BMSallocMemory(ptr)
SCIP_Bool SCIPmessagehdlrIsQuiet(SCIP_MESSAGEHDLR *messagehdlr)
const char * SCIPparamGetName(SCIP_PARAM *param)
public methods for displaying runtime statistics
public methods for managing events
public methods for primal heuristics
public methods for message output
public data structures and miscellaneous methods
public methods for handling parameter settings
public methods for primal CIP solutions
public methods for problem variables
public methods for concurrent solving mode
public methods for problem copies
public methods for event handler plugins and event handlers
public methods for primal heuristic plugins and divesets
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for solutions
public methods for querying solving statistics
public methods for timing
SCIP_BOUNDSTORE * SCIPsyncdataGetBoundChgs(SCIP_SYNCDATA *syncdata)
void SCIPsyncdataSetUpperbound(SCIP_SYNCDATA *syncdata, SCIP_Real upperbound)
SCIP_RETCODE SCIPsyncdataAddBoundChanges(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_BOUNDSTORE *boundstore)
void SCIPsyncdataGetSolutions(SCIP_SYNCDATA *syncdata, SCIP_Real ***solvalues, int **solowner, int *nsols)
void SCIPsyncdataSetStatus(SCIP_SYNCDATA *syncdata, SCIP_STATUS status, int solverid)
void SCIPsyncdataSetLowerbound(SCIP_SYNCDATA *syncdata, SCIP_Real lowerbound)
void SCIPsyncdataGetSolutionBuffer(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_Real solobj, int ownerid, SCIP_Real **buffer)
SCIP_Bool SCIPsyncstoreIsInitialized(SCIP_SYNCSTORE *syncstore)
void SCIPsyncdataAddMemTotal(SCIP_SYNCDATA *syncdata, SCIP_Longint memtotal)
SCIP_STATUS SCIPsyncdataGetStatus(SCIP_SYNCDATA *syncdata)
the function declarations for the synchronization store
struct SCIP_ConcSolver SCIP_CONCSOLVER
#define SCIP_DECL_CONCSOLVERSTOP(x)
#define SCIP_DECL_CONCSOLVERINITSEEDS(x)
#define SCIP_DECL_CONCSOLVERTYPEFREEDATA(x)
#define SCIP_DECL_CONCSOLVERSYNCWRITE(x)
#define SCIP_DECL_CONCSOLVERDESTROYINST(x)
#define SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(x)
struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA
#define SCIP_DECL_CONCSOLVEREXEC(x)
#define SCIP_DECL_CONCSOLVERCREATEINST(x)
#define SCIP_DECL_CONCSOLVERSYNCREAD(x)
struct SCIP_ConcSolverData SCIP_CONCSOLVERDATA
struct SCIP_Eventhdlr SCIP_EVENTHDLR
#define SCIP_EVENTTYPE_SYNC
#define SCIP_DECL_EVENTEXIT(x)
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
#define SCIP_DECL_EVENTEXEC(x)
#define SCIP_DECL_EVENTINIT(x)
#define SCIP_DECL_EVENTFREE(x)
struct SCIP_Heur SCIP_HEUR
enum SCIP_BoundType SCIP_BOUNDTYPE
struct SCIP_HashMap SCIP_HASHMAP
@ SCIP_PARAMEMPHASIS_DEFAULT
@ SCIP_PARAMEMPHASIS_CPSOLVER
@ SCIP_PARAMEMPHASIS_HARDLP
@ SCIP_PARAMEMPHASIS_FEASIBILITY
@ SCIP_PARAMEMPHASIS_EASYCIP
@ SCIP_PARAMEMPHASIS_COUNTER
@ SCIP_PARAMEMPHASIS_OPTIMALITY
struct SCIP_Param SCIP_PARAM
enum SCIP_ParamEmphasis SCIP_PARAMEMPHASIS
enum SCIP_Retcode SCIP_RETCODE
enum SCIP_Status SCIP_STATUS
struct SCIP_SyncStore SCIP_SYNCSTORE
struct SCIP_BoundStore SCIP_BOUNDSTORE
@ SCIP_VARSTATUS_MULTAGGR