Detailed Description
helper functions for concurrent SCIP solvers
Definition in file concurrent.c.
#include "scip/concurrent.h"
#include "scip/struct_concurrent.h"
#include "scip/concsolver.h"
#include "scip/event.h"
#include "scip/struct_scip.h"
#include "scip/stat.h"
#include "scip/struct_set.h"
#include "scip/struct_primal.h"
#include "scip/struct_stat.h"
#include "scip/struct_sol.h"
#include "scip/struct_prop.h"
#include "scip/struct_heur.h"
#include "scip/struct_sepa.h"
#include "scip/struct_presol.h"
#include "scip/prob.h"
#include "scip/prop_sync.h"
#include "scip/heur_sync.h"
#include "scip/event_globalbnd.h"
#include "scip/scip.h"
#include "scip/syncstore.h"
#include "scip/set.h"
#include "tpi/tpi.h"
Go to the source code of this file.
Function Documentation
◆ SCIPcreateConcurrent()
SCIP_RETCODE SCIPcreateConcurrent | ( | SCIP * | scip, |
SCIP_CONCSOLVER * | concsolver, | ||
int * | varperm | ||
) |
create concurrent data
- Parameters
-
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, NULL, 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::solindex, Scip::stat, SCIP_Stat::subscipdepth, SCIP_Concurrent::varperm, and SCIP_Concurrent::wallclock.
Referenced by initConcsolver().
◆ SCIPgetNConcurrentSolvers()
int SCIPgetNConcurrentSolvers | ( | SCIP * | scip | ) |
get number of initialized concurrent solvers
- Parameters
-
scip SCIP datastructure
Definition at line 107 of file concurrent.c.
References SCIP_Set::nconcsolvers, NULL, and Scip::set.
Referenced by SCIPconcsolverCreateInstance(), SCIPprintConcsolverStatistics(), SCIPsolveConcurrent(), SCIPsolveIsStopped(), and SCIPsyncstoreInit().
◆ SCIPgetConcurrentSolvers()
SCIP_CONCSOLVER** SCIPgetConcurrentSolvers | ( | SCIP * | scip | ) |
gets the initialized concurrent solvers
- Parameters
-
scip SCIP datastructure
Definition at line 118 of file concurrent.c.
References SCIP_Set::concsolvers, NULL, and Scip::set.
Referenced by SCIPprintConcsolverStatistics().
◆ SCIPaddConcurrentSolver()
SCIP_RETCODE SCIPaddConcurrentSolver | ( | SCIP * | scip, |
SCIP_CONCSOLVER * | concsolver | ||
) |
adds an initialized concurrent solver
- Parameters
-
scip SCIP datastructure concsolver concurrent solver of given SCIP instance
Definition at line 129 of file concurrent.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPsetIncludeConcsolver(), and Scip::set.
Referenced by SCIPconcsolverCreateInstance().
◆ SCIPfreeConcurrent()
SCIP_RETCODE SCIPfreeConcurrent | ( | SCIP * | scip | ) |
frees concurrent data
- Parameters
-
scip SCIP datastructure
Definition at line 142 of file concurrent.c.
References Scip::concurrent, SCIP_Stat::detertimecnt, SCIP_Concurrent::mainscip, NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPfreeClock(), SCIPgetNOrigVars(), Scip::stat, SCIP_Concurrent::varperm, and SCIP_Concurrent::wallclock.
Referenced by SCIPfreeProb(), and SCIPsolveConcurrent().
◆ SCIPincrementConcurrentTime()
SCIP_RETCODE SCIPincrementConcurrentTime | ( | SCIP * | scip, |
SCIP_Real | val | ||
) |
increments the time counter for synchronization
- Parameters
-
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, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPblkmem(), SCIPconcsolverGetSyncFreq(), SCIPconcsolverSetTimeSinceLastSync(), SCIPeventCreateSync(), SCIPeventqueueAdd(), SCIPgetClockTime(), SCIPresetClock(), SCIPstartClock(), Scip::set, and SCIP_Concurrent::wallclock.
◆ SCIPsynchronize()
SCIP_RETCODE SCIPsynchronize | ( | SCIP * | scip | ) |
synchronize with other concurrent solvers
- Parameters
-
scip SCIP datastructure
Definition at line 236 of file concurrent.c.
References SCIP_Concurrent::concsolver, Scip::concurrent, SCIP_Concurrent::eventglobalbnd, SCIP_Concurrent::mainscip, NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverSync(), SCIPeventGlobalbndClearBoundChanges(), Scip::set, SCIP_Concurrent::solidx, SCIP_Stat::solindex, and Scip::stat.
Referenced by SCIP_DECL_EVENTEXEC().
◆ SCIPdisableConcurrentBoundStorage()
void SCIPdisableConcurrentBoundStorage | ( | SCIP * | scip | ) |
disables storing global bound changes
- Parameters
-
scip SCIP data structure
Definition at line 254 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::eventglobalbnd, NULL, and SCIPeventGlobalbndDisableBoundStorage().
Referenced by applyBoundChanges().
◆ SCIPenableConcurrentBoundStorage()
void SCIPenableConcurrentBoundStorage | ( | SCIP * | scip | ) |
enables storing global bound changes
- Parameters
-
scip SCIP data structure
Definition at line 266 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::eventglobalbnd, NULL, and SCIPeventGlobalbndEnableBoundStorage().
Referenced by applyBoundChanges().
◆ SCIPgetConcurrentMemTotal()
SCIP_Longint SCIPgetConcurrentMemTotal | ( | SCIP * | scip | ) |
gets total memory usage of all concurrent solvers together
- Parameters
-
scip SCIP data structure
Definition at line 278 of file concurrent.c.
References SCIP_Concurrent::concsolver, Scip::concurrent, SCIP_Concurrent::mainscip, MAX, NULL, SCIP_Longint, SCIPconcsolverGetMemTotal(), and SCIPgetMemTotal().
Referenced by SCIPsolveIsStopped().
◆ SCIPgetConcurrentDualbound()
gets the dualbound in the last synchronization
- Parameters
-
scip SCIP data structure
Definition at line 296 of file concurrent.c.
References NULL, Scip::origprob, SCIPgetSyncstore(), SCIPprobExternObjval(), SCIPsyncstoreGetLastLowerbound(), Scip::set, and Scip::transprob.
Referenced by SCIP_DECL_DISPOUTPUT(), and SCIPgetConcurrentGap().
◆ SCIPgetConcurrentPrimalbound()
gets the primalbound in the last synchronization
- Parameters
-
scip SCIP data structure
Definition at line 311 of file concurrent.c.
References NULL, Scip::origprob, SCIPgetSyncstore(), SCIPprobExternObjval(), SCIPsyncstoreGetLastUpperbound(), Scip::set, and Scip::transprob.
Referenced by SCIP_DECL_DISPOUTPUT(), and SCIPgetConcurrentGap().
◆ SCIPgetConcurrentGap()
gets the gap in the last synchronization
- Parameters
-
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().
◆ SCIPgetConcurrentNTightenedBnds()
SCIP_Longint SCIPgetConcurrentNTightenedBnds | ( | SCIP * | scip | ) |
gives the total number of tightened bounds received from other concurrent solvers
- Parameters
-
scip SCIP data structure
Definition at line 340 of file concurrent.c.
References Scip::concurrent, NULL, SCIP_Concurrent::propsync, and SCIPpropSyncGetNTightenedBnds().
◆ SCIPgetConcurrentNTightenedIntBnds()
SCIP_Longint SCIPgetConcurrentNTightenedIntBnds | ( | SCIP * | scip | ) |
gives the total number of tightened bounds for integer variables received from other concurrent solvers
- Parameters
-
scip SCIP data structure
Definition at line 351 of file concurrent.c.
References Scip::concurrent, NULL, SCIP_Concurrent::propsync, and SCIPpropSyncGetNTightenedIntBnds().
◆ SCIPaddConcurrentSol()
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
- Parameters
-
scip SCIP datastructure sol solution
Definition at line 362 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::heursync, NULL, SCIP_CALL, SCIP_OKAY, and SCIPheurSyncPassSol().
Referenced by SCIP_DECL_CONCSOLVERSYNCREAD().
◆ SCIPaddConcurrentBndchg()
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
- Parameters
-
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, NULL, SCIP_Concurrent::propsync, SCIP_CALL, SCIP_OKAY, and SCIPpropSyncAddBndchg().
Referenced by SCIP_DECL_CONCSOLVERSYNCREAD().
◆ SCIPcopySolStats()
SCIP_RETCODE SCIPcopySolStats | ( | SCIP_SOL * | source, |
SCIP_SOL * | target | ||
) |
copy the nodenumber, depth, time, and runnumber of one solution to another one
- Parameters
-
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, NULL, SCIP_Sol::runnum, SCIP_OKAY, and SCIP_Sol::time.
Referenced by SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA().
◆ SCIPgetConcurrentVaridx()
get variable index of original variable that is the same between concurrent solvers
- Parameters
-
scip SCIP data structure var variable
Definition at line 413 of file concurrent.c.
References Scip::concurrent, NULL, SCIPgetNOrigVars(), SCIPvarGetIndex(), SCIPvarIsOriginal(), and SCIP_Concurrent::varperm.
Referenced by SCIP_DECL_EVENTEXEC().
◆ SCIPIsConcurrentSolNew()
is the solution new since the last synchronization point
- Parameters
-
scip SCIP data structure sol the solution
Definition at line 429 of file concurrent.c.
References Scip::concurrent, NULL, SCIPsolGetIndex(), and SCIP_Concurrent::solidx.
Referenced by SCIP_DECL_CONCSOLVERSYNCWRITE().
◆ SCIPgetConcurrentGlobalBoundChanges()
SCIP_BOUNDSTORE* SCIPgetConcurrentGlobalBoundChanges | ( | SCIP * | scip | ) |
gets the global lower bound changes since the last synchronization point
- Parameters
-
scip SCIP data structure
Definition at line 442 of file concurrent.c.
References Scip::concurrent, SCIP_Concurrent::eventglobalbnd, NULL, and SCIPeventGlobalbndGetBoundChanges().
Referenced by SCIP_DECL_CONCSOLVERSYNCWRITE().
◆ execConcsolver()
|
static |
executes the concurrent solver corresponding to the current thread
- Parameters
-
args SCIP data structure passed in as a void pointer
Definition at line 457 of file concurrent.c.
References SCIP_Set::concsolvers, NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverExec(), SCIPconcsolverSync(), SCIPtpiGetThreadNum(), and Scip::set.
Referenced by SCIPconcurrentSolve().
◆ SCIPconcurrentSolve()
SCIP_RETCODE SCIPconcurrentSolve | ( | SCIP * | scip | ) |
start solving in parallel using the given set of concurrent solvers
- Parameters
-
scip pointer to scip datastructure
Definition at line 474 of file concurrent.c.
References SCIP_Set::concsolvers, execConcsolver(), FALSE, SCIP_Set::nconcsolvers, NULL, 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().
◆ SCIPcopyConcurrentSolvingStats()
SCIP_RETCODE SCIPcopyConcurrentSolvingStats | ( | SCIP * | source, |
SCIP * | target | ||
) |
copy solving statistics
- Parameters
-
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::dualrefintegral, 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::ncutsaddeddirect, SCIP_Sepa::ncutsaddedviapool, SCIP_Sepa::ncutsapplieddirect, SCIP_Sepa::ncutsappliedviapool, 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_Sepa::nrootcalls, 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, NULL, 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::previousdualrefgap, SCIP_Stat::previousgap, SCIP_Stat::previousprimalrefgap, SCIP_Stat::prevrunnvars, Scip::primal, SCIP_Stat::primaldualintegral, SCIP_Stat::primallptime, SCIP_Stat::primalrefintegral, 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().