methods for concurrent solvers
Definition in file concsolver.c.
#include <assert.h>#include <string.h>#include "scip/concsolver.h"#include "scip/set.h"#include "scip/scip.h"#include "scip/concurrent.h"#include "scip/struct_concsolver.h"#include "scip/struct_stat.h"#include "scip/struct_scip.h"#include "blockmemshell/memory.h"#include "scip/syncstore.h"#include "scip/boundstore.h"#include "scip/clock.h"Go to the source code of this file.
|
static |
internal method for creating a concurrent solver type
| concsolvertype | pointer to concurrent solver data structure |
| set | global SCIP settings |
| messagehdlr | message handler |
| blkmem | block memory for parameter settings |
| name | name of concurrent solver |
| prefpriodefault | the default preferred priority of this concurrent solver type |
| data | the concurrent solver type's data |
Definition at line 52 of file concsolver.c.
References assert(), BMSallocMemory, BMSclearMemory, BMSduplicateMemoryArray, FALSE, NULL, paramname, SCIP_ALLOC, SCIP_CALL, SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA, SCIP_DECL_CONCSOLVERCREATEINST, SCIP_DECL_CONCSOLVERDESTROYINST, SCIP_DECL_CONCSOLVEREXEC, SCIP_DECL_CONCSOLVERINITSEEDS, SCIP_DECL_CONCSOLVERSTOP, SCIP_DECL_CONCSOLVERSYNCREAD, SCIP_DECL_CONCSOLVERSYNCWRITE, SCIP_DECL_CONCSOLVERTYPEFREEDATA, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPsetAddRealParam(), and SCIPsnprintf().
Referenced by SCIPconcsolverTypeCreate().
| 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 ) |
creates a concurrent solver type
| concsolvertype | pointer to concurrent solver data structure |
| set | global SCIP settings |
| messagehdlr | message handler |
| blkmem | block memory for parameter settings |
| name | name of concurrent solver |
| prefpriodefault | the default preferred priority of this concurrent solver type |
| data | the concurrent solver type's data |
Definition at line 113 of file concsolver.c.
References assert(), doConcsolverTypeCreate(), NULL, SCIP_CALL_FINALLY, SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA, SCIP_DECL_CONCSOLVERCREATEINST, SCIP_DECL_CONCSOLVERDESTROYINST, SCIP_DECL_CONCSOLVEREXEC, SCIP_DECL_CONCSOLVERINITSEEDS, SCIP_DECL_CONCSOLVERSTOP, SCIP_DECL_CONCSOLVERSYNCREAD, SCIP_DECL_CONCSOLVERSYNCWRITE, SCIP_DECL_CONCSOLVERTYPEFREEDATA, SCIP_OKAY, SCIP_Real, and SCIPconcsolverTypeFree().
Referenced by SCIPincludeConcsolverType().
| void SCIPconcsolverTypeFree | ( | SCIP_CONCSOLVERTYPE ** | concsolvertype | ) |
frees all memory of a concurrent solver type
| concsolvertype | pointer to concurrent solver data structure |
Definition at line 153 of file concsolver.c.
References assert(), BMSfreeMemory, BMSfreeMemoryArrayNull, and NULL.
Referenced by SCIPconcsolverTypeCreate().
| SCIP_CONCSOLVERTYPEDATA * SCIPconcsolverTypeGetData | ( | SCIP_CONCSOLVERTYPE * | concsolvertype | ) |
gets the data of a concurrent solver type
| concsolvertype | concurrent solver type |
Definition at line 170 of file concsolver.c.
References assert(), SCIP_ConcSolverType::data, and NULL.
Referenced by SCIP_DECL_CONCSOLVERCREATEINST().
| void SCIPconcsolverTypeSetData | ( | SCIP_CONCSOLVERTYPE * | concsolvertype, |
| SCIP_CONCSOLVERTYPEDATA * | data ) |
sets the data of a concurrent solver type
| concsolvertype | concurrent solver type |
| data | the concurrent solver's data |
Definition at line 180 of file concsolver.c.
References assert(), SCIP_ConcSolverType::data, and NULL.
| char * SCIPconcsolverTypeGetName | ( | SCIP_CONCSOLVERTYPE * | concsolvertype | ) |
gets the name of a concurrent solver type
| concsolvertype | concurrent solver type |
Definition at line 191 of file concsolver.c.
References assert(), SCIP_ConcSolverType::name, and NULL.
| SCIP_Real SCIPconcsolverTypeGetPrefPrio | ( | SCIP_CONCSOLVERTYPE * | concsolvertype | ) |
gets the preferred priority from a concurrent solver type
| concsolvertype | concurrent solver type |
Definition at line 201 of file concsolver.c.
References assert(), NULL, SCIP_ConcSolverType::prefprio, and SCIP_Real.
Referenced by SCIPsolveConcurrent().
| SCIP_RETCODE SCIPconcsolverCreateInstance | ( | SCIP_SET * | set, |
| SCIP_CONCSOLVERTYPE * | concsolvertype, | ||
| SCIP_CONCSOLVER ** | concsolver ) |
creates an instance of the given concurrent solver type
| set | global SCIP settings |
| concsolvertype | concurrent solver type to create |
| concsolver | pointer to return concurrent solver instance |
Definition at line 211 of file concsolver.c.
References BMSallocMemory, BMSduplicateMemoryArray, SCIP_ConcSolverType::name, SCIP_ConcSolverType::ninstances, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_PARA_DETERMINISTIC, SCIPaddConcurrentSolver(), SCIPcreateWallClock(), SCIPdebugMessage, SCIPgetNConcurrentSolvers(), SCIPgetNVars(), and SCIPsnprintf().
Referenced by SCIPsolveConcurrent().
| SCIP_RETCODE SCIPconcsolverDestroyInstance | ( | SCIP_SET * | set, |
| SCIP_CONCSOLVER ** | concsolver ) |
destroys an instance of the given concurrent solver
Definition at line 260 of file concsolver.c.
References assert(), BMSfreeMemory, BMSfreeMemoryArray, NULL, SCIP_CALL, SCIP_OKAY, and SCIPfreeClock().
| SCIP_CONCSOLVERDATA * SCIPconcsolverGetData | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the data of a concurrent solver
| concsolver | concurrent solver |
Definition at line 282 of file concsolver.c.
References assert(), SCIP_ConcSolver::data, and NULL.
Referenced by initConcsolver(), SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(), SCIP_DECL_CONCSOLVERDESTROYINST(), SCIP_DECL_CONCSOLVEREXEC(), SCIP_DECL_CONCSOLVERINITSEEDS(), SCIP_DECL_CONCSOLVERSTOP(), SCIP_DECL_CONCSOLVERSYNCREAD(), SCIP_DECL_CONCSOLVERSYNCWRITE(), and setChildSelRule().
| void SCIPconcsolverSetData | ( | SCIP_CONCSOLVER * | concsolver, |
| SCIP_CONCSOLVERDATA * | data ) |
sets the data of a concurrent solver
| concsolver | concurrent solver |
| data | the concurrent solver's data |
Definition at line 292 of file concsolver.c.
References assert(), SCIP_ConcSolver::data, and NULL.
Referenced by SCIP_DECL_CONCSOLVERCREATEINST(), and SCIP_DECL_CONCSOLVERDESTROYINST().
| char * SCIPconcsolverGetName | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the name of a concurrent solver
| concsolver | concurrent solver |
Definition at line 303 of file concsolver.c.
References assert(), SCIP_ConcSolver::name, and NULL.
Referenced by initConcsolver(), SCIP_DECL_CONCSOLVERCREATEINST(), SCIP_DECL_CONCSOLVEREXEC(), SCIP_DECL_CONCSOLVERINITSEEDS(), SCIP_DECL_CONCSOLVERSYNCREAD(), SCIP_DECL_CONCSOLVERSYNCWRITE(), SCIPcollectConcsolverStatistics(), and SCIPprintConcsolverStatistics().
| SCIP_RETCODE SCIPconcsolverInitSeeds | ( | SCIP_CONCSOLVER * | concsolver, |
| unsigned int | seed ) |
initializes the random seeds of a concurrent solver
| concsolver | concurrent solver |
| seed | seed for initializing the solver's internal random seeds |
Definition at line 313 of file concsolver.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIP_ConcSolver::type.
Referenced by SCIPsolveConcurrent().
| SCIP_RETCODE SCIPconcsolverExec | ( | SCIP_CONCSOLVER * | concsolver | ) |
start the solving process of a concurrent solver
| concsolver | concurrent solver |
Definition at line 330 of file concsolver.c.
References assert(), FALSE, SCIP_ConcSolver::nlpiterations, SCIP_ConcSolver::nnodes, NULL, SCIP_CALL, SCIP_OKAY, SCIP_ConcSolver::solvingtime, SCIP_ConcSolver::stopped, and SCIP_ConcSolver::type.
Referenced by execConcsolver().
| SCIP_RETCODE SCIPconcsolverGetSolvingData | ( | SCIP_CONCSOLVER * | concsolver, |
| SCIP * | scip ) |
gets solving data of concurrent solver and stores it in the given SCIP instance
Definition at line 348 of file concsolver.c.
References assert(), NULL, and SCIP_ConcSolver::type.
Referenced by SCIPconcurrentSolve().
| SCIP_RETCODE SCIPconcsolverStop | ( | SCIP_CONCSOLVER * | concsolver | ) |
interrupt solving in a concurrent solver
| concsolver | concurrent solver |
Definition at line 361 of file concsolver.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_ConcSolver::stopped, TRUE, and SCIP_ConcSolver::type.
Referenced by SCIPconcsolverSync().
| SCIP_RETCODE SCIPconcsolverSync | ( | SCIP_CONCSOLVER * | concsolver, |
| SCIP_SET * | set ) |
let the given concurrent solver synchronize, i.e., pass its own solutions and bounds to syncstore
Definition at line 378 of file concsolver.c.
References assert(), MAX, SCIP_ConcSolver::name, SCIP_ConcSolver::nsolsrecvd, SCIP_ConcSolver::nsolsshared, SCIP_ConcSolver::nsyncs, SCIP_ConcSolver::ntighterbnds, SCIP_ConcSolver::ntighterintbnds, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_STATUS_UNKNOWN, SCIPboundstoreGetNChgs(), SCIPconcsolverStop(), SCIPdebugMessage, SCIPgetSyncstore(), SCIPrelDiff(), SCIPsetInfinity(), SCIPsetIsGE(), SCIPsetIsInfinity(), SCIPstartClock(), SCIPstopClock(), SCIPsyncdataGetBoundChgs(), SCIPsyncdataGetLowerbound(), SCIPsyncdataGetNSynced(), SCIPsyncdataGetStatus(), SCIPsyncdataGetSyncFreq(), SCIPsyncdataGetUpperbound(), SCIPsyncdataSetSyncFreq(), SCIPsyncstoreEnsureAllSynced(), SCIPsyncstoreFinishSync(), SCIPsyncstoreGetNextSyncdata(), SCIPsyncstoreGetNSolvers(), SCIPsyncstoreGetSyncdata(), SCIPsyncstoreStartSync(), SCIP_ConcSolver::stopped, SCIP_ConcSolver::syncdata, SCIP_ConcSolver::syncdelay, SCIP_ConcSolver::syncfreq, SCIP_ConcSolver::timesincelastsync, SCIP_ConcSolver::totalsynctime, and SCIP_ConcSolver::type.
Referenced by execConcsolver(), and SCIPsynchronize().
| SCIP_Real SCIPconcsolverGetSyncFreq | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the current synchronization frequency of the concurrent solver
| concsolver | concurrent solver |
Definition at line 513 of file concsolver.c.
References assert(), NULL, SCIP_Real, and SCIP_ConcSolver::syncfreq.
Referenced by SCIPincrementConcurrentTime().
| SCIP_Longint SCIPconcsolverGetMemTotal | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the total memory used by the concurrent solver
| concsolver | concurrent solver |
Definition at line 523 of file concsolver.c.
References assert(), NULL, SCIP_Longint, SCIPsyncdataGetMemTotal(), and SCIP_ConcSolver::syncdata.
Referenced by SCIPgetConcurrentMemTotal().
| void SCIPconcsolverSetTimeSinceLastSync | ( | SCIP_CONCSOLVER * | concsolver, |
| SCIP_Real | time ) |
sets the time elapsed since the last synchronization. Must be set before the synchronization is started.
| concsolver | concurrent solver |
| time | the time passed since the last synchronization |
Definition at line 535 of file concsolver.c.
References assert(), NULL, SCIP_Real, and SCIP_ConcSolver::timesincelastsync.
Referenced by SCIPincrementConcurrentTime().
| SCIP_Real SCIPconcsolverGetSolvingTime | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the solving time of the concurrent solver
| concsolver | concurrent solver |
Definition at line 546 of file concsolver.c.
References assert(), NULL, SCIP_Real, and SCIP_ConcSolver::solvingtime.
Referenced by SCIPcollectConcsolverStatistics(), and SCIPprintConcsolverStatistics().
| SCIP_Real SCIPconcsolverGetSyncTime | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the time spent for synchronization for the concurrent solver
| concsolver | concurrent solver |
Definition at line 556 of file concsolver.c.
References assert(), NULL, SCIP_Real, SCIPclockGetTime(), and SCIP_ConcSolver::totalsynctime.
Referenced by SCIPcollectConcsolverStatistics(), and SCIPprintConcsolverStatistics().
| SCIP_Longint SCIPconcsolverGetNLPIterations | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of lp iterations the concurrent solver used
| concsolver | concurrent solver |
Definition at line 566 of file concsolver.c.
References assert(), SCIP_ConcSolver::nlpiterations, NULL, and SCIP_Longint.
Referenced by SCIPcollectConcsolverStatistics(), and SCIPprintConcsolverStatistics().
| SCIP_Longint SCIPconcsolverGetNNodes | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of branch and bound nodes the concurrent solver used
| concsolver | concurrent solver |
Definition at line 576 of file concsolver.c.
References assert(), SCIP_ConcSolver::nnodes, NULL, and SCIP_Longint.
Referenced by SCIPcollectConcsolverStatistics(), and SCIPprintConcsolverStatistics().
| SCIP_Longint SCIPconcsolverGetNSolsRecvd | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of solutions the concurrent solver received during synchronization
| concsolver | concurrent solver |
Definition at line 586 of file concsolver.c.
References assert(), SCIP_ConcSolver::nsolsrecvd, NULL, and SCIP_Longint.
Referenced by SCIPcollectConcsolverStatistics(), and SCIPprintConcsolverStatistics().
| SCIP_Longint SCIPconcsolverGetNSolsShared | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of solutions the concurrent solver shared during synchronization
| concsolver | concurrent solver |
Definition at line 596 of file concsolver.c.
References assert(), SCIP_ConcSolver::nsolsshared, NULL, and SCIP_Longint.
Referenced by SCIPcollectConcsolverStatistics(), and SCIPprintConcsolverStatistics().
| SCIP_Longint SCIPconcsolverGetNTighterBnds | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of tighter global variable bounds the solver received
| concsolver | concurrent solver |
Definition at line 606 of file concsolver.c.
References assert(), SCIP_ConcSolver::ntighterbnds, NULL, and SCIP_Longint.
Referenced by SCIPcollectConcsolverStatistics(), and SCIPprintConcsolverStatistics().
| SCIP_Longint SCIPconcsolverGetNTighterIntBnds | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of tighter global variable bounds of integer variables the solver received
| concsolver | concurrent solver |
Definition at line 616 of file concsolver.c.
References assert(), SCIP_ConcSolver::ntighterintbnds, NULL, and SCIP_Longint.
Referenced by SCIPcollectConcsolverStatistics(), and SCIPprintConcsolverStatistics().
| int SCIPconcsolverGetIdx | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets index of concurrent solver
| concsolver | concurrent solver |
Definition at line 626 of file concsolver.c.
References assert(), SCIP_ConcSolver::idx, and NULL.
Referenced by SCIP_DECL_CONCSOLVERCREATEINST(), SCIP_DECL_CONCSOLVERSYNCREAD(), SCIP_DECL_CONCSOLVERSYNCWRITE(), and setChildSelRule().