Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

methods for concurrent solvers

Author
Leona Gottwald

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.

Functions

static SCIP_RETCODE doConcsolverTypeCreate (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)
 
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)
 
void SCIPconcsolverTypeFree (SCIP_CONCSOLVERTYPE **concsolvertype)
 
SCIP_CONCSOLVERTYPEDATASCIPconcsolverTypeGetData (SCIP_CONCSOLVERTYPE *concsolvertype)
 
void SCIPconcsolverTypeSetData (SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVERTYPEDATA *data)
 
char * SCIPconcsolverTypeGetName (SCIP_CONCSOLVERTYPE *concsolvertype)
 
SCIP_Real SCIPconcsolverTypeGetPrefPrio (SCIP_CONCSOLVERTYPE *concsolvertype)
 
SCIP_RETCODE SCIPconcsolverCreateInstance (SCIP_SET *set, SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVER **concsolver)
 
SCIP_RETCODE SCIPconcsolverDestroyInstance (SCIP_SET *set, SCIP_CONCSOLVER **concsolver)
 
SCIP_CONCSOLVERDATASCIPconcsolverGetData (SCIP_CONCSOLVER *concsolver)
 
void SCIPconcsolverSetData (SCIP_CONCSOLVER *concsolver, SCIP_CONCSOLVERDATA *data)
 
char * SCIPconcsolverGetName (SCIP_CONCSOLVER *concsolver)
 
SCIP_RETCODE SCIPconcsolverInitSeeds (SCIP_CONCSOLVER *concsolver, unsigned int seed)
 
SCIP_RETCODE SCIPconcsolverExec (SCIP_CONCSOLVER *concsolver)
 
SCIP_RETCODE SCIPconcsolverGetSolvingData (SCIP_CONCSOLVER *concsolver, SCIP *scip)
 
SCIP_RETCODE SCIPconcsolverStop (SCIP_CONCSOLVER *concsolver)
 
SCIP_RETCODE SCIPconcsolverSync (SCIP_CONCSOLVER *concsolver, SCIP_SET *set)
 
SCIP_Real SCIPconcsolverGetSyncFreq (SCIP_CONCSOLVER *concsolver)
 
SCIP_Longint SCIPconcsolverGetMemTotal (SCIP_CONCSOLVER *concsolver)
 
void SCIPconcsolverSetTimeSinceLastSync (SCIP_CONCSOLVER *concsolver, SCIP_Real time)
 
SCIP_Real SCIPconcsolverGetSolvingTime (SCIP_CONCSOLVER *concsolver)
 
SCIP_Real SCIPconcsolverGetSyncTime (SCIP_CONCSOLVER *concsolver)
 
SCIP_Longint SCIPconcsolverGetNLPIterations (SCIP_CONCSOLVER *concsolver)
 
SCIP_Longint SCIPconcsolverGetNNodes (SCIP_CONCSOLVER *concsolver)
 
SCIP_Longint SCIPconcsolverGetNSolsRecvd (SCIP_CONCSOLVER *concsolver)
 
SCIP_Longint SCIPconcsolverGetNSolsShared (SCIP_CONCSOLVER *concsolver)
 
SCIP_Longint SCIPconcsolverGetNTighterBnds (SCIP_CONCSOLVER *concsolver)
 
SCIP_Longint SCIPconcsolverGetNTighterIntBnds (SCIP_CONCSOLVER *concsolver)
 
int SCIPconcsolverGetIdx (SCIP_CONCSOLVER *concsolver)
 

Function Documentation

◆ doConcsolverTypeCreate()

static SCIP_RETCODE doConcsolverTypeCreate ( 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 
)
static

internal method for creating a concurrent solver type

Parameters
concsolvertypepointer to concurrent solver data structure
setglobal SCIP settings
messagehdlrmessage handler
blkmemblock memory for parameter settings
namename of concurrent solver
prefpriodefaultthe default preferred priority of this concurrent solver type
datathe concurent solver type's data

Definition at line 43 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
concsolvertypepointer to concurrent solver data structure
setglobal SCIP settings
messagehdlrmessage handler
blkmemblock memory for parameter settings
namename of concurrent solver
prefpriodefaultthe default preferred priority of this concurrent solver type
datathe concurent solver type's data

Definition at line 104 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
concsolvertypepointer to concurrent solver data structure

Definition at line 144 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
concsolvertypeconcurrent solver type

Definition at line 160 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
concsolvertypeconcurrent solver type
datathe concurrent solver's data

Definition at line 170 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
concsolvertypeconcurrent solver type

Definition at line 181 of file concsolver.c.

References SCIP_ConcSolverType::name, and NULL.

Referenced by SCIPsetSortPropsName().

◆ SCIPconcsolverTypeGetPrefPrio()

SCIP_Real SCIPconcsolverTypeGetPrefPrio ( SCIP_CONCSOLVERTYPE concsolvertype)

gets the preferred priority from a concurrent solver type

Parameters
concsolvertypeconcurrent solver type

Definition at line 191 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
setglobal SCIP settings
concsolvertypeconcurrent solver type to create
concsolverpointer to return concurrent solver instance

Definition at line 201 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
setglobal SCIP settings
concsolverconcurrent solver

Definition at line 248 of file concsolver.c.

References BMSfreeMemory, BMSfreeMemoryArray, NULL, SCIP_CALL, SCIP_OKAY, and SCIPfreeClock().

◆ SCIPconcsolverGetData()

◆ SCIPconcsolverSetData()

void SCIPconcsolverSetData ( SCIP_CONCSOLVER concsolver,
SCIP_CONCSOLVERDATA data 
)

sets the data of a concurrent solver

Parameters
concsolverconcurrent solver
datathe concurrent solver's data

Definition at line 280 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
concsolverconcurrent solver

Definition at line 291 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
concsolverconcurrent solver
seedseed for initializing the solver's internal random seeds

Definition at line 301 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
concsolverconcurrent solver

Definition at line 316 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
concsolverconcurrent solver
scipSCIP datastructure

Definition at line 334 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
concsolverconcurrent solver

Definition at line 347 of file concsolver.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIP_ConcSolver::stopped, TRUE, and SCIP_ConcSolver::type.

Referenced by SCIPconcsolverSync().

◆ SCIPconcsolverSync()

◆ SCIPconcsolverGetSyncFreq()

SCIP_Real SCIPconcsolverGetSyncFreq ( SCIP_CONCSOLVER concsolver)

gets the current synchronization frequency of the concurent solver

Parameters
concsolverconcurrent solver

Definition at line 501 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
concsolverconcurrent solver

Definition at line 511 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
concsolverconcurrent solver
timethe time passed since the last synchronization

Definition at line 523 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
concsolverconcurrent solver

Definition at line 534 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
concsolverconcurrent solver

Definition at line 544 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
concsolverconcurrent solver

Definition at line 554 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
concsolverconcurrent solver

Definition at line 564 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
concsolverconcurrent solver

Definition at line 574 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
concsolverconcurrent solver

Definition at line 584 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
concsolverconcurrent solver

Definition at line 594 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
concsolverconcurrent solver

Definition at line 604 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
concsolverconcurrent solver

Definition at line 614 of file concsolver.c.

References SCIP_ConcSolver::idx, and NULL.

Referenced by SCIP_DECL_CONCSOLVERCREATEINST(), SCIP_DECL_CONCSOLVERSYNCREAD(), SCIP_DECL_CONCSOLVERSYNCWRITE(), and setChildSelRule().