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-2019 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 scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file concsolver_scip.c
17  * @ingroup PARALLEL
18  * @brief implementation of concurrent solver interface for SCIP
19  * @author Robert Lion 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/allowdualreds", FALSE) );
209 
210  return SCIP_OKAY;
211 }
212 
213 /** sets the child selection rule based on the index of the concurrent solver */
214 static
216  SCIP_CONCSOLVER* concsolver /**< the concurrent solver */
217  )
218 {
219  SCIP_CONCSOLVERDATA* data;
220  static char childsel[] = { 'h', 'i', 'p', 'r', 'l', 'd', 'u' };
221 
222  assert(concsolver != NULL);
223 
224  data = SCIPconcsolverGetData(concsolver);
225  assert(data != NULL);
226 
227  SCIP_CALL( SCIPsetCharParam(data->solverscip, "nodeselection/childsel", childsel[SCIPconcsolverGetIdx(concsolver) % 7]) );
228 
229  return SCIP_OKAY;
230 }
231 
232 /** initialize the concurrent SCIP solver, i.e. setup the copy of the problem and the
233  * mapping of the variables */
234 static
236  SCIP* scip, /**< the main SCIP instance */
237  SCIP_CONCSOLVER* concsolver /**< the concurrent solver to set up */
238  )
239 {
240  int i;
241  SCIP_VAR** vars;
242  SCIP_Bool valid;
243  SCIP_HASHMAP* varmapfw;
244  SCIP_CONCSOLVERDATA* data;
245  int* varperm;
246 
247  assert(scip != NULL);
248  assert(concsolver != NULL);
249 
250  data = SCIPconcsolverGetData(concsolver);
251  assert(data != NULL);
252 
253  data->nvars = SCIPgetNVars(scip);
254  vars = SCIPgetVars(scip);
255 
256  /* create the concurrent solver's SCIP instance and set up the problem */
257  SCIP_CALL( SCIPcreate(&data->solverscip) );
258  SCIP_CALL( SCIPhashmapCreate(&varmapfw, SCIPblkmem(data->solverscip), data->nvars) );
259  SCIP_CALL( SCIPcopy(scip, data->solverscip, varmapfw, NULL, SCIPconcsolverGetName(concsolver), TRUE, FALSE, 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  varperm[SCIPvarGetIndex(var)] = i;
272  data->vars[i] = var;
273  }
274 
275  if( SCIPgetNSols(scip) != 0 )
276  {
277  SCIP_Bool stored;
278  SCIP_Real* solvals;
279  SCIP_SOL* sol = SCIPgetBestSol(scip);
280  SCIP_SOL* solversol;
281 
282  SCIP_CALL( SCIPallocBufferArray(data->solverscip, &solvals, data->nvars) );
283 
284  SCIP_CALL( SCIPgetSolVals(scip, sol, data->nvars, vars, solvals) );
285  SCIP_CALL( SCIPcreateSol(data->solverscip, &solversol, NULL) );
286  SCIP_CALL( SCIPsetSolVals(data->solverscip, solversol, data->nvars, data->vars, solvals) );
287 
288  SCIPfreeBufferArray(data->solverscip, &solvals);
289 
290  SCIP_CALL( SCIPaddSol(data->solverscip, solversol, &stored) );
291 
292  assert(stored);
293  }
294 
295  /* create the concurrent data structure for the concurrent solver's SCIP */
296  /* this assert fails on check/instances/Orbitope/packorb_1-FullIns_3.cip
297  * assert(SCIPgetNOrigVars(data->solverscip) == data->nvars);
298  * also fails on check/instances/Orbitope/partorb_1-FullIns_3.cip
299  * TODO: test if this leads to any problems
300  */
301  SCIP_CALL( SCIPcreateConcurrent(data->solverscip, concsolver, varperm) );
302  SCIPfreeBufferArray(data->solverscip, &varperm);
303 
304  /* free the hashmap */
305  SCIPhashmapFree(&varmapfw);
306 
307  return SCIP_OKAY;
308 }
309 
310 /** creates an instance of a concurrent SCIP solver */
311 static
312 SCIP_DECL_CONCSOLVERCREATEINST(concsolverScipCreateInstance)
313 {
314  SCIP_CONCSOLVERDATA* data;
315  SCIP_CONCSOLVERTYPEDATA* typedata;
316  char* prefix;
317  char filename[SCIP_MAXSTRLEN];
318  SCIP_Bool changechildsel;
319 
320  assert(scip != NULL);
321  assert(concsolvertype != NULL);
322  assert(concsolver != NULL);
323 
324  typedata = SCIPconcsolverTypeGetData(concsolvertype);
325 
326  SCIP_ALLOC( BMSallocMemory(&data) );
327  SCIPconcsolverSetData(concsolver, data);
328 
329  SCIP_CALL( initConcsolver(scip, concsolver) );
330 
331  /* check if emphasis setting should be loaded */
332  if( typedata->loademphasis )
333  {
334  SCIP_PARAM** params;
335  SCIP_PARAM** fixedparams;
336  int nparams;
337  int nfixedparams;
338  int i;
339 
340  params = SCIPgetParams(data->solverscip);
341  nparams = SCIPgetNParams(data->solverscip);
342  SCIP_CALL( SCIPallocBufferArray(data->solverscip, &fixedparams, nparams) );
343  nfixedparams = 0;
344 
345  /* fix certain parameters before loading emphasis to avoid setting them to default values */
346  for( i = 0; i < nparams; ++i )
347  {
348  const char* paramname;
349 
350  paramname = SCIPparamGetName(params[i]);
351 
352  if( strncmp(paramname, "limits/", 7) == 0 ||
353  strncmp(paramname, "numerics/", 9) == 0 ||
354  strncmp(paramname, "memory/", 7) == 0 ||
355  strncmp(paramname, "concurrent/sync/", 16) == 0 ||
356  strncmp(paramname, "heuristics/sync/", 16) == 0 ||
357  strncmp(paramname, "propagating/sync/", 17) == 0 )
358  {
359  fixedparams[nfixedparams++] = params[i];
360  SCIP_CALL( SCIPfixParam(data->solverscip, paramname) );
361  }
362  }
363 
364  SCIP_CALL( SCIPsetEmphasis(data->solverscip, typedata->emphasis, TRUE) );
365 
366  for( i = 0; i < nfixedparams; ++i )
367  SCIP_CALL( SCIPunfixParam(data->solverscip, SCIPparamGetName(fixedparams[i])) );
368 
369  SCIPfreeBufferArray(data->solverscip, &fixedparams);
370  }
371 
372  /* load settings file if it exists */
373  SCIP_CALL( SCIPgetStringParam(scip, "concurrent/paramsetprefix", &prefix) );
374  (void) SCIPsnprintf(filename, SCIP_MAXSTRLEN, "%s%s.set", prefix, SCIPconcsolverGetName(concsolver));
375 
376  if( SCIPfileExists(filename) )
377  {
378  /* load settings file and print info message */
379  SCIPinfoMessage(scip, NULL, "reading parameter file <%s> for concurrent solver <%s>\n", filename, SCIPconcsolverGetName(concsolver));
380  SCIP_CALL( SCIPreadParams(data->solverscip, filename) );
381  }
382  else
383  {
384  /* print message about missing setting files only in verblevel full */
385  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "skipping non existent parameter file <%s> for concurrent solver <%s>\n",
386  filename, SCIPconcsolverGetName(concsolver));
387  }
388 
389  /* include eventhandler for synchronization */
390  SCIP_CALL( includeEventHdlrSync(data->solverscip) );
391 
392  /* disable output for subscip */
393  SCIP_CALL( SCIPsetIntParam(data->solverscip, "display/verblevel", 0) );
394 
395  /* use wall clock time in subscips */
396  SCIP_CALL( SCIPsetIntParam(data->solverscip, "timing/clocktype", (int)SCIP_CLOCKTYPE_WALL) );
397 
398  /* don't catch ctrlc since already caught in main scip */
399  SCIP_CALL( SCIPsetBoolParam(data->solverscip, "misc/catchctrlc", FALSE) );
400 
401  /* one solver can do all dual reductions and share them with the other solvers */
402  if( SCIPconcsolverGetIdx(concsolver) != 0 )
403  {
404  SCIP_CALL( disableConflictingDualReductions(data->solverscip) );
405  }
406 
407  /* set different child selection rules if corresponding parameter is TRUE */
408  SCIP_CALL( SCIPgetBoolParam(scip, "concurrent/changechildsel", &changechildsel) );
409  if( changechildsel )
410  {
411  SCIP_CALL( setChildSelRule(concsolver) );
412  }
413 
414  return SCIP_OKAY;
415 }
416 
417 /** destroys an instance of a concurrent SCIP solver */
418 static
419 SCIP_DECL_CONCSOLVERDESTROYINST(concsolverScipDestroyInstance)
420 {
421  SCIP_CONCSOLVERDATA* data;
422 
423  assert(concsolver != NULL);
424 
425  data = SCIPconcsolverGetData(concsolver);
426  assert(data != NULL);
427  assert(data->solverscip != NULL);
428 
429  /* free the array with the variable mapping */
430  SCIPfreeBlockMemoryArray(data->solverscip, &data->vars, data->nvars);
431 
432  /* free subscip */
433  SCIP_CALL( SCIPfree(&data->solverscip) );
434  BMSfreeMemory(&data);
435  SCIPconcsolverSetData(concsolver, NULL);
436 
437  return SCIP_OKAY;
438 }
439 
440 /** frees the data of a concurrent solver type */
441 static
442 SCIP_DECL_CONCSOLVERTYPEFREEDATA(concsolverTypeScipFreeData)
443 {
444  BMSfreeMemory(data);
445 }
446 
447 /** initializes the random and permutation seeds with the given one
448  * and enables permutation of constraints and variables
449  */
450 static
451 SCIP_DECL_CONCSOLVERINITSEEDS(concsolverScipInitSeeds)
452 {
453  SCIP_CONCSOLVERDATA* data;
454 
455  assert(concsolver != NULL);
456 
457  data = SCIPconcsolverGetData(concsolver);
458  assert(data != NULL);
459 
460  SCIPinfoMessage(data->solverscip, NULL, "initializing seeds to %d in concurrent solver '%s'\n", (int) seed, SCIPconcsolverGetName(concsolver));
461 
462  SCIP_CALL( SCIPsetIntParam(data->solverscip, "randomization/randomseedshift", (int) seed) );
463  SCIP_CALL( SCIPsetIntParam(data->solverscip, "randomization/permutationseed", (int) seed) );
464  SCIP_CALL( SCIPsetBoolParam(data->solverscip, "randomization/permutevars", TRUE) );
465  SCIP_CALL( SCIPsetBoolParam(data->solverscip, "randomization/permuteconss", TRUE) );
466 
467  return SCIP_OKAY;
468 }
469 
470 /** installs the solving status of this concurrent solver and the solving statistics
471  * into the given SCIP instance
472  */
473 static
474 SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(concsolverGetSolvingData)
475 {
476  SCIP_CONCSOLVERDATA* data;
477  SCIP_VAR** vars;
478  int nvars;
479  int nsols;
480  SCIP_SOL** sols;
481  SCIP_Real* solvals;
482  SCIP_HEUR* heur;
483  int i;
484 
485  assert(concsolver != NULL);
486 
487  data = SCIPconcsolverGetData(concsolver);
488  assert(data != NULL);
489  assert(data->solverscip != NULL);
490 
491  assert(scip != NULL);
492  vars = SCIPgetVars(scip);
493  nvars = SCIPgetNVars(scip);
494 
495  nsols = SCIPgetNSols(data->solverscip);
496  sols = SCIPgetSols(data->solverscip);
497 
498  assert(nvars == data->nvars);
499 
500  /* allocate buffer array used for translating the solution to the given SCIP */
501  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, nvars) );
502 
503  /* add the solutions to the given SCIP */
504  for( i = 0; i < nsols; ++i )
505  {
506  SCIP_SOL* sol;
507  SCIP_Bool stored;
508  SCIP_CALL( SCIPgetSolVals(data->solverscip, sols[i], nvars, data->vars, solvals) );
509 
510  heur = SCIPsolGetHeur(sols[i]);
511 
512  if( heur != NULL )
513  heur = SCIPfindHeur(scip, SCIPheurGetName(heur));
514 
515  SCIP_CALL( SCIPcreateSol(scip, &sol, heur) );
516  SCIP_CALL( SCIPsetSolVals(scip, sol, nvars, vars, solvals) );
517 
518  SCIP_CALL( SCIPcopySolStats(sols[i], sol) );
519 
520  SCIP_CALL( SCIPaddSolFree(scip, &sol, &stored) );
521  }
522 
523  /* free the buffer array */
524  SCIPfreeBufferArray(scip, &solvals);
525 
526  /* copy solving statistics and status from the solver SCIP to the given SCIP */
527  SCIP_CALL( SCIPcopyConcurrentSolvingStats(data->solverscip, scip) );
528 
529  return SCIP_OKAY;
530 }
531 
532 /** start solving the problem until the solving reaches a limit, gets interrupted, or
533  * just finished successfully
534  */
535 static
536 SCIP_DECL_CONCSOLVEREXEC(concsolverScipExec)
537 {
538  SCIP_CONCSOLVERDATA* data;
539 
540  assert(concsolver != NULL);
541 
542  data = SCIPconcsolverGetData(concsolver);
543  assert(data != NULL);
544 
545  /* print info message that solving has started */
546  SCIPinfoMessage(data->solverscip, NULL, "starting solve in concurrent solver '%s'\n", SCIPconcsolverGetName(concsolver));
547 
548  /* solve */
549  SCIP_CALL( SCIPsolve(data->solverscip) );
550 
551  /* print info message with status */
552  SCIPinfoMessage(data->solverscip, NULL, "concurrent solver '%s' stopped with status ", SCIPconcsolverGetName(concsolver));
553  SCIP_CALL( SCIPprintStatus(data->solverscip, NULL) );
554  SCIPinfoMessage(data->solverscip, NULL, "\n");
555 
556  /* set solving statistics */
557  *solvingtime = SCIPgetSolvingTime(data->solverscip);
558  *nlpiterations = SCIPgetNLPIterations(data->solverscip);
559  *nnodes = SCIPgetNNodes(data->solverscip);
560 
561  return SCIP_OKAY;
562 }
563 
564 /** stops the concurrent solver as soon as possible */
565 static
566 SCIP_DECL_CONCSOLVERSTOP(concsolverScipStop)
567 {
568  SCIP_CONCSOLVERDATA* data;
569  assert(concsolver != NULL);
570 
571  data = SCIPconcsolverGetData(concsolver);
572  assert(data != NULL);
573 
574  SCIP_CALL( SCIPinterruptSolve(data->solverscip) );
575 
576  return SCIP_OKAY;
577 }
578 
579 /** writes new solutions and global boundchanges to the iven synchronization data */
580 static
581 SCIP_DECL_CONCSOLVERSYNCWRITE(concsolverScipSyncWrite)
582 {
583  int i;
584  int nsols;
585  SCIP_SOL** sols;
586  SCIP_CONCSOLVERDATA* data;
587  SCIP_BOUNDSTORE* boundstore;
588  int concsolverid;
589  SCIP_STATUS solverstatus;
590 
591  data = SCIPconcsolverGetData(concsolver);
592  assert(data != NULL);
593  concsolverid = SCIPconcsolverGetIdx(concsolver);
594  solverstatus = SCIPgetStatus(data->solverscip);
595 
596  SCIPsyncdataSetStatus(syncdata, solverstatus, concsolverid);
597  SCIPsyncdataSetLowerbound(syncdata, SCIPgetDualbound(data->solverscip));
598  SCIPsyncdataSetUpperbound(syncdata, SCIPgetPrimalbound(data->solverscip));
599 
600  *nsolsshared = 0;
601 
602  if( SCIPsyncdataGetStatus(syncdata) != SCIP_STATUS_UNKNOWN )
603  return SCIP_OKAY;
604 
605  SCIPdebugMessage("syncing in concurrent solver %s\n", SCIPconcsolverGetName(concsolver));
606 
607  /* consider at most maxcandsols many solutions, and since
608  * the solution array is sorted, we will cosider the best
609  * solutions
610  */
611  nsols = SCIPgetNSols(data->solverscip);
612  nsols = MIN(nsols, maxcandsols);
613  sols = SCIPgetSols(data->solverscip);
614 
615  for( i = 0; i < nsols; ++i )
616  {
617  if( SCIPIsConcurrentSolNew(data->solverscip, sols[i]) )
618  {
619  SCIP_Real solobj;
620  SCIP_Real* solvals;
621 
622  solobj = SCIPgetSolOrigObj(data->solverscip, sols[i]);
623 
624  SCIPdebugMessage("adding sol to spi in concurrent solver %s\n", SCIPconcsolverGetName(concsolver));
625  SCIPsyncdataGetSolutionBuffer(syncstore, syncdata, solobj, concsolverid, &solvals);
626 
627  /* if syncstore has no place for this solution we can stop since the next solution will have
628  * a worse objective value and thus won't be accepted either
629  */
630  if( solvals == NULL )
631  break;
632 
633  ++(*nsolsshared);
634  SCIP_CALL( SCIPgetSolVals(data->solverscip, sols[i], data->nvars, data->vars, solvals) );
635 
636  /* if we have added the maximum number of solutions we can also stop */
637  if( *nsolsshared == maxsharedsols )
638  break;
639  }
640  }
641 
642  boundstore = SCIPgetConcurrentGlobalBoundChanges(data->solverscip);
643 
644  if( boundstore != NULL )
645  SCIP_CALL( SCIPsyncdataAddBoundChanges(syncstore, syncdata, boundstore) );
646 
647  SCIPsyncdataAddMemTotal(syncdata, SCIPgetMemTotal(data->solverscip));
648 
649  return SCIP_OKAY;
650 }
651 
652 /** reads the solutions and bounds from the given synchronization data */
653 static
654 SCIP_DECL_CONCSOLVERSYNCREAD(concsolverScipSyncRead)
655 { /*lint --e{715}*/
656  int i;
657  int nsols;
658  SCIP_Real** solvals;
659  SCIP_CONCSOLVERDATA* data;
660  SCIP_BOUNDSTORE* boundstore;
661  int* concsolverids;
662  int concsolverid;
663  int nbndchgs;
664 
665  data = SCIPconcsolverGetData(concsolver);
666  assert(data != NULL);
667 
668  concsolverid = SCIPconcsolverGetIdx(concsolver);
669 
670  /* get solutions from synchronization data */
671  SCIPsyncdataGetSolutions(syncdata, &solvals, &concsolverids, &nsols);
672  *nsolsrecvd = 0;
673 
674  for( i = 0; i < nsols; ++i )
675  {
676  SCIP_SOL* newsol;
677 
678  /* do not add own solutions */
679  if( concsolverids[i] == concsolverid )
680  continue;
681 
682  /* solution is from other solver so translate to this solvers variable space
683  * and add it to the SCIP
684  */
685  ++(*nsolsrecvd);
686  SCIP_CALL( SCIPcreateOrigSol(data->solverscip, &newsol, NULL) );
687 
688  SCIP_CALL( SCIPsetSolVals(data->solverscip, newsol, data->nvars, data->vars, solvals[i]) );
689  SCIPdebugMessage("adding solution in concurrent solver %s\n", SCIPconcsolverGetName(concsolver));
690  SCIP_CALL( SCIPaddConcurrentSol(data->solverscip, newsol) );
691  }
692 
693  /* get bound changes from the synchronization data and add it to this
694  * concurrent solvers SCIP
695  */
696  *ntighterbnds = 0;
697  *ntighterintbnds = 0;
698  boundstore = SCIPsyncdataGetBoundChgs(syncdata);
699  nbndchgs = SCIPboundstoreGetNChgs(boundstore);
700 
701  for( i = 0; i < nbndchgs; ++i )
702  {
703  SCIP_VAR* var;
704  SCIP_BOUNDTYPE boundtype;
705  SCIP_Real newbound;
706 
707  var = data->vars[SCIPboundstoreGetChgVaridx(boundstore, i)];
708  boundtype = SCIPboundstoreGetChgType(boundstore, i);
709  newbound = SCIPboundstoreGetChgVal(boundstore, i);
710 
711  SCIP_CALL( SCIPvarGetProbvarBound(&var, &newbound, &boundtype) );
712 
713  /* cannot change bounds of multi-aggregated variables so dont pass this bound-change to the propagator */
715  return SCIP_OKAY;
716 
717  /* if bound is not better than also don't pass this bound to the propagator and
718  * don't waste memory for storing this boundchange
719  */
720  if( boundtype == SCIP_BOUNDTYPE_LOWER && SCIPisGE(data->solverscip, SCIPvarGetLbGlobal(var), newbound) )
721  return SCIP_OKAY;
722 
723  if( boundtype == SCIP_BOUNDTYPE_UPPER && SCIPisLE(data->solverscip, SCIPvarGetUbGlobal(var), newbound) )
724  return SCIP_OKAY;
725 
726  /* bound is better so incremented counters for statistics and pass it to the sync propagator */
727  ++(*ntighterbnds);
728 
730  ++(*ntighterintbnds);
731 
732  SCIP_CALL( SCIPaddConcurrentBndchg(data->solverscip, var, newbound, boundtype) );
733  }
734 
735  return SCIP_OKAY;
736 }
737 
738 
739 /** creates the concurrent SCIP solver plugins and includes them in SCIP */
741  SCIP* scip /**< SCIP datastructure */
742  )
743 {
745 
746  assert(scip != NULL);
747 
748  /* include concurrent solvers for SCIP for all emphasis settings and without an emphasis setting.
749  * For the SCIP without an emphasis setting we set the default preferred priority to 1 and for the other types to 0
750  * so that the default concurent solve will use multiple SCIP's using settings as specified by the user in the main SCIP
751  */
752  SCIP_CALL( SCIPallocMemory(scip, &data) );
753  data->loademphasis = FALSE;
754  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip", 1.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
755  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
756  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
757 
758  SCIP_CALL( SCIPallocMemory(scip, &data) );
759  data->loademphasis = TRUE;
760  data->emphasis = SCIP_PARAMEMPHASIS_DEFAULT;
761  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-default", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
762  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
763  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
764 
765  SCIP_CALL( SCIPallocMemory(scip, &data) );
766  data->loademphasis = TRUE;
767  data->emphasis = SCIP_PARAMEMPHASIS_CPSOLVER;
768  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-cpsolver", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
769  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
770  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
771 
772  SCIP_CALL( SCIPallocMemory(scip, &data) );
773  data->loademphasis = TRUE;
774  data->emphasis = SCIP_PARAMEMPHASIS_EASYCIP;
775  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-easycip", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
776  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
777  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
778 
779  SCIP_CALL( SCIPallocMemory(scip, &data) );
780  data->loademphasis = TRUE;
781  data->emphasis = SCIP_PARAMEMPHASIS_FEASIBILITY;
782  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-feas", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
783  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
784  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
785 
786  SCIP_CALL( SCIPallocMemory(scip, &data) );
787  data->loademphasis = TRUE;
788  data->emphasis = SCIP_PARAMEMPHASIS_HARDLP;
789  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-hardlp", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
790  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
791  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
792 
793  SCIP_CALL( SCIPallocMemory(scip, &data) );
794  data->loademphasis = TRUE;
795  data->emphasis = SCIP_PARAMEMPHASIS_OPTIMALITY;
796  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-opti", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
797  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
798  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
799 
800  SCIP_CALL( SCIPallocMemory(scip, &data) );
801  data->loademphasis = TRUE;
802  data->emphasis = SCIP_PARAMEMPHASIS_COUNTER;
803  SCIP_CALL( SCIPincludeConcsolverType(scip, "scip-counter", 0.0, concsolverScipCreateInstance, concsolverScipDestroyInstance, concsolverScipInitSeeds,
804  concsolverScipExec, concsolverGetSolvingData, concsolverScipStop, concsolverScipSyncWrite,
805  concsolverScipSyncRead, concsolverTypeScipFreeData, data) );
806 
807  return SCIP_OKAY;
808 }
void SCIPeventhdlrSetData(SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: event.c:334
#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:556
struct SCIP_ConcSolverTypeData SCIP_CONCSOLVERTYPEDATA
#define NULL
Definition: def.h:253
#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:1254
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:10466
SCIP_STATUS SCIPgetStatus(SCIP *scip)
Definition: scip_general.c:466
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
Definition: scip_solve.c:3399
SCIP_RETCODE SCIPgetStringParam(SCIP *scip, const char *name, char **value)
Definition: scip_param.c:335
static SCIP_DECL_CONCSOLVERTYPEFREEDATA(concsolverTypeScipFreeData)
#define SCIP_MAXSTRLEN
Definition: def.h:274
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:138
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
Definition: scip_param.c:240
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:314
int SCIPgetNVars(SCIP *scip)
Definition: scip_prob.c:1987
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip_timing.c:359
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip_message.c:215
#define FALSE
Definition: def.h:73
char * SCIPconcsolverGetName(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:290
SCIP_EXPORT SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2553
SCIP_EXPORT SCIP_RETCODE SCIPvarGetProbvarBound(SCIP_VAR **var, SCIP_Real *bound, SCIP_BOUNDTYPE *boundtype)
Definition: var.c:11963
SCIP_EXPORT SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
Definition: var.c:16903
#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:53
const char * SCIPparamGetName(SCIP_PARAM *param)
Definition: paramset.c:641
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip_solve.c:2535
datastructures for concurrent solvers
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3078
public methods for problem variables
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip_mem.h:95
#define SCIPdebugMessage
Definition: pub_message.h:77
SCIP_EXPORT SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
Definition: var.c:16857
SCIP_Longint SCIPgetMemTotal(SCIP *scip)
Definition: scip_mem.c:103
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:123
#define BMSfreeMemory(ptr)
Definition: memory.h:135
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip_mem.h:78
void SCIPconcsolverSetData(SCIP_CONCSOLVER *concsolver, SCIP_CONCSOLVERDATA *data)
Definition: concsolver.c:279
SCIP_RETCODE SCIPcopy(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *suffix, SCIP_Bool global, SCIP_Bool enablepricing, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip_copy.c:2550
public methods for numerical tolerances
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
Definition: scip_heur.c:248
static SCIP_DECL_CONCSOLVERSYNCWRITE(concsolverScipSyncWrite)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip_sol.c:319
SCIP_PARAM ** SCIPgetParams(SCIP *scip)
Definition: scip_param.c:986
static SCIP_RETCODE initConcsolver(SCIP *scip, SCIP_CONCSOLVER *concsolver)
public methods for querying solving statistics
int SCIPgetNSols(SCIP *scip)
Definition: scip_sol.c:2205
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:324
SCIP_Longint SCIPgetNNodes(SCIP *scip)
public methods for handling parameter settings
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:282
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:140
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:357
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:276
SCIP_VAR ** SCIPgetVars(SCIP *scip)
Definition: scip_prob.c:1942
void SCIPsyncdataSetStatus(SCIP_SYNCDATA *syncdata, SCIP_STATUS status, int solverid)
Definition: syncstore.c:633
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip_mem.c:47
the interface of the boundstore structure
public methods for problem copies
public methods for primal CIP solutions
#define SCIP_CALL(x)
Definition: def.h:365
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
Definition: scip_param.c:670
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:375
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:1254
#define SCIP_Bool
Definition: def.h:70
SCIP_RETCODE SCIPaddSolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool *stored)
Definition: scip_sol.c:3014
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:2891
static SCIP_DECL_EVENTEXEC(eventExecSync)
enum SCIP_Status SCIP_STATUS
Definition: type_stat.h:58
SCIP_EXPORT SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Definition: var.c:17362
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:869
#define MIN(x, y)
Definition: def.h:223
SCIP_RETCODE SCIPcopyConcurrentSolvingStats(SCIP *source, SCIP *target)
Definition: concurrent.c:526
int SCIPgetNParams(SCIP *scip)
Definition: scip_param.c:1000
SCIP_CONCSOLVERDATA * SCIPconcsolverGetData(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:269
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:94
helper functions for concurrent scip solvers
enum SCIP_ParamEmphasis SCIP_PARAMEMPHASIS
Definition: type_paramset.h:73
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_sol.c:1389
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:612
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:154
SCIP_RETCODE SCIPreadParams(SCIP *scip, const char *filename)
Definition: scip_param.c:760
SCIP_BOUNDSTORE * SCIPsyncdataGetBoundChgs(SCIP_SYNCDATA *syncdata)
Definition: syncstore.c:609
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip_sol.c:2254
SCIP_RETCODE SCIPprintStatus(SCIP *scip, FILE *file)
Definition: scip_general.c:489
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip_event.c:310
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
SCIP_EXPORT SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
Definition: var.c:17352
static SCIP_DECL_CONCSOLVERDESTROYINST(concsolverScipDestroyInstance)
public methods for message output
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10263
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2925
#define EVENTHDLR_NAME
#define SCIP_Real
Definition: def.h:164
SCIP_RETCODE SCIPaddSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *stored)
Definition: scip_sol.c:2924
public methods for message handling
#define BMSallocMemory(ptr)
Definition: memory.h:109
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:438
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:159
#define nnodes
Definition: gastrans.c:65
#define EVENTHDLR_DESC
public methods for primal heuristics
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:314
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip_message.c:198
#define SCIP_EVENTTYPE_SYNC
Definition: type_event.h:100
SCIP_BOUNDTYPE SCIPboundstoreGetChgType(SCIP_BOUNDSTORE *boundstore, int i)
Definition: boundstore.c:164
#define SCIP_ALLOC(x)
Definition: def.h:376
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:2304
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:496
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:17035
SCIP_RETCODE SCIPsetEventhdlrExit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXIT((*eventexit)))
Definition: scip_event.c:168
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:1435
memory allocation routines