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