Scippy

SCIP

Solving Constraint Integer Programs

concsolver_scip.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-2020 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 concsolver_scip.c
17  * @ingroup PARALLEL
18  * @brief implementation of concurrent solver interface for SCIP
19  * @author Leona Gottwald
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include "blockmemshell/memory.h"
25 #include "scip/boundstore.h"
26 #include "scip/concsolver.h"
27 #include "scip/concsolver_scip.h"
28 #include "scip/concurrent.h"
29 #include "scip/pub_event.h"
30 #include "scip/pub_heur.h"
31 #include "scip/pub_message.h"
32 #include "scip/pub_misc.h"
33 #include "scip/pub_paramset.h"
34 #include "scip/pub_sol.h"
35 #include "scip/pub_var.h"
36 #include "scip/scip_concurrent.h"
37 #include "scip/scip_copy.h"
38 #include "scip/scip_event.h"
39 #include "scip/scip_general.h"
40 #include "scip/scip_heur.h"
41 #include "scip/scip_mem.h"
42 #include "scip/scip_message.h"
43 #include "scip/scip_numerics.h"
44 #include "scip/scip_param.h"
45 #include "scip/scip_prob.h"
46 #include "scip/scip_sol.h"
47 #include "scip/scip_solve.h"
48 #include "scip/scip_solvingstats.h"
49 #include "scip/scip_timing.h"
50 #include "scip/syncstore.h"
51 #include <string.h>
52 
53 /* event handler for synchronization */
54 #define EVENTHDLR_NAME "sync"
55 #define EVENTHDLR_DESC "event handler for synchronization of concurrent scip sovlers"
56 
57 /*
58  * Data structures
59  */
60 
61 /** event handler data */
62 struct SCIP_EventhdlrData
63 {
64  int filterpos;
65 };
66 
67 /*
68  * Callback methods of event handler
69  */
70 
71 /** destructor of event handler to free user data (called when SCIP is exiting) */
72 static
73 SCIP_DECL_EVENTFREE(eventFreeSync)
74 { /*lint --e{715}*/
75  SCIP_EVENTHDLRDATA* eventhdlrdata;
76 
77  assert(scip != NULL);
78  assert(eventhdlr != NULL);
79  assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);
80 
81  eventhdlrdata = SCIPeventhdlrGetData(eventhdlr);
82  assert(eventhdlrdata != NULL);
83 
84  SCIPfreeBlockMemory(scip, &eventhdlrdata);
85 
86  SCIPeventhdlrSetData(eventhdlr, NULL);
87 
88  return SCIP_OKAY;
89 }
90 
91 /** initialization method of event handler (called after problem was transformed) */
92 static
93 SCIP_DECL_EVENTINIT(eventInitSync)
94 { /*lint --e{715}*/
95  SCIP_EVENTHDLRDATA* eventhdlrdata;
96  SCIP_SYNCSTORE* syncstore;
97 
98  assert(scip != NULL);
99  assert(eventhdlr != NULL);
100  assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);
101 
102  eventhdlrdata = SCIPeventhdlrGetData(eventhdlr);
103  assert(eventhdlrdata != NULL);
104 
105  syncstore = SCIPgetSyncstore(scip);
106  assert(syncstore != NULL);
107 
108  if( eventhdlrdata->filterpos < 0 && SCIPsyncstoreIsInitialized(syncstore) )
109  {
110  /* notify SCIP that your event handler wants to react on synchronization events */
111  SCIP_CALL( SCIPcatchEvent(scip, SCIP_EVENTTYPE_SYNC, eventhdlr, NULL, &eventhdlrdata->filterpos) );
112  }
113 
114  return SCIP_OKAY;
115 }
116 
117 /** deinitialization method of event handler (called before transformed problem is freed) */
118 static
119 SCIP_DECL_EVENTEXIT(eventExitSync)
120 { /*lint --e{715}*/
121  SCIP_EVENTHDLRDATA* eventhdlrdata;
122 
123  assert(scip != NULL);
124  assert(eventhdlr != NULL);
125  assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);
126 
127  eventhdlrdata = SCIPeventhdlrGetData(eventhdlr);
128  assert(eventhdlrdata != NULL);
129 
130  /* notify SCIP that your event handler wants to drop the event type synchronization found */
131  if( eventhdlrdata->filterpos >= 0 )
132  {
133  SCIP_CALL( SCIPdropEvent(scip, SCIP_EVENTTYPE_SYNC, eventhdlr, NULL, eventhdlrdata->filterpos) );
134  eventhdlrdata->filterpos = -1;
135  }
136 
137  return SCIP_OKAY;
138 }
139 
140 /** execution method of event handler */
141 static
142 SCIP_DECL_EVENTEXEC(eventExecSync)
143 { /*lint --e{715}*/
144  assert(eventhdlr != NULL);
145  assert(strcmp(SCIPeventhdlrGetName(eventhdlr), EVENTHDLR_NAME) == 0);
146  assert(event != NULL);
147  assert(scip != NULL);
148 
150 
151  return SCIP_OKAY;
152 }
153 
154 
155 /** includes event handler for synchronization found */
156 static
158  SCIP* scip /**< SCIP data structure */
159  )
160 {
161  SCIP_EVENTHDLR* eventhdlr;
162  SCIP_EVENTHDLRDATA* eventhdlrdata;
163 
164  SCIP_CALL( SCIPallocBlockMemory(scip, &eventhdlrdata) );
165  eventhdlrdata->filterpos = -1;
166 
167  /* create event handler for events on watched variables */
168  SCIP_CALL( SCIPincludeEventhdlrBasic(scip, &eventhdlr, EVENTHDLR_NAME, EVENTHDLR_DESC, eventExecSync, eventhdlrdata) );
169  assert(eventhdlr != NULL);
170 
171  SCIP_CALL( SCIPsetEventhdlrFree(scip, eventhdlr, eventFreeSync) );
172  SCIP_CALL( SCIPsetEventhdlrInit(scip, eventhdlr, eventInitSync) );
173  SCIP_CALL( SCIPsetEventhdlrExit(scip, eventhdlr, eventExitSync) );
174 
175  return SCIP_OKAY;
176 }
177 
178 /** data for a concurrent solver type */
179 struct SCIP_ConcSolverTypeData
180 {
181  SCIP_Bool loademphasis; /**< should emphasis settings be loaded whe ncreatig an instance of this concurrent solver */
182  SCIP_PARAMEMPHASIS emphasis; /**< parameter emphasis that will be loaded if loademphasis is true */
183 };
184 
185 /** data for a concurrent solver */
186 struct SCIP_ConcSolverData
187 {
188  SCIP* solverscip; /**< the concurrent solvers private scip datastructure */
189  SCIP_VAR** vars; /**< array of variables in the order of the main SCIP's variable array */
190  int nvars; /**< number of variables in the above arrays */
191 };
192 
193 /** Disable dual reductions that might cut off optimal solutions. Although they keep at least
194  * one optimal solution intact, communicating these bounds may cut off all optimal solutions,
195  * if different optimal solutions were kept in different concurrent solvers. */
196 static
198  SCIP* scip /**< SCIP datastructure */
199  )
200 {
201  SCIP_Bool commvarbnds;
202 
203  SCIP_CALL( SCIPgetBoolParam(scip, "concurrent/commvarbnds", &commvarbnds) );
204 
205  if( !commvarbnds )
206  return SCIP_OKAY;
207 
208  SCIP_CALL( SCIPsetBoolParam(scip, "misc/allowstrongdualreds", FALSE) );
209  return SCIP_OKAY;
210 }
211 
212 /** sets the child selection rule based on the index of the concurrent solver */
213 static
215  SCIP_CONCSOLVER* concsolver /**< the concurrent solver */
216  )
217 {
218  SCIP_CONCSOLVERDATA* data;
219  static char childsel[] = { 'h', 'i', 'p', 'r', 'l', 'd', 'u' };
220 
221  assert(concsolver != NULL);
222 
223  data = SCIPconcsolverGetData(concsolver);
224  assert(data != NULL);
225 
226  SCIP_CALL( SCIPsetCharParam(data->solverscip, "nodeselection/childsel", childsel[SCIPconcsolverGetIdx(concsolver) % 7]) );
227 
228  return SCIP_OKAY;
229 }
230 
231 /** initialize the concurrent SCIP solver, i.e. setup the copy of the problem and the
232  * mapping of the variables */
233 static
235  SCIP* scip, /**< the main SCIP instance */
236  SCIP_CONCSOLVER* concsolver /**< the concurrent solver to set up */
237  )
238 {
239  int i;
240  SCIP_VAR** vars;
241  SCIP_Bool valid;
242  SCIP_HASHMAP* varmapfw;
243  SCIP_CONCSOLVERDATA* data;
244  int* varperm;
245 
246  assert(scip != NULL);
247  assert(concsolver != NULL);
248 
249  data = SCIPconcsolverGetData(concsolver);
250  assert(data != NULL);
251 
252  data->nvars = SCIPgetNVars(scip);
253  vars = SCIPgetVars(scip);
254 
255  /* create the concurrent solver's SCIP instance and set up the problem */
256  SCIP_CALL( SCIPcreate(&data->solverscip) );
257  SCIP_CALL( SCIPhashmapCreate(&varmapfw, SCIPblkmem(data->solverscip), data->nvars) );
258  SCIP_CALL( SCIPcopy(scip, data->solverscip, varmapfw, NULL, SCIPconcsolverGetName(concsolver), TRUE, FALSE, FALSE,
259  FALSE, &valid) );
260  assert(valid);
261 
262  /* allocate memory for the arrays to store the variable mapping */
263  SCIP_CALL( SCIPallocBlockMemoryArray(data->solverscip, &data->vars, data->nvars) );
264  SCIP_CALL( SCIPallocBufferArray(data->solverscip, &varperm, data->nvars) );
265 
266  /* set up the arrays for the variable mapping */
267  for( i = 0; i < data->nvars; i++ )
268  {
269  SCIP_VAR* var;
270  var = (SCIP_VAR*) SCIPhashmapGetImage(varmapfw, vars[i]);
271  assert(var != NULL);
272  varperm[SCIPvarGetIndex(var)] = i;
273  data->vars[i] = var;
274  }
275 
276  if( SCIPgetNSols(scip) != 0 )
277  {
278  SCIP_Bool stored;
279  SCIP_Real* solvals;
280  SCIP_SOL* sol = SCIPgetBestSol(scip);
281  SCIP_SOL* solversol;
282 
283  SCIP_CALL( SCIPallocBufferArray(data->solverscip, &solvals, data->nvars) );
284 
285  SCIP_CALL( SCIPgetSolVals(scip, sol, data->nvars, vars, solvals) );
286  SCIP_CALL( SCIPcreateSol(data->solverscip, &solversol, NULL) );
287  SCIP_CALL( SCIPsetSolVals(data->solverscip, solversol, data->nvars, data->vars, solvals) );
288 
289  SCIPfreeBufferArray(data->solverscip, &solvals);
290 
291  SCIP_CALL( SCIPaddSol(data->solverscip, solversol, &stored) );
292 
293  assert(stored);
294  }
295 
296  /* create the concurrent data structure for the concurrent solver's SCIP */
297  /* this assert fails on check/instances/Orbitope/packorb_1-FullIns_3.cip
298  * assert(SCIPgetNOrigVars(data->solverscip) == data->nvars);
299  * also fails on check/instances/Orbitope/partorb_1-FullIns_3.cip
300  * TODO: test if this leads to any problems
301  */
302  SCIP_CALL( SCIPcreateConcurrent(data->solverscip, concsolver, varperm) );
303  SCIPfreeBufferArray(data->solverscip, &varperm);
304 
305  /* free the hashmap */
306  SCIPhashmapFree(&varmapfw);
307 
308  return SCIP_OKAY;
309 }
310 
311 /** creates an instance of a concurrent SCIP solver */
312 static
313 SCIP_DECL_CONCSOLVERCREATEINST(concsolverScipCreateInstance)
314 {
315  SCIP_CONCSOLVERDATA* data;
316  SCIP_CONCSOLVERTYPEDATA* typedata;
317  char* prefix;
318  char filename[SCIP_MAXSTRLEN];
319  SCIP_Bool changechildsel;
320 
321  assert(scip != NULL);
322  assert(concsolvertype != NULL);
323  assert(concsolver != NULL);
324 
325  typedata = SCIPconcsolverTypeGetData(concsolvertype);
326 
327  SCIP_ALLOC( BMSallocMemory(&data) );
328  SCIPconcsolverSetData(concsolver, data);
329 
330  SCIP_CALL( initConcsolver(scip, concsolver) );
331 
332  /* check if emphasis setting should be loaded */
333  if( typedata->loademphasis )
334  {
335  SCIP_PARAM** params;
336  SCIP_PARAM** fixedparams;
337  int nparams;
338  int nfixedparams;
339  int i;
340 
341  params = SCIPgetParams(data->solverscip);
342  nparams = SCIPgetNParams(data->solverscip);
343  SCIP_CALL( SCIPallocBufferArray(data->solverscip, &fixedparams, nparams) );
344  nfixedparams = 0;
345 
346  /* fix certain parameters before loading emphasis to avoid setting them to default values */
347  for( i = 0; i < nparams; ++i )
348  {
349  const char* paramname;
350 
351  paramname = SCIPparamGetName(params[i]);
352 
353  if( strncmp(paramname, "limits/", 7) == 0 ||
354  strncmp(paramname, "numerics/", 9) == 0 ||
355  strncmp(paramname, "memory/", 7) == 0 ||
356  strncmp(paramname, "concurrent/sync/", 16) == 0 ||
357  strncmp(paramname, "heuristics/sync/", 16) == 0 ||
358  strncmp(paramname, "propagating/sync/", 17) == 0 )
359  {
360  fixedparams[nfixedparams++] = params[i];
361  SCIP_CALL( SCIPfixParam(data->solverscip, paramname) );
362  }
363  }
364 
365  SCIP_CALL( SCIPsetEmphasis(data->solverscip, typedata->emphasis, TRUE) );
366 
367  for( i = 0; i < nfixedparams; ++i )
368  SCIP_CALL( SCIPunfixParam(data->solverscip, SCIPparamGetName(fixedparams[i])) );
369 
370  SCIPfreeBufferArray(data->solverscip, &fixedparams);
371  }
372 
373  /* load settings file if it exists */
374  SCIP_CALL( SCIPgetStringParam(scip, "concurrent/paramsetprefix", &prefix) );
375  (void) SCIPsnprintf(filename, SCIP_MAXSTRLEN, "%s%s.set", prefix, SCIPconcsolverGetName(concsolver));
376 
377  if( SCIPfileExists(filename) )
378  {
379  /* load settings file and print info message */
380  SCIPinfoMessage(scip, NULL, "reading parameter file <%s> for concurrent solver <%s>\n", filename, SCIPconcsolverGetName(concsolver));
381  SCIP_CALL( SCIPreadParams(data->solverscip, filename) );
382  }
383  else
384  {
385  /* print message about missing setting files only in verblevel full */
386  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "skipping non existent parameter file <%s> for concurrent solver <%s>\n",
387  filename, SCIPconcsolverGetName(concsolver));
388  }
389 
390  /* include eventhandler for synchronization */
391  SCIP_CALL( includeEventHdlrSync(data->solverscip) );
392 
393  /* disable output for subscip */
394  SCIP_CALL( SCIPsetIntParam(data->solverscip, "display/verblevel", 0) );
395 
396  /* use wall clock time in subscips */
397  SCIP_CALL( SCIPsetIntParam(data->solverscip, "timing/clocktype", (int)SCIP_CLOCKTYPE_WALL) );
398 
399  /* don't catch ctrlc since already caught in main scip */
400  SCIP_CALL( SCIPsetBoolParam(data->solverscip, "misc/catchctrlc", FALSE) );
401 
402  /* one solver can do all dual reductions and share them with the other solvers */
403  if( SCIPconcsolverGetIdx(concsolver) != 0 )
404  {
405  SCIP_CALL( disableConflictingDualReductions(data->solverscip) );
406  }
407 
408  /* set different child selection rules if corresponding parameter is TRUE */
409  SCIP_CALL( SCIPgetBoolParam(scip, "concurrent/changechildsel", &changechildsel) );
410  if( changechildsel )
411  {
412  SCIP_CALL( setChildSelRule(concsolver) );
413  }
414 
415  return SCIP_OKAY;
416 }
417 
418 /** destroys an instance of a concurrent SCIP solver */
419 static
420 SCIP_DECL_CONCSOLVERDESTROYINST(concsolverScipDestroyInstance)
421 {
422  SCIP_CONCSOLVERDATA* data;
423 
424  assert(concsolver != NULL);
425 
426  data = SCIPconcsolverGetData(concsolver);
427  assert(data != NULL);
428  assert(data->solverscip != NULL);
429 
430  /* free the array with the variable mapping */
431  SCIPfreeBlockMemoryArray(data->solverscip, &data->vars, data->nvars);
432 
433  /* free subscip */
434  SCIP_CALL( SCIPfree(&data->solverscip) );
435  BMSfreeMemory(&data);
436  SCIPconcsolverSetData(concsolver, NULL);
437 
438  return SCIP_OKAY;
439 }
440 
441 /** frees the data of a concurrent solver type */
442 static
443 SCIP_DECL_CONCSOLVERTYPEFREEDATA(concsolverTypeScipFreeData)
444 {
445  BMSfreeMemory(data);
446 }
447 
448 /** initializes the random and permutation seeds with the given one
449  * and enables permutation of constraints and variables
450  */
451 static
452 SCIP_DECL_CONCSOLVERINITSEEDS(concsolverScipInitSeeds)
453 {
454  SCIP_CONCSOLVERDATA* data;
455 
456  assert(concsolver != NULL);
457 
458  data = SCIPconcsolverGetData(concsolver);
459  assert(data != NULL);
460 
461  SCIPinfoMessage(data->solverscip, NULL, "initializing seeds to %d in concurrent solver '%s'\n", (int) seed, SCIPconcsolverGetName(concsolver));
462 
463  SCIP_CALL( SCIPsetIntParam(data->solverscip, "randomization/randomseedshift", (int) seed) );
464  SCIP_CALL( SCIPsetIntParam(data->solverscip, "randomization/permutationseed", (int) seed) );
465  SCIP_CALL( SCIPsetBoolParam(data->solverscip, "randomization/permutevars", TRUE) );
466  SCIP_CALL( SCIPsetBoolParam(data->solverscip, "randomization/permuteconss", TRUE) );
467 
468  return SCIP_OKAY;
469 }
470 
471 /** installs the solving status of this concurrent solver and the solving statistics
472  * into the given SCIP instance
473  */
474 static
475 SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(concsolverGetSolvingData)
476 {
477  SCIP_CONCSOLVERDATA* data;
478  SCIP_VAR** vars;
479  int nvars;
480  int nsols;
481  SCIP_SOL** sols;
482  SCIP_Real* solvals;
483  SCIP_HEUR* heur;
484  int i;
485 
486  assert(concsolver != NULL);
487 
488  data = SCIPconcsolverGetData(concsolver);
489  assert(data != NULL);
490  assert(data->solverscip != NULL);
491 
492  assert(scip != NULL);
493  vars = SCIPgetVars(scip);
494  nvars = SCIPgetNVars(scip);
495 
496  nsols = SCIPgetNSols(data->solverscip);
497  sols = SCIPgetSols(data->solverscip);
498 
499  assert(nvars == data->nvars);
500 
501  /* allocate buffer array used for translating the solution to the given SCIP */
502  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, nvars) );
503 
504  /* add the solutions to the given SCIP */
505  for( i = 0; i < nsols; ++i )
506  {
507  SCIP_SOL* sol;
508  SCIP_Bool stored;
509  SCIP_CALL( SCIPgetSolVals(data->solverscip, sols[i], nvars, data->vars, solvals) );
510 
511  heur = SCIPsolGetHeur(sols[i]);
512 
513  if( heur != NULL )
514  heur = SCIPfindHeur(scip, SCIPheurGetName(heur));
515 
516  SCIP_CALL( SCIPcreateSol(scip, &sol, heur) );
517  SCIP_CALL( SCIPsetSolVals(scip, sol, nvars, vars, solvals) );
518 
519  SCIP_CALL( SCIPcopySolStats(sols[i], sol) );
520 
521  SCIP_CALL( SCIPaddSolFree(scip, &sol, &stored) );
522  }
523 
524  /* free the buffer array */
525  SCIPfreeBufferArray(scip, &solvals);
526 
527  /* copy solving statistics and status from the solver SCIP to the given SCIP */
528  SCIP_CALL( SCIPcopyConcurrentSolvingStats(data->solverscip, scip) );
529 
530  return SCIP_OKAY;
531 }
532 
533 /** start solving the problem until the solving reaches a limit, gets interrupted, or
534  * just finished successfully
535  */
536 static
537 SCIP_DECL_CONCSOLVEREXEC(concsolverScipExec)
538 {
539  SCIP_CONCSOLVERDATA* data;
540 
541  assert(concsolver != NULL);
542 
543  data = SCIPconcsolverGetData(concsolver);
544  assert(data != NULL);
545 
546  /* print info message that solving has started */
547  SCIPinfoMessage(data->solverscip, NULL, "starting solve in concurrent solver '%s'\n", SCIPconcsolverGetName(concsolver));
548 
549  /* solve */
550  SCIP_CALL( SCIPsolve(data->solverscip) );
551 
552  /* print info message with status */
553  SCIPinfoMessage(data->solverscip, NULL, "concurrent solver '%s' stopped with status ", SCIPconcsolverGetName(concsolver));
554  SCIP_CALL( SCIPprintStatus(data->solverscip, NULL) );
555  SCIPinfoMessage(data->solverscip, NULL, "\n");
556 
557  /* set solving statistics */
558  *solvingtime = SCIPgetSolvingTime(data->solverscip);
559  *nlpiterations = SCIPgetNLPIterations(data->solverscip);
560  *nnodes = SCIPgetNNodes(data->solverscip);
561 
562  return SCIP_OKAY;
563 }
564 
565 /** stops the concurrent solver as soon as possible */
566 static
567 SCIP_DECL_CONCSOLVERSTOP(concsolverScipStop)
568 {
569  SCIP_CONCSOLVERDATA* data;
570  assert(concsolver != NULL);
571 
572  data = SCIPconcsolverGetData(concsolver);
573  assert(data != NULL);
574 
575  SCIP_CALL( SCIPinterruptSolve(data->solverscip) );
576 
577  return SCIP_OKAY;
578 }
579 
580 /** writes new solutions and global boundchanges to the iven synchronization data */
581 static
582 SCIP_DECL_CONCSOLVERSYNCWRITE(concsolverScipSyncWrite)
583 {
584  int i;
585  int nsols;
586  SCIP_SOL** sols;
587  SCIP_CONCSOLVERDATA* data;
588  SCIP_BOUNDSTORE* boundstore;
589  int concsolverid;
590  SCIP_STATUS solverstatus;
591 
592  data = SCIPconcsolverGetData(concsolver);
593  assert(data != NULL);
594  concsolverid = SCIPconcsolverGetIdx(concsolver);
595  solverstatus = SCIPgetStatus(data->solverscip);
596 
597  SCIPsyncdataSetStatus(syncdata, solverstatus, concsolverid);
598  SCIPsyncdataSetLowerbound(syncdata, SCIPgetDualbound(data->solverscip));
599  SCIPsyncdataSetUpperbound(syncdata, SCIPgetPrimalbound(data->solverscip));
600 
601  *nsolsshared = 0;
602 
603  if( SCIPsyncdataGetStatus(syncdata) != SCIP_STATUS_UNKNOWN )
604  return SCIP_OKAY;
605 
606  SCIPdebugMessage("syncing in concurrent solver %s\n", SCIPconcsolverGetName(concsolver));
607 
608  /* consider at most maxcandsols many solutions, and since
609  * the solution array is sorted, we will cosider the best
610  * solutions
611  */
612  nsols = SCIPgetNSols(data->solverscip);
613  nsols = MIN(nsols, maxcandsols);
614  sols = SCIPgetSols(data->solverscip);
615 
616  for( i = 0; i < nsols; ++i )
617  {
618  if( SCIPIsConcurrentSolNew(data->solverscip, sols[i]) )
619  {
620  SCIP_Real solobj;
621  SCIP_Real* solvals;
622 
623  solobj = SCIPgetSolOrigObj(data->solverscip, sols[i]);
624 
625  SCIPdebugMessage("adding sol to spi in concurrent solver %s\n", SCIPconcsolverGetName(concsolver));
626  SCIPsyncdataGetSolutionBuffer(syncstore, syncdata, solobj, concsolverid, &solvals);
627 
628  /* if syncstore has no place for this solution we can stop since the next solution will have
629  * a worse objective value and thus won't be accepted either
630  */
631  if( solvals == NULL )
632  break;
633 
634  ++(*nsolsshared);
635  SCIP_CALL( SCIPgetSolVals(data->solverscip, sols[i], data->nvars, data->vars, solvals) );
636 
637  /* if we have added the maximum number of solutions we can also stop */
638  if( *nsolsshared == maxsharedsols )
639  break;
640  }
641  }
642 
643  boundstore = SCIPgetConcurrentGlobalBoundChanges(data->solverscip);
644 
645  if( boundstore != NULL )
646  SCIP_CALL( SCIPsyncdataAddBoundChanges(syncstore, syncdata, boundstore) );
647 
648  SCIPsyncdataAddMemTotal(syncdata, SCIPgetMemTotal(data->solverscip));
649 
650  return SCIP_OKAY;
651 }
652 
653 /** reads the solutions and bounds from the given synchronization data */
654 static
655 SCIP_DECL_CONCSOLVERSYNCREAD(concsolverScipSyncRead)
656 { /*lint --e{715}*/
657  int i;
658  int nsols;
659  SCIP_Real** solvals;
660  SCIP_CONCSOLVERDATA* data;
661  SCIP_BOUNDSTORE* boundstore;
662  int* concsolverids;
663  int concsolverid;
664  int nbndchgs;
665 
666  data = SCIPconcsolverGetData(concsolver);
667  assert(data != NULL);
668 
669  concsolverid = SCIPconcsolverGetIdx(concsolver);
670 
671  /* get solutions from synchronization data */
672  SCIPsyncdataGetSolutions(syncdata, &solvals, &concsolverids, &nsols);
673  *nsolsrecvd = 0;
674 
675  for( i = 0; i < nsols; ++i )
676  {
677  SCIP_SOL* newsol;
678 
679  /* do not add own solutions */
680  if( concsolverids[i] == concsolverid )
681  continue;
682 
683  /* solution is from other solver so translate to this solvers variable space
684  * and add it to the SCIP
685  */
686  ++(*nsolsrecvd);
687  SCIP_CALL( SCIPcreateOrigSol(data->solverscip, &newsol, NULL) );
688 
689  SCIP_CALL( SCIPsetSolVals(data->solverscip, newsol, data->nvars, data->vars, solvals[i]) );
690  SCIPdebugMessage("adding solution in concurrent solver %s\n", SCIPconcsolverGetName(concsolver));
691  SCIP_CALL( SCIPaddConcurrentSol(data->solverscip, newsol) );
692  }
693 
694  /* get bound changes from the synchronization data and add it to this
695  * concurrent solvers SCIP
696  */
697  *ntighterbnds = 0;
698  *ntighterintbnds = 0;
699  boundstore = SCIPsyncdataGetBoundChgs(syncdata);
700  nbndchgs = SCIPboundstoreGetNChgs(boundstore);
701 
702  for( i = 0; i < nbndchgs; ++i )
703  {
704  SCIP_VAR* var;
705  SCIP_BOUNDTYPE boundtype;
706  SCIP_Real newbound;
707 
708  var = data->vars[SCIPboundstoreGetChgVaridx(boundstore, i)];
709  boundtype = SCIPboundstoreGetChgType(boundstore, i);
710  newbound = SCIPboundstoreGetChgVal(boundstore, i);
711 
712  SCIP_CALL( SCIPvarGetProbvarBound(&var, &newbound, &boundtype) );
713 
714  /* cannot change bounds of multi-aggregated variables so dont pass this bound-change to the propagator */
716  return SCIP_OKAY;
717 
718  /* if bound is not better than also don't pass this bound to the propagator and
719  * don't waste memory for storing this boundchange
720  */
721  if( boundtype == SCIP_BOUNDTYPE_LOWER && SCIPisGE(data->solverscip, SCIPvarGetLbGlobal(var), newbound) )
722  return SCIP_OKAY;
723 
724  if( boundtype == SCIP_BOUNDTYPE_UPPER && SCIPisLE(data->solverscip, SCIPvarGetUbGlobal(var), newbound) )
725  return SCIP_OKAY;
726 
727  /* bound is better so incremented counters for statistics and pass it to the sync propagator */
728  ++(*ntighterbnds);
729 
731  ++(*ntighterintbnds);
732 
733  SCIP_CALL( SCIPaddConcurrentBndchg(data->solverscip, var, newbound, boundtype) );
734  }
735 
736  return SCIP_OKAY;
737 }
738 
739 
740 /** creates the concurrent SCIP solver plugins and includes them in SCIP */
742  SCIP* scip /**< SCIP datastructure */
743  )
744 {
746 
747  assert(scip != NULL);
748 
749  /* include concurrent solvers for SCIP for all emphasis settings and without an emphasis setting.
750  * For the SCIP without an emphasis setting we set the default preferred priority to 1 and for the other types to 0
751  * so that the default concurent solve will use multiple SCIP's using settings as specified by the user in the main SCIP
752  */
753  SCIP_CALL( SCIPallocMemory(scip, &data) );
754  data->loademphasis = FALSE;
755  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip", 1.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
756  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
757  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
758 
759  SCIP_CALL( SCIPallocMemory(scip, &data) );
760  data->loademphasis = TRUE;
761  data->emphasis = SCIP_PARAMEMPHASIS_DEFAULT;
762  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-default", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
763  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
764  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
765 
766  SCIP_CALL( SCIPallocMemory(scip, &data) );
767  data->loademphasis = TRUE;
768  data->emphasis = SCIP_PARAMEMPHASIS_CPSOLVER;
769  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-cpsolver", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
770  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
771  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
772 
773  SCIP_CALL( SCIPallocMemory(scip, &data) );
774  data->loademphasis = TRUE;
775  data->emphasis = SCIP_PARAMEMPHASIS_EASYCIP;
776  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-easycip", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
777  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
778  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
779 
780  SCIP_CALL( SCIPallocMemory(scip, &data) );
781  data->loademphasis = TRUE;
782  data->emphasis = SCIP_PARAMEMPHASIS_FEASIBILITY;
783  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-feas", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
784  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
785  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
786 
787  SCIP_CALL( SCIPallocMemory(scip, &data) );
788  data->loademphasis = TRUE;
789  data->emphasis = SCIP_PARAMEMPHASIS_HARDLP;
790  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-hardlp", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
791  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
792  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
793 
794  SCIP_CALL( SCIPallocMemory(scip, &data) );
795  data->loademphasis = TRUE;
796  data->emphasis = SCIP_PARAMEMPHASIS_OPTIMALITY;
797  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-opti", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
798  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
799  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
800 
801  SCIP_CALL( SCIPallocMemory(scip, &data) );
802  data->loademphasis = TRUE;
803  data->emphasis = SCIP_PARAMEMPHASIS_COUNTER;
804  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-counter", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
805  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
806  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
807 
808  return SCIP_OKAY;
809 }
void SCIPeventhdlrSetData(SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: event.c:335
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:97
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
SCIP_RETCODE SCIPcreateOrigSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip_sol.c:557
struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA
#define SCIPallocBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:80
static SCIP_DECL_CONCSOLVEREXEC(concsolverScipExec)
static SCIP_RETCODE includeEventHdlrSync(SCIP *scip)
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1429
public methods for SCIP parameter handling
static SCIP_DECL_EVENTEXIT(eventExitSync)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPboundstoreGetNChgs(SCIP_BOUNDSTORE *boundstore)
Definition: boundstore.c:188
public methods for memory management
SCIP_Bool SCIPfileExists(const char *filename)
Definition: misc.c:10793
SCIP_STATUS SCIPgetStatus(SCIP *scip)
Definition: scip_general.c:467
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
Definition: scip_solve.c:3407
SCIP_RETCODE SCIPgetStringParam(SCIP *scip, const char *name, char **value)
Definition: scip_param.c:336
static SCIP_DECL_CONCSOLVERTYPEFREEDATA(concsolverTypeScipFreeData)
#define SCIP_MAXSTRLEN
Definition: def.h:273
SCIP_STATUS SCIPsyncdataGetStatus(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:506
static SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(concsolverGetSolvingData)
void SCIPsyncdataSetUpperbound(SCIP_SYNCDATA *syncdata, SCIP_Real upperbound)
Definition: syncstore.c:675
public solving methods
public methods for timing
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
Definition: type_event.h:146
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
Definition: scip_param.c:241
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:315
int SCIPgetNVars(SCIP *scip)
Definition: scip_prob.c:1986
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip_timing.c:360
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip_message.c:216
#define FALSE
Definition: def.h:73
char * SCIPconcsolverGetName(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:291
SCIP_EXPORT SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2604
SCIP_EXPORT SCIP_RETCODE SCIPvarGetProbvarBound(SCIP_VAR **var, SCIP_Real *bound, SCIP_BOUNDTYPE *boundtype)
Definition: var.c:12240
SCIP_EXPORT SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
Definition: var.c:17182
#define TRUE
Definition: def.h:72
void SCIPsyncdataSetLowerbound(SCIP_SYNCDATA *syncdata, SCIP_Real lowerbound)
Definition: syncstore.c:686
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
const char * SCIPparamGetName(SCIP_PARAM *param)
Definition: paramset.c:650
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip_solve.c:2527
datastructures for concurrent solvers
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3200
SCIP_RETCODE SCIPcopy(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool threadsafe, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip_copy.c:2814
public methods for problem variables
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip_mem.h:95
#define SCIPdebugMessage
Definition: pub_message.h:87
SCIP_EXPORT SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
Definition: var.c:17136
SCIP_Longint SCIPgetMemTotal(SCIP *scip)
Definition: scip_mem.c:104
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:123
#define BMSfreeMemory(ptr)
Definition: memory.h:137
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip_mem.h:78
void SCIPconcsolverSetData(SCIP_CONCSOLVER *concsolver, SCIP_CONCSOLVERDATA *data)
Definition: concsolver.c:280
public methods for numerical tolerances
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
Definition: scip_heur.c:249
static SCIP_DECL_CONCSOLVERSYNCWRITE(concsolverScipSyncWrite)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip_sol.c:320
SCIP_PARAM ** SCIPgetParams(SCIP *scip)
Definition: scip_param.c:988
static SCIP_RETCODE initConcsolver(SCIP *scip, SCIP_CONCSOLVER *concsolver)
public methods for querying solving statistics
int SCIPgetNSols(SCIP *scip)
Definition: scip_sol.c:2206
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:325
SCIP_Longint SCIPgetNNodes(SCIP *scip)
public methods for handling parameter settings
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:283
void SCIPsyncdataGetSolutionBuffer(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_Real solobj, int ownerid, SCIP_Real **buffer)
Definition: syncstore.c:699
int SCIPboundstoreGetChgVaridx(SCIP_BOUNDSTORE *boundstore, int i)
Definition: boundstore.c:152
implementation of concurrent solver interface for SCIP
SCIP_RETCODE SCIPsetEventhdlrFree(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTFREE((*eventfree)))
Definition: scip_event.c:141
SCIP_RETCODE SCIPaddConcurrentBndchg(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE bndtype)
Definition: concurrent.c:377
SCIP_Bool SCIPsyncstoreIsInitialized(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:775
SCIP_RETCODE SCIPfixParam(SCIP *scip, const char *name)
Definition: scip_param.c:358
public methods for event handler plugins and event handlers
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip_event.c:277
SCIP_VAR ** SCIPgetVars(SCIP *scip)
Definition: scip_prob.c:1941
void SCIPsyncdataSetStatus(SCIP_SYNCDATA *syncdata, SCIP_STATUS status, int solverid)
Definition: syncstore.c:633
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip_mem.c:48
#define NULL
Definition: lpi_spx1.cpp:155
the interface of the boundstore structure
public methods for problem copies
public methods for primal CIP solutions
#define SCIP_CALL(x)
Definition: def.h:364
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
Definition: scip_param.c:671
SCIP_RETCODE SCIPaddConcurrentSol(SCIP *scip, SCIP_SOL *sol)
Definition: concurrent.c:362
static SCIP_DECL_CONCSOLVERSTOP(concsolverScipStop)
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)
public methods for primal heuristic plugins and divesets
static SCIP_RETCODE disableConflictingDualReductions(SCIP *scip)
SCIP_RETCODE SCIPunfixParam(SCIP *scip, const char *name)
Definition: scip_param.c:376
the function declarations for the synchronization store
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip_mem.h:111
static SCIP_DECL_EVENTFREE(eventFreeSync)
public data structures and miscellaneous methods
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_sol.c:1255
#define SCIP_Bool
Definition: def.h:70
SCIP_RETCODE SCIPaddSolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool *stored)
Definition: scip_sol.c:3015
void SCIPsyncdataAddMemTotal(SCIP_SYNCDATA *syncdata, SCIP_Longint memtotal)
Definition: syncstore.c:664
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:3013
static SCIP_DECL_EVENTEXEC(eventExecSync)
enum SCIP_Status SCIP_STATUS
Definition: type_stat.h:58
static const char * paramname[]
Definition: lpi_msk.c:4958
SCIP_EXPORT SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Definition: var.c:17677
static SCIP_DECL_CONCSOLVERSYNCREAD(concsolverScipSyncRead)
public methods for concurrent solving mode
SCIP_RETCODE SCIPsetEmphasis(SCIP *scip, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
Definition: scip_param.c:871
SCIP_RETCODE SCIPcopyConcurrentSolvingStats(SCIP *source, SCIP *target)
Definition: concurrent.c:526
int SCIPgetNParams(SCIP *scip)
Definition: scip_param.c:1002
SCIP_CONCSOLVERDATA * SCIPconcsolverGetData(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:270
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip_event.c:95
helper functions for concurrent scip solvers
enum SCIP_ParamEmphasis SCIP_PARAMEMPHASIS
Definition: type_paramset.h:74
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_sol.c:1390
static SCIP_DECL_CONCSOLVERCREATEINST(concsolverScipCreateInstance)
SCIP_RETCODE SCIPcopySolStats(SCIP_SOL *source, SCIP_SOL *target)
Definition: concurrent.c:395
int SCIPconcsolverGetIdx(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:613
SCIP_RETCODE SCIPincludeConcurrentScipSolvers(SCIP *scip)
public methods for managing events
general public methods
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
SCIP_Real SCIPboundstoreGetChgVal(SCIP_BOUNDSTORE *boundstore, int i)
Definition: boundstore.c:176
public methods for solutions
SCIP_RETCODE SCIPsetEventhdlrInit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINIT((*eventinit)))
Definition: scip_event.c:155
SCIP_RETCODE SCIPreadParams(SCIP *scip, const char *filename)
Definition: scip_param.c:761
SCIP_BOUNDSTORE * SCIPsyncdataGetBoundChgs(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:609
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip_sol.c:2255
SCIP_RETCODE SCIPprintStatus(SCIP *scip, FILE *file)
Definition: scip_general.c:490
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip_event.c:311
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
SCIP_EXPORT SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
Definition: var.c:17667
static SCIP_DECL_CONCSOLVERDESTROYINST(concsolverScipDestroyInstance)
public methods for message output
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10590
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:3047
#define EVENTHDLR_NAME
#define SCIP_Real
Definition: def.h:163
SCIP_RETCODE SCIPaddSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *stored)
Definition: scip_sol.c:2925
public methods for message handling
#define BMSallocMemory(ptr)
Definition: memory.h:111
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
SCIP_Bool SCIPIsConcurrentSolNew(SCIP *scip, SCIP_SOL *sol)
Definition: concurrent.c:429
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition: scip_param.c:439
static SCIP_RETCODE setChildSelRule(SCIP_CONCSOLVER *concsolver)
SCIP_BOUNDSTORE * SCIPgetConcurrentGlobalBoundChanges(SCIP *scip)
Definition: concurrent.c:442
#define SCIPallocMemory(scip, ptr)
Definition: scip_mem.h:51
static SCIP_DECL_EVENTINIT(eventInitSync)
SCIP_CONCSOLVERTYPEDATA * SCIPconcsolverTypeGetData(SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: concsolver.c:160
#define nnodes
Definition: gastrans.c:65
#define EVENTHDLR_DESC
public methods for primal heuristics
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:315
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip_message.c:199
#define SCIP_EVENTTYPE_SYNC
Definition: type_event.h:108
SCIP_BOUNDTYPE SCIPboundstoreGetChgType(SCIP_BOUNDSTORE *boundstore, int i)
Definition: boundstore.c:164
#define SCIP_ALLOC(x)
Definition: def.h:375
public methods for global and local (sub)problems
SCIP_Real SCIPgetDualbound(SCIP *scip)
static SCIP_DECL_CONCSOLVERINITSEEDS(concsolverScipInitSeeds)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip_sol.c:2305
SCIP_RETCODE SCIPsyncdataAddBoundChanges(SCIP_SYNCSTORE *syncstore, SCIP_SYNCDATA *syncdata, SCIP_BOUNDSTORE *boundstore)
Definition: syncstore.c:758
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip_param.c:497
SCIP_RETCODE SCIPsynchronize(SCIP *scip)
Definition: concurrent.c:236
void SCIPsyncdataGetSolutions(SCIP_SYNCDATA *syncdata, SCIP_Real ***solvalues, int **solowner, int *nsols)
Definition: syncstore.c:591
struct SCIP_ConcSolverData SCIP_CONCSOLVERDATA
SCIP_EXPORT int SCIPvarGetIndex(SCIP_VAR *var)
Definition: var.c:17350
SCIP_RETCODE SCIPsetEventhdlrExit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXIT((*eventexit)))
Definition: scip_event.c:169
SCIP_RETCODE SCIPcreateConcurrent(SCIP *scip, SCIP_CONCSOLVER *concsolver, int *varperm)
Definition: concurrent.c:48
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip_sol.c:1436
memory allocation routines