Scippy

SCIP

Solving Constraint Integer Programs

concsolver.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file concsolver.h
17  * @brief datastructures for concurrent solvers
18  * @author Leona Gottwald
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #ifndef __SCIP_CONCSOLVER_H__
24 #define __SCIP_CONCSOLVER_H__
25 
26 #include "scip/def.h"
27 #include "blockmemshell/memory.h"
28 #include "scip/type_retcode.h"
29 #include "scip/type_set.h"
30 #include "scip/type_concsolver.h"
31 #include "scip/type_syncstore.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /** creates a concurrent solver type */
39  SCIP_CONCSOLVERTYPE** concsolvertype, /**< pointer to concurrent solver data structure */
40  SCIP_SET* set, /**< global SCIP settings */
41  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
42  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
43  const char* name, /**< name of concurrent solver */
44  SCIP_Real prefpriodefault, /**< the default preferred priority of this concurrent solver type */
45  SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)),/**< data copy method of concurrent solver */
46  SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)),/**< data copy method of concurrent solver */
47  SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)),/**< initialize random seeds of concurrent solver */
48  SCIP_DECL_CONCSOLVEREXEC ((*concsolverexec)),/**< execution method of concurrent solver */
49  SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata)),/**< method to copy solving data */
50  SCIP_DECL_CONCSOLVERSTOP ((*concsolverstop)),/**< terminate solving in concurrent solver */
51  SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)),/**< synchronization method of concurrent solver */
52  SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)),/**< synchronization method of concurrent solver */
53  SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata)),/**< method to free data of concurrent solver type */
54  SCIP_CONCSOLVERTYPEDATA* data /**< the concurent solver type's data */
55  );
56 
57 /** frees all memory of a concurrent solver type */
59  SCIP_CONCSOLVERTYPE** concsolvertype /**< pointer to concurrent solver data structure */
60  );
61 
62 /** gets the data of a concurrent solver type */
64  SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
65  );
66 
67 /** sets the data of a concurrent solver type */
69  SCIP_CONCSOLVERTYPE* concsolvertype, /**< concurrent solver type */
70  SCIP_CONCSOLVERTYPEDATA* data /**< the concurrent solver's data */
71  );
72 
73 /** gets the name of a concurrent solver type */
75  SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
76  );
77 
78 /** gets the preferred priority from a concurrent solver type */
80  SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
81  );
82 
83 /** creates an instance of the given concurrent solver type */
85  SCIP_SET* set, /**< global SCIP settings */
86  SCIP_CONCSOLVERTYPE* concsolvertype, /**< concurrent solver type to create */
87  SCIP_CONCSOLVER** concsolver /**< pointer to return concurrent solver instance */
88  );
89 
90 /** destroys an instance of the given concurrent solver */
92  SCIP_SET* set, /**< global SCIP settings */
93  SCIP_CONCSOLVER** concsolver /**< concurrent solver */
94  );
95 
96 /** gets the data of a concurrent solver */
98  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
99  );
100 
101 /** sets the data of a concurrent solver */
103  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
104  SCIP_CONCSOLVERDATA* data /**< the concurrent solver's data */
105  );
106 
107 /** gets the name of a concurrent solver */
109  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
110  );
111 
112 /** initializes the random seeds of a concurrent solver */
114  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
115  unsigned int seed /**< seed for initializing the solver's internal random seeds */
116  );
117 
118 /** start the solving process of a concurrent solver */
120  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
121  );
122 
123 /** gets solving data of concurrent solver and stores it in the given SCIP instance */
125  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
126  SCIP* scip /**< SCIP datastructure */
127  );
128 
129 /** interrupt solving in a concurrent solver */
131  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
132  );
133 
134 /** let the given concurrent solver synchronize, i.e. pass its own solutions and bounds to
135  * the SPI.
136  */
138  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
139  SCIP_SET* set /**< global SCIP settings */
140  );
141 
142 /** gets the current synchronization frequency of the concurent solver */
144  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
145  );
146 
147 /** gets the total memory used by the concurent solver */
149  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
150  );
151 
152 /** sets the time elapsed since the last synchronization. Must be set before the synchronization is
153  * started.
154  */
156  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
157  SCIP_Real time /**< the time passed since the last synchronization */
158  );
159 
160 /** gets the solving time of the concurrent solver */
162  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
163  );
164 
165 /** gets the time spent for synchronization for the concurrent solver */
167  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
168  );
169 
170 /** gets the number of lp iterations the concurrent solver used */
172  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
173  );
174 
175 /** gets the number of branch and bound nodes the concurrent solver used */
177  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
178  );
179 
180 /** gets the number of solutions the concurrent solver received during synchronization */
182  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
183  );
184 
185 /** gets the number of solutions the concurrent solver shared during synchronization */
187  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
188  );
189 
190 /** gets the number of tighter global variable bounds the solver received */
192  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
193  );
194 
195 /** gets the number of tighter global variable bounds of integer variables the solver received */
197  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
198  );
199 
200 /** gets index of concurrent solver */
202  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
203  );
204 
205 #ifdef __cplusplus
206 }
207 #endif
208 
209 #endif
SCIP_Longint SCIPconcsolverGetNTighterBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:594
char * SCIPconcsolverGetName(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:291
struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA
#define SCIP_DECL_CONCSOLVERSYNCREAD(x)
void SCIPconcsolverTypeFree(SCIP_CONCSOLVERTYPE **concsolvertype)
Definition: concsolver.c:144
char * SCIPconcsolverTypeGetName(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:181
#define SCIP_DECL_CONCSOLVEREXEC(x)
SCIP_RETCODE SCIPconcsolverGetSolvingData(SCIP_CONCSOLVER *concsolver, SCIP *scip)
Definition: concsolver.c:334
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
type definitions for global SCIP settings
SCIP_Real SCIPconcsolverGetSyncFreq(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:501
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPconcsolverCreateInstance(SCIP_SET *set, SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVER **concsolver)
Definition: concsolver.c:201
#define SCIP_DECL_CONCSOLVERDESTROYINST(x)
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)
Definition: concsolver.c:104
SCIP_Longint SCIPconcsolverGetNSolsShared(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:584
SCIP_Longint SCIPconcsolverGetMemTotal(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:511
#define SCIP_DECL_CONCSOLVERSTOP(x)
SCIP_Longint SCIPconcsolverGetNNodes(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:564
void SCIPconcsolverSetTimeSinceLastSync(SCIP_CONCSOLVER *concsolver, SCIP_Real time)
Definition: concsolver.c:523
void SCIPconcsolverSetData(SCIP_CONCSOLVER *concsolver, SCIP_CONCSOLVERDATA *data)
Definition: concsolver.c:280
SCIP_RETCODE SCIPconcsolverSync(SCIP_CONCSOLVER *concsolver, SCIP_SET *set)
Definition: concsolver.c:366
SCIP_Real SCIPconcsolverGetSolvingTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:534
SCIP_Longint SCIPconcsolverGetNSolsRecvd(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:574
SCIP_RETCODE SCIPconcsolverStop(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:347
SCIP_RETCODE SCIPconcsolverDestroyInstance(SCIP_SET *set, SCIP_CONCSOLVER **concsolver)
Definition: concsolver.c:248
#define SCIP_DECL_CONCSOLVERINITSEEDS(x)
int SCIPconcsolverGetIdx(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:614
SCIP_Real SCIPconcsolverGetSyncTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:544
SCIP_RETCODE SCIPconcsolverExec(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:316
#define SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(x)
SCIP_RETCODE SCIPconcsolverInitSeeds(SCIP_CONCSOLVER *concsolver, unsigned int seed)
Definition: concsolver.c:301
SCIP_Longint SCIPconcsolverGetNTighterIntBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:604
#define SCIP_DECL_CONCSOLVERTYPEFREEDATA(x)
SCIP_Longint SCIPconcsolverGetNLPIterations(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:554
the type definitions for the synchronization store
SCIP_CONCSOLVERDATA * SCIPconcsolverGetData(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:270
SCIP_CONCSOLVERTYPEDATA * SCIPconcsolverTypeGetData(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:160
#define SCIP_Real
Definition: def.h:177
#define SCIP_Longint
Definition: def.h:162
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:430
void SCIPconcsolverTypeSetData(SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVERTYPEDATA *data)
Definition: concsolver.c:170
#define SCIP_DECL_CONCSOLVERSYNCWRITE(x)
SCIP_Real SCIPconcsolverTypeGetPrefPrio(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:191
#define SCIP_DECL_CONCSOLVERCREATEINST(x)
struct SCIP_ConcSolverData SCIP_CONCSOLVERDATA
type definitions for concurrent solvers
memory allocation routines