53#include "objscip/objscip.h"
66#ifdef UG_DEBUG_SOLUTION
67#ifndef WITH_DEBUG_SOLUTION
68#define WITH_DEBUG_SOLUTION
70#include "scip/debug.h"
71#include "scip/struct_scip.h"
72#include "scip/struct_set.h"
78#if ( defined(_COMM_PTH) || defined(_COMM_CPP11) )
91#define CONFLICTHDLR_NAME "conflictCollector"
92#define CONFLICTHDLR_DESC "conflict handler to collect conflicts"
93#define CONFLICTHDLR_PRIORITY +100000000
102 assert(conflicthdlr != NULL);
104 assert(bdchginfos != NULL || nbdchginfos == 0);
105 assert(result != NULL);
110 *result = SCIP_DIDNOTRUN;
114 *result = SCIP_DIDNOTFIND;
117 SCIP_CALL( SCIPallocBufferArray(scip, &vars, nbdchginfos) );
118 SCIP_CALL( SCIPallocBufferArray(scip, &vals, nbdchginfos) );
120 for( i = 0; i < nbdchginfos; ++i )
122 assert(bdchginfos != NULL);
124 vars[i] = SCIPbdchginfoGetVar(bdchginfos[i]);
128 if( !SCIPvarIsBinary(vars[i]) )
132 if( SCIPbdchginfoGetNewbound(bdchginfos[i]) < 0.5 )
141 if( i == nbdchginfos )
146 localNodeInfo->
linearRhs = SCIPinfinity(scip);
149 localNodeInfo->
linearCoefs =
new double[nbdchginfos];
150 for( i = 0; i < nbdchginfos; ++i )
152 SCIP_VAR *transformVar = vars[i];
153 SCIP_Real scalar = vals[i];
154 SCIP_Real constant = 0.0;
155 if( SCIPvarGetOrigvarSum(&transformVar, &scalar, &constant ) == SCIP_INVALIDDATA )
176 if( i == nbdchginfos )
179 conflictConsList->push_back(localNodeInfo);
185 delete localNodeInfo;
190 SCIPfreeBufferArray(scip, &vals);
191 SCIPfreeBufferArray(scip, &vars);
197ScipParaSolver::setWinnerRacingParams(
203 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
208 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
209 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
210 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
213#if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) )
225#if SCIP_VERSION >= 320
241 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
251 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"randomization/permutationseed", scipRacingParams->
getPermuteProbSeed()) );
281 switch( nHeuristics )
285 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
290 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
295 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_FAST, TRUE) );
300 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_OFF, TRUE) );
306 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"heuristics/ObjLim/freq", 1) );
308 switch( nPresolving )
312 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
320 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
324 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
327 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
333 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_FAST, TRUE) );
338 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_OFF, TRUE) );
345 switch( nSeparating )
349 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
357 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
363 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
364 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
368 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
374 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
375 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
379 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
386 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_FAST, TRUE) );
391 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_OFF, TRUE) );
399 assert(SCIPgetStage(
scip) <= SCIP_STAGE_TRANSFORMED);
401#if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) )
414 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"branching/random/maxdepth", 2) );
415 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"branching/random/priority", 100000) );
423 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"randomization/permutationseed", scipRacingParams->
getPermuteProbSeed()) );
431#if SCIP_VERSION >= 320
447#ifdef UG_DEBUG_SOLUTION
448 if(
scip->set->debugsoldata == NULL )
450 SCIP_CALL_ABORT( SCIPdebugSolDataCreate(&((
scip->set)->debugsoldata)));
480 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_OFF, TRUE) );
487 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
517#if SCIP_APIVERSION >= 163
518 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"symmetries/enabled", FALSE ) );
520 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"misc/usesymmetry", 0 ) );
523#if SCIP_VERSION >= 320
531 SCIP_VAR **orgVars = SCIPgetOrigVars(
scip);
532 int nOrg = SCIPgetNOrigVars(
scip);
533 if( scipParaDiffSubproblem )
543 if( scipParaDiffSubproblem->
getBoundType(v) == SCIP_BOUNDTYPE_LOWER )
557 else if (scipParaDiffSubproblem->
getBoundType(v) == SCIP_BOUNDTYPE_UPPER)
559 SCIP_CALL_ABORT(SCIPchgVarUbGlobal(
585 if( scipParaDiffSubproblem->
getIndex(v) < nOrg )
587 if( scipParaDiffSubproblem->
getBoundType(v) == SCIP_BOUNDTYPE_LOWER )
592 orgVars[scipParaDiffSubproblem->
getIndex(v)],
597 assert(SCIPisEQ(
scip,SCIPvarGetLbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)]),scipParaDiffSubproblem->
getBranchBound(v)));
598 assert(SCIPisLE(
scip,SCIPvarGetLbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)]),SCIPvarGetUbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)])));
601 else if (scipParaDiffSubproblem->
getBoundType(v) == SCIP_BOUNDTYPE_UPPER)
603 SCIP_CALL_ABORT(SCIPchgVarUbGlobal(
605 orgVars[scipParaDiffSubproblem->
getIndex(v)],
610 assert(SCIPisEQ(
scip,SCIPvarGetUbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)]),scipParaDiffSubproblem->
getBranchBound(v)));
611 assert(SCIPisLE(
scip,SCIPvarGetLbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)]),SCIPvarGetUbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)])));
621 std::cout <<
"fixing branching variable index = " << scipParaDiffSubproblem->
getIndex(v) <<
" is omitted!" << std::endl;
641 char consname[SCIP_MAXSTRLEN];
651 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, nVars) );
652 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vals, nVars) );
656 for(
int v = 0; v < nVars; ++v )
664 for(
int v = 0; v < nVars; ++v )
673 SCIP_CALL_ABORT( SCIPcreateConsLinear(
scip, &cons, consname, nVars, vars, vals,
675 TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) );
679 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
682 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
684 SCIPfreeBufferArray(
scip, &vals);
685 SCIPfreeBufferArray(
scip, &vars);
696 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, nVars) );
700 for(
int v = 0; v < nVars; ++v )
707 for(
int v = 0; v < nVars; ++v )
718 SCIP_CALL_ABORT( SCIPcreateConsSetpart(
scip, &cons, consname, nVars, vars,
719 TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE ) );
722 SCIP_CALL_ABORT( SCIPcreateConsSetpack(
scip, &cons, consname, nVars, vars,
723 TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE ) );
726 SCIP_CALL_ABORT( SCIPcreateConsSetcover(
scip, &cons, consname, nVars, vars,
727 TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE ) );
733 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
736 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
738 SCIPfreeBufferArray(
scip, &vars);
752 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, nVars) );
753 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vals, nVars) );
757 for(
int v = 0; v < nVars; ++v )
765 for(
int v = 0; v < nVars; ++v )
773 (void) SCIPsnprintf(consname, SCIP_MAXSTRLEN,
"cli%d", i);
774 SCIP_CALL_ABORT( SCIPcreateConsLinear(
scip, &cons, consname, nVars, vars, vals,
776 TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) );
780 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
783 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
785 SCIPfreeBufferArray(
scip, &vals);
786 SCIPfreeBufferArray(
scip, &vars);
801 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, nVars) );
802 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vals, nVars) );
806 for(
int v = 0; v < nVars; ++v )
814 for(
int v = 0; v < nVars; ++v )
822 (void) SCIPsnprintf(consname, SCIP_MAXSTRLEN,
"cli%d", i);
823 SCIP_CALL_ABORT( SCIPcreateConsLinear(
scip, &cons, consname, nVars, vars, vals,
825 TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) );
829 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
832 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
834 SCIPfreeBufferArray(
scip, &vals);
835 SCIPfreeBufferArray(
scip, &vars);
847 SCIP_BOUNDTYPE *types;
851 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, nVars) );
852 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &types, nVars) );
853 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &bounds, nVars) );
857 for(
int v = 0; v < nVars; ++v )
866 for(
int v = 0; v < nVars; ++v )
875 (void) SCIPsnprintf(consname, SCIP_MAXSTRLEN,
"bdj%d", i);
876 SCIP_CALL_ABORT( SCIPcreateConsBounddisjunction(
scip, &cons, consname, nVars, vars, types, bounds,
888 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
891 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
893 SCIPfreeBufferArray(
scip, &bounds);
894 SCIPfreeBufferArray(
scip, &types);
895 SCIPfreeBufferArray(
scip, &vars);
904 if( addingConsParam != 0 )
907 || addingConsParam == 2 || addingConsParam == 3 )
910 int nvars = SCIPgetNVars(
scip);
911 SCIP_VAR **vars = SCIPgetVars(
scip);
912 SCIP_Real* vals =
new SCIP_Real[nvars];
913 for(
int v = 0; v < nvars; ++v )
915 vals[v] = SCIPvarGetObj(vars[v]);
917 SCIP_CALL_ABORT( SCIPcreateConsLinear(
scip, &cons,
"objective", nvars, vars, vals, dualBoundValue, SCIPinfinity(
scip),
918 TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) );
919 assert( SCIPisEQ(
scip, SCIPgetTransObjscale(
scip), 1.0 ) );
920 assert( SCIPisZero(
scip, SCIPgetTransObjoffset(
scip) ) );
925 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
926 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
943 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"misc/transsolsorig", FALSE) );
945 if( SCIPgetStage(
scip) == SCIP_STAGE_PROBLEM)
947 SCIP_CALL_ABORT( SCIPtransformProb(
scip));
952 orgVars = SCIPgetOrigVars(
scip);
993#if SCIP_VERSION >= 312
996 if( scipParaDiffSubproblem && scipParaDiffSubproblem->
getNVarValueVars() > 0 )
998 orgVars = SCIPgetOrigVars(
scip);
1135 SCIP_CALL_ABORT( SCIPfreeTransform(
scip) );
1172 SCIP_VAR **orgVars = SCIPgetOrigVars(
scip);
1178 for(
int v = 0; v <
nOrgVars; v++ )
1180 SCIP_CALL_ABORT( SCIPchgVarLbGlobal(
scip,orgVars[v],
orgVarLbs[v] ) );
1181 SCIP_CALL_ABORT( SCIPchgVarUbGlobal(
scip,orgVars[v],
orgVarUbs[v] ) );
1205 SCIP_SOL *sol = SCIPgetBestSol(
scip);
1206 int nVars = SCIPgetNOrigVars(
scip);
1207 SCIP_VAR **vars = SCIPgetOrigVars(
scip);
1208 SCIP_Real *vals =
new SCIP_Real[nVars];
1209 SCIP_CALL_ABORT( SCIPgetSolVals(
scip, sol, nVars, vars, vals) );
1212 SCIP_VAR **varsInOrig =
new SCIP_VAR*[nVars];
1213 SCIP_Real *valsInOrig =
new SCIP_Real[nVars]();
1214 int nVarsInOrig = 0;
1215 for(
int i = 0; i < nVars; i++ )
1219 varsInOrig[nVarsInOrig] = vars[i];
1220 valsInOrig[nVarsInOrig] = vals[i];
1225 scipParaComm->createScipParaSolution(
1227 SCIPgetSolOrigObj(
scip, sol),
1233 delete [] varsInOrig;
1234 delete [] valsInOrig;
1239 scipParaComm->createScipParaSolution(
1241 SCIPgetSolOrigObj(
scip, sol),
1264 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/gap", 0.0 ) );
1265 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/absgap", 0.0 ) );
1270#if SCIP_APIVERSION < 61
1271 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"numerics/lpfeastol",
orgLpfeastol / 10.0) );
1276 if( SCIPsumepsilon(
scip) > feastol )
1278 if( SCIPepsilon(
scip) > feastol )
1280 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"numerics/epsilon", feastol) );
1283 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"numerics/sumepsilon", feastol) );
1286 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"numerics/feastol", feastol) );
1296 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"misc/catchctrlc", FALSE) );
1299#ifdef UG_DEBUG_SOLUTION
1300 const double limit = DBL_MAX;
1303 SCIP_CALL_ABORT( SCIPsetObjlimit(
scip, limit) );
1327#if SCIP_APIVERSION >= 163
1328 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"symmetries/enabled", FALSE ) );
1330 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"misc/usesymmetry", 0 ) );
1333 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
1336#ifdef UG_DEBUG_SOLUTION
1341 SCIPdebugSolEnable(
scip);
1342 std::cout <<
"R." <<
paraComm->
getRank() <<
": enable debug" << std::endl;
1343 assert( SCIPdebugSolIsEnabled(
scip) == TRUE );
1347 SCIPdebugSolDisable(
scip);
1348 std::cout <<
"R." <<
paraComm->
getRank() <<
": disable debug" << std::endl;
1349 assert( SCIPdebugSolIsEnabled(
scip) == FALSE );
1353#if (SCIP_VERSION >= 700)
1358 SCIP_CALL_ABORT( SCIPsetCharParam(
scip,
"estimation/restarts/restartpolicy",
'n' ) );
1366 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
1367 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
1370#if SCIP_APIVERSION >= 101
1371 if( SCIPgetParam(
scip,
"presolving/milp/threads") != NULL )
1373 int nmilpthreads = 0;
1374 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/milp/threads", &nmilpthreads) );
1375 assert( nmilpthreads == 1 );
1382 SCIP_RETCODE ret = SCIPsolve(
scip);
1383 if( ret != SCIP_OKAY )
1385#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
1386 SCIPprintError(ret, NULL);
1388 SCIPprintError(ret);
1400 std::cout <<
"ret = " << (int)ret << std::endl;
1411 SCIP_STATUS status = SCIPgetStatus(
scip);
1413#if SCIP_APIVERSION >= 101
1418 if( status == SCIP_STATUS_OPTIMAL )
1422 if( selfSplitNodesel->inSampling() && status == SCIP_STATUS_OPTIMAL )
1438 if( SCIPgetNSols(
scip) > 0 )
1445#ifdef UG_DEBUG_SOLUTION
1446 if( status != SCIP_STATUS_OPTIMAL )
1448 if( SCIPdebugSolIsEnabled(
scip) &&
1453 std::cout <<
"R" <<
paraComm->
getRank() <<
" solver lost optimal solution." << std::endl;
1454 throw "Optimal solution lost!";
1467 if( status == SCIP_STATUS_OPTIMAL ||
1468 status == SCIP_STATUS_GAPLIMIT )
1515 else if( status == SCIP_STATUS_INFEASIBLE )
1528 if( status == SCIP_STATUS_NODELIMIT )
1530 throw "SCIP terminated with SCIP_STATUS_NODELIMIT";
1532 else if( status == SCIP_STATUS_TOTALNODELIMIT )
1534 throw "SCIP terminated with SCIP_STATUS_TOTALNODELIMIT";
1536 else if( status == SCIP_STATUS_STALLNODELIMIT )
1538 throw "SCIP terminated with SCIP_STATUS_STALLNODELIMIT";
1540 else if( status == SCIP_STATUS_TIMELIMIT )
1550 else if( status == SCIP_STATUS_MEMLIMIT )
1554 else if( status == SCIP_STATUS_SOLLIMIT )
1556 throw "SCIP terminated with SCIP_STATUS_SOLLIMIT";
1558 else if( status == SCIP_STATUS_BESTSOLLIMIT )
1560 throw "SCIP terminated with SCIP_STATUS_BESTSOLLIMIT";
1562 else if( status == SCIP_STATUS_USERINTERRUPT && SCIPisObjIntegral(
scip) )
1573 else if( status == SCIP_STATUS_USERINTERRUPT )
1612 for(
int i = 0; i < nConfilcts; i++ )
1623#if SCIP_APIVERSION >= 101
1627 int numnodesels = SCIPgetNNodesels(
scip );
1628 SCIP_NODESEL** nodesels = SCIPgetNodesels(
scip );
1630 for( i = 0; i < numnodesels; ++i )
1632 std::string nodeselname(SCIPnodeselGetName(nodesels[i]));
1633 if( std::string(nodeselname) == std::string(
"ScipParaObjSelfSplitNodeSel") )
1638 assert( i != numnodesels );
1639 SCIP_CALL_ABORT( SCIPsetNodeselStdPriority(
scip, nodesels[i], -INT_MAX/4 ) );
1649 if( SCIPgetStage(
scip) == SCIP_STAGE_SOLVING || SCIPgetStage(
scip) == SCIP_STAGE_SOLVED )
1651 return SCIPgetNTotalNodes(
scip);
1663 if( SCIPgetStage(
scip) == SCIP_STAGE_SOLVING || SCIPgetStage(
scip) == SCIP_STAGE_SOLVED )
1665 return SCIPgetNNodesLeft(
scip);
1669 if( SCIPgetStage(
scip) >= SCIP_STAGE_PRESOLVING && SCIPgetStage(
scip) <= SCIP_STAGE_INITSOLVE )
1684 if( SCIPgetStage(
scip) == SCIP_STAGE_PRESOLVING || SCIPgetStage(
scip) == SCIP_STAGE_INITSOLVE )
1690 return SCIPgetDualbound(
scip);
1702 ) : BbParaSolver(argc, argv, inNhanders,
comm, inParaParamSet, inParaInstance, inDetTimer),
1705 originalParamSet(0),
1706 conflictConsList(0),
1710#if SCIP_APIVERSION >= 101
1711 selfSplitNodesel(0),
1714 interruptMsgMonitor(0),
1715 nPreviousNodesLeft(0),
1716 originalPriority(0),
1718 nOrgVarsInSolvers(0),
1723 mapToOriginalIndecies(0),
1724 mapToSolverLocalIndecies(0),
1725 mapToProbIndecies(0),
1738 miscAllowdualreds(0),
1745 collectingModeIsProhibited(false),
1749 copyIncreasedVariables(false)
1755 char* logname = NULL;
1764 SCIP_CALL_ABORT( SCIPcreate(&
scip) );
1765 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
1769 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
1776 SCIP_CALL_ABORT( SCIPincludeDefaultPlugins(
scip) );
1784 SCIP_CALL_ABORT( SCIPincludeObjHeur(
scip, updator, TRUE) );
1799 SCIP_CALL_ABORT( SCIPincludeObjNodesel(
scip,
nodesel, TRUE) );
1800#if SCIP_APIVERSION >= 101
1803 selfSplitNodesel =
new ScipParaObjSelfSplitNodesel(
1811 SCIP_CALL_ABORT( SCIPincludeObjNodesel(
scip, selfSplitNodesel, TRUE) );
1820 SCIP_CONFLICTHDLRDATA *conflictHdrData =
reinterpret_cast< SCIP_CONFLICTHDLRDATA *
>(
this);
1822#if SCIP_VERSION == 211 && SCIP_SUBVERSION == 0
1824 NULL, NULL, NULL, NULL, NULL, NULL, conflictExecCollector, conflictHdrData) );
1827 conflictExecCollector, conflictHdrData) );
1831 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/feastol", &
orgFeastol ) );
1832 if( SCIP_APIVERSION < 61 )
1834 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/lpfeastol", &
orgLpfeastol ) );
1840 for(
int i = 3; i < argc; ++i )
1842 if( strcmp(argv[i],
"-l") == 0 )
1852 else if( strcmp(argv[i],
"-q") == 0 )
1863#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
1865 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
1867 SCIPsetMessagehdlrQuiet(
scip, TRUE);
1872 if( logname != NULL ||
quiet )
1874 if( logname != NULL )
1876 std::ostringstream os;
1878 logfile = fopen(os.str().c_str(),
"a");
1885#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
1886 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
1889 SCIP_CALL_ABORT( SCIPmessagehdlrRelease(&
messagehdlr));
1899 int tempIsWarmStarted;
1905 int solutionExists = 0;
1907 if( solutionExists )
1923 for(
int i = 3; i < argc; ++i )
1926 if( strcmp(argv[i],
"-sl") == 0 )
1936 std::cerr <<
"missing settings filename after parameter '-sl'" << std::endl;
1940 else if ( strcmp(argv[i],
"-isol") == 0 )
1949 std::cerr <<
"missing settings filename after parameter '-isol'" << std::endl;
1955#if( !defined(UG_QUBO) && !defined(UG_SMOOTHIE) )
1978 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/epsilon", &epsilon));
2024#ifndef SCIP_EVENTTYPE_COMM
2048 ) : BbParaSolver(argc, argv, inNhanders,
comm, inParaParamSet, inParaInstance, inDetTimer),
2051 originalParamSet(0),
2052 conflictConsList(0),
2056#if SCIP_APIVERSION >= 101
2057 selfSplitNodesel(0),
2060 interruptMsgMonitor(0),
2061 originalPriority(0),
2064 nOrgVarsInSolvers(0),
2069 mapToOriginalIndecies(0),
2070 mapToSolverLocalIndecies(0),
2071 mapToProbIndecies(0),
2084 miscAllowdualreds(0),
2091 collectingModeIsProhibited(false),
2095 copyIncreasedVariables(false)
2102 char* logname = NULL;
2116 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
2121 SCIP_CALL_ABORT( SCIPcreate(&
scip) );
2122 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
2126 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
2128 SCIP_CALL_ABORT( SCIPincludeDefaultPlugins(
scip) );
2137 SCIP_CALL_ABORT( SCIPincludeObjHeur(
scip, updator, TRUE) );
2152 SCIP_CALL_ABORT( SCIPincludeObjNodesel(
scip,
nodesel, TRUE) );
2153#if SCIP_APIVERSION >= 101
2156 selfSplitNodesel =
new ScipParaObjSelfSplitNodesel(
2164 SCIP_CALL_ABORT( SCIPincludeObjNodesel(
scip, selfSplitNodesel, TRUE) );
2173 SCIP_CONFLICTHDLRDATA *conflictHdrData =
reinterpret_cast< SCIP_CONFLICTHDLRDATA *
>(
this);
2175#if SCIP_VERSION == 211 && SCIP_SUBVERSION == 0
2177 NULL, NULL, NULL, NULL, NULL, NULL, conflictExecCollector, conflictHdrData) );
2180 conflictExecCollector, conflictHdrData) );
2184 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/feastol", &
orgFeastol ) );
2185 if( SCIP_APIVERSION < 61 )
2187 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/lpfeastol", &
orgLpfeastol ) );
2193 for(
int i = 3; i < argc; ++i )
2195 if( strcmp(argv[i],
"-l") == 0 )
2205 else if( strcmp(argv[i],
"-q") == 0 )
2215#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2217 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
2219 SCIPsetMessagehdlrQuiet(
scip, TRUE );
2224 if( logname != NULL ||
quiet )
2227 if( logname != NULL )
2229 std::ostringstream os;
2231 logfile = fopen(os.str().c_str(),
"a");
2238#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2239 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
2242 SCIP_CALL_ABORT( SCIPmessagehdlrRelease(&
messagehdlr));
2253 int tempIsWarmStarted;
2260 int solutionExists = 0;
2267 int solutionExists = 0;
2269 if( solutionExists )
2286 for(
int i = 3; i < argc; ++i )
2289 if( strcmp(argv[i],
"-sl") == 0 )
2299 std::cerr <<
"missing settings filename after parameter '-sl'" << std::endl;
2303 else if ( strcmp(argv[i],
"-isol") == 0 )
2312 std::cerr <<
"missing settings filename after parameter '-isol'" << std::endl;
2318#if( !defined(UG_QUBO) && !defined(UG_SMOOTHIE) )
2334 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/epsilon", &epsilon));
2372#if ( defined(_COMM_PTH) || defined(_COMM_CPP11) )
2386#ifndef SCIP_EVENTTYPE_COMM
2415#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2418 SCIP_CALL_ABORT( SCIPsetDefaultMessagehdlr() );
2419 SCIP_CALL_ABORT( SCIPfreeObjMessagehdlr(&
messagehdlr) );
2428 SCIP_CALL_ABORT( SCIPfree(&
scip) );
2436 for(
int i = 0; i < nConfilcts; i++ )
2502 double detTime = -1.0;
2547 delete paraSolverTerminationState;
2558 const std::string& filename
2561 FILE *file = fopen(filename.c_str(),
"a");
2564 std::cout <<
"file : " << filename <<
"cannot open." << std::endl;
2567 SCIP_CALL_ABORT( SCIPprintTransProblem(
scip, file,
"cip", FALSE) );
2574 SCIP *backupScip =
scip;
2580 SCIP_CALL_ABORT( SCIPsolve(
scip) );
2592 if( SCIPgetStage(
scip) <= SCIP_STAGE_TRANSFORMING || SCIPgetStage(
scip) >= SCIP_STAGE_SOLVED )
2615 if( SCIPcreateOrigSol(
scip, &newsol, 0) != SCIP_OKAY )
2622 SCIP_VAR** vars = SCIPgetOrigVars(
scip);
2623 SCIP_Real* vals =
new SCIP_Real[tempSol->
getNVars()]();
2625 for(i = 0; i < tempSol->
getNVars(); i++ )
2633 if( probindex >= 0 )
2635 vals[probindex] = tempSol->
getValues()[i];
2642 SCIP_CALL_ABORT( SCIPsetSolVals(
scip, newsol, tempSol->
getNVars(), vars, vals) );
2654#if SCIP_VERSION == 211 && SCIP_SUBVERSION == 0
2655 if( SCIPgetStage(
scip) == SCIP_STAGE_TRANSFORMED || SCIPgetStage(
scip) == SCIP_STAGE_PRESOLVED )
2658 SCIPgetStage(
scip) == SCIP_STAGE_PRESOLVED ||
2659 SCIPgetStage(
scip) == SCIP_STAGE_INITPRESOLVE )
2663#if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) )
2664 SCIP_CALL_ABORT( SCIPtrySolFree(
scip, &newsol, FALSE, TRUE, TRUE, TRUE, &success) );
2666 SCIP_CALL_ABORT( SCIPtrySolFree(
scip, &newsol, FALSE, TRUE, TRUE, TRUE, TRUE, &success) );
2673 SCIP_CALL_ABORT( SCIPheurPassSolTrySol(
scip, SCIPfindHeur(
scip,
"trysol"), newsol) );
2674 SCIP_CALL_ABORT( SCIPfreeSol(
scip, &newsol) );
2688 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_FAST, TRUE) );
2689 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_FAST, TRUE) );
2690 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_FAST, TRUE) );
2701#if SCIP_VERSION >= 320
2713 std::string subcipprefix(
"SolverCip");
2714 std::string subcipfilename;
2715 std::ostringstream oss;
2718 subcipfilename = oss.str();
2719 subcipfilename +=
".cip";
2720 SCIP_CALL_ABORT( SCIPwriteOrigProblem(
scip, subcipfilename.c_str(),
"cip", FALSE) );
2721#ifdef UG_DEBUG_SOLUTION
2725 std::cout <<
"** " << subcipfilename <<
" contains optimal solution." << std::endl;
2729 std::cout <<
"** " << subcipfilename <<
" does NOT contain optimal solution." << std::endl;
2732 subcipfilename = oss.str();
2733 subcipfilename +=
"-t.cip";
2734 if( SCIPgetStage(
scip) >= SCIP_STAGE_TRANSFORMED )
2736 SCIP_CALL_ABORT( SCIPwriteTransProblem(
scip, subcipfilename.c_str(),
"cip", FALSE) );
2738 char name[SCIP_MAXSTRLEN];
2739 (void)SCIPsnprintf(name, SCIP_MAXSTRLEN,
"SolverCip%d.set",
paraComm->
getRank());
2740 SCIP_CALL_ABORT( SCIPwriteParams(
scip, name, TRUE, FALSE) );
2759 SCIP_VAR **vars = SCIPgetVars(
scip);
2771 for(
int v = 0; v <
nOrgVars ; v++ )
2785 for(
int v = 0; v <
nOrgVars; v++ )
2799 for(
int i = 0; i < SCIPgetNTotalVars(
scip); i++ )
2825 for(
int v = 0; v <
nOrgVars; v++ )
2837 for(
int v = 0; v <
nOrgVars; v++ )
2864 SCIP_CALL_ABORT( SCIPfree(&
scip) );
2878 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
2889 SCIP_CALL_ABORT( SCIPcreate(&
scip) );
2890 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
2894 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
2897 SCIP_CALL_ABORT( SCIPincludeDefaultPlugins(
scip) );
2906 SCIP_CALL_ABORT( SCIPincludeObjHeur(
scip, updator, TRUE) );
2921 SCIP_CALL_ABORT( SCIPincludeObjNodesel(
scip,
nodesel, TRUE) );
2930 SCIP_CONFLICTHDLRDATA *conflictHdrData =
reinterpret_cast< SCIP_CONFLICTHDLRDATA *
>(
this);
2932#if SCIP_VERSION == 211 && SCIP_SUBVERSION == 0
2934 NULL, NULL, NULL, NULL, NULL, NULL, conflictExecCollector, conflictHdrData) );
2937 conflictExecCollector, conflictHdrData) );
2944#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2946 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
2948 SCIPsetMessagehdlrQuiet(
scip, TRUE);
2956#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2957 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
2960 SCIP_CALL_ABORT( SCIPmessagehdlrRelease(&
messagehdlr));
3008 if( SCIPgetStage(
scip) != SCIP_STAGE_SOLVING )
3022#if SCIP_VERSION >= 320
3034 char *bakFileName = NULL;
3035 SCIP_CALL_ABORT( SCIPgetStringParam(
scip,
"visual/bakfilename", &bakFileName) );
3036 if( strcmp(bakFileName,
"-") != 0 )
3038 std::ostringstream os;
3040 SCIP_CALL_ABORT( SCIPsetStringParam(
scip,
"visual/bakfilename", os.str().c_str() ) );
3041 SCIP_CALL_ABORT( SCIPsetStringParam(
scip,
"visual/baknodeprefix", ((
currentTask->
getTaskId()).toString()+
":").c_str() ) );
3054 double tightenedBound;
3073 assert( SCIPisLE(
scip,
orgVarLbs[tightenedIdex], tightenedBound) &&
3076 SCIP_Var* var = SCIPvarGetTransVar(SCIPgetOrigVars(
scip)[tightenedIdex]);
3077 if( var && SCIPisLT(
scip,
tightenedVarLbs[tightenedIdex], tightenedBound) && SCIPvarGetStatus(var) != SCIP_VARSTATUS_MULTAGGR )
3096 double tightenedBound;
3115 assert( SCIPisLE(
scip,
orgVarLbs[tightenedIdex], tightenedBound) &&
3118 SCIP_Var* var = SCIPvarGetTransVar(SCIPgetOrigVars(
scip)[tightenedIdex]);
3119 if( var && SCIPisGT(
scip,
tightenedVarUbs[tightenedIdex], tightenedBound) && SCIPvarGetStatus(var) != SCIP_VARSTATUS_MULTAGGR )
3180 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/stuffing/maxrounds", &stuffingMaxrounds) );
3181 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/domcol/maxrounds", &domcolMaxrounds) );
3182#if ( SCIP_VERSION >= 322 || (SCIP_VERSION == 321 && SCIP_SUBVERSION >= 2) )
3183 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/dualcomp/maxrounds", &dualcompMaxrounds) );
3185 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/dualinfer/maxrounds", &dualinferMaxrounds) );
3188 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/abspower/dualpresolve", &abspowerDualpresolve) );
3189 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/and/dualpresolving", &andDualpresolving) );
3190 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/cumulative/dualpresolve", &cumulativeDualpresolve) );
3191 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/knapsack/dualpresolving", &knapsackDualpresolving) );
3192 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/dualpresolving", &linearDualpresolving) );
3193 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/setppc/dualpresolving", &setppcDualpresolving) );
3194 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/logicor/dualpresolving", &logicorDualpresolving) );
3198#if SCIP_APIVERSION > 34
3212 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/stuffing/maxrounds", 0) );
3213 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/domcol/maxrounds", 0) );
3214#if ( SCIP_VERSION >= 322 || (SCIP_VERSION == 321 && SCIP_SUBVERSION >= 2) )
3215 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/dualcomp/maxrounds", 0) );
3217 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/dualinfer/maxrounds", 0) );
3220 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/abspower/dualpresolve", FALSE) );
3221 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/and/dualpresolving", FALSE) );
3222 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/cumulative/dualpresolve", FALSE) );
3223 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/knapsack/dualpresolving", FALSE) );
3224 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/dualpresolving", FALSE) );
3225 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/setppc/dualpresolving", FALSE) );
3226 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/logicor/dualpresolving", FALSE) );
3230#if SCIP_APIVERSION > 34
3231 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"misc/allowstrongdualreds", FALSE) );
3233 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"misc/allowdualreds", FALSE) );
3244 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/stuffing/maxrounds", stuffingMaxrounds) );
3245 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/domcol/maxrounds", domcolMaxrounds) );
3246#if ( SCIP_VERSION >= 322 || (SCIP_VERSION == 321 && SCIP_SUBVERSION >= 2) )
3247 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/dualcomp/maxrounds", dualcompMaxrounds) );
3249 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/dualinfer/maxrounds", dualinferMaxrounds) );
3252 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/setppc/dualpresolving", setppcDualpresolving) );
3253 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/logicor/dualpresolving", logicorDualpresolving) );
3259#if SCIP_APIVERSION > 34
3270 SCIP_CALL_ABORT( SCIPinterruptSolve(
scip) );
#define DEF_BB_PARA_COMM(para_comm, comm)
Base class of communicator for UG Framework.
Base class for instance data.
Base class for BbParaNode.
This class contains solver termination state which is transferred form Solver to LC.
Base class for solver: Generic parallelized solver.
void setParametersInScip(SCIP *scip)
virtual int bcast(UG::ParaComm *comm, int root)=0
int getNBranchConsSetppcConss()
SCIP_BOUNDTYPE getBoundType(int i)
int getNVarsBoundDisjunction(int i)
SCIP_Real getBoundsBoundDisjunction(int i, int j)
SCIP_Real getBranchConsLinearLhs(int i)
ScipParaDiffSubproblemBranchLinearCons * getBranchLinearConss()
SCIP_Real getVarValueUpinfer(int i, int j)
SCIP_Real getBendersLinearCoefs(int i, int j)
int getNLinearCoefs(int i)
SCIP_Real getVarValueDownconflen(int i, int j)
int getBranchConsSetppcVars(int i, int j)
SCIP_Real getBranchConsLinearRhs(int i)
int getNBendersLinearCoefs(int i)
int getIdxLBranchStatsVars(int i)
SCIP_Real getBranchBound(int i)
SCIP_Real getLinearRhs(int i)
SCIP_Real getLinearLhs(int i)
SCIP_Real getLinearCoefs(int i, int j)
SCIP_Bool getFlagBoundDisjunctionModifiable(int i)
SCIP_Bool getFlagBoundDisjunctionLocal(int i)
SCIP_Real getDowninfer(int i)
SCIP_Real getVarValueDownvsids(int i, int j)
SCIP_Real getDowncutoff(int i)
SCIP_Real getUpconflen(int i)
int getNBendersLinearConss()
SCIP_Real getDownvsids(int i)
int getNVarValueValues(int i)
SCIP_Real getUpinfer(int i)
int getBranchConsLinearConsNames()
SCIP_Real getDownconflen(int i)
SCIP_Bool getFlagBoundDisjunctionEnforce(int i)
int getIdxBendersLinearCoefsVars(int i, int j)
SCIP_Bool getFlagBoundDisjunctionSeparate(int i)
int getIdxLinearCoefsVars(int i, int j)
int getNBoundDisjunctions()
SCIP_Bool getFlagBoundDisjunctionRemovable(int i)
int getBranchConsLinearIdxCoefsVars(int i, int j)
SCIP_Bool getFlagBoundDisjunctionDynamic(int i)
SCIP_Real getUppscost(int i)
SCIP_BOUNDTYPE getBoundTypesBoundDisjunction(int i, int j)
SCIP_Real getDownpscost(int i)
SCIP_Real getVarValueUpcutoff(int i, int j)
SCIP_Real getUpcutoff(int i)
SCIP_Real getBranchConsLinearCoefs(int i, int j)
SCIP_Real getUpvsids(int i)
int getIdxBoundDisjunctionVars(int i, int j)
int getBranchConsSetppcNVars(int i)
SCIP_Bool getFlagBoundDisjunctionInitial(int i)
int getNBranchConsLinearConss()
SCIP_Bool getFlagBoundDisjunctionCheck(int i)
SCIP_Real getVarValueDowninfer(int i, int j)
SCIP_Real getVarValueUpconflen(int i, int j)
SCIP_Bool getFlagBoundDisjunctionPropagate(int i)
SCIP_Real getVarValue(int i, int j)
ScipParaDiffSubproblemBranchSetppcCons * getBranchSetppcConss()
int getBranchConsSetppcType(int i)
int getBranchConsNLinearCoefs(int i)
SCIP_Real getBendersLinearLhs(int i)
int getBranchConsSetppcConsNames()
SCIP_Bool getFlagBoundDisjunctionStickingatnode(int i)
SCIP_Real getVarValueDowncutoff(int i, int j)
SCIP_Real getVarVlaueUpvsids(int i, int j)
SCIP_Real getBendersLinearRhs(int i)
virtual void setFileName(const char *fileName)=0
int * extractOrigProbIndexMap()
SCIP_Real getVarLb(int i)
int * extractSolverLocalIndexMap()
SCIP_Real getVarUb(int i)
void createProblem(SCIP *scip, int method, bool noPreprocessingInLC, bool usetRootNodeCuts, ScipDiffParamSet *scipDiffParamSetRoot, ScipDiffParamSet *scipDiffParamSet, char *settingsNameLC, char *isolname)
bool isOriginalIndeciesMap()
void setOriginalNodeSelectionStrategy()
void resetCommPointHdlr()
void addBoundChange(SCIP *scip, SCIP_BOUNDTYPE boundType, int index, SCIP_Real bound)
int getGenerateBranchOrderSeed()
int getScipRacingParamSeed()
ScipDiffParamSet * getScipDiffParamSet()
int indexAmongSolvers(int index)
void tryNewSolution(UG::ParaSolution *sol)
int lbBoundTightened(int source, int tag)
bool isCopyIncreasedVariables()
virtual void freeSubproblem()
virtual void createSubproblem()
void setLightWeightRootNodeProcess()
int getOriginalIndex(int index)
SCIP_Real * tightenedVarUbs
void solveToCheckEffectOfRootNodePreprocesses()
long long nPreviousNodesLeft
ScipParaSolver(int argc, char **argv, UG::ParaComm *comm, UG::ParaParamSet *paraParamSet, UG::ParaInstance *inParaInstance, UG::ParaDeterministicTimer *detTimer)
void setOriginalRootNodeProcess()
ScipDiffParamSet * originalParamSet
const char * problemFileName
void saveOriginalSettings()
SCIP_MESSAGEHDLR * messagehdlr
void saveOrgProblemBounds()
std::list< LocalNodeInfoPtr > * conflictConsList
void setOriginalNodeSelectionStrategy()
void setRacingParams(UG::ParaRacingRampUpParamSet *inRacingParams, bool winnerParam)
void saveOriginalPriority()
virtual ~ScipParaSolver()
void saveImprovedSolution()
ScipDiffParamSet * scipDiffParamSet
ScipParaObjNodesel * nodesel
ScipParaInterruptMsgMonitor * interruptMsgMonitor
interrupt message monitor
void setOriginalMaxRestart()
ScipUserPlugins * userPlugins
ScipParaObjCommPointHdlr * commPointHdlr
void setWinnerRacingParams(UG::ParaRacingRampUpParamSet *inRacingParams)
void recoverOriginalSettings()
bool copyIncreasedVariables
void dropSettingsForVariableBoundsExchnage()
int * mapToOriginalIndecies
void setUserPlugins(ScipUserPlugins *inUi)
int getOriginalMaxRestart()
unsigned int miscAllowdualreds
ScipParaObjProp * scipPropagator
void writeCurrentTaskProblem(const std::string &filename)
int ubBoundTightened(int source, int tag)
void prohibitCollectingMode()
static void runInterruptMsgMonitorThread(void *threadData)
int * mapToSolverLocalIndecies
SCIP_CONS * addedDualCons
std::list< LocalNodeInfoPtr > * getConflictConsList()
long long getNNodesSolved()
SCIP * scipToCheckEffectOfRootNodeProcesses
ScipDiffParamSet * scipDiffParamSetRoot
bool isOriginalIndeciesMap()
void issueInterruptSolve()
SCIP_Real * tightenedVarLbs
double getDualBoundValue()
void includeUserPlugins(SCIP *inScip)
virtual void writeSubproblem(SCIP *scip)
virtual void newSubproblem(SCIP *scip, const ScipParaDiffSubproblemBranchLinearCons *linearConss, const ScipParaDiffSubproblemBranchSetppcCons *setppcConss)
double getInitialDualBoundValue()
getter of initial dual bound value
double getDualBoundValue()
getter of dual bound value
class BbParaSolverTerminationState (Solver termination state in a ParaSolver)
int minNSolved
minimum number of subtree nodes rooted from ParaNode
bool restartingRacing
indicate that this solver is restarting racing
int maxNSolved
maximum number of subtree nodes rooted from ParaNode
bool isRacingInterruptRequested()
check if racing interrupt was requested or not
int nTransferredLocalCutsFromSolver
number of local cuts transferred from this Solver
int nTightened
the number of tightened variable bounds in racing
bool isCollectingAllNodes()
check if Solver is sending all nodes to LoadCoordinaor or not
int maxRestarts
maximum number of restarts
ParaTask * getCurrentNode()
get current ParaNode object
int totalNSolved
Counters related to this BbParaSolver.
ParaParamSet * getParaParamSet()
get ParaParamSet object
int nParaNodesSolvedAtRoot
number of ParaNodes solved at root node
bool lightWeightRootNodeComputation
indicate that fast root node computation is required
virtual void waitNotificationIdMessage()
wait notification id message to synchronized with LoadCoordinator
double maxRootNodeTime
maximum time consumed by root node process
virtual void sendLocalSolution()
send solution found in this Solver
double getGlobalBestIncumbentValue()
get global best incumbent value
virtual void iReceiveMessages()
non-blocking receive messages
int nSolvedWithNoPreprocesses
number of nodes solved when it is solved with no preprocesses
int totalNSent
accumulated number of nodes sent from this BbParaSolver
int minRestarts
minimum number of restarts
double solverDualBound
dual bound value achieved for a subproblem
int nTightenedInt
the number of tightened integral variable bounds in racing
int nTransferredBendersCutsFromSolver
number of benders cuts transferred from this Solver
bool isRacingStage()
check if Solver is in racing stage or not
double minRootNodeTime
minimum time consumed by root node process
int minTransferredLocalCutsFromSolver
minimum number of local cuts transferred from this Solver
int minTransferredBendersCutsFromSolver
minimum number of benders cuts transferred from this Solver
int nParaNodesSolvedAtPreCheck
number of ParaNodes solved at pre-checking of root node solvability
int maxTransferredBendersCutsFromSolver
maximum number of benders cuts transferred from this Solver
virtual bool saveIfImprovedSolutionWasFound(ParaSolution *sol)
save improved solution if it was found in this Solver
int maxTransferredLocalCutsFromSolver
maximum number of local cuts transferred from this Solver
double totalRootNodeTime
accumulated root node process time solved by this solver so far
int totalNImprovedIncumbent
accumulated number of improvements of incumbent value in this BbParaSolver
int nTotalRestarts
number of total restarts
bool waitToken(int rank)
wait token for deterministic mode
int getRank()
get rank of caller's thread
int bcast(void *buffer, int count, const int datatypeId, int root)
broadcast function for standard ParaData types
Base class of communicator object.
virtual void lockApp()=0
lock UG application to synchronize with other threads
virtual ParaSolution * createParaSolution()=0
create ParaSolution object by default constructor
virtual int getSize()=0
get number of UG processes or UG threads depending on run-time environment
virtual bool passTermToken(int rank)
pass termination token from the rank to the next
virtual void unlockApp()=0
unlock UG application to synchronize with other threads
virtual int receive(void *bufer, int count, const int datatypeId, int source, const int tag)=0
receive function for standard ParaData types
virtual int bcast(void *buffer, int count, const int datatypeId, int root)=0
Some action need to be taken for fault tolerant, when the functions return. So, they rerun status val...
virtual ParaInstance * createParaInstance()=0
create ParaInstance object by default constructor
virtual int getRank()=0
get rank of this process or this thread depending on run-time environment
class for deterministic timer
virtual double getElapsedTime()=0
getter of the deterministic time
virtual void send(ParaComm *comm, int dest)=0
send function for ParaInitialStat object
virtual int bcast(ParaComm *comm, int rank, int method)=0
broadcast function to all solvers
bool getBoolParamValue(int param)
get bool parameter value
bool getBoolParamDefaultValue(int param)
get default value of bool parameter
double getRealParamValue(int param)
get real parameter value
int getIntParamValue(int param)
get int parameter value
const char * getStringParamValue(int param)
get string parameter value
class ParaRacingRampUpParamSet (parameter set for racing ramp-up)
virtual void bcast(ParaComm *comm, int root)=0
broadcast solution data
virtual void send(ParaComm *comm, int destination, int tag)=0
send this object
double idleTimeToWaitNotificationId
idle time to wait a message within collecting mode
ParaParamSet * paraParams
ParaParamSet object.
ParaComm * paraComm
ParaCommunicator object.
void setTerminationMode(int tm)
set termination mode
ParaTask * currentTask
solving task
bool notificationProcessed
if true, notification is issued but not receive the corresponding LCB
int nParaTasksReceived
Counters related to this ParaSolver.
double idleTimeBetweenParaTasks
idle time between ParaTasks processing
bool racingIsInterrupted
indicate whether if racing phases is interrupted or not: true - interrupted
ParaSolution * globalBestIncumbentSolution
global best solution. However, this is not always feasible for the current sub-MIP
double previousIdleTimeToWaitToken
previous idle time to wait token
bool memoryLimitIsReached
indicate if memory limit is reached or not, when base solver has memory management feature
ParaRacingRampUpParamSet * winnerRacingParams
Winner ParaRacingRampUpParamSet object.
bool warmStarted
indicate whether if system is warm started or not
double eps
absolute values smaller than this are considered zero esp should be set in the constructor of the der...
double idleTimeToWaitToken
idle time to wait token
ParaTimer * paraTimer
timer for this ParaSolver
double idleTimeToWaitAckCompletion
idle time to wait acknowledgment of completion
bool isRacingWinner()
check if this solver is in racing ramp-up or not
double previousStopTime
Idle Times.
double idleTimeAfterLastParaTask
idle time after the last ParaTask was solved
double globalBestIncumbentValue
global best incumbent value
bool racingWinner
indicate racing ramp-up winner or not: true - winner
ParaDeterministicTimer * paraDetTimer
deterministic timer for this ParaSolver
double idleTimeToFirstParaTask
idle time to start solving the first ParaTask
int nParaTasksSolved
number of ParaTasks solved ( received ) in this ParaSolver
int terminationMode
indicate that termination mode 0: no termination mode 1: normal termination mode 2: interrupted termi...
ParaInstance * paraInstance
root problem instance
bool isRootTask()
check if root task or not
TaskId getGeneratorTaskId()
getter of generator task id
TaskId getTaskId()
getter of task id
ParaDiffSubproblem * getDiffSubproblem()
getter of diffSubproblem
void setOffset(double time)
virtual double getElapsedTime()=0
get elapsed time
static ScipParaCommTh * comm
static const int CustomizedToSharedMemory
static const int AddDualBoundCons
struct ParaSCIP::LocalNodeInfo_t LocalNodeInfo
static const int MemoryLimit
static const int RacingParamsDirPath
static const int NoSolverPresolvingAtRootDefaultSet
static const int CompTerminatedByInterruptRequest
static const int TagLbBoundTightenedBound
static const int NoUpperBoundTransferInRacing
static const int UseRootNodeCuts
static const int NoTerminationMode
termination mode
static const int NoAggressiveSeparatorInRacing
static const int TagLbBoundTightenedIndex
static const int ProvingRun
static const int InstanceTransferMethod
static const int TagTerminated
static const int TagUbBoundTightenedIndex
static const int TransferConflictCuts
static const int CheckEffectOfRootNodePreprocesses
static const int NoPreprocessingInLC
static const int TimeLimit
static const int TimeLimitTerminationMode
static const int ControlCollectingModeOnSolverSide
static const int Deterministic
static const int RampUpPhaseProcess
static const int CompTerminatedNormally
static const int InterruptedTerminationMode
static const int TagUbBoundTightenedBound
static const int RacingStatBranching
static const int AllowTreeSearchRestart
static const int NoSolverPresolvingAtRoot
static const int DistributeBestPrimalSolution
static const int ParaDOUBLE
static const int SelfSplitTreeDepth
static const int SetAllDefaultsAfterRacing
static const int CommunicateTighterBoundsInRacing
#define PARA_COMM_CALL(paracommcall)
#define THROW_LOGICAL_ERROR1(msg1)
#define THROW_LOGICAL_ERROR2(msg1, msg2)
#define THROW_LOGICAL_ERROR3(msg1, msg2, msg3)
Base class for initial statistics collecting class.
#define DEF_SCIP_PARA_COMM(scip_para_comm, comm)
ParaInitialStat extension for SCIP solver.
Branching rule plug-in for SCIP solver.
Event handlr for communication point.
heuristic to update objlimit
SCIP message handler for ParaSCIP and FiberSCIP.
C++ wrapper for propagators.
node selector for self-split ramp-up
#define SCIP_MEMORY_COPY_FACTOR
ParaRacingRampUpParamSet extension for SCIP solver.
void setUserPlugins(UG::ParaInstance *instance)
static SCIP_DECL_CONFLICTEXEC(conflictExecCollector)
#define CONFLICTHDLR_PRIORITY
#define CONFLICTHDLR_NAME
#define CONFLICTHDLR_DESC
double memoryLimitOfSolverSCIP
long long virtualMemUsedAtLc