Scippy

SCIP

Solving Constraint Integer Programs

concsolver_scip.c File Reference

Detailed Description

implementation of concurrent solver interface for SCIP

Author
Leona Gottwald

Definition in file concsolver_scip.c.

#include "blockmemshell/memory.h"
#include "scip/boundstore.h"
#include "scip/concsolver.h"
#include "scip/concsolver_scip.h"
#include "scip/concurrent.h"
#include "scip/pub_event.h"
#include "scip/pub_heur.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_paramset.h"
#include "scip/pub_sol.h"
#include "scip/pub_var.h"
#include "scip/scip_concurrent.h"
#include "scip/scip_copy.h"
#include "scip/scip_event.h"
#include "scip/scip_general.h"
#include "scip/scip_heur.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_sol.h"
#include "scip/scip_solve.h"
#include "scip/scip_solvingstats.h"
#include "scip/scip_timing.h"
#include "scip/syncstore.h"
#include <string.h>

Go to the source code of this file.

Macros

#define EVENTHDLR_NAME   "sync"
 
#define EVENTHDLR_DESC   "event handler for synchronization of concurrent scip sovlers"
 

Functions

static SCIP_DECL_EVENTFREE (eventFreeSync)
 
static SCIP_DECL_EVENTINIT (eventInitSync)
 
static SCIP_DECL_EVENTEXIT (eventExitSync)
 
static SCIP_DECL_EVENTEXEC (eventExecSync)
 
static SCIP_RETCODE includeEventHdlrSync (SCIP *scip)
 
static SCIP_RETCODE disableConflictingDualReductions (SCIP *scip)
 
static SCIP_RETCODE setChildSelRule (SCIP_CONCSOLVER *concsolver)
 
static SCIP_RETCODE initConcsolver (SCIP *scip, SCIP_CONCSOLVER *concsolver)
 
static SCIP_DECL_CONCSOLVERCREATEINST (concsolverScipCreateInstance)
 
static SCIP_DECL_CONCSOLVERDESTROYINST (concsolverScipDestroyInstance)
 
static SCIP_DECL_CONCSOLVERTYPEFREEDATA (concsolverTypeScipFreeData)
 
static SCIP_DECL_CONCSOLVERINITSEEDS (concsolverScipInitSeeds)
 
static SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA (concsolverGetSolvingData)
 
static SCIP_DECL_CONCSOLVEREXEC (concsolverScipExec)
 
static SCIP_DECL_CONCSOLVERSTOP (concsolverScipStop)
 
static SCIP_DECL_CONCSOLVERSYNCWRITE (concsolverScipSyncWrite)
 
static SCIP_DECL_CONCSOLVERSYNCREAD (concsolverScipSyncRead)
 
SCIP_RETCODE SCIPincludeConcurrentScipSolvers (SCIP *scip)
 

Macro Definition Documentation

◆ EVENTHDLR_NAME

#define EVENTHDLR_NAME   "sync"

Definition at line 63 of file concsolver_scip.c.

◆ EVENTHDLR_DESC

#define EVENTHDLR_DESC   "event handler for synchronization of concurrent scip sovlers"

Definition at line 64 of file concsolver_scip.c.

Function Documentation

◆ SCIP_DECL_EVENTFREE()

static SCIP_DECL_EVENTFREE ( eventFreeSync  )
static

destructor of event handler to free user data (called when SCIP is exiting)

Definition at line 82 of file concsolver_scip.c.

References EVENTHDLR_NAME, NULL, SCIP_OKAY, SCIPeventhdlrGetData(), SCIPeventhdlrGetName(), SCIPeventhdlrSetData(), and SCIPfreeBlockMemory.

◆ SCIP_DECL_EVENTINIT()

static SCIP_DECL_EVENTINIT ( eventInitSync  )
static

initialization method of event handler (called after problem was transformed)

Definition at line 102 of file concsolver_scip.c.

References EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_EVENTTYPE_SYNC, SCIP_OKAY, SCIPcatchEvent(), SCIPeventhdlrGetData(), SCIPeventhdlrGetName(), SCIPgetSyncstore(), and SCIPsyncstoreIsInitialized().

◆ SCIP_DECL_EVENTEXIT()

static SCIP_DECL_EVENTEXIT ( eventExitSync  )
static

deinitialization method of event handler (called before transformed problem is freed)

Definition at line 128 of file concsolver_scip.c.

References EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_EVENTTYPE_SYNC, SCIP_OKAY, SCIPdropEvent(), SCIPeventhdlrGetData(), and SCIPeventhdlrGetName().

◆ SCIP_DECL_EVENTEXEC()

static SCIP_DECL_EVENTEXEC ( eventExecSync  )
static

execution method of event handler

Definition at line 151 of file concsolver_scip.c.

References EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPeventhdlrGetName(), and SCIPsynchronize().

◆ includeEventHdlrSync()

static SCIP_RETCODE includeEventHdlrSync ( SCIP scip)
static

includes event handler for synchronization found

Parameters
scipSCIP data structure

Definition at line 166 of file concsolver_scip.c.

References EVENTHDLR_DESC, EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPincludeEventhdlrBasic(), SCIPsetEventhdlrExit(), SCIPsetEventhdlrFree(), and SCIPsetEventhdlrInit().

Referenced by SCIP_DECL_CONCSOLVERCREATEINST().

◆ disableConflictingDualReductions()

static SCIP_RETCODE disableConflictingDualReductions ( SCIP scip)
static

Disable dual reductions that might cut off optimal solutions. Although they keep at least one optimal solution intact, communicating these bounds may cut off all optimal solutions, if different optimal solutions were kept in different concurrent solvers.

Parameters
scipSCIP datastructure

Definition at line 206 of file concsolver_scip.c.

References FALSE, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPgetBoolParam(), and SCIPsetBoolParam().

Referenced by SCIP_DECL_CONCSOLVERCREATEINST().

◆ setChildSelRule()

static SCIP_RETCODE setChildSelRule ( SCIP_CONCSOLVER concsolver)
static

sets the child selection rule based on the index of the concurrent solver

Parameters
concsolverthe concurrent solver

Definition at line 223 of file concsolver_scip.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverGetData(), SCIPconcsolverGetIdx(), and SCIPsetCharParam().

Referenced by SCIP_DECL_CONCSOLVERCREATEINST().

◆ initConcsolver()

◆ SCIP_DECL_CONCSOLVERCREATEINST()

◆ SCIP_DECL_CONCSOLVERDESTROYINST()

static SCIP_DECL_CONCSOLVERDESTROYINST ( concsolverScipDestroyInstance  )
static

destroys an instance of a concurrent SCIP solver

Definition at line 439 of file concsolver_scip.c.

References BMSfreeMemory, NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverGetData(), SCIPconcsolverSetData(), SCIPfree(), and SCIPfreeBlockMemoryArray.

◆ SCIP_DECL_CONCSOLVERTYPEFREEDATA()

static SCIP_DECL_CONCSOLVERTYPEFREEDATA ( concsolverTypeScipFreeData  )
static

frees the data of a concurrent solver type

Definition at line 462 of file concsolver_scip.c.

References BMSfreeMemory.

◆ SCIP_DECL_CONCSOLVERINITSEEDS()

static SCIP_DECL_CONCSOLVERINITSEEDS ( concsolverScipInitSeeds  )
static

initializes the random and permutation seeds with the given one and enables permutation of constraints and variables

Definition at line 471 of file concsolver_scip.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverGetData(), SCIPconcsolverGetName(), SCIPinfoMessage(), SCIPsetBoolParam(), SCIPsetIntParam(), and TRUE.

◆ SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA()

static SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ( concsolverGetSolvingData  )
static

◆ SCIP_DECL_CONCSOLVEREXEC()

static SCIP_DECL_CONCSOLVEREXEC ( concsolverScipExec  )
static

start solving the problem until the solving reaches a limit, gets interrupted, or just finished successfully

Definition at line 556 of file concsolver_scip.c.

References nnodes, NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverGetData(), SCIPconcsolverGetName(), SCIPgetNLPIterations(), SCIPgetNNodes(), SCIPgetSolvingTime(), SCIPinfoMessage(), SCIPprintStatus(), and SCIPsolve().

◆ SCIP_DECL_CONCSOLVERSTOP()

static SCIP_DECL_CONCSOLVERSTOP ( concsolverScipStop  )
static

stops the concurrent solver as soon as possible

Definition at line 586 of file concsolver_scip.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPconcsolverGetData(), and SCIPinterruptSolve().

◆ SCIP_DECL_CONCSOLVERSYNCWRITE()

◆ SCIP_DECL_CONCSOLVERSYNCREAD()

◆ SCIPincludeConcurrentScipSolvers()

SCIP_RETCODE SCIPincludeConcurrentScipSolvers ( SCIP scip)