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/type_retcode.h"#include "scip/def.h"Go to the source code of this file.
| SCIP_RETCODE SCIPcreateConcurrent | ( | SCIP * | scip, |
| SCIP_CONCSOLVER * | concsolver, | ||
| int * | varperm, | ||
| int | nvars ) |
create concurrent data
| scip | SCIP datastructure |
| concsolver | concurrent solver of given SCIP instance |
| varperm | permutation of variables for communication |
| nvars | number of variables in problem |
Definition at line 67 of file concurrent.c.
References assert(), NULL, nvars, SCIP_CALL, SCIP_OKAY, SCIP_PARA_DETERMINISTIC, SCIPallocBlockMemory, SCIPcreateWallClock(), SCIPduplicateBlockMemoryArray, SCIPfindEventhdlr(), SCIPfindHeur(), SCIPfindProp(), SCIPincludeEventHdlrGlobalbnd(), SCIPincludeHeurSync(), SCIPincludePropSync(), and SCIPstartClock().
Referenced by initConcsolver().
| int SCIPgetNConcurrentSolvers | ( | SCIP * | scip | ) |
get number of initialized concurrent solvers
Definition at line 126 of file concurrent.c.
References assert(), and NULL.
Referenced by SCIPcollectConcsolverStatistics(), SCIPconcsolverCreateInstance(), SCIPprintConcsolverStatistics(), SCIPsolveConcurrent(), SCIPsolveIsStopped(), and SCIPsyncstoreInit().
| SCIP_CONCSOLVER ** SCIPgetConcurrentSolvers | ( | SCIP * | scip | ) |
gets the concurrent solvers
gets the initialized concurrent solvers
Definition at line 137 of file concurrent.c.
References assert(), and NULL.
Referenced by SCIPcollectConcsolverStatistics(), and SCIPprintConcsolverStatistics().
| SCIP_RETCODE SCIPaddConcurrentSolver | ( | SCIP * | scip, |
| SCIP_CONCSOLVER * | concsolver ) |
adds a concurrent solver
adds an initialized concurrent solver
Definition at line 148 of file concurrent.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPsetIncludeConcsolver().
Referenced by SCIPconcsolverCreateInstance().
| SCIP_RETCODE SCIPfreeConcurrent | ( | SCIP * | scip | ) |
frees concurrent data
Definition at line 161 of file concurrent.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, and SCIPfreeClock().
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 199 of file concurrent.c.
References assert(), Scip::eventfilter, Scip::eventqueue, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPblkmem(), SCIPconcsolverGetSyncFreq(), SCIPconcsolverSetTimeSinceLastSync(), SCIPeventCreateSync(), SCIPeventqueueAdd(), SCIPgetClockTime(), SCIPresetClock(), SCIPstartClock(), and Scip::set.
| SCIP_RETCODE SCIPsynchronize | ( | SCIP * | scip | ) |
synchronize with other concurrent solvers
Definition at line 258 of file concurrent.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverSync(), and SCIPeventGlobalbndClearBoundChanges().
Referenced by SCIP_DECL_EVENTEXEC().
| SCIP_RETCODE SCIPaddConcurrentSol | ( | SCIP * | scip, |
| SCIP_SOL * | sol ) |
pass a solution to the given SCIP instance that was received via synchronization by using the sync heuristic
Definition at line 383 of file concurrent.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPheurSyncPassSol(), and sol.
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
Definition at line 398 of file concurrent.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPpropSyncAddBndchg(), and var.
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 416 of file concurrent.c.
References assert(), SCIP_Sol::depth, SCIP_Sol::nodenum, NULL, SCIP_Sol::runnum, SCIP_OKAY, and SCIP_Sol::time.
Referenced by SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA().
| SCIP_RETCODE SCIPcopyConcurrentSolvingStats | ( | SCIP * | source, |
| SCIP * | target ) |
copy solving statistics
Definition at line 577 of file concurrent.c.
References assert(), 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_Node::estimate, SCIP_Stat::firstlpdualbound, SCIP_Stat::firstlptime, SCIP_Stat::firstprimalbound, SCIP_Stat::firstprimaldepth, SCIP_Stat::firstprimalheur, SCIP_Stat::firstprimaltime, SCIP_Stat::firstsolgap, SCIP_Heur::heurclock, i, 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_Node::lowerbound, SCIP_Stat::lpcount, SCIP_Stat::lpsoltime, MAX, SCIP_Sepa::maxbounddist, SCIP_Stat::maxcopytime, SCIP_Stat::maxdepth, SCIP_Stat::maxtotaldepth, MIN, 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_Heur::nbestsolsfound, SCIP_Primal::nbestsolsfound, SCIP_Stat::nboundchgs, SCIP_Heur::ncalls, SCIP_Presol::ncalls, SCIP_Prop::ncalls, SCIP_Sepa::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_Heur::nsolsfound, SCIP_Primal::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(), SCIP_Sepa::sepaclock, Scip::set, SCIP_Heur::setuptime, SCIP_Presol::setuptime, SCIP_Prop::setuptime, SCIP_Sepa::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
Definition at line 434 of file concurrent.c.
References assert(), NULL, SCIPvarGetProbindex(), SCIPvarIsOriginal(), and var.
Referenced by SCIP_DECL_EVENTEXEC().
has the solution been created after the last synchronization point
is the solution new since the last synchronization point
Definition at line 459 of file concurrent.c.
References assert(), NULL, SCIP_Bool, SCIPsolGetIndex(), and sol.
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
Definition at line 472 of file concurrent.c.
References assert(), NULL, 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 508 of file concurrent.c.
References assert(), execConcsolver(), FALSE, i, NULL, SCIP_CALL, SCIP_CALL_ABORT, SCIP_SUBMIT_SUCCESS, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, SCIPconcsolverGetSolvingData(), SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPgetSyncstore(), SCIPsyncstoreGetNSolvers(), SCIPsyncstoreGetWinner(), SCIPsyncstoreIsInitialized(), SCIPsyncstoreSetSolveIsStopped(), SCIPtpiCollectJobs(), SCIPtpiCreateJob(), SCIPtpiGetNewJobID(), SCIPtpiSubmitJob(), TPI_PARA, and TPI_SINGLE.
Referenced by SCIPsolveConcurrent().
| void SCIPdisableConcurrentBoundStorage | ( | SCIP * | scip | ) |
disables storing global bound changes
Definition at line 276 of file concurrent.c.
References assert(), NULL, and SCIPeventGlobalbndDisableBoundStorage().
Referenced by applyBoundChanges().
| void SCIPenableConcurrentBoundStorage | ( | SCIP * | scip | ) |
enables storing global bound changes
Definition at line 288 of file concurrent.c.
References assert(), NULL, and SCIPeventGlobalbndEnableBoundStorage().
Referenced by applyBoundChanges().
| SCIP_Longint SCIPgetConcurrentMemTotal | ( | SCIP * | scip | ) |
gets total memory usage of all concurrent solvers together
Definition at line 300 of file concurrent.c.
References assert(), MAX, NULL, SCIP_Longint, SCIPconcsolverGetMemTotal(), and SCIPgetMemTotal().
Referenced by SCIPsolveIsStopped().
gets the dualbound in the last synchronization
Definition at line 318 of file concurrent.c.
References assert(), NULL, SCIP_Real, SCIPgetSyncstore(), SCIPprobExternObjval(), and SCIPsyncstoreGetLastLowerbound().
Referenced by SCIP_DECL_DISPOUTPUT(), SCIPgetConcurrentGap(), and SCIPsyncstoreFinishSync().
gets the primalbound in the last synchronization
Definition at line 333 of file concurrent.c.
References assert(), NULL, SCIP_Real, SCIPgetSyncstore(), SCIPprobExternObjval(), and SCIPsyncstoreGetLastUpperbound().
Referenced by SCIP_DECL_DISPOUTPUT(), SCIPgetConcurrentGap(), and SCIPsyncstoreFinishSync().
gets the gap in the last synchronization
Definition at line 348 of file concurrent.c.
References SCIP_Real, SCIPcomputeGap(), SCIPepsilon(), SCIPgetConcurrentDualbound(), SCIPgetConcurrentPrimalbound(), and SCIPinfinity().
Referenced by SCIP_DECL_DISPOUTPUT(), and SCIPsyncstoreFinishSync().
| SCIP_Longint SCIPgetConcurrentNTightenedBnds | ( | SCIP * | scip | ) |
gives the total number of tightened bounds received from other concurrent solvers
Definition at line 362 of file concurrent.c.
References assert(), NULL, SCIP_Longint, and SCIPpropSyncGetNTightenedBnds().
| SCIP_Longint SCIPgetConcurrentNTightenedIntBnds | ( | SCIP * | scip | ) |
gives the total number of tightened bounds for integer variables received from other concurrent solvers
Definition at line 373 of file concurrent.c.
References assert(), NULL, SCIP_Longint, and SCIPpropSyncGetNTightenedIntBnds().