helper functions for concurrent scip solvers
Definition in file concurrent.h.
#include "scip/type_concurrent.h"
#include "scip/type_scip.h"
#include "scip/type_concsolver.h"
#include "scip/type_sol.h"
#include "scip/type_var.h"
#include "scip/type_syncstore.h"
#include "scip/def.h"
Go to the source code of this file.
SCIP_RETCODE SCIPcreateConcurrent | ( | SCIP * | scip, |
SCIP_CONCSOLVER * | concsolver, | ||
int * | varperm | ||
) |
create concurrent data
scip | SCIP datastructure |
concsolver | concurrent solver of given SCIP instance |
varperm | permutation of variables for communication |
Definition at line 48 of file concurrent.c.
References SCIP_Concurrent::concsolver, Scip::concurrent, SCIP_Set::concurrent_commvarbnds, SCIP_Concurrent::dettime, SCIP_Concurrent::eventglobalbnd, SCIP_Concurrent::heursync, SCIP_Concurrent::mainscip, SCIP_Set::parallel_mode, SCIP_Concurrent::propsync, SCIP_CALL, SCIP_OKAY, SCIP_PARA_DETERMINISTIC, SCIPallocBlockMemory, SCIPcreateWallClock(), SCIPduplicateBlockMemoryArray, SCIPfindEventhdlr(), SCIPfindHeur(), SCIPfindProp(), SCIPgetNOrigVars(), SCIPincludeEventHdlrGlobalbnd(), SCIPincludeHeurSync(), SCIPincludePropSync(), SCIPstartClock(), Scip::set, SCIP_Concurrent::solidx, Scip::stat, SCIP_Stat::subscipdepth, SCIP_Concurrent::varperm, and SCIP_Concurrent::wallclock.
Referenced by initConcsolver().
int SCIPgetNConcurrentSolvers | ( | SCIP * | scip | ) |
get number of initialized concurrent solvers
scip | SCIP datastructure |
Definition at line 107 of file concurrent.c.
References SCIP_Set::nconcsolvers, and Scip::set.
Referenced by SCIPconcsolverCreateInstance(), SCIPprintConcsolverStatistics(), SCIPsolveConcurrent(), SCIPsolveIsStopped(), and SCIPsyncstoreInit().
SCIP_CONCSOLVER** SCIPgetConcurrentSolvers | ( | SCIP * | scip | ) |
gets the concurrent solvers
gets the initialized concurrent solvers
scip | SCIP datastructure |
Definition at line 118 of file concurrent.c.
References SCIP_Set::concsolvers, and Scip::set.
Referenced by SCIPprintConcsolverStatistics().
SCIP_RETCODE SCIPaddConcurrentSolver | ( | SCIP * | scip, |
SCIP_CONCSOLVER * | concsolver | ||
) |
adds a concurrent solver
adds an initialized concurrent solver
scip | SCIP datastructure |
concsolver | concurrent solver of given SCIP instance |
Definition at line 129 of file concurrent.c.
References SCIP_CALL, SCIP_OKAY, SCIPsetIncludeConcsolver(), and Scip::set.
Referenced by SCIPconcsolverCreateInstance().
SCIP_RETCODE SCIPfreeConcurrent | ( | SCIP * | scip | ) |
frees concurrent data
scip | SCIP datastructure |
Definition at line 142 of file concurrent.c.
References Scip::concurrent, SCIP_Stat::detertimecnt, SCIP_Concurrent::mainscip, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPfreeClock(), SCIPgetNOrigVars(), Scip::stat, SCIP_Concurrent::varperm, and SCIP_Concurrent::wallclock.
Referenced by SCIPfreeProb(), and SCIPsolveConcurrent().
SCIP_RETCODE SCIPincrementConcurrentTime | ( | SCIP * | scip, |
SCIP_Real | val | ||
) |
increments the time counter for synchronization
scip | SCIP datastructure |
val | value by which the time counter for synchronization is incremented |
Definition at line 180 of file concurrent.c.
References SCIP_Concurrent::concsolver, Scip::concurrent, SCIP_Concurrent::dettime, Scip::eventfilter, Scip::eventqueue, SCIP_Concurrent::mainscip, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPblkmem(), SCIPconcsolverGetSyncFreq(), SCIPconcsolverSetTimeSinceLastSync(), SCIPeventCreateSync(), SCIPeventqueueAdd(), SCIPgetClockTime(), SCIPresetClock(), SCIPstartClock(), Scip::set, and SCIP_Concurrent::wallclock.
SCIP_RETCODE SCIPsynchronize | ( | SCIP * | scip | ) |
synchronize with other concurrent solvers
scip | SCIP datastructure |
Definition at line 236 of file concurrent.c.
References SCIP_Concurrent::concsolver, Scip::concurrent, SCIP_Concurrent::eventglobalbnd, SCIP_Concurrent::mainscip, SCIP_CALL, SCIP_OKAY, SCIPconcsolverSync(), SCIPeventGlobalbndClearBoundChanges(), Scip::set, SCIP_Concurrent::solidx, SCIP_Stat::solindex, and Scip::stat.
Referenced by SCIP_DECL_EVENTEXEC().
SCIP_RETCODE SCIPaddConcurrentSol | ( | SCIP * | scip, |
SCIP_SOL * | sol | ||
) |
pass a solution to the given SCIP instance using that was received via synchronization by using the sync heuristic
scip | SCIP datastructure |
sol | solution |
Definition at line 362 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::heursync, SCIP_CALL, SCIP_OKAY, and SCIPheurSyncPassSol().
Referenced by SCIP_DECL_CONCSOLVERSYNCREAD().
SCIP_RETCODE SCIPaddConcurrentBndchg | ( | SCIP * | scip, |
SCIP_VAR * | var, | ||
SCIP_Real | val, | ||
SCIP_BOUNDTYPE | bndtype | ||
) |
adds a global boundchange to the given SCIP, by passing it to the sync propagator
scip | SCIP data structure |
var | variable for bound |
val | value of bound |
bndtype | type of bound |
Definition at line 377 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::mainscip, SCIP_Concurrent::propsync, SCIP_CALL, SCIP_OKAY, and SCIPpropSyncAddBndchg().
Referenced by SCIP_DECL_CONCSOLVERSYNCREAD().
SCIP_RETCODE SCIPcopySolStats | ( | SCIP_SOL * | source, |
SCIP_SOL * | target | ||
) |
copy the nodenumber, depth, time, and runnumber of one solution to another one
source | source for solution statistics |
target | target for solution statistics |
Definition at line 395 of file concurrent.c.
References SCIP_Sol::depth, SCIP_Sol::nodenum, SCIP_Sol::runnum, SCIP_OKAY, and SCIP_Sol::time.
Referenced by SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA().
SCIP_RETCODE SCIPcopyConcurrentSolvingStats | ( | SCIP * | source, |
SCIP * | target | ||
) |
copy solving statistics
source | SCIP data structure |
target | target SCIP data structure |
Definition at line 526 of file concurrent.c.
References SCIP_Stat::barrierlptime, SCIP_Stat::barrierzeroittime, SCIP_Stat::bestsolnode, SCIP_Stat::conflictlptime, SCIP_Stat::divinglptime, SCIP_Stat::domchgcount, SCIP_Stat::duallptime, SCIP_Stat::dualzeroittime, SCIP_Stat::firstlpdualbound, SCIP_Stat::firstlptime, SCIP_Stat::firstprimalbound, SCIP_Stat::firstprimaldepth, SCIP_Stat::firstprimalheur, SCIP_Stat::firstprimaltime, SCIP_Stat::firstsolgap, SCIP_Heur::heurclock, SCIP_Stat::lastbranchdir, SCIP_Stat::lastbranchvalue, SCIP_Stat::lastconflictnode, SCIP_Stat::lastdispnode, SCIP_Stat::lastdivenode, SCIP_Stat::lastdualbound, SCIP_Stat::lastlowerbound, SCIP_Stat::lastprimalbound, SCIP_Stat::lastsblpsolstats, SCIP_Sepa::lastsepanode, SCIP_Stat::lastsolgap, SCIP_Stat::lastupperbound, SCIP_Stat::lexduallptime, SCIP_Stat::lpcount, SCIP_Stat::lpsoltime, MAX, SCIP_Sepa::maxbounddist, SCIP_Stat::maxcopytime, SCIP_Stat::maxdepth, SCIP_Stat::maxtotaldepth, SCIP_Stat::mincopytime, SCIP_Stat::nactivatednodes, SCIP_Presol::naddconss, SCIP_Presol::naddholes, SCIP_Presol::naggrvars, SCIP_Stat::nbacktracks, SCIP_Stat::nbarrierlpiterations, SCIP_Stat::nbarrierlps, SCIP_Stat::nbarrierzeroitlps, SCIP_Primal::nbestsolsfound, SCIP_Heur::nbestsolsfound, SCIP_Stat::nboundchgs, SCIP_Prop::ncalls, SCIP_Sepa::ncalls, SCIP_Presol::ncalls, SCIP_Heur::ncalls, SCIP_Presol::nchgbds, SCIP_Presol::nchgcoefs, SCIP_Presol::nchgsides, SCIP_Presol::nchgvartypes, SCIP_Stat::nconflictlpiterations, SCIP_Stat::nconflictlps, SCIP_Stat::nconfrestarts, SCIP_Sepa::nconssfound, SCIP_Stat::ncopies, SCIP_Stat::ncreatednodes, SCIP_Stat::ncreatednodesrun, SCIP_Prop::ncutoffs, SCIP_Sepa::ncutoffs, SCIP_Sepa::ncutsapplied, SCIP_Sepa::ncutsfound, SCIP_Stat::ndeactivatednodes, SCIP_Stat::ndelayedcutoffs, SCIP_Presol::ndelconss, SCIP_Stat::ndivesetcalls, SCIP_Stat::ndivesetlpiterations, SCIP_Stat::ndivesetlps, SCIP_Stat::ndivinglpiterations, SCIP_Stat::ndivinglps, SCIP_Prop::ndomredsfound, SCIP_Sepa::ndomredsfound, SCIP_Stat::nduallpiterations, SCIP_Stat::nduallps, SCIP_Stat::ndualresolvelpiterations, SCIP_Stat::ndualresolvelps, SCIP_Stat::ndualzeroitlps, SCIP_Stat::nearlybacktracks, SCIP_Stat::nexternalsolsfound, SCIP_Stat::nfeasleaves, SCIP_Presol::nfixedvars, SCIP_Stat::nholechgs, SCIP_Stat::ninfeasleaves, SCIP_Stat::ninitconssadded, SCIP_Stat::ninitlpiterations, SCIP_Stat::ninitlps, SCIP_Stat::ninternalnodes, SCIP_Stat::nisstoppedcalls, SCIP_Stat::nlexduallpiterations, SCIP_Stat::nlexduallps, SCIP_Stat::nlexdualresolvelpiterations, SCIP_Stat::nlexdualresolvelps, SCIP_Primal::nlimsolsfound, SCIP_Stat::nlpbestsolsfound, SCIP_Stat::nlpiterations, SCIP_Stat::nlps, SCIP_Stat::nlpsolsfound, SCIP_Stat::nlpsoltime, SCIP_Stat::nnlps, SCIP_Stat::nnodelpiterations, SCIP_Stat::nnodelps, SCIP_Stat::nnodes, SCIP_Stat::nnodesaboverefbound, SCIP_Stat::nnodesbeforefirst, SCIP_Stat::nnz, SCIP_Stat::nobjleaves, SCIP_Stat::nodeactivationtime, SCIP_Stat::npresoladdconss, SCIP_Stat::npresoladdholes, SCIP_Stat::npresolaggrvars, SCIP_Stat::npresolchgbds, SCIP_Stat::npresolchgcoefs, SCIP_Stat::npresolchgsides, SCIP_Stat::npresolchgvartypes, SCIP_Stat::npresoldelconss, SCIP_Stat::npresolfixedvars, SCIP_Stat::npresolrounds, SCIP_Stat::npresolroundsext, SCIP_Stat::npresolroundsfast, SCIP_Stat::npresolroundsmed, SCIP_Stat::npresolupgdconss, SCIP_Stat::npricerounds, SCIP_Stat::nprimallpiterations, SCIP_Stat::nprimallps, SCIP_Stat::nprimalresolvelpiterations, SCIP_Stat::nprimalresolvelps, SCIP_Stat::nprimalzeroitlps, SCIP_Stat::nprobboundchgs, SCIP_Stat::nprobholechgs, SCIP_Stat::npsbestsolsfound, SCIP_Stat::npssolsfound, SCIP_Stat::nreoptruns, SCIP_Stat::nrepropboundchgs, SCIP_Stat::nrepropcutoffs, SCIP_Stat::nreprops, SCIP_Prop::nrespropcalls, SCIP_Stat::nrootboundchgs, SCIP_Stat::nrootboundchgsrun, SCIP_Stat::nrootfirstlpiterations, SCIP_Stat::nrootintfixings, SCIP_Stat::nrootintfixingsrun, SCIP_Stat::nrootlpiterations, SCIP_Stat::nrootlps, SCIP_Stat::nrootsblpiterations, SCIP_Stat::nrootstrongbranchs, SCIP_Stat::nruns, SCIP_Stat::nrunsbeforefirst, SCIP_Stat::nsbbestsolsfound, SCIP_Stat::nsbdivinglpiterations, SCIP_Stat::nsbdivinglps, SCIP_Stat::nsbdowndomchgs, SCIP_Stat::nsblpiterations, SCIP_Stat::nsbsolsfound, SCIP_Stat::nsbtimesiterlimhit, SCIP_Stat::nsbupdomchgs, SCIP_Stat::nseparounds, SCIP_Primal::nsolsfound, SCIP_Heur::nsolsfound, SCIP_Stat::nstrongbranchs, SCIP_Stat::ntotalinternalnodes, SCIP_Stat::ntotalnodes, SCIP_Presol::nupgdconss, Scip::origprob, SCIP_Stat::plungedepth, SCIP_Presol::presolclock, SCIP_Prop::presoltime, SCIP_Stat::presolvingtime, SCIP_Stat::presolvingtimeoverall, SCIP_Stat::previntegralevaltime, SCIP_Stat::previousgap, SCIP_Stat::prevrunnvars, Scip::primal, SCIP_Stat::primaldualintegral, SCIP_Stat::primallptime, SCIP_Stat::primalzeroittime, SCIP_Prop::proptime, SCIP_Stat::pseudosoltime, SCIP_Stat::referencebound, SCIP_Stat::reoptupdatetime, SCIP_Prop::resproptime, SCIP_Stat::rootlowerbound, SCIP_Stat::rootlpbestestimate, SCIP_Prop::sbproptime, SCIP_Stat::sbsoltime, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPfindHeur(), SCIPfindPresol(), SCIPfindProp(), SCIPfindSepa(), SCIPgetClockTime(), SCIPgetDualbound(), SCIPgetHeurs(), SCIPgetNHeurs(), SCIPgetNPresols(), SCIPgetNProps(), SCIPgetNSepas(), SCIPgetPresols(), SCIPgetProps(), SCIPgetRootNode(), SCIPgetSepas(), SCIPheurGetName(), SCIPpresolGetName(), SCIPprobExternObjval(), SCIPprobSetDualbound(), SCIPpropGetName(), SCIPsepaGetName(), SCIPsetClockTime(), SCIPupdateNodeLowerbound(), SCIP_Sepa::sepaclock, Scip::set, SCIP_Presol::setuptime, SCIP_Prop::setuptime, SCIP_Sepa::setuptime, SCIP_Heur::setuptime, SCIP_Stat::solvingtimeoverall, SCIP_Set::stage, Scip::stat, SCIP_Stat::status, SCIP_Stat::strongbranchtime, SCIP_Stat::strongpropclock, SCIP_Stat::totaldivesetdepth, Scip::transprob, and SCIP_Stat::vsidsweight.
Referenced by SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA().
get variable index of original variable that is the same between concurrent solvers
scip | SCIP data structure |
var | variable |
Definition at line 413 of file concurrent.c.
References Scip::concurrent, SCIPgetNOrigVars(), SCIPvarGetIndex(), SCIPvarIsOriginal(), and SCIP_Concurrent::varperm.
Referenced by SCIP_DECL_EVENTEXEC().
has the solution been created after the last synchronization point
is the solution new since the last synchronization point
scip | SCIP data structure |
sol | the solution |
Definition at line 429 of file concurrent.c.
References Scip::concurrent, SCIPsolGetIndex(), and SCIP_Concurrent::solidx.
Referenced by SCIP_DECL_CONCSOLVERSYNCWRITE().
SCIP_BOUNDSTORE* SCIPgetConcurrentGlobalBoundChanges | ( | SCIP * | scip | ) |
gets the global bound changes since the last synchronization point
gets the global lower bound changes since the last synchronization point
scip | SCIP data structure |
Definition at line 442 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::eventglobalbnd, and SCIPeventGlobalbndGetBoundChanges().
Referenced by SCIP_DECL_CONCSOLVERSYNCWRITE().
SCIP_RETCODE SCIPconcurrentSolve | ( | SCIP * | scip | ) |
start solving in parallel using the given set of concurrent solvers
scip | pointer to scip datastructure |
Definition at line 474 of file concurrent.c.
References SCIP_Set::concsolvers, execConcsolver(), FALSE, SCIP_Set::nconcsolvers, SCIP_CALL, SCIP_CALL_ABORT, SCIP_SUBMIT_SUCCESS, SCIPconcsolverGetSolvingData(), SCIPgetSyncstore(), SCIPsyncstoreGetNSolvers(), SCIPsyncstoreGetWinner(), SCIPsyncstoreIsInitialized(), SCIPsyncstoreSetSolveIsStopped(), SCIPtpiCollectJobs(), SCIPtpiCreateJob(), SCIPtpiGetNewJobID(), SCIPtpiSumbitJob(), Scip::set, TPI_PARA, and TPI_SINGLE.
Referenced by SCIPsolveConcurrent().
void SCIPdisableConcurrentBoundStorage | ( | SCIP * | scip | ) |
disables storing global bound changes
scip | SCIP data structure |
Definition at line 254 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::eventglobalbnd, and SCIPeventGlobalbndDisableBoundStorage().
Referenced by applyBoundChanges().
void SCIPenableConcurrentBoundStorage | ( | SCIP * | scip | ) |
enables storing global bound changes
scip | SCIP data structure |
Definition at line 266 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::eventglobalbnd, and SCIPeventGlobalbndEnableBoundStorage().
Referenced by applyBoundChanges().
SCIP_Longint SCIPgetConcurrentMemTotal | ( | SCIP * | scip | ) |
gets total memory usage of all concurrent solvers together
scip | SCIP data structure |
Definition at line 278 of file concurrent.c.
References SCIP_Concurrent::concsolver, Scip::concurrent, SCIP_Concurrent::mainscip, MAX, SCIP_Longint, SCIPconcsolverGetMemTotal(), and SCIPgetMemTotal().
Referenced by SCIPsolveIsStopped().
gets the dualbound in the last synchronization
scip | SCIP data structure |
Definition at line 296 of file concurrent.c.
References Scip::origprob, SCIPgetSyncstore(), SCIPprobExternObjval(), SCIPsyncstoreGetLastLowerbound(), Scip::set, and Scip::transprob.
Referenced by SCIP_DECL_DISPOUTPUT(), and SCIPgetConcurrentGap().
gets the primalbound in the last synchronization
scip | SCIP data structure |
Definition at line 311 of file concurrent.c.
References Scip::origprob, SCIPgetSyncstore(), SCIPprobExternObjval(), SCIPsyncstoreGetLastUpperbound(), Scip::set, and Scip::transprob.
Referenced by SCIP_DECL_DISPOUTPUT(), and SCIPgetConcurrentGap().
gets the gap in the last synchronization
scip | SCIP data structure |
Definition at line 326 of file concurrent.c.
References SCIP_Real, SCIPcomputeGap(), SCIPepsilon(), SCIPgetConcurrentDualbound(), SCIPgetConcurrentPrimalbound(), and SCIPinfinity().
Referenced by SCIP_DECL_DISPOUTPUT().
SCIP_Longint SCIPgetConcurrentNTightenedBnds | ( | SCIP * | scip | ) |
gives the total number of tightened bounds received from other concurrent solvers
scip | SCIP data structure |
Definition at line 340 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::propsync, and SCIPpropSyncGetNTightenedBnds().
SCIP_Longint SCIPgetConcurrentNTightenedIntBnds | ( | SCIP * | scip | ) |
gives the total number of tightened bounds for integer variables received from other concurrent solvers
scip | SCIP data structure |
Definition at line 351 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::propsync, and SCIPpropSyncGetNTightenedIntBnds().