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-2021 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 concurrent.h
17  * @ingroup PARALLEL
18  * @brief helper functions for concurrent scip solvers
19  * @author Leona 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 */
41  SCIP* scip, /**< SCIP datastructure */
42  SCIP_CONCSOLVER* concsolver, /**< concurrent solver of given SCIP instance */
43  int* varperm /**< permutation of variables for communication */
44  );
45 
46 /** get number of initialized concurrent solvers */
48  SCIP* scip /**< SCIP datastructure */
49  );
50 
51 /** gets the concurrent solvers */
53  SCIP* scip /**< SCIP datastructure */
54  );
55 
56 /** adds a concurrent solver */
58  SCIP* scip, /**< SCIP datastructure */
59  SCIP_CONCSOLVER* concsolver /**< concurrent solver of given SCIP instance */
60  );
61 
62 /** frees concurrent data */
64  SCIP* scip /**< SCIP datastructure */
65  );
66 
67 /** increments the time counter for synchronization */
69  SCIP* scip, /**< SCIP datastructure */
70  SCIP_Real val /**< value by which the time counter for synchronization is incremented */
71  );
72 
73 /** synchronize with other concurrent solvers */
75  SCIP* scip /**< SCIP datastructure */
76  );
77 
78 /** pass a solution to the given SCIP instance using that was received via synchronization by using
79  * the sync heuristic */
81  SCIP* scip, /**< SCIP datastructure */
82  SCIP_SOL* sol /**< solution */
83  );
84 
85 /** adds a global boundchange to the given SCIP, by passing it to the sync propagator */
87  SCIP* scip, /**< SCIP data structure */
88  SCIP_VAR* var, /**< variable for bound */
89  SCIP_Real val, /**< value of bound */
90  SCIP_BOUNDTYPE bndtype /**< type of bound */
91  );
92 
93 /** copy the nodenumber, depth, time, and runnumber of one solution to another one */
95  SCIP_SOL* source, /**< source for solution statistics */
96  SCIP_SOL* target /**< target for solution statistics */
97  );
98 
99 /** copy solving statistics */
101  SCIP* source, /**< SCIP data structure */
102  SCIP* target /**< target SCIP data structure */
103  );
104 
105 /** get variable index of original variable that is the same between concurrent solvers */
107  SCIP* scip, /**< SCIP data structure */
108  SCIP_VAR* var /**< variable */
109  );
110 
111 /** has the solution been created after the last synchronization point */
113  SCIP* scip, /**< SCIP data structure */
114  SCIP_SOL* sol /**< the solution */
115  );
116 
117 /** gets the global bound changes since the last synchronization point */
119  SCIP* scip /**< SCIP data structure */
120  );
121 
122 /** start solving in parallel using the given set of concurrent solvers */
124  SCIP* scip /**< pointer to scip datastructure */
125  );
126 
127 /** disables storing global bound changes */
129  SCIP* scip /**< SCIP data structure */
130  );
131 
132 /** enables storing global bound changes */
134  SCIP* scip /**< SCIP data structure */
135  );
136 
137 /** gets total memory usage of all concurrent solvers together */
139  SCIP* scip /**< SCIP data structure */
140  );
141 
142 /** gets the dualbound in the last synchronization */
144  SCIP* scip /**< SCIP data structure */
145  );
146 
147 /** gets the primalbound in the last synchronization */
149  SCIP* scip /**< SCIP data structure */
150  );
151 
152 /** gets the gap in the last synchronization */
154  SCIP* scip /**< SCIP data structure */
155  );
156 
157 /** gives the total number of tightened bounds received from other concurrent solvers */
159  SCIP* scip /**< SCIP data structure */
160  );
161 
162 /** gives the total number of tightened bounds for integer variables received from
163  * other concurrent solvers */
165  SCIP* scip /**< SCIP data structure */
166  );
167 
168 #ifdef __cplusplus
169 }
170 #endif
171 
172 #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:54
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:70
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:163
SCIP_RETCODE SCIPconcurrentSolve(SCIP *scip)
Definition: concurrent.c:474
#define SCIP_Longint
Definition: def.h:148
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