Scippy

SCIP

Solving Constraint Integer Programs

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-2017 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file concurrent.h
17  * @ingroup PARALLEL
18  * @brief helper functions for concurrent scip solvers
19  * @author Robert Lion Gottwald
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include "scip/type_concurrent.h"
25 #include "scip/type_scip.h"
26 #include "scip/type_concsolver.h"
27 #include "scip/type_sol.h"
28 #include "scip/type_var.h"
29 #include "scip/type_syncstore.h"
30 #include "scip/def.h"
31 
32 #ifndef __SCIP_CONCURRENT_H__
33 #define __SCIP_CONCURRENT_H__
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /** create concurrent data */
40 extern
42  SCIP* scip, /**< SCIP datastructure */
43  SCIP_CONCSOLVER* concsolver, /**< concurrent solver of given SCIP instance */
44  int* varperm /**< permutation of variables for communication */
45  );
46 
47 /** get number of initialized concurrent solvers */
48 extern
50  SCIP* scip /**< SCIP datastructure */
51  );
52 
53 /** gets the concurrent solvers */
54 extern
56  SCIP* scip /**< SCIP datastructure */
57  );
58 
59 /** adds a concurrent solver */
60 extern
62  SCIP* scip, /**< SCIP datastructure */
63  SCIP_CONCSOLVER* concsolver /**< concurrent solver of given SCIP instance */
64  );
65 
66 /** frees concurrent data */
67 extern
69  SCIP* scip /**< SCIP datastructure */
70  );
71 
72 /** increments the time counter for synchronization */
73 extern
75  SCIP* scip, /**< SCIP datastructure */
76  SCIP_Real val /**< value by which the time counter for synchronization is incremented */
77  );
78 
79 /** synchronize with other concurrent solvers */
80 extern
82  SCIP* scip /**< SCIP datastructure */
83  );
84 
85 /** pass a solution to the given SCIP instance using that was received via synchronization by using
86  * the sync heuristic */
87 extern
89  SCIP* scip, /**< SCIP datastructure */
90  SCIP_SOL* sol /**< solution */
91  );
92 
93 /** adds a global boundchange to the given SCIP, by passing it to the sync propagator */
94 extern
96  SCIP* scip, /**< SCIP data structure */
97  SCIP_VAR* var, /**< variable for bound */
98  SCIP_Real val, /**< value of bound */
99  SCIP_BOUNDTYPE bndtype /**< type of bound */
100  );
101 
102 /** copy the nodenumber, depth, time, and runnumber of one solution to another one */
103 extern
105  SCIP_SOL* source, /**< source for solution statistics */
106  SCIP_SOL* target /**< target for solution statistics */
107  );
108 
109 /** copy solving statistics */
110 extern
112  SCIP* source, /**< SCIP data structure */
113  SCIP* target /**< target SCIP data structure */
114  );
115 
116 /** get variable index of original variable that is the same between concurrent solvers */
117 extern
119  SCIP* scip, /**< SCIP data structure */
120  SCIP_VAR* var /**< variable */
121  );
122 
123 /** has the solution been created after the last synchronization point */
124 extern
126  SCIP* scip, /**< SCIP data structure */
127  SCIP_SOL* sol /**< the solution */
128  );
129 
130 /** gets the global bound changes since the last synchronization point */
131 extern
133  SCIP* scip /**< SCIP data structure */
134  );
135 
136 /** start solving in parallel using the given set of concurrent solvers */
137 extern
139  SCIP* scip /**< pointer to scip datastructure */
140  );
141 
142 /** disables storing global bound changes */
143 extern
145  SCIP* scip /**< SCIP data structure */
146  );
147 
148 /** enables storing global bound changes */
149 extern
151  SCIP* scip /**< SCIP data structure */
152  );
153 
154 /** gets total memory usage of all concurrent solvers together */
155 extern
157  SCIP* scip /**< SCIP data structure */
158  );
159 
160 /** gets the dualbound in the last synchronization */
161 extern
163  SCIP* scip /**< SCIP data structure */
164  );
165 
166 /** gets the primalbound in the last synchronization */
167 extern
169  SCIP* scip /**< SCIP data structure */
170  );
171 
172 /** gets the gap in the last synchronization */
173 extern
175  SCIP* scip /**< SCIP data structure */
176  );
177 
178 /** gives the total number of tightened bounds received from other concurrent solvers */
179 extern
181  SCIP* scip /**< SCIP data structure */
182  );
183 
184 /** gives the total number of tightened bounds for integer variables received from
185  * other concurrent solvers */
186 extern
188  SCIP* scip /**< SCIP data structure */
189  );
190 
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 #endif
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
void SCIPenableConcurrentBoundStorage(SCIP *scip)
Definition: concurrent.c:266
SCIP_RETCODE SCIPfreeConcurrent(SCIP *scip)
Definition: concurrent.c:142
SCIP_Longint SCIPgetConcurrentNTightenedIntBnds(SCIP *scip)
Definition: concurrent.c:351
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPincrementConcurrentTime(SCIP *scip, SCIP_Real val)
Definition: concurrent.c:180
SCIP_Real SCIPgetConcurrentDualbound(SCIP *scip)
Definition: concurrent.c:296
SCIP_RETCODE SCIPaddConcurrentSol(SCIP *scip, SCIP_SOL *sol)
Definition: concurrent.c:362
int SCIPgetNConcurrentSolvers(SCIP *scip)
Definition: concurrent.c:107
SCIP_RETCODE SCIPaddConcurrentSolver(SCIP *scip, SCIP_CONCSOLVER *concsolver)
Definition: concurrent.c:129
SCIP_Real SCIPgetConcurrentPrimalbound(SCIP *scip)
Definition: concurrent.c:311
SCIP_RETCODE SCIPsynchronize(SCIP *scip)
Definition: concurrent.c:236
type definitions for SCIP&#39;s main datastructure
type definition of concurrent data
int SCIPgetConcurrentVaridx(SCIP *scip, SCIP_VAR *var)
Definition: concurrent.c:413
SCIP_Bool SCIPIsConcurrentSolNew(SCIP *scip, SCIP_SOL *sol)
Definition: concurrent.c:429
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:61
SCIP_RETCODE SCIPcopySolStats(SCIP_SOL *source, SCIP_SOL *target)
Definition: concurrent.c:395
type definitions for storing primal CIP solutions
SCIP_Longint SCIPgetConcurrentMemTotal(SCIP *scip)
Definition: concurrent.c:278
SCIP_Longint SCIPgetConcurrentNTightenedBnds(SCIP *scip)
Definition: concurrent.c:340
the type definitions for the synchronization store
SCIP_Real SCIPgetConcurrentGap(SCIP *scip)
Definition: concurrent.c:326
SCIP_RETCODE SCIPcopyConcurrentSolvingStats(SCIP *source, SCIP *target)
Definition: concurrent.c:526
SCIP_CONCSOLVER ** SCIPgetConcurrentSolvers(SCIP *scip)
Definition: concurrent.c:118
SCIP_BOUNDSTORE * SCIPgetConcurrentGlobalBoundChanges(SCIP *scip)
Definition: concurrent.c:442
#define SCIP_Real
Definition: def.h:149
SCIP_RETCODE SCIPconcurrentSolve(SCIP *scip)
Definition: concurrent.c:474
#define SCIP_Longint
Definition: def.h:134
SCIP_RETCODE SCIPaddConcurrentBndchg(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE bndtype)
Definition: concurrent.c:377
SCIP_RETCODE SCIPcreateConcurrent(SCIP *scip, SCIP_CONCSOLVER *concsolver, int *varperm)
Definition: concurrent.c:48
common defines and data types used in all packages of SCIP
void SCIPdisableConcurrentBoundStorage(SCIP *scip)
Definition: concurrent.c:254
type definitions for concurrent solvers