Detailed Description
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.
Function Documentation
◆ doConcsolverTypeCreate()
|
static |
internal method for creating a concurrent solver type
- Parameters
-
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 concurent solver type's data
Definition at line 52 of file concsolver.c.
References BMSallocMemory, BMSclearMemory, BMSduplicateMemoryArray, FALSE, NULL, paramname, SCIP_ALLOC, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPsetAddRealParam(), and SCIPsnprintf().
Referenced by SCIPconcsolverTypeCreate().
◆ 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
- Parameters
-
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 concurent solver type's data
Definition at line 113 of file concsolver.c.
References doConcsolverTypeCreate(), NULL, SCIP_CALL_FINALLY, SCIP_OKAY, and SCIPconcsolverTypeFree().
Referenced by SCIPincludeConcsolverType().
◆ SCIPconcsolverTypeFree()
void SCIPconcsolverTypeFree | ( | SCIP_CONCSOLVERTYPE ** | concsolvertype | ) |
frees all memory of a concurrent solver type
- Parameters
-
concsolvertype pointer to concurrent solver data structure
Definition at line 153 of file concsolver.c.
References BMSfreeMemory, BMSfreeMemoryArrayNull, and NULL.
Referenced by SCIPconcsolverTypeCreate().
◆ SCIPconcsolverTypeGetData()
SCIP_CONCSOLVERTYPEDATA * SCIPconcsolverTypeGetData | ( | SCIP_CONCSOLVERTYPE * | concsolvertype | ) |
gets the data of a concurrent solver type
- Parameters
-
concsolvertype concurrent solver type
Definition at line 169 of file concsolver.c.
References SCIP_ConcSolverType::data, and NULL.
Referenced by SCIP_DECL_CONCSOLVERCREATEINST().
◆ SCIPconcsolverTypeSetData()
void SCIPconcsolverTypeSetData | ( | SCIP_CONCSOLVERTYPE * | concsolvertype, |
SCIP_CONCSOLVERTYPEDATA * | data | ||
) |
sets the data of a concurrent solver type
- Parameters
-
concsolvertype concurrent solver type data the concurrent solver's data
Definition at line 179 of file concsolver.c.
References SCIP_ConcSolverType::data, and NULL.
◆ SCIPconcsolverTypeGetName()
char * SCIPconcsolverTypeGetName | ( | SCIP_CONCSOLVERTYPE * | concsolvertype | ) |
gets the name of a concurrent solver type
- Parameters
-
concsolvertype concurrent solver type
Definition at line 190 of file concsolver.c.
References SCIP_ConcSolverType::name, and NULL.
◆ SCIPconcsolverTypeGetPrefPrio()
SCIP_Real SCIPconcsolverTypeGetPrefPrio | ( | SCIP_CONCSOLVERTYPE * | concsolvertype | ) |
gets the preferred priority from a concurrent solver type
- Parameters
-
concsolvertype concurrent solver type
Definition at line 200 of file concsolver.c.
References NULL, and SCIP_ConcSolverType::prefprio.
Referenced by SCIPsolveConcurrent().
◆ SCIPconcsolverCreateInstance()
SCIP_RETCODE SCIPconcsolverCreateInstance | ( | SCIP_SET * | set, |
SCIP_CONCSOLVERTYPE * | concsolvertype, | ||
SCIP_CONCSOLVER ** | concsolver | ||
) |
creates an instance of the given concurrent solver type
- Parameters
-
set global SCIP settings concsolvertype concurrent solver type to create concsolver pointer to return concurrent solver instance
Definition at line 210 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().
◆ SCIPconcsolverDestroyInstance()
SCIP_RETCODE SCIPconcsolverDestroyInstance | ( | SCIP_SET * | set, |
SCIP_CONCSOLVER ** | concsolver | ||
) |
destroys an instance of the given concurrent solver
- Parameters
-
set global SCIP settings concsolver concurrent solver
Definition at line 257 of file concsolver.c.
References BMSfreeMemory, BMSfreeMemoryArray, NULL, SCIP_CALL, SCIP_OKAY, and SCIPfreeClock().
◆ SCIPconcsolverGetData()
SCIP_CONCSOLVERDATA * SCIPconcsolverGetData | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the data of a concurrent solver
- Parameters
-
concsolver concurrent solver
Definition at line 279 of file concsolver.c.
References 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().
◆ SCIPconcsolverSetData()
void SCIPconcsolverSetData | ( | SCIP_CONCSOLVER * | concsolver, |
SCIP_CONCSOLVERDATA * | data | ||
) |
sets the data of a concurrent solver
- Parameters
-
concsolver concurrent solver data the concurrent solver's data
Definition at line 289 of file concsolver.c.
References SCIP_ConcSolver::data, and NULL.
Referenced by SCIP_DECL_CONCSOLVERCREATEINST(), and SCIP_DECL_CONCSOLVERDESTROYINST().
◆ SCIPconcsolverGetName()
char * SCIPconcsolverGetName | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the name of a concurrent solver
- Parameters
-
concsolver concurrent solver
Definition at line 300 of file concsolver.c.
References SCIP_ConcSolver::name, and NULL.
Referenced by initConcsolver(), SCIP_DECL_CONCSOLVERCREATEINST(), SCIP_DECL_CONCSOLVEREXEC(), SCIP_DECL_CONCSOLVERINITSEEDS(), SCIP_DECL_CONCSOLVERSYNCREAD(), SCIP_DECL_CONCSOLVERSYNCWRITE(), and SCIPprintConcsolverStatistics().
◆ SCIPconcsolverInitSeeds()
SCIP_RETCODE SCIPconcsolverInitSeeds | ( | SCIP_CONCSOLVER * | concsolver, |
unsigned int | seed | ||
) |
initializes the random seeds of a concurrent solver
- Parameters
-
concsolver concurrent solver seed seed for initializing the solver's internal random seeds
Definition at line 310 of file concsolver.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIP_ConcSolver::type.
Referenced by SCIPsolveConcurrent().
◆ SCIPconcsolverExec()
SCIP_RETCODE SCIPconcsolverExec | ( | SCIP_CONCSOLVER * | concsolver | ) |
start the solving process of a concurrent solver
- Parameters
-
concsolver concurrent solver
Definition at line 325 of file concsolver.c.
References 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().
◆ SCIPconcsolverGetSolvingData()
SCIP_RETCODE SCIPconcsolverGetSolvingData | ( | SCIP_CONCSOLVER * | concsolver, |
SCIP * | scip | ||
) |
gets solving data of concurrent solver and stores it in the given SCIP instance
- Parameters
-
concsolver concurrent solver scip SCIP datastructure
Definition at line 343 of file concsolver.c.
References NULL, and SCIP_ConcSolver::type.
Referenced by SCIPconcurrentSolve().
◆ SCIPconcsolverStop()
SCIP_RETCODE SCIPconcsolverStop | ( | SCIP_CONCSOLVER * | concsolver | ) |
interrupt solving in a concurrent solver
- Parameters
-
concsolver concurrent solver
Definition at line 356 of file concsolver.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIP_ConcSolver::stopped, TRUE, and SCIP_ConcSolver::type.
Referenced by SCIPconcsolverSync().
◆ 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 the SPI.
- Parameters
-
concsolver concurrent solver set global SCIP settings
Definition at line 375 of file concsolver.c.
References 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().
◆ SCIPconcsolverGetSyncFreq()
SCIP_Real SCIPconcsolverGetSyncFreq | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the current synchronization frequency of the concurent solver
- Parameters
-
concsolver concurrent solver
Definition at line 510 of file concsolver.c.
References NULL, and SCIP_ConcSolver::syncfreq.
Referenced by SCIPincrementConcurrentTime().
◆ SCIPconcsolverGetMemTotal()
SCIP_Longint SCIPconcsolverGetMemTotal | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the total memory used by the concurent solver
- Parameters
-
concsolver concurrent solver
Definition at line 520 of file concsolver.c.
References NULL, SCIPsyncdataGetMemTotal(), and SCIP_ConcSolver::syncdata.
Referenced by SCIPgetConcurrentMemTotal().
◆ SCIPconcsolverSetTimeSinceLastSync()
void SCIPconcsolverSetTimeSinceLastSync | ( | SCIP_CONCSOLVER * | concsolver, |
SCIP_Real | time | ||
) |
sets the time elapsed since the last synchronization. Must be set before the synchronization is started.
- Parameters
-
concsolver concurrent solver time the time passed since the last synchronization
Definition at line 532 of file concsolver.c.
References NULL, and SCIP_ConcSolver::timesincelastsync.
Referenced by SCIPincrementConcurrentTime().
◆ SCIPconcsolverGetSolvingTime()
SCIP_Real SCIPconcsolverGetSolvingTime | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the solving time of the concurrent solver
- Parameters
-
concsolver concurrent solver
Definition at line 543 of file concsolver.c.
References NULL, and SCIP_ConcSolver::solvingtime.
Referenced by SCIPprintConcsolverStatistics().
◆ SCIPconcsolverGetSyncTime()
SCIP_Real SCIPconcsolverGetSyncTime | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the time spent for synchronization for the concurrent solver
- Parameters
-
concsolver concurrent solver
Definition at line 553 of file concsolver.c.
References NULL, SCIPclockGetTime(), and SCIP_ConcSolver::totalsynctime.
Referenced by SCIPprintConcsolverStatistics().
◆ SCIPconcsolverGetNLPIterations()
SCIP_Longint SCIPconcsolverGetNLPIterations | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of lp iterations the concurrent solver used
- Parameters
-
concsolver concurrent solver
Definition at line 563 of file concsolver.c.
References SCIP_ConcSolver::nlpiterations, and NULL.
Referenced by SCIPprintConcsolverStatistics().
◆ SCIPconcsolverGetNNodes()
SCIP_Longint SCIPconcsolverGetNNodes | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of branch and bound nodes the concurrent solver used
- Parameters
-
concsolver concurrent solver
Definition at line 573 of file concsolver.c.
References SCIP_ConcSolver::nnodes, and NULL.
Referenced by SCIPprintConcsolverStatistics().
◆ SCIPconcsolverGetNSolsRecvd()
SCIP_Longint SCIPconcsolverGetNSolsRecvd | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of solutions the concurrent solver received during synchronization
- Parameters
-
concsolver concurrent solver
Definition at line 583 of file concsolver.c.
References SCIP_ConcSolver::nsolsrecvd, and NULL.
Referenced by SCIPprintConcsolverStatistics().
◆ SCIPconcsolverGetNSolsShared()
SCIP_Longint SCIPconcsolverGetNSolsShared | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of solutions the concurrent solver shared during synchronization
- Parameters
-
concsolver concurrent solver
Definition at line 593 of file concsolver.c.
References SCIP_ConcSolver::nsolsshared, and NULL.
Referenced by SCIPprintConcsolverStatistics().
◆ SCIPconcsolverGetNTighterBnds()
SCIP_Longint SCIPconcsolverGetNTighterBnds | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of tighter global variable bounds the solver received
- Parameters
-
concsolver concurrent solver
Definition at line 603 of file concsolver.c.
References SCIP_ConcSolver::ntighterbnds, and NULL.
Referenced by SCIPprintConcsolverStatistics().
◆ SCIPconcsolverGetNTighterIntBnds()
SCIP_Longint SCIPconcsolverGetNTighterIntBnds | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets the number of tighter global variable bounds of integer variables the solver received
- Parameters
-
concsolver concurrent solver
Definition at line 613 of file concsolver.c.
References SCIP_ConcSolver::ntighterintbnds, and NULL.
Referenced by SCIPprintConcsolverStatistics().
◆ SCIPconcsolverGetIdx()
int SCIPconcsolverGetIdx | ( | SCIP_CONCSOLVER * | concsolver | ) |
gets index of concurrent solver
- Parameters
-
concsolver concurrent solver
Definition at line 623 of file concsolver.c.
References SCIP_ConcSolver::idx, and NULL.
Referenced by SCIP_DECL_CONCSOLVERCREATEINST(), SCIP_DECL_CONCSOLVERSYNCREAD(), SCIP_DECL_CONCSOLVERSYNCWRITE(), and setChildSelRule().