Scippy

SCIP

Solving Constraint Integer Programs

concsolver.c
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 concsolver.c
17  * @brief methods for concurrent solvers
18  * @author Robert Lion Gottwald
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #include <assert.h>
24 #include <string.h>
25 
26 #include "scip/concsolver.h"
27 #include "scip/set.h"
28 #include "scip/scip.h"
29 #include "scip/concurrent.h"
30 
31 #include "scip/struct_concsolver.h"
32 #include "scip/struct_stat.h"
33 #include "scip/struct_scip.h"
34 #include "blockmemshell/memory.h"
35 #include "scip/syncstore.h"
36 #include "scip/boundstore.h"
37 #include "scip/clock.h"
38 
39 
40 /** creates a concurrent solver type */
42  SCIP_CONCSOLVERTYPE** concsolvertype, /**< pointer to concurrent solver data structure */
43  SCIP_SET* set, /**< global SCIP settings */
44  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
45  BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
46  const char* name, /**< name of concurrent solver */
47  SCIP_Real prefpriodefault, /**< the default preferred priority of this concurrent solver type */
48  SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)),/**< data copy method of concurrent solver */
49  SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)),/**< data copy method of concurrent solver */
50  SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)),/**< initialize random seeds of concurrent solver */
51  SCIP_DECL_CONCSOLVEREXEC ((*concsolverexec)),/**< execution method of concurrent solver */
52  SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata)),/**< method to copy solving data */
53  SCIP_DECL_CONCSOLVERSTOP ((*concsolverstop)),/**< terminate solving in concurrent solver */
54  SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)),/**< synchronization method of concurrent solver */
55  SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)),/**< synchronization method of concurrent solver */
56  SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata)),/**< method to free data of concurrent solver type */
57  SCIP_CONCSOLVERTYPEDATA* data /**< the concurent solver type's data */
58  )
59 {
60  char paramname[SCIP_MAXSTRLEN];
61  char paramdesc[SCIP_MAXSTRLEN];
62 
63  assert(concsolvertype != NULL);
64  assert(name != NULL);
65  assert(prefpriodefault >= 0.0 && prefpriodefault <= 1.0);
66 
67  assert(concsolvercreateinst != NULL);
68  assert(concsolverdestroyinst != NULL);
69  assert(concsolverexec != NULL);
70  assert(concsolvercopysolvdata != NULL);
71  assert(concsolverstop != NULL);
72  assert(concsolversyncwrite != NULL);
73  assert(concsolversyncread != NULL);
74 
75  SCIP_ALLOC( BMSallocMemory(concsolvertype) );
76  SCIP_ALLOC( BMSduplicateMemoryArray(&(*concsolvertype)->name, name, strlen(name) + 1) );
77 
78  (*concsolvertype)->data = data;
79  (*concsolvertype)->ninstances = 0;
80  (*concsolvertype)->concsolvercreateinst = concsolvercreateinst;
81  (*concsolvertype)->concsolverdestroyinst = concsolverdestroyinst;
82  (*concsolvertype)->concsolverinitseeds = concsolverinitseeds;
83  (*concsolvertype)->concsolverexec = concsolverexec;
84  (*concsolvertype)->concsolvercopysolvdata = concsolvercopysolvdata;
85  (*concsolvertype)->concsolverstop = concsolverstop;
86  (*concsolvertype)->concsolversyncwrite = concsolversyncwrite;
87  (*concsolvertype)->concsolversyncread = concsolversyncread;
88  (*concsolvertype)->concsolvertypefreedata = concsolvertypefreedata;
89 
90  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "concurrent/%s/prefprio", name);
91  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "the preferred number concurrent solvers of type <%s> with respect to the number of threads", name);
92  SCIP_CALL( SCIPsetAddRealParam(set, messagehdlr, blkmem, paramname, paramdesc,
93  &(*concsolvertype)->prefprio, FALSE, prefpriodefault, 0.0, 1.0,
94  NULL, NULL) ); /*lint !e740*/
95 
96  return SCIP_OKAY;
97 }
98 
99 /** frees all memory of a concurrent solver type */
101  SCIP_CONCSOLVERTYPE** concsolvertype /**< pointer to concurrent solver data structure */
102  )
103 {
104  assert(concsolvertype != NULL);
105  assert(*concsolvertype != NULL);
106 
107  if( (*concsolvertype)->concsolvertypefreedata != NULL )
108  (*concsolvertype)->concsolvertypefreedata(&(*concsolvertype)->data);
109 
110  BMSfreeMemoryArray(&(*concsolvertype)->name);
111  BMSfreeMemory(concsolvertype);
112 }
113 
114 /** gets the data of a concurrent solver type */
116  SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
117  )
118 {
119  assert(concsolvertype != NULL);
120 
121  return concsolvertype->data;
122 }
123 
124 /** sets the data of a concurrent solver type */
126  SCIP_CONCSOLVERTYPE* concsolvertype, /**< concurrent solver type */
127  SCIP_CONCSOLVERTYPEDATA* data /**< the concurrent solver's data */
128  )
129 {
130  assert(concsolvertype != NULL);
131 
132  concsolvertype->data = data;
133 }
134 
135 /** gets the name of a concurrent solver type */
137  SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
138  )
139 {
140  assert(concsolvertype != NULL);
141 
142  return concsolvertype->name;
143 }
144 
145 /** gets the preferred priority from a concurrent solver type */
147  SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
148  )
149 {
150  assert(concsolvertype != NULL);
151 
152  return concsolvertype->prefprio;
153 }
154 
155 /** creates an instance of the given concurrent solver type */
157  SCIP_SET* set, /**< global SCIP settings */
158  SCIP_CONCSOLVERTYPE* concsolvertype, /**< concurrent solver type to create */
159  SCIP_CONCSOLVER** concsolver /**< pointer to return concurrent solver instance */
160  )
161 {
162  char instancename[SCIP_MAXSTRLEN];
163 
164  ++concsolvertype->ninstances;
165  (void) SCIPsnprintf(instancename, SCIP_MAXSTRLEN, "%s-%i", concsolvertype->name, concsolvertype->ninstances);
166 
167  SCIP_ALLOC( BMSallocMemory(concsolver) );
168  SCIP_ALLOC( BMSduplicateMemoryArray(&(*concsolver)->name, instancename, strlen(instancename) + 1) );
169 
170  (*concsolver)->type = concsolvertype;
171 
172  /* initialize counters for statistics */
173  (*concsolver)->nsolsrecvd = 0;
174  (*concsolver)->nsolsshared = 0;
175  (*concsolver)->ntighterbnds = 0;
176  (*concsolver)->ntighterintbnds = 0;
177  SCIP_CALL( SCIPcreateWallClock(set->scip, &(*concsolver)->totalsynctime) );
178 
179  /* initialize synchronization fields */
180  (*concsolver)->nsyncs = 0;
181  (*concsolver)->syncdelay = 0.0;
182 
183  /* in deterministic mode use number of nonzeros and variables to get a good initial synchronization frequency
184  * in opportunistic mode use the frequency as set by the user
185  */
186  if( set->parallel_mode == (int) SCIP_PARA_DETERMINISTIC )
187  (*concsolver)->syncfreq = 0.01 * set->scip->stat->nnz * SCIPgetNVars(set->scip) * set->concurrent_freqinit;
188  else
189  (*concsolver)->syncfreq = set->concurrent_freqinit;
190 
191  (*concsolver)->syncdata = NULL;
192 
193  SCIPdebugMessage("concsolver %s initialized sync freq to %f\n", (*concsolver)->name, (*concsolver)->syncfreq);
194  /* register concurrent solver */
195  (*concsolver)->idx = SCIPgetNConcurrentSolvers(set->scip);
196  SCIP_CALL( concsolvertype->concsolvercreateinst(set->scip, concsolvertype, *concsolver) );
197  SCIP_CALL( SCIPaddConcurrentSolver(set->scip, *concsolver) );
198 
199  return SCIP_OKAY;
200 }
201 
202 /** destroys an instance of the given concurrent solver */
204  SCIP_SET* set, /**< global SCIP settings */
205  SCIP_CONCSOLVER** concsolver /**< concurrent solver */
206  )
207 {
208  assert(concsolver != NULL);
209  assert((*concsolver)->type != NULL);
210  assert(set != NULL);
211  assert((*concsolver)->type->concsolverdestroyinst != NULL);
212 
213  SCIP_CALL( (*concsolver)->type->concsolverdestroyinst(set->scip, *concsolver) );
214  --(*concsolver)->type->ninstances;
215 
216  SCIP_CALL( SCIPfreeClock(set->scip, &(*concsolver)->totalsynctime) );
217  BMSfreeMemoryArray(&(*concsolver)->name);
218 
219  BMSfreeMemory(concsolver);
220 
221  return SCIP_OKAY;
222 }
223 
224 /** gets the data of a concurrent solver */
226  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
227  )
228 {
229  assert(concsolver != NULL);
230 
231  return concsolver->data;
232 }
233 
234 /** sets the data of a concurrent solver */
236  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
237  SCIP_CONCSOLVERDATA* data /**< the concurrent solver's data */
238  )
239 {
240  assert(concsolver != NULL);
241 
242  concsolver->data = data;
243 }
244 
245 /** gets the name of a concurrent solver */
247  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
248  )
249 {
250  assert(concsolver != NULL);
251 
252  return concsolver->name;
253 }
254 
255 /** initializes the random seeds of a concurrent solver */
257  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
258  unsigned int seed /**< seed for initializing the solver's internal random seeds */
259  )
260 {
261  assert(concsolver != NULL);
262  assert(concsolver->type != NULL);
263 
264  if( concsolver->type->concsolverinitseeds != NULL )
265  SCIP_CALL( concsolver->type->concsolverinitseeds(concsolver, seed) );
266 
267  return SCIP_OKAY;
268 }
269 
270 /** start the solving process of a concurrent solver */
272  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
273  )
274 {
275  assert(concsolver != NULL);
276  assert(concsolver->type != NULL);
277  assert(concsolver->type->concsolverexec != NULL);
278 
279  /* set the stopped flag to false */
280  concsolver->stopped = FALSE;
281 
282  /* then call the execute callback */
283  SCIP_CALL( concsolver->type->concsolverexec(concsolver, &concsolver->solvingtime, &concsolver->nlpiterations, &concsolver->nnodes) );
284 
285  return SCIP_OKAY;
286 }
287 
288 /** gets solving data of concurrent solver and stores it in the given SCIP instance */
290  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
291  SCIP* scip /**< SCIP datastructure */
292  )
293 {
294  assert(concsolver != NULL);
295  assert(concsolver->type != NULL);
296  assert(concsolver->type->concsolvercopysolvdata != NULL);
297 
298  return concsolver->type->concsolvercopysolvdata(concsolver, scip);
299 }
300 
301 /** interrupt solving in a concurrent solver */
303  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
304  )
305 {
306  assert(concsolver != NULL);
307  assert(concsolver->type != NULL);
308  assert(concsolver->type->concsolverstop != NULL);
309 
310  SCIP_CALL( concsolver->type->concsolverstop(concsolver) );
311 
312  /* set the stopped flag to true */
313  concsolver->stopped = TRUE;
314 
315  return SCIP_OKAY;
316 }
317 
318 /** let the given concurrent solver synchronize, i.e. pass its own solutions and bounds to
319  * the SPI.
320  */
322  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
323  SCIP_SET* set /**< global SCIP settings */
324  )
325 {
326  SCIP_SYNCDATA* syncdata;
327  SCIP_SYNCSTORE* syncstore;
328  int nsols;
329  int ntighterintbnds;
330  int ntighterbnds;
331  SCIP_CONCSOLVERTYPE* concsolvertype;
332 
333  assert(concsolver != NULL);
334  assert(concsolver->type != NULL);
335  assert(concsolver->type->concsolversyncwrite != NULL);
336  assert(concsolver->type->concsolversyncread != NULL);
337 
338  if( concsolver->stopped )
339  return SCIP_OKAY;
340 
341  SCIP_CALL( SCIPstartClock(set->scip, concsolver->totalsynctime) );
342 
343  concsolvertype = concsolver->type;
344 
345  syncstore = SCIPgetSyncstore(set->scip);
346  assert(syncstore != NULL);
347 
348  SCIP_CALL( SCIPsyncstoreStartSync(syncstore, concsolver->nsyncs, &syncdata) );
349 
350  if( syncdata == NULL )
351  {
352  SCIP_CALL( SCIPstopClock(set->scip, concsolver->totalsynctime) );
353  return SCIP_OKAY;
354  }
355 
356  SCIPdebugMessage("concsolver %s starts sync %lli\n", concsolver->name, concsolver->nsyncs);
357 
358  SCIP_CALL( concsolvertype->concsolversyncwrite(concsolver, syncstore, syncdata, set->concurrent_nbestsols, set->concurrent_maxnsols, &nsols) );
359  concsolver->nsolsshared += nsols;
360 
361  if( SCIPsyncdataGetStatus(syncdata) != SCIP_STATUS_UNKNOWN )
362  {
363  SCIP_CALL( SCIPconcsolverStop(concsolver) );
364  }
365  else if( SCIPsyncdataGetNSynced(syncdata) == SCIPsyncstoreGetNSolvers(syncstore) - 1 )
366  {
367  /* if this is the last concurrent solver that is synchronizing for this synchronization data
368  * it will adjust the synchronization frequency using the progress on the gap
369  */
370  SCIP_Bool lbok;
371  SCIP_Bool ubok;
372  SCIP_Real progress;
373  SCIP_Real prevub;
374  SCIP_Real prevlb;
375  SCIP_Real newub;
376  SCIP_Real newlb;
377  SCIP_Real freqfactor;
378  SCIP_Real newsyncfreq;
379  SCIP_SYNCDATA* prevsync;
380 
381  if( concsolver->nsyncs == 0 )
382  {
383  SCIPsyncdataSetSyncFreq(syncstore, syncdata, concsolver->syncfreq);
384  }
385  else
386  {
387  prevsync = SCIPsyncstoreGetSyncdata(syncstore, concsolver->nsyncs - 1);
388  assert(SCIPsyncdataGetNSynced(prevsync) == SCIPsyncstoreGetNSolvers(syncstore));
389 
390  prevub = SCIPsyncdataGetUpperbound(prevsync);
391  prevlb = SCIPsyncdataGetLowerbound(prevsync);
392  newub = SCIPsyncdataGetUpperbound(syncdata);
393  newlb = SCIPsyncdataGetLowerbound(syncdata);
394  lbok = prevlb > -SCIPsetInfinity(set);
395  ubok = prevub < SCIPsetInfinity(set);
396 
397  if( lbok && ubok )
398  progress = SCIPrelDiff(prevub - prevlb, newub - newlb);
399  else if( lbok )
400  progress = SCIPrelDiff(newlb, prevlb);
401  else if( ubok )
402  progress = SCIPrelDiff(prevub, newub);
403  else if( !SCIPsetIsInfinity(set, -newlb) || !SCIPsetIsInfinity(set, newub) ||
405  progress = set->concurrent_targetprogress;
406  else
407  progress = 0.0;
408 
409  /* should not be negative */
410  assert(SCIPsetIsGE(set, progress, 0.0));
411 
412  if( progress < 0.5 * set->concurrent_targetprogress )
413  freqfactor = set->concurrent_freqfactor;
414  else if( progress > 2 * set->concurrent_targetprogress )
415  freqfactor = 0.5 + 0.5 / set->concurrent_freqfactor;
416  else
417  freqfactor = 1.0;
418 
419  SCIPdebugMessage("syncfreq is %g and freqfactor is %f due to progress %f\n", concsolver->syncfreq, freqfactor, progress);
420  newsyncfreq = concsolver->syncfreq * freqfactor;
421  SCIPsyncdataSetSyncFreq(syncstore, syncdata, newsyncfreq);
422  SCIPdebugMessage("new syncfreq is %g\n", SCIPsyncdataGetSyncFreq(syncdata));
423  }
424  }
425 
426  SCIPdebugMessage("concsolver %s finishing sync %lli\n", concsolver->name, concsolver->nsyncs);
427 
428  SCIP_CALL( SCIPsyncstoreFinishSync(syncstore, &syncdata) );
429  ++concsolver->nsyncs;
430 
431  concsolver->syncdelay += concsolver->timesincelastsync;
432 
433  syncdata = SCIPsyncstoreGetNextSyncdata(syncstore, concsolver->syncdata, concsolver->syncfreq, concsolver->nsyncs, &concsolver->syncdelay);
434 
435  while( syncdata != NULL )
436  {
437  SCIP_CALL( SCIPsyncstoreEnsureAllSynced(syncstore, syncdata) );
438  concsolver->syncdata = syncdata;
439  SCIP_CALL( concsolvertype->concsolversyncread(concsolver, syncstore, syncdata, &nsols, &ntighterbnds, &ntighterintbnds) );
440  concsolver->ntighterbnds += ntighterbnds;
441  concsolver->ntighterintbnds += ntighterintbnds;
442  concsolver->nsolsrecvd += nsols;
443  SCIPdebugMessage("syncfreq before reading the next syncdata is %g\n", concsolver->syncfreq);
444  concsolver->syncfreq = SCIPsyncdataGetSyncFreq(concsolver->syncdata);
445  SCIPdebugMessage("syncfreq after reading the next syncdata is %g\n", concsolver->syncfreq);
446  syncdata = SCIPsyncstoreGetNextSyncdata(syncstore, concsolver->syncdata, concsolver->syncfreq, concsolver->nsyncs, &concsolver->syncdelay);
447  }
448 
449  SCIP_CALL( SCIPstopClock(set->scip, concsolver->totalsynctime) );
450 
451  return SCIP_OKAY;
452 }
453 
454 /** gets the current synchronization frequency of the concurent solver */
456  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
457  )
458 {
459  assert(concsolver != NULL);
460 
461  return concsolver->syncfreq;
462 }
463 
464 /** gets the total memory used by the concurent solver */
466  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
467  )
468 {
469  assert(concsolver != NULL);
470 
471  return concsolver->syncdata != NULL ? SCIPsyncdataGetMemTotal(concsolver->syncdata) : 0;
472 }
473 
474 /** sets the time elapsed since the last synchronization. Must be set before the synchronization is
475  * started.
476  */
478  SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
479  SCIP_Real time /**< the time passed since the last synchronization */
480  )
481 {
482  assert(concsolver != NULL);
483 
484  concsolver->timesincelastsync = time;
485 }
486 
487 /** gets the solving time of the concurrent solver */
489  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
490  )
491 {
492  assert(concsolver != NULL);
493 
494  return concsolver->solvingtime;
495 }
496 
497 /** gets the time spent for synchronization for the concurrent solver */
499  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
500  )
501 {
502  assert(concsolver != NULL);
503 
504  return SCIPclockGetTime(concsolver->totalsynctime);
505 }
506 
507 /** gets the number of lp iterations the concurrent solver used */
509  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
510  )
511 {
512  assert(concsolver != NULL);
513 
514  return concsolver->nlpiterations;
515 }
516 
517 /** gets the number of branch and bound nodes the concurrent solver used */
519  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
520  )
521 {
522  assert(concsolver != NULL);
523 
524  return concsolver->nnodes;
525 }
526 
527 /** gets the number of solutions the concurrent solver received during synchronization */
529  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
530  )
531 {
532  assert(concsolver != NULL);
533 
534  return concsolver->nsolsrecvd;
535 }
536 
537 /** gets the number of solutions the concurrent solver shared during synchronization */
539  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
540  )
541 {
542  assert(concsolver != NULL);
543 
544  return concsolver->nsolsshared;
545 }
546 
547 /** gets the number of tighter global variable bounds the solver received */
549  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
550  )
551 {
552  assert(concsolver != NULL);
553 
554  return concsolver->ntighterbnds;
555 }
556 
557 /** gets the number of tighter global variable bounds of integer variables the solver received */
559  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
560  )
561 {
562  assert(concsolver != NULL);
563 
564  return concsolver->ntighterintbnds;
565 }
566 
567 /** gets index of concurrent solver */
569  SCIP_CONCSOLVER* concsolver /**< concurrent solver */
570  )
571 {
572  assert(concsolver != NULL);
573 
574  return concsolver->idx;
575 }
SCIP_Longint nsyncs
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5776
struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA
#define SCIP_DECL_CONCSOLVERSYNCREAD(x)
int SCIPboundstoreGetNChgs(SCIP_BOUNDSTORE *boundstore)
Definition: boundstore.c:188
int SCIPgetNConcurrentSolvers(SCIP *scip)
Definition: concurrent.c:107
SCIP_RETCODE SCIPsyncstoreEnsureAllSynced(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:395
#define SCIP_MAXSTRLEN
Definition: def.h:259
SCIP_Real SCIPconcsolverTypeGetPrefPrio(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:146
SCIP_STATUS SCIPsyncdataGetStatus(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:505
internal methods for clocks and timing issues
SCIP_SYNCDATA * SCIPsyncstoreGetSyncdata(SCIP_SYNCSTORE *syncstore, SCIP_Longint syncnum)
Definition: syncstore.c:326
void SCIPconcsolverTypeFree(SCIP_CONCSOLVERTYPE **concsolvertype)
Definition: concsolver.c:100
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:5636
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:46109
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:41
#define SCIP_DECL_CONCSOLVEREXEC(x)
#define FALSE
Definition: def.h:64
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
Definition: misc.c:10289
char * SCIPconcsolverGetName(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:246
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10011
#define TRUE
Definition: def.h:63
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_Longint SCIPconcsolverGetNSolsShared(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:538
datastructures for concurrent solvers
SCIP_RETCODE SCIPconcsolverSync(SCIP_CONCSOLVER *concsolver, SCIP_SET *set)
Definition: concsolver.c:321
SCIP_Longint ntighterbnds
datastructures for concurrent solvers
#define SCIPdebugMessage
Definition: pub_message.h:77
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:46058
#define BMSfreeMemory(ptr)
Definition: memory.h:127
SCIP_RETCODE SCIPconcsolverCreateInstance(SCIP_SET *set, SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVER **concsolver)
Definition: concsolver.c:156
#define SCIP_DECL_CONCSOLVERDESTROYINST(x)
void SCIPconcsolverSetData(SCIP_CONCSOLVER *concsolver, SCIP_CONCSOLVERDATA *data)
Definition: concsolver.c:235
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5870
SCIP_RETCODE SCIPcreateWallClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:46041
SCIP_SYNCDATA * SCIPsyncstoreGetNextSyncdata(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_Real syncfreq, SCIP_Longint writenum, SCIP_Real *delay)
Definition: syncstore.c:347
#define SCIP_DECL_CONCSOLVERSTOP(x)
SCIP_Longint SCIPconcsolverGetMemTotal(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:465
SCIP_Longint nsolsshared
SCIP_RETCODE SCIPconcsolverGetSolvingData(SCIP_CONCSOLVER *concsolver, SCIP *scip)
Definition: concsolver.c:289
SCIP_Longint SCIPconcsolverGetNSolsRecvd(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:528
SCIP_Real SCIPconcsolverGetSolvingTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:488
void SCIPsyncdataSetSyncFreq(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_Real syncfreq)
Definition: syncstore.c:619
void SCIPconcsolverSetTimeSinceLastSync(SCIP_CONCSOLVER *concsolver, SCIP_Real time)
Definition: concsolver.c:477
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:129
SCIP_Real SCIPconcsolverGetSyncFreq(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:455
SCIP_Longint nsolsrecvd
SCIP_CLOCK * totalsynctime
struct SCIP_SyncData SCIP_SYNCDATA
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:428
the interface of the boundstore structure
SCIP_RETCODE SCIPconcsolverInitSeeds(SCIP_CONCSOLVER *concsolver, unsigned int seed)
Definition: concsolver.c:256
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:350
SCIP main data structure.
#define SCIP_DECL_CONCSOLVERINITSEEDS(x)
SCIP_RETCODE SCIPconcsolverDestroyInstance(SCIP_SET *set, SCIP_CONCSOLVER **concsolver)
Definition: concsolver.c:203
SCIP_RETCODE SCIPconcsolverStop(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:302
SCIP_Longint SCIPconcsolverGetNNodes(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:518
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:125
SCIP_Longint SCIPconcsolverGetNTighterIntBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:558
the function declarations for the synchronization store
SCIP_CONCSOLVERTYPE * type
#define SCIP_Bool
Definition: def.h:61
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
Definition: scip.c:42011
SCIP_Real SCIPsyncdataGetLowerbound(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:581
SCIP_RETCODE SCIPsyncstoreStartSync(SCIP_SYNCSTORE *syncstore, SCIP_Longint syncnum, SCIP_SYNCDATA **syncdata)
Definition: syncstore.c:424
SCIP_CONCSOLVERTYPEDATA * data
SCIP_Longint SCIPsyncdataGetMemTotal(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:551
#define SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(x)
SCIP_CONCSOLVERDATA * SCIPconcsolverGetData(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:225
datastructures for problem statistics
#define SCIP_DECL_CONCSOLVERTYPEFREEDATA(x)
helper functions for concurrent scip solvers
int SCIPgetNVars(SCIP *scip)
Definition: scip.c:11806
int SCIPsyncdataGetNSynced(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:529
int SCIPconcsolverGetIdx(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:568
SCIP_Longint ntighterintbnds
SCIP_SYNCDATA * syncdata
SCIP_Real SCIPconcsolverGetSyncTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:498
SCIP_CONCSOLVERDATA * data
SCIP_RETCODE SCIPconcsolverExec(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:271
SCIP_BOUNDSTORE * SCIPsyncdataGetBoundChgs(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:609
SCIP_RETCODE SCIPaddConcurrentSolver(SCIP *scip, SCIP_CONCSOLVER *concsolver)
Definition: concurrent.c:129
SCIP_Real SCIPsyncdataGetSyncFreq(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:561
#define SCIP_Real
Definition: def.h:149
SCIP_Longint SCIPconcsolverGetNTighterBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:548
void SCIPconcsolverTypeSetData(SCIP_CONCSOLVERTYPE *concsolvertype, SCIP_CONCSOLVERTYPEDATA *data)
Definition: concsolver.c:125
#define BMSallocMemory(ptr)
Definition: memory.h:101
#define SCIP_Longint
Definition: def.h:134
SCIP_Longint SCIPconcsolverGetNLPIterations(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:508
SCIP_RETCODE SCIPsyncstoreFinishSync(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA **syncdata)
Definition: syncstore.c:467
SCIP_CONCSOLVERTYPEDATA * SCIPconcsolverTypeGetData(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:115
SCIP_Longint nlpiterations
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:419
SCIP_RETCODE SCIPsetAddRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: set.c:2861
SCIP_Real SCIPsyncdataGetUpperbound(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:571
#define SCIP_DECL_CONCSOLVERSYNCWRITE(x)
#define SCIP_ALLOC(x)
Definition: def.h:361
int SCIPsyncstoreGetNSolvers(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:539
#define SCIP_DECL_CONCSOLVERCREATEINST(x)
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:46092
SCIP_Longint nnodes
SCIP callable library.
struct SCIP_ConcSolverData SCIP_CONCSOLVERDATA
SCIP_Real timesincelastsync
char * SCIPconcsolverTypeGetName(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:136
memory allocation routines