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-2024 Zuse Institute Berlin (ZIB) */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file concurrent.h
26  * @ingroup PARALLEL
27  * @brief helper functions for concurrent scip solvers
28  * @author Leona Gottwald
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #include "scip/type_concurrent.h"
34 #include "scip/type_scip.h"
35 #include "scip/type_concsolver.h"
36 #include "scip/type_sol.h"
37 #include "scip/type_var.h"
38 #include "scip/type_syncstore.h"
39 #include "scip/type_retcode.h"
40 #include "scip/def.h"
41 
42 #ifndef __SCIP_CONCURRENT_H__
43 #define __SCIP_CONCURRENT_H__
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /** create concurrent data */
51  SCIP* scip, /**< SCIP datastructure */
52  SCIP_CONCSOLVER* concsolver, /**< concurrent solver of given SCIP instance */
53  int* varperm /**< permutation of variables for communication */
54  );
55 
56 /** get number of initialized concurrent solvers */
58  SCIP* scip /**< SCIP datastructure */
59  );
60 
61 /** gets the concurrent solvers */
63  SCIP* scip /**< SCIP datastructure */
64  );
65 
66 /** adds a concurrent solver */
68  SCIP* scip, /**< SCIP datastructure */
69  SCIP_CONCSOLVER* concsolver /**< concurrent solver of given SCIP instance */
70  );
71 
72 /** frees concurrent data */
74  SCIP* scip /**< SCIP datastructure */
75  );
76 
77 /** increments the time counter for synchronization */
79  SCIP* scip, /**< SCIP datastructure */
80  SCIP_Real val /**< value by which the time counter for synchronization is incremented */
81  );
82 
83 /** synchronize with other concurrent solvers */
85  SCIP* scip /**< SCIP datastructure */
86  );
87 
88 /** pass a solution to the given SCIP instance using that was received via synchronization by using
89  * the sync heuristic */
91  SCIP* scip, /**< SCIP datastructure */
92  SCIP_SOL* sol /**< solution */
93  );
94 
95 /** adds a global boundchange to the given SCIP, by passing it to the sync propagator */
97  SCIP* scip, /**< SCIP data structure */
98  SCIP_VAR* var, /**< variable for bound */
99  SCIP_Real val, /**< value of bound */
100  SCIP_BOUNDTYPE bndtype /**< type of bound */
101  );
102 
103 /** copy the nodenumber, depth, time, and runnumber of one solution to another one */
105  SCIP_SOL* source, /**< source for solution statistics */
106  SCIP_SOL* target /**< target for solution statistics */
107  );
108 
109 /** copy solving statistics */
111  SCIP* source, /**< SCIP data structure */
112  SCIP* target /**< target SCIP data structure */
113  );
114 
115 /** get variable index of original variable that is the same between concurrent solvers */
117  SCIP* scip, /**< SCIP data structure */
118  SCIP_VAR* var /**< variable */
119  );
120 
121 /** has the solution been created after the last synchronization point */
123  SCIP* scip, /**< SCIP data structure */
124  SCIP_SOL* sol /**< the solution */
125  );
126 
127 /** gets the global bound changes since the last synchronization point */
129  SCIP* scip /**< SCIP data structure */
130  );
131 
132 /** start solving in parallel using the given set of concurrent solvers */
134  SCIP* scip /**< pointer to scip datastructure */
135  );
136 
137 /** disables storing global bound changes */
139  SCIP* scip /**< SCIP data structure */
140  );
141 
142 /** enables storing global bound changes */
144  SCIP* scip /**< SCIP data structure */
145  );
146 
147 /** gets total memory usage of all concurrent solvers together */
149  SCIP* scip /**< SCIP data structure */
150  );
151 
152 /** gets the dualbound in the last synchronization */
154  SCIP* scip /**< SCIP data structure */
155  );
156 
157 /** gets the primalbound in the last synchronization */
159  SCIP* scip /**< SCIP data structure */
160  );
161 
162 /** gets the gap in the last synchronization */
164  SCIP* scip /**< SCIP data structure */
165  );
166 
167 /** gives the total number of tightened bounds received from other concurrent solvers */
169  SCIP* scip /**< SCIP data structure */
170  );
171 
172 /** gives the total number of tightened bounds for integer variables received from
173  * other concurrent solvers */
175  SCIP* scip /**< SCIP data structure */
176  );
177 
178 #ifdef __cplusplus
179 }
180 #endif
181 
182 #endif
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:59
void SCIPenableConcurrentBoundStorage(SCIP *scip)
Definition: concurrent.c:276
SCIP_RETCODE SCIPfreeConcurrent(SCIP *scip)
Definition: concurrent.c:152
SCIP_Longint SCIPgetConcurrentNTightenedIntBnds(SCIP *scip)
Definition: concurrent.c:361
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
SCIP_RETCODE SCIPincrementConcurrentTime(SCIP *scip, SCIP_Real val)
Definition: concurrent.c:190
type definitions for return codes for SCIP methods
SCIP_Real SCIPgetConcurrentDualbound(SCIP *scip)
Definition: concurrent.c:306
SCIP_RETCODE SCIPaddConcurrentSol(SCIP *scip, SCIP_SOL *sol)
Definition: concurrent.c:372
int SCIPgetNConcurrentSolvers(SCIP *scip)
Definition: concurrent.c:117
SCIP_RETCODE SCIPaddConcurrentSolver(SCIP *scip, SCIP_CONCSOLVER *concsolver)
Definition: concurrent.c:139
SCIP_Real SCIPgetConcurrentPrimalbound(SCIP *scip)
Definition: concurrent.c:321
SCIP_RETCODE SCIPsynchronize(SCIP *scip)
Definition: concurrent.c:246
type definitions for SCIP&#39;s main datastructure
type definition of concurrent data
int SCIPgetConcurrentVaridx(SCIP *scip, SCIP_VAR *var)
Definition: concurrent.c:423
SCIP_Bool SCIPIsConcurrentSolNew(SCIP *scip, SCIP_SOL *sol)
Definition: concurrent.c:439
type definitions for problem variables
#define SCIP_Bool
Definition: def.h:91
SCIP_RETCODE SCIPcopySolStats(SCIP_SOL *source, SCIP_SOL *target)
Definition: concurrent.c:405
type definitions for storing primal CIP solutions
SCIP_Longint SCIPgetConcurrentMemTotal(SCIP *scip)
Definition: concurrent.c:288
SCIP_Longint SCIPgetConcurrentNTightenedBnds(SCIP *scip)
Definition: concurrent.c:350
the type definitions for the synchronization store
SCIP_Real SCIPgetConcurrentGap(SCIP *scip)
Definition: concurrent.c:336
SCIP_RETCODE SCIPcopyConcurrentSolvingStats(SCIP *source, SCIP *target)
Definition: concurrent.c:540
SCIP_CONCSOLVER ** SCIPgetConcurrentSolvers(SCIP *scip)
Definition: concurrent.c:128
SCIP_BOUNDSTORE * SCIPgetConcurrentGlobalBoundChanges(SCIP *scip)
Definition: concurrent.c:452
#define SCIP_Real
Definition: def.h:173
SCIP_RETCODE SCIPconcurrentSolve(SCIP *scip)
Definition: concurrent.c:484
#define SCIP_Longint
Definition: def.h:158
SCIP_RETCODE SCIPaddConcurrentBndchg(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE bndtype)
Definition: concurrent.c:387
SCIP_RETCODE SCIPcreateConcurrent(SCIP *scip, SCIP_CONCSOLVER *concsolver, int *varperm)
Definition: concurrent.c:58
common defines and data types used in all packages of SCIP
void SCIPdisableConcurrentBoundStorage(SCIP *scip)
Definition: concurrent.c:264
type definitions for concurrent solvers