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 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"misc/usesymmetry", 0 ) );
519#if SCIP_VERSION >= 320
527 SCIP_VAR **orgVars = SCIPgetOrigVars(
scip);
528 int nOrg = SCIPgetNOrigVars(
scip);
529 if( scipParaDiffSubproblem )
539 if( scipParaDiffSubproblem->
getBoundType(v) == SCIP_BOUNDTYPE_LOWER )
553 else if (scipParaDiffSubproblem->
getBoundType(v) == SCIP_BOUNDTYPE_UPPER)
555 SCIP_CALL_ABORT(SCIPchgVarUbGlobal(
581 if( scipParaDiffSubproblem->
getIndex(v) < nOrg )
583 if( scipParaDiffSubproblem->
getBoundType(v) == SCIP_BOUNDTYPE_LOWER )
588 orgVars[scipParaDiffSubproblem->
getIndex(v)],
593 assert(SCIPisEQ(
scip,SCIPvarGetLbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)]),scipParaDiffSubproblem->
getBranchBound(v)));
594 assert(SCIPisLE(
scip,SCIPvarGetLbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)]),SCIPvarGetUbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)])));
597 else if (scipParaDiffSubproblem->
getBoundType(v) == SCIP_BOUNDTYPE_UPPER)
599 SCIP_CALL_ABORT(SCIPchgVarUbGlobal(
601 orgVars[scipParaDiffSubproblem->
getIndex(v)],
606 assert(SCIPisEQ(
scip,SCIPvarGetUbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)]),scipParaDiffSubproblem->
getBranchBound(v)));
607 assert(SCIPisLE(
scip,SCIPvarGetLbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)]),SCIPvarGetUbGlobal(orgVars[scipParaDiffSubproblem->
getIndex(v)])));
617 std::cout <<
"fixing branching variable index = " << scipParaDiffSubproblem->
getIndex(v) <<
" is omitted!" << std::endl;
637 char consname[SCIP_MAXSTRLEN];
647 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, nVars) );
648 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vals, nVars) );
652 for(
int v = 0; v < nVars; ++v )
660 for(
int v = 0; v < nVars; ++v )
669 SCIP_CALL_ABORT( SCIPcreateConsLinear(
scip, &cons, consname, nVars, vars, vals,
671 TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) );
675 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
678 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
680 SCIPfreeBufferArray(
scip, &vals);
681 SCIPfreeBufferArray(
scip, &vars);
692 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, nVars) );
696 for(
int v = 0; v < nVars; ++v )
703 for(
int v = 0; v < nVars; ++v )
714 SCIP_CALL_ABORT( SCIPcreateConsSetpart(
scip, &cons, consname, nVars, vars,
715 TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE ) );
718 SCIP_CALL_ABORT( SCIPcreateConsSetpack(
scip, &cons, consname, nVars, vars,
719 TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE ) );
722 SCIP_CALL_ABORT( SCIPcreateConsSetcover(
scip, &cons, consname, nVars, vars,
723 TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE ) );
729 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
732 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
734 SCIPfreeBufferArray(
scip, &vars);
748 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, nVars) );
749 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vals, nVars) );
753 for(
int v = 0; v < nVars; ++v )
761 for(
int v = 0; v < nVars; ++v )
769 (void) SCIPsnprintf(consname, SCIP_MAXSTRLEN,
"cli%d", i);
770 SCIP_CALL_ABORT( SCIPcreateConsLinear(
scip, &cons, consname, nVars, vars, vals,
772 TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) );
776 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
779 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
781 SCIPfreeBufferArray(
scip, &vals);
782 SCIPfreeBufferArray(
scip, &vars);
797 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, nVars) );
798 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vals, nVars) );
802 for(
int v = 0; v < nVars; ++v )
810 for(
int v = 0; v < nVars; ++v )
818 (void) SCIPsnprintf(consname, SCIP_MAXSTRLEN,
"cli%d", i);
819 SCIP_CALL_ABORT( SCIPcreateConsLinear(
scip, &cons, consname, nVars, vars, vals,
821 TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) );
825 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
828 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
830 SCIPfreeBufferArray(
scip, &vals);
831 SCIPfreeBufferArray(
scip, &vars);
843 SCIP_BOUNDTYPE *types;
847 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &vars, nVars) );
848 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &types, nVars) );
849 SCIP_CALL_ABORT( SCIPallocBufferArray(
scip, &bounds, nVars) );
853 for(
int v = 0; v < nVars; ++v )
862 for(
int v = 0; v < nVars; ++v )
871 (void) SCIPsnprintf(consname, SCIP_MAXSTRLEN,
"bdj%d", i);
872 SCIP_CALL_ABORT( SCIPcreateConsBounddisjunction(
scip, &cons, consname, nVars, vars, types, bounds,
884 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
887 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
889 SCIPfreeBufferArray(
scip, &bounds);
890 SCIPfreeBufferArray(
scip, &types);
891 SCIPfreeBufferArray(
scip, &vars);
900 if( addingConsParam != 0 )
903 || addingConsParam == 2 || addingConsParam == 3 )
906 int nvars = SCIPgetNVars(
scip);
907 SCIP_VAR **vars = SCIPgetVars(
scip);
908 SCIP_Real* vals =
new SCIP_Real[nvars];
909 for(
int v = 0; v < nvars; ++v )
911 vals[v] = SCIPvarGetObj(vars[v]);
913 SCIP_CALL_ABORT( SCIPcreateConsLinear(
scip, &cons,
"objective", nvars, vars, vals, dualBoundValue, SCIPinfinity(
scip),
914 TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE) );
915 assert( SCIPisEQ(
scip, SCIPgetTransObjscale(
scip), 1.0 ) );
916 assert( SCIPisZero(
scip, SCIPgetTransObjoffset(
scip) ) );
921 SCIP_CALL_ABORT( SCIPaddCons(
scip, cons) );
922 SCIP_CALL_ABORT( SCIPreleaseCons(
scip, &cons) );
939 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"misc/transsolsorig", FALSE) );
941 if( SCIPgetStage(
scip) == SCIP_STAGE_PROBLEM)
943 SCIP_CALL_ABORT( SCIPtransformProb(
scip));
948 orgVars = SCIPgetOrigVars(
scip);
989#if SCIP_VERSION >= 312
992 if( scipParaDiffSubproblem && scipParaDiffSubproblem->
getNVarValueVars() > 0 )
994 orgVars = SCIPgetOrigVars(
scip);
1131 SCIP_CALL_ABORT( SCIPfreeTransform(
scip) );
1168 SCIP_VAR **orgVars = SCIPgetOrigVars(
scip);
1174 for(
int v = 0; v <
nOrgVars; v++ )
1176 SCIP_CALL_ABORT( SCIPchgVarLbGlobal(
scip,orgVars[v],
orgVarLbs[v] ) );
1177 SCIP_CALL_ABORT( SCIPchgVarUbGlobal(
scip,orgVars[v],
orgVarUbs[v] ) );
1201 SCIP_SOL *sol = SCIPgetBestSol(
scip);
1202 int nVars = SCIPgetNOrigVars(
scip);
1203 SCIP_VAR **vars = SCIPgetOrigVars(
scip);
1204 SCIP_Real *vals =
new SCIP_Real[nVars];
1205 SCIP_CALL_ABORT( SCIPgetSolVals(
scip, sol, nVars, vars, vals) );
1208 SCIP_VAR **varsInOrig =
new SCIP_VAR*[nVars];
1209 SCIP_Real *valsInOrig =
new SCIP_Real[nVars]();
1210 int nVarsInOrig = 0;
1211 for(
int i = 0; i < nVars; i++ )
1215 varsInOrig[nVarsInOrig] = vars[i];
1216 valsInOrig[nVarsInOrig] = vals[i];
1221 scipParaComm->createScipParaSolution(
1223 SCIPgetSolOrigObj(
scip, sol),
1229 delete [] varsInOrig;
1230 delete [] valsInOrig;
1235 scipParaComm->createScipParaSolution(
1237 SCIPgetSolOrigObj(
scip, sol),
1259 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/gap", 0.0 ) );
1260 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/absgap", 0.0 ) );
1265 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"numerics/feastol", (
orgFeastol/10.0) ) );
1266 if( SCIP_APIVERSION < 61 )
1268 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"numerics/lpfeastol", (
orgLpfeastol/10.0) ) );
1283 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"misc/catchctrlc", FALSE) );
1286#ifdef UG_DEBUG_SOLUTION
1287 const double limit = DBL_MAX;
1290 SCIP_CALL_ABORT( SCIPsetObjlimit(
scip, limit) );
1314 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"misc/usesymmetry", 0 ) );
1316 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
1319#ifdef UG_DEBUG_SOLUTION
1324 SCIPdebugSolEnable(
scip);
1325 std::cout <<
"R." <<
paraComm->
getRank() <<
": enable debug" << std::endl;
1326 assert( SCIPdebugSolIsEnabled(
scip) == TRUE );
1330 SCIPdebugSolDisable(
scip);
1331 std::cout <<
"R." <<
paraComm->
getRank() <<
": disable debug" << std::endl;
1332 assert( SCIPdebugSolIsEnabled(
scip) == FALSE );
1336#if (SCIP_VERSION >= 700)
1341 SCIP_CALL_ABORT( SCIPsetCharParam(
scip,
"estimation/restarts/restartpolicy",
'n' ) );
1349 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
1350 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
1353#if SCIP_APIVERSION >= 101
1354 if( SCIPgetParam(
scip,
"presolving/milp/threads") != NULL )
1356 int nmilpthreads = 0;
1357 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/milp/threads", &nmilpthreads) );
1358 assert( nmilpthreads == 1 );
1365 SCIP_RETCODE ret = SCIPsolve(
scip);
1366 if( ret != SCIP_OKAY )
1368#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
1369 SCIPprintError(ret, NULL);
1371 SCIPprintError(ret);
1383 std::cout <<
"ret = " << (int)ret << std::endl;
1394 SCIP_STATUS status = SCIPgetStatus(
scip);
1396#if SCIP_APIVERSION >= 101
1401 if( status == SCIP_STATUS_OPTIMAL )
1405 if( selfSplitNodesel->inSampling() && status == SCIP_STATUS_OPTIMAL )
1421 if( SCIPgetNSols(
scip) > 0 )
1428#ifdef UG_DEBUG_SOLUTION
1429 if( status != SCIP_STATUS_OPTIMAL )
1431 if( SCIPdebugSolIsEnabled(
scip) &&
1436 std::cout <<
"R" <<
paraComm->
getRank() <<
" solver lost optimal solution." << std::endl;
1437 throw "Optimal solution lost!";
1450 if( status == SCIP_STATUS_OPTIMAL ||
1451 status == SCIP_STATUS_GAPLIMIT )
1498 else if( status == SCIP_STATUS_INFEASIBLE )
1511 if( status == SCIP_STATUS_NODELIMIT )
1513 throw "SCIP terminated with SCIP_STATUS_NODELIMIT";
1515 else if( status == SCIP_STATUS_TOTALNODELIMIT )
1517 throw "SCIP terminated with SCIP_STATUS_TOTALNODELIMIT";
1519 else if( status == SCIP_STATUS_STALLNODELIMIT )
1521 throw "SCIP terminated with SCIP_STATUS_STALLNODELIMIT";
1523 else if( status == SCIP_STATUS_TIMELIMIT )
1533 else if( status == SCIP_STATUS_MEMLIMIT )
1537 else if( status == SCIP_STATUS_SOLLIMIT )
1539 throw "SCIP terminated with SCIP_STATUS_SOLLIMIT";
1541 else if( status == SCIP_STATUS_BESTSOLLIMIT )
1543 throw "SCIP terminated with SCIP_STATUS_BESTSOLLIMIT";
1545 else if( status == SCIP_STATUS_USERINTERRUPT && SCIPisObjIntegral(
scip) )
1556 else if( status == SCIP_STATUS_USERINTERRUPT )
1595 for(
int i = 0; i < nConfilcts; i++ )
1606#if SCIP_APIVERSION >= 101
1610 int numnodesels = SCIPgetNNodesels(
scip );
1611 SCIP_NODESEL** nodesels = SCIPgetNodesels(
scip );
1613 for( i = 0; i < numnodesels; ++i )
1615 std::string nodeselname(SCIPnodeselGetName(nodesels[i]));
1616 if( std::string(nodeselname) == std::string(
"ScipParaObjSelfSplitNodeSel") )
1621 assert( i != numnodesels );
1622 SCIP_CALL_ABORT( SCIPsetNodeselStdPriority(
scip, nodesels[i], -INT_MAX/4 ) );
1632 if( SCIPgetStage(
scip) == SCIP_STAGE_SOLVING || SCIPgetStage(
scip) == SCIP_STAGE_SOLVED )
1634 return SCIPgetNTotalNodes(
scip);
1646 if( SCIPgetStage(
scip) == SCIP_STAGE_SOLVING || SCIPgetStage(
scip) == SCIP_STAGE_SOLVED )
1648 return SCIPgetNNodesLeft(
scip);
1652 if( SCIPgetStage(
scip) >= SCIP_STAGE_PRESOLVING && SCIPgetStage(
scip) <= SCIP_STAGE_INITSOLVE )
1667 if( SCIPgetStage(
scip) == SCIP_STAGE_PRESOLVING || SCIPgetStage(
scip) == SCIP_STAGE_INITSOLVE )
1673 return SCIPgetDualbound(
scip);
1685 ) : BbParaSolver(argc, argv, inNhanders,
comm, inParaParamSet, inParaInstance, inDetTimer),
1688 originalParamSet(0),
1689 conflictConsList(0),
1693#if SCIP_APIVERSION >= 101
1694 selfSplitNodesel(0),
1697 interruptMsgMonitor(0),
1698 nPreviousNodesLeft(0),
1699 originalPriority(0),
1701 nOrgVarsInSolvers(0),
1706 mapToOriginalIndecies(0),
1707 mapToSolverLocalIndecies(0),
1708 mapToProbIndecies(0),
1721 miscAllowdualreds(0),
1728 collectingModeIsProhibited(false),
1732 copyIncreasedVariables(false)
1738 char* logname = NULL;
1747 SCIP_CALL_ABORT( SCIPcreate(&
scip) );
1748 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
1752 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
1759 SCIP_CALL_ABORT( SCIPincludeDefaultPlugins(
scip) );
1767 SCIP_CALL_ABORT( SCIPincludeObjHeur(
scip, updator, TRUE) );
1782 SCIP_CALL_ABORT( SCIPincludeObjNodesel(
scip,
nodesel, TRUE) );
1783#if SCIP_APIVERSION >= 101
1786 selfSplitNodesel =
new ScipParaObjSelfSplitNodesel(
1794 SCIP_CALL_ABORT( SCIPincludeObjNodesel(
scip, selfSplitNodesel, TRUE) );
1803 SCIP_CONFLICTHDLRDATA *conflictHdrData =
reinterpret_cast< SCIP_CONFLICTHDLRDATA *
>(
this);
1805#if SCIP_VERSION == 211 && SCIP_SUBVERSION == 0
1807 NULL, NULL, NULL, NULL, NULL, NULL, conflictExecCollector, conflictHdrData) );
1810 conflictExecCollector, conflictHdrData) );
1814 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/feastol", &
orgFeastol ) );
1815 if( SCIP_APIVERSION < 61 )
1817 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/lpfeastol", &
orgLpfeastol ) );
1823 for(
int i = 3; i < argc; ++i )
1825 if( strcmp(argv[i],
"-l") == 0 )
1835 else if( strcmp(argv[i],
"-q") == 0 )
1846#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
1848 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
1850 SCIPsetMessagehdlrQuiet(
scip, TRUE);
1855 if( logname != NULL ||
quiet )
1857 if( logname != NULL )
1859 std::ostringstream os;
1861 logfile = fopen(os.str().c_str(),
"a");
1868#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
1869 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
1872 SCIP_CALL_ABORT( SCIPmessagehdlrRelease(&
messagehdlr));
1882 int tempIsWarmStarted;
1888 int solutionExists = 0;
1890 if( solutionExists )
1906 for(
int i = 3; i < argc; ++i )
1909 if( strcmp(argv[i],
"-sl") == 0 )
1919 std::cerr <<
"missing settings filename after parameter '-sl'" << std::endl;
1923 else if ( strcmp(argv[i],
"-isol") == 0 )
1932 std::cerr <<
"missing settings filename after parameter '-isol'" << std::endl;
1938#if( !defined(UG_QUBO) && !defined(UG_SMOOTHIE) )
1961 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/epsilon", &epsilon));
2007#ifndef SCIP_EVENTTYPE_COMM
2031 ) : BbParaSolver(argc, argv, inNhanders,
comm, inParaParamSet, inParaInstance, inDetTimer),
2034 originalParamSet(0),
2035 conflictConsList(0),
2039#if SCIP_APIVERSION >= 101
2040 selfSplitNodesel(0),
2043 interruptMsgMonitor(0),
2044 originalPriority(0),
2047 nOrgVarsInSolvers(0),
2052 mapToOriginalIndecies(0),
2053 mapToSolverLocalIndecies(0),
2054 mapToProbIndecies(0),
2067 miscAllowdualreds(0),
2074 collectingModeIsProhibited(false),
2078 copyIncreasedVariables(false)
2085 char* logname = NULL;
2099 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
2104 SCIP_CALL_ABORT( SCIPcreate(&
scip) );
2105 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
2109 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
2111 SCIP_CALL_ABORT( SCIPincludeDefaultPlugins(
scip) );
2120 SCIP_CALL_ABORT( SCIPincludeObjHeur(
scip, updator, TRUE) );
2135 SCIP_CALL_ABORT( SCIPincludeObjNodesel(
scip,
nodesel, TRUE) );
2136#if SCIP_APIVERSION >= 101
2139 selfSplitNodesel =
new ScipParaObjSelfSplitNodesel(
2147 SCIP_CALL_ABORT( SCIPincludeObjNodesel(
scip, selfSplitNodesel, TRUE) );
2156 SCIP_CONFLICTHDLRDATA *conflictHdrData =
reinterpret_cast< SCIP_CONFLICTHDLRDATA *
>(
this);
2158#if SCIP_VERSION == 211 && SCIP_SUBVERSION == 0
2160 NULL, NULL, NULL, NULL, NULL, NULL, conflictExecCollector, conflictHdrData) );
2163 conflictExecCollector, conflictHdrData) );
2167 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/feastol", &
orgFeastol ) );
2168 if( SCIP_APIVERSION < 61 )
2170 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/lpfeastol", &
orgLpfeastol ) );
2176 for(
int i = 3; i < argc; ++i )
2178 if( strcmp(argv[i],
"-l") == 0 )
2188 else if( strcmp(argv[i],
"-q") == 0 )
2198#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2200 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
2202 SCIPsetMessagehdlrQuiet(
scip, TRUE );
2207 if( logname != NULL ||
quiet )
2210 if( logname != NULL )
2212 std::ostringstream os;
2214 logfile = fopen(os.str().c_str(),
"a");
2221#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2222 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
2225 SCIP_CALL_ABORT( SCIPmessagehdlrRelease(&
messagehdlr));
2236 int tempIsWarmStarted;
2243 int solutionExists = 0;
2250 int solutionExists = 0;
2252 if( solutionExists )
2269 for(
int i = 3; i < argc; ++i )
2272 if( strcmp(argv[i],
"-sl") == 0 )
2282 std::cerr <<
"missing settings filename after parameter '-sl'" << std::endl;
2286 else if ( strcmp(argv[i],
"-isol") == 0 )
2295 std::cerr <<
"missing settings filename after parameter '-isol'" << std::endl;
2301#if( !defined(UG_QUBO) && !defined(UG_SMOOTHIE) )
2317 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/epsilon", &epsilon));
2355#if ( defined(_COMM_PTH) || defined(_COMM_CPP11) )
2369#ifndef SCIP_EVENTTYPE_COMM
2398#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2401 SCIP_CALL_ABORT( SCIPsetDefaultMessagehdlr() );
2402 SCIP_CALL_ABORT( SCIPfreeObjMessagehdlr(&
messagehdlr) );
2411 SCIP_CALL_ABORT( SCIPfree(&
scip) );
2419 for(
int i = 0; i < nConfilcts; i++ )
2479 double detTime = -1.0;
2524 delete paraSolverTerminationState;
2535 const std::string& filename
2538 FILE *file = fopen(filename.c_str(),
"a");
2541 std::cout <<
"file : " << filename <<
"cannot open." << std::endl;
2544 SCIP_CALL_ABORT( SCIPprintTransProblem(
scip, file,
"cip", FALSE) );
2551 SCIP *backupScip =
scip;
2557 SCIP_CALL_ABORT( SCIPsolve(
scip) );
2569 if( SCIPgetStage(
scip) <= SCIP_STAGE_TRANSFORMING || SCIPgetStage(
scip) >= SCIP_STAGE_SOLVED )
2592 if( SCIPcreateOrigSol(
scip, &newsol, 0) != SCIP_OKAY )
2599 SCIP_VAR** vars = SCIPgetOrigVars(
scip);
2600 SCIP_Real* vals =
new SCIP_Real[tempSol->
getNVars()]();
2602 for(i = 0; i < tempSol->
getNVars(); i++ )
2610 if( probindex >= 0 )
2612 vals[probindex] = tempSol->
getValues()[i];
2619 SCIP_CALL_ABORT( SCIPsetSolVals(
scip, newsol, tempSol->
getNVars(), vars, vals) );
2631#if SCIP_VERSION == 211 && SCIP_SUBVERSION == 0
2632 if( SCIPgetStage(
scip) == SCIP_STAGE_TRANSFORMED || SCIPgetStage(
scip) == SCIP_STAGE_PRESOLVED )
2635 SCIPgetStage(
scip) == SCIP_STAGE_PRESOLVED ||
2636 SCIPgetStage(
scip) == SCIP_STAGE_INITPRESOLVE )
2640#if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) )
2641 SCIP_CALL_ABORT( SCIPtrySolFree(
scip, &newsol, FALSE, TRUE, TRUE, TRUE, &success) );
2643 SCIP_CALL_ABORT( SCIPtrySolFree(
scip, &newsol, FALSE, TRUE, TRUE, TRUE, TRUE, &success) );
2650 SCIP_CALL_ABORT( SCIPheurPassSolTrySol(
scip, SCIPfindHeur(
scip,
"trysol"), newsol) );
2651 SCIP_CALL_ABORT( SCIPfreeSol(
scip, &newsol) );
2665 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_FAST, TRUE) );
2666 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_FAST, TRUE) );
2667 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_FAST, TRUE) );
2678#if SCIP_VERSION >= 320
2690 std::string subcipprefix(
"SolverCip");
2691 std::string subcipfilename;
2692 std::ostringstream oss;
2695 subcipfilename = oss.str();
2696 subcipfilename +=
".cip";
2697 SCIP_CALL_ABORT( SCIPwriteOrigProblem(
scip, subcipfilename.c_str(),
"cip", FALSE) );
2698#ifdef UG_DEBUG_SOLUTION
2702 std::cout <<
"** " << subcipfilename <<
" contains optimal solution." << std::endl;
2706 std::cout <<
"** " << subcipfilename <<
" does NOT contain optimal solution." << std::endl;
2709 subcipfilename = oss.str();
2710 subcipfilename +=
"-t.cip";
2711 if( SCIPgetStage(
scip) >= SCIP_STAGE_TRANSFORMED )
2713 SCIP_CALL_ABORT( SCIPwriteTransProblem(
scip, subcipfilename.c_str(),
"cip", FALSE) );
2715 char name[SCIP_MAXSTRLEN];
2716 (void)SCIPsnprintf(name, SCIP_MAXSTRLEN,
"SolverCip%d.set",
paraComm->
getRank());
2717 SCIP_CALL_ABORT( SCIPwriteParams(
scip, name, TRUE, FALSE) );
2736 SCIP_VAR **vars = SCIPgetVars(
scip);
2745 for(
int v = 0; v <
nOrgVars ; v++ )
2759 for(
int v = 0; v <
nOrgVars; v++ )
2773 for(
int i = 0; i < SCIPgetNTotalVars(
scip); i++ )
2796 for(
int v = 0; v <
nOrgVars; v++ )
2808 for(
int v = 0; v <
nOrgVars; v++ )
2835 SCIP_CALL_ABORT( SCIPfree(&
scip) );
2849 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
2860 SCIP_CALL_ABORT( SCIPcreate(&
scip) );
2861 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"timing/clocktype", 2) );
2865 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/time", timeRemains) );
2868 SCIP_CALL_ABORT( SCIPincludeDefaultPlugins(
scip) );
2877 SCIP_CALL_ABORT( SCIPincludeObjHeur(
scip, updator, TRUE) );
2892 SCIP_CALL_ABORT( SCIPincludeObjNodesel(
scip,
nodesel, TRUE) );
2901 SCIP_CONFLICTHDLRDATA *conflictHdrData =
reinterpret_cast< SCIP_CONFLICTHDLRDATA *
>(
this);
2903#if SCIP_VERSION == 211 && SCIP_SUBVERSION == 0
2905 NULL, NULL, NULL, NULL, NULL, NULL, conflictExecCollector, conflictHdrData) );
2908 conflictExecCollector, conflictHdrData) );
2915#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2917 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
2919 SCIPsetMessagehdlrQuiet(
scip, TRUE);
2927#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
2928 SCIP_CALL_ABORT( SCIPsetMessagehdlr(
messagehdlr) );
2931 SCIP_CALL_ABORT( SCIPmessagehdlrRelease(&
messagehdlr));
2979 if( SCIPgetStage(
scip) != SCIP_STAGE_SOLVING )
2993#if SCIP_VERSION >= 320
3005 char *bakFileName = NULL;
3006 SCIP_CALL_ABORT( SCIPgetStringParam(
scip,
"visual/bakfilename", &bakFileName) );
3007 if( strcmp(bakFileName,
"-") != 0 )
3009 std::ostringstream os;
3011 SCIP_CALL_ABORT( SCIPsetStringParam(
scip,
"visual/bakfilename", os.str().c_str() ) );
3012 SCIP_CALL_ABORT( SCIPsetStringParam(
scip,
"visual/baknodeprefix", ((
currentTask->
getTaskId()).toString()+
":").c_str() ) );
3025 double tightenedBound;
3044 assert( SCIPisLE(
scip,
orgVarLbs[tightenedIdex], tightenedBound) &&
3047 SCIP_Var* var = SCIPvarGetTransVar(SCIPgetOrigVars(
scip)[tightenedIdex]);
3048 if( var && SCIPisLT(
scip,
tightenedVarLbs[tightenedIdex], tightenedBound) && SCIPvarGetStatus(var) != SCIP_VARSTATUS_MULTAGGR )
3067 double tightenedBound;
3086 assert( SCIPisLE(
scip,
orgVarLbs[tightenedIdex], tightenedBound) &&
3089 SCIP_Var* var = SCIPvarGetTransVar(SCIPgetOrigVars(
scip)[tightenedIdex]);
3090 if( var && SCIPisGT(
scip,
tightenedVarUbs[tightenedIdex], tightenedBound) && SCIPvarGetStatus(var) != SCIP_VARSTATUS_MULTAGGR )
3151 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/stuffing/maxrounds", &stuffingMaxrounds) );
3152 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/domcol/maxrounds", &domcolMaxrounds) );
3153#if ( SCIP_VERSION >= 322 || (SCIP_VERSION == 321 && SCIP_SUBVERSION >= 2) )
3154 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/dualcomp/maxrounds", &dualcompMaxrounds) );
3156 SCIP_CALL_ABORT( SCIPgetIntParam(
scip,
"presolving/dualinfer/maxrounds", &dualinferMaxrounds) );
3159 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/abspower/dualpresolve", &abspowerDualpresolve) );
3160 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/and/dualpresolving", &andDualpresolving) );
3161 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/cumulative/dualpresolve", &cumulativeDualpresolve) );
3162 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/knapsack/dualpresolving", &knapsackDualpresolving) );
3163 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/linear/dualpresolving", &linearDualpresolving) );
3164 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/setppc/dualpresolving", &setppcDualpresolving) );
3165 SCIP_CALL_ABORT( SCIPgetBoolParam(
scip,
"constraints/logicor/dualpresolving", &logicorDualpresolving) );
3169#if SCIP_APIVERSION > 34
3183 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/stuffing/maxrounds", 0) );
3184 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/domcol/maxrounds", 0) );
3185#if ( SCIP_VERSION >= 322 || (SCIP_VERSION == 321 && SCIP_SUBVERSION >= 2) )
3186 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/dualcomp/maxrounds", 0) );
3188 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/dualinfer/maxrounds", 0) );
3191 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/abspower/dualpresolve", FALSE) );
3192 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/and/dualpresolving", FALSE) );
3193 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/cumulative/dualpresolve", FALSE) );
3194 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/knapsack/dualpresolving", FALSE) );
3195 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/linear/dualpresolving", FALSE) );
3196 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/setppc/dualpresolving", FALSE) );
3197 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/logicor/dualpresolving", FALSE) );
3201#if SCIP_APIVERSION > 34
3202 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"misc/allowstrongdualreds", FALSE) );
3204 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"misc/allowdualreds", FALSE) );
3215 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/stuffing/maxrounds", stuffingMaxrounds) );
3216 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/domcol/maxrounds", domcolMaxrounds) );
3217#if ( SCIP_VERSION >= 322 || (SCIP_VERSION == 321 && SCIP_SUBVERSION >= 2) )
3218 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/dualcomp/maxrounds", dualcompMaxrounds) );
3220 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"presolving/dualinfer/maxrounds", dualinferMaxrounds) );
3223 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/setppc/dualpresolving", setppcDualpresolving) );
3224 SCIP_CALL_ABORT( SCIPsetBoolParam(
scip,
"constraints/logicor/dualpresolving", logicorDualpresolving) );
3230#if SCIP_APIVERSION > 34
3241 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