concsolver.c
Go to the documentation of this file.
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
59 SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)),/**< data copy method of concurrent solver */
60 SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)),/**< data copy method of concurrent solver */
61 SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)),/**< initialize random seeds of concurrent solver */
63 SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata)),/**< method to copy solving data */
65 SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)),/**< synchronization method of concurrent solver */
66 SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)),/**< synchronization method of concurrent solver */
67 SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata)),/**< method to free data of concurrent solver type */
104 (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "the preferred number concurrent solvers of type <%s> with respect to the number of threads", name);
119 SCIP_Real prefpriodefault, /**< the default preferred priority of this concurrent solver type */
120 SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)),/**< data copy method of concurrent solver */
121 SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)),/**< data copy method of concurrent solver */
122 SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)),/**< initialize random seeds of concurrent solver */
124 SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata)),/**< method to copy solving data */
126 SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)),/**< synchronization method of concurrent solver */
127 SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)),/**< synchronization method of concurrent solver */
128 SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata)),/**< method to free data of concurrent solver type */
145 name, prefpriodefault, concsolvercreateinst, concsolverdestroyinst, concsolverinitseeds, concsolverexec,
146 concsolvercopysolvdata, concsolverstop, concsolversyncwrite, concsolversyncread, concsolvertypefreedata, data),
219 (void) SCIPsnprintf(instancename, SCIP_MAXSTRLEN, "%s-%i", concsolvertype->name, concsolvertype->ninstances);
222 SCIP_ALLOC( BMSduplicateMemoryArray(&(*concsolver)->name, instancename, strlen(instancename) + 1) );
237 /* in deterministic mode use number of nonzeros and variables to get a good initial synchronization frequency
241 (*concsolver)->syncfreq = 0.01 * set->scip->stat->nnz * SCIPgetNVars(set->scip) * set->concurrent_freqinit;
247 SCIPdebugMessage("concsolver %s initialized sync freq to %f\n", (*concsolver)->name, (*concsolver)->syncfreq);
337 SCIP_CALL( concsolver->type->concsolverexec(concsolver, &concsolver->solvingtime, &concsolver->nlpiterations, &concsolver->nnodes) );
412 SCIP_CALL( concsolvertype->concsolversyncwrite(concsolver, syncstore, syncdata, set->concurrent_nbestsols, set->concurrent_maxnsols, &nsols) );
474 SCIPdebugMessage("syncfreq is %g and freqfactor is %f due to progress %f\n", concsolver->syncfreq, freqfactor, progress);
488 syncdata = SCIPsyncstoreGetNextSyncdata(syncstore, concsolver->syncdata, concsolver->syncfreq, concsolver->nsyncs, &concsolver->syncdelay);
494 SCIP_CALL( concsolvertype->concsolversyncread(concsolver, syncstore, syncdata, &nsols, &ntighterbnds, &ntighterintbnds) );
501 syncdata = SCIPsyncstoreGetNextSyncdata(syncstore, concsolver->syncdata, concsolver->syncfreq, concsolver->nsyncs, &concsolver->syncdelay);
529 /** sets the time elapsed since the last synchronization. Must be set before the synchronization is
612 /** gets the number of tighter global variable bounds of integer variables the solver received */
struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA
Definition: type_concsolver.h:50
#define SCIP_DECL_CONCSOLVERSYNCREAD(x)
Definition: type_concsolver.h:125
Definition: struct_scip.h:69
int SCIPboundstoreGetNChgs(SCIP_BOUNDSTORE *boundstore)
Definition: boundstore.c:197
SCIP_RETCODE SCIPsyncstoreEnsureAllSynced(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:407
SCIP_Real SCIPconcsolverTypeGetPrefPrio(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:200
SCIP_STATUS SCIPsyncdataGetStatus(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:517
internal methods for clocks and timing issues
SCIP_SYNCDATA * SCIPsyncstoreGetSyncdata(SCIP_SYNCSTORE *syncstore, SCIP_Longint syncnum)
Definition: syncstore.c:338
void SCIPconcsolverTypeFree(SCIP_CONCSOLVERTYPE **concsolvertype)
Definition: concsolver.c:153
SCIP_RETCODE SCIPconcsolverTypeCreate(SCIP_CONCSOLVERTYPE **concsolvertype, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, 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)
Definition: concsolver.c:113
char * SCIPconcsolverGetName(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:300
Definition: struct_message.h:45
SCIP_Longint SCIPconcsolverGetNSolsShared(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:593
datastructures for concurrent solvers
SCIP_RETCODE SCIPconcsolverSync(SCIP_CONCSOLVER *concsolver, SCIP_SET *set)
Definition: concsolver.c:375
datastructures for concurrent solvers
SCIP_RETCODE SCIPconcsolverCreateInstance(SCIP_SET *set, SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVER **concsolver)
Definition: concsolver.c:210
#define SCIP_DECL_CONCSOLVERDESTROYINST(x)
Definition: type_concsolver.h:73
Definition: heur_padm.c:134
void SCIPconcsolverSetData(SCIP_CONCSOLVER *concsolver, SCIP_CONCSOLVERDATA *data)
Definition: concsolver.c:289
static SCIP_RETCODE doConcsolverTypeCreate(SCIP_CONCSOLVERTYPE **concsolvertype, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, 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)
Definition: concsolver.c:52
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6375
Definition: struct_set.h:73
SCIP_RETCODE SCIPcreateWallClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip_timing.c:110
SCIP_SYNCDATA * SCIPsyncstoreGetNextSyncdata(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_Real syncfreq, SCIP_Longint writenum, SCIP_Real *delay)
Definition: syncstore.c:359
SCIP_Longint SCIPconcsolverGetMemTotal(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:520
SCIP_RETCODE SCIPconcsolverGetSolvingData(SCIP_CONCSOLVER *concsolver, SCIP *scip)
Definition: concsolver.c:343
SCIP_Longint SCIPconcsolverGetNSolsRecvd(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:583
SCIP_Real SCIPconcsolverGetSolvingTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:543
Definition: struct_concsolver.h:64
void SCIPsyncdataSetSyncFreq(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_Real syncfreq)
Definition: syncstore.c:630
void SCIPconcsolverSetTimeSinceLastSync(SCIP_CONCSOLVER *concsolver, SCIP_Real time)
Definition: concsolver.c:532
SCIP_Real SCIPconcsolverGetSyncFreq(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:510
the interface of the boundstore structure
SCIP_RETCODE SCIPconcsolverInitSeeds(SCIP_CONCSOLVER *concsolver, unsigned int seed)
Definition: concsolver.c:310
Definition: type_retcode.h:42
Definition: type_stat.h:42
internal methods for global SCIP settings
SCIP main data structure.
#define SCIP_DECL_CONCSOLVERINITSEEDS(x)
Definition: type_concsolver.h:93
SCIP_RETCODE SCIPconcsolverDestroyInstance(SCIP_SET *set, SCIP_CONCSOLVER **concsolver)
Definition: concsolver.c:257
SCIP_RETCODE SCIPconcsolverStop(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:356
SCIP_Longint SCIPconcsolverGetNNodes(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:573
SCIP_Longint SCIPconcsolverGetNTighterIntBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:613
the function declarations for the synchronization store
Definition: type_syncstore.h:45
SCIP_Real SCIPsyncdataGetLowerbound(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:592
SCIP_RETCODE SCIPsyncstoreStartSync(SCIP_SYNCSTORE *syncstore, SCIP_Longint syncnum, SCIP_SYNCDATA **syncdata)
Definition: syncstore.c:436
SCIP_Longint SCIPsyncdataGetMemTotal(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:562
#define SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(x)
Definition: type_concsolver.h:156
SCIP_CONCSOLVERDATA * SCIPconcsolverGetData(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:279
datastructures for problem statistics
#define SCIP_DECL_CONCSOLVERTYPEFREEDATA(x)
Definition: type_concsolver.h:83
helper functions for concurrent scip solvers
int SCIPsyncdataGetNSynced(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:541
int SCIPconcsolverGetIdx(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:623
SCIP_Real SCIPconcsolverGetSyncTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:553
SCIP_RETCODE SCIPconcsolverExec(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:325
SCIP_BOUNDSTORE * SCIPsyncdataGetBoundChgs(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:620
SCIP_RETCODE SCIPaddConcurrentSolver(SCIP *scip, SCIP_CONCSOLVER *concsolver)
Definition: concurrent.c:139
SCIP_Real SCIPsyncdataGetSyncFreq(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:572
SCIP_Longint SCIPconcsolverGetNTighterBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:603
void SCIPconcsolverTypeSetData(SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVERTYPEDATA *data)
Definition: concsolver.c:179
SCIP_Longint SCIPconcsolverGetNLPIterations(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:563
SCIP_RETCODE SCIPsyncstoreFinishSync(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA **syncdata)
Definition: syncstore.c:479
SCIP_CONCSOLVERTYPEDATA * SCIPconcsolverTypeGetData(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:169
Definition: struct_concsolver.h:46
SCIP_RETCODE SCIPsetAddRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:3114
SCIP_Real SCIPsyncdataGetUpperbound(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:582
Definition: objbenders.h:43
#define SCIP_DECL_CONCSOLVERSYNCWRITE(x)
Definition: type_concsolver.h:111
int SCIPsyncstoreGetNSolvers(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:551
#define SCIP_DECL_CONCSOLVERCREATEINST(x)
Definition: type_concsolver.h:63
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip_timing.c:161
Definition: struct_syncstore.h:48
SCIP callable library.
char * SCIPconcsolverTypeGetName(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:190
memory allocation routines