Scippy

SCIP

Solving Constraint Integer Programs

scip_concurrent.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-2018 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 scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_concurrent.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for concurrent solving mode
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Thorsten Koch
22  * @author Alexander Martin
23  * @author Marc Pfetsch
24  * @author Kati Wolter
25  * @author Gregor Hendel
26  * @author Robert Lion Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_CONCURRENT_H__
32 #define __SCIP_SCIP_CONCURRENT_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_concsolver.h"
37 #include "scip/type_retcode.h"
38 #include "scip/type_scip.h"
39 #include "scip/type_syncstore.h"
40 
41 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
42  * this structure except the interface methods in scip.c.
43  * In optimized mode, the structure is included in scip.h, because some of the methods
44  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
45  * Additionally, the internal "set.h" is included, such that the defines in set.h are
46  * available in optimized mode.
47  */
48 #ifdef NDEBUG
49 #include "scip/struct_scip.h"
50 #include "scip/struct_stat.h"
51 #include "scip/set.h"
52 #include "scip/tree.h"
53 #include "scip/misc.h"
54 #include "scip/var.h"
55 #include "scip/cons.h"
56 #include "scip/solve.h"
57 #include "scip/debug.h"
58 #endif
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 /**@addtogroup PublicConcsolverTypeMethods
65  *
66  * @{
67  */
68 
69 /** creates a concurrent solver type and includes it in SCIP.
70  *
71  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
72  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
73  *
74  * @pre This method can be called if @p scip is in one of the following stages:
75  * - \ref SCIP_STAGE_INIT
76  * - \ref SCIP_STAGE_PROBLEM
77  */
78 extern
80  SCIP* scip, /**< SCIP data structure */
81  const char* name, /**< name of concurrent_solver */
82  SCIP_Real prefpriodefault, /**< the default preferred priority of this concurrent solver type */
83  SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)), /**< data copy method of concurrent solver */
84  SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)), /**< data copy method of concurrent solver */
85  SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)), /**< initialize random seeds of concurrent solver */
86  SCIP_DECL_CONCSOLVEREXEC ((*concsolverexec)), /**< execution method of concurrent solver */
87  SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata)),/**< method to copy solving data */
88  SCIP_DECL_CONCSOLVERSTOP ((*concsolverstop)), /**< terminate solving in concurrent solver */
89  SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)), /**< synchronization method of concurrent solver */
90  SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)), /**< synchronization method of concurrent solver */
91  SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata)),/**< method to free data of concurrent solver type */
92  SCIP_CONCSOLVERTYPEDATA* data /**< the concurent solver type's data */
93  );
94 
95 /** returns the concurrent solver type with the given name, or NULL if not existing */
96 extern
98  SCIP* scip, /**< SCIP data structure */
99  const char* name /**< name of concurrent_solver */
100  );
101 
102 /** returns the array of included concurrent solver types */
103 extern
105  SCIP* scip /**< SCIP data structure */
106  );
107 
108 /** returns the number of included concurrent solver types */
109 extern
111  SCIP* scip /**< SCIP data structure */
112  );
113 
114 /* @} */
115 
116 /**@addtogroup PublicParallelMethods
117  *
118  * @{
119  */
120 
121 /** Constructs the parallel interface to execute processes concurrently.
122  *
123  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
124  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
125  *
126  * @pre This method can be called if @p scip is in one of the following stages:
127  * - \ref SCIP_STAGE_PROBLEM
128  * - \ref SCIP_STAGE_TRANSFORMING
129  * - \ref SCIP_STAGE_TRANSFORMED
130  * - \ref SCIP_STAGE_INITPRESOLVE
131  * - \ref SCIP_STAGE_PRESOLVING
132  * - \ref SCIP_STAGE_EXITPRESOLVE
133  * - \ref SCIP_STAGE_PRESOLVED
134  * - \ref SCIP_STAGE_INITSOLVE
135  * - \ref SCIP_STAGE_SOLVING
136  * - \ref SCIP_STAGE_SOLVED
137  * - \ref SCIP_STAGE_EXITSOLVE
138  * - \ref SCIP_STAGE_FREETRANS
139  *
140  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
141  */
142 extern
144  SCIP* scip /**< SCIP data structure */
145  );
146 
147 /** releases the current synchronization store
148  *
149  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
150  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
151  *
152  * @pre This method can be called if @p scip is in one of the following stages:
153  * - \ref SCIP_STAGE_PROBLEM
154  * - \ref SCIP_STAGE_TRANSFORMING
155  * - \ref SCIP_STAGE_TRANSFORMED
156  * - \ref SCIP_STAGE_INITPRESOLVE
157  * - \ref SCIP_STAGE_PRESOLVING
158  * - \ref SCIP_STAGE_EXITPRESOLVE
159  * - \ref SCIP_STAGE_PRESOLVED
160  * - \ref SCIP_STAGE_INITSOLVE
161  * - \ref SCIP_STAGE_SOLVING
162  * - \ref SCIP_STAGE_SOLVED
163  * - \ref SCIP_STAGE_EXITSOLVE
164  * - \ref SCIP_STAGE_FREETRANS
165  * - \ref SCIP_STAGE_FREE
166  *
167  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
168  */
170  SCIP* scip /**< SCIP data structure */
171  );
172 
173 /** Gets the synchronization store.
174  *
175  * @return the \ref SCIP_SYNCSTORE parallel interface pointer to submit jobs for concurrent processing.
176  *
177  * @pre This method can be called if @p scip is in one of the following stages:
178  * - \ref SCIP_STAGE_INIT
179  * - \ref SCIP_STAGE_PROBLEM
180  * - \ref SCIP_STAGE_TRANSFORMING
181  * - \ref SCIP_STAGE_TRANSFORMED
182  * - \ref SCIP_STAGE_INITPRESOLVE
183  * - \ref SCIP_STAGE_PRESOLVING
184  * - \ref SCIP_STAGE_EXITPRESOLVE
185  * - \ref SCIP_STAGE_PRESOLVED
186  * - \ref SCIP_STAGE_INITSOLVE
187  * - \ref SCIP_STAGE_SOLVING
188  * - \ref SCIP_STAGE_SOLVED
189  * - \ref SCIP_STAGE_EXITSOLVE
190  * - \ref SCIP_STAGE_FREETRANS
191  *
192  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
193  */
194 extern
196  SCIP* scip /**< SCIP data structure */
197  );
198 
199 /**@} */
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 #endif
struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA
#define SCIP_DECL_CONCSOLVERSYNCREAD(x)
internal methods for branch and bound tree
#define SCIP_DECL_CONCSOLVEREXEC(x)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
type definitions for return codes for SCIP methods
#define SCIP_DECL_CONCSOLVERDESTROYINST(x)
SCIP_RETCODE SCIPconstructSyncstore(SCIP *scip)
#define SCIP_DECL_CONCSOLVERSTOP(x)
SCIP_RETCODE SCIPincludeConcsolverType(SCIP *scip, 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)
type definitions for SCIP&#39;s main datastructure
internal miscellaneous methods
internal methods for global SCIP settings
SCIP main data structure.
#define SCIP_DECL_CONCSOLVERINITSEEDS(x)
internal methods for problem variables
SCIP_RETCODE SCIPfreeSyncstore(SCIP *scip)
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
methods for debugging
#define SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(x)
datastructures for problem statistics
#define SCIP_DECL_CONCSOLVERTYPEFREEDATA(x)
int SCIPgetNConcsolverTypes(SCIP *scip)
SCIP_CONCSOLVERTYPE ** SCIPgetConcsolverTypes(SCIP *scip)
the type definitions for the synchronization store
internal methods for main solving loop and node processing
#define SCIP_Real
Definition: def.h:150
internal methods for constraints and constraint handlers
common defines and data types used in all packages of SCIP
#define SCIP_DECL_CONCSOLVERSYNCWRITE(x)
#define SCIP_DECL_CONCSOLVERCREATEINST(x)
SCIP_CONCSOLVERTYPE * SCIPfindConcsolverType(SCIP *scip, const char *name)
type definitions for concurrent solvers