54 #include "objscip/objscip.h" 66 #include "scip/scip.h" 67 #ifdef UG_DEBUG_SOLUTION 68 #ifndef WITH_DEBUG_SOLUTION 69 #define WITH_DEBUG_SOLUTION 71 #include "scip/debug.h" 72 #include "scip/struct_scip.h" 73 #include "scip/struct_set.h" 79 #if ( defined(_COMM_PTH) || defined(_COMM_CPP11) ) 92 #define CONFLICTHDLR_NAME "conflictCollector" 93 #define CONFLICTHDLR_DESC "conflict handler to collect conflicts" 94 #define CONFLICTHDLR_PRIORITY +100000000 103 assert(conflicthdlr != NULL);
105 assert(bdchginfos != NULL || nbdchginfos == 0);
106 assert(result != NULL);
111 *result = SCIP_DIDNOTRUN;
115 *result = SCIP_DIDNOTFIND;
118 SCIP_CALL( SCIPallocBufferArray(scip, &vars, nbdchginfos) );
119 SCIP_CALL( SCIPallocBufferArray(scip, &vals, nbdchginfos) );
121 for( i = 0; i < nbdchginfos; ++i )
123 assert(bdchginfos != NULL);
125 vars[i] = SCIPbdchginfoGetVar(bdchginfos[i]);
129 if( !SCIPvarIsBinary(vars[i]) )
133 if( SCIPbdchginfoGetNewbound(bdchginfos[i]) < 0.5 )
142 if( i == nbdchginfos )
147 localNodeInfo->
linearRhs = SCIPinfinity(scip);
150 localNodeInfo->
linearCoefs =
new double[nbdchginfos];
151 for( i = 0; i < nbdchginfos; ++i )
153 SCIP_VAR *transformVar = vars[i];
154 SCIP_Real scalar = vals[i];
155 SCIP_Real constant = 0.0;
156 if( SCIPvarGetOrigvarSum(&transformVar, &scalar, &constant ) == SCIP_INVALIDDATA )
177 if( i == nbdchginfos )
180 conflictConsList->push_back(localNodeInfo);
186 delete localNodeInfo;
191 SCIPfreeBufferArray(scip, &vals);
192 SCIPfreeBufferArray(scip, &vars);
204 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
209 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
210 SCIP_CALL_ABORT( SCIPsetPresolving(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
211 SCIP_CALL_ABORT( SCIPsetSeparating(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
214 #if (SCIP_VERSION < 321 || ( SCIP_VERSION == 321 && SCIP_SUBVERSION < 2) ) 226 #if SCIP_VERSION >= 320 242 SCIP_CALL_ABORT( SCIPresetParams(
scip) );
252 SCIP_CALL_ABORT( SCIPsetIntParam(
scip,
"randomization/permutationseed", scipRacingParams->
getPermuteProbSeed()) );
282 switch( nHeuristics )
286 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_DEFAULT, TRUE) );
291 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_AGGRESSIVE, TRUE) );
296 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_FAST, TRUE) );
301 SCIP_CALL_ABORT( SCIPsetHeuristics(
scip, SCIP_PARAMSETTING_OFF, TRUE) );
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( SCIPfindPresol(
scip,
"milp") != 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++ )
1600 if( info->linearCoefs )
delete[] info->linearCoefs;
1601 if( info->idxLinearCoefsVars )
delete[] info->idxLinearCoefsVars;
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),
1693 #if SCIP_APIVERSION >= 101
1694 selfSplitNodesel(0),
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;
1860 os << logname << comm->
getRank();
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) ) 1958 scipDiffParamSet->setParametersInScip(
scip);
1961 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"numerics/epsilon", &epsilon));
1997 SCIP_CALL_ABORT( SCIPsetRealParam(
scip,
"limits/memory", dynamic_cast<ScipParaParamSet *>(
paraParams)->getRealParamValue(
MemoryLimit)) );
2007 #ifndef SCIP_EVENTTYPE_COMM 2031 ) :
BbParaSolver(argc, argv, inNhanders, comm, inParaParamSet, inParaInstance, inDetTimer),
2039 #if SCIP_APIVERSION >= 101
2040 selfSplitNodesel(0),
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;
2213 os << logname << comm->
getRank();
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) ) 2315 scipDiffParamSet->setParametersInScip(
scip);
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++ )
2424 if( info->linearCoefs )
delete[] info->linearCoefs;
2425 if( info->idxLinearCoefsVars )
delete[] info->idxLinearCoefsVars;
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++ )
2763 orgVarLbs[v] = scipParaInstance->
getVarLb(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++ )
2810 orgVarLbs[v] = scipParaInstance->
getVarLb(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) );
ScipUserPlugins * userPlugins
ScipParaSolver(int argc, char **argv, UG::ParaComm *comm, UG::ParaParamSet *paraParamSet, UG::ParaInstance *inParaInstance, UG::ParaDeterministicTimer *detTimer)
#define DEF_BB_PARA_COMM(para_comm, comm)
int minTransferredBendersCutsFromSolver
minimum number of benders cuts transferred from this Solver
void saveOrgProblemBounds()
static const int AddDualBoundCons
bool getBoolParamDefaultValue(int param)
get default value of bool parameter
virtual void setFileName(const char *file)=0
static const int CompTerminatedByInterruptRequest
SCIP_Real getDownpscost(int i)
ScipParaDiffSubproblemBranchLinearCons * getBranchLinearConss()
bool notificationProcessed
if true, notification is issued but not receive the corresponding LCB
virtual int bcast(UG::ParaComm *comm, int root)=0
int getOriginalIndex(int index)
double idleTimeToFirstParaTask
idle time to start solving the first ParaTask
SCIP_CONS * addedDualCons
#define CONFLICTHDLR_DESC
static const int AllowTreeSearchRestart
SCIP_Real getVarValueUpinfer(int i, int j)
double getDualBoundValue()
virtual void writeSubproblem(SCIP *scip)
static ScipParaCommTh * comm
unsigned int miscAllowdualreds
SCIP_Real getDownconflen(int i)
bool memoryLimitIsReached
indicate if memory limit is reached or not, when base solver has memory management feature ...
SCIP_Bool getFlagBoundDisjunctionSeparate(int i)
SCIP_BOUNDTYPE getBoundType(int i)
SCIP_Bool getFlagBoundDisjunctionEnforce(int i)
const char * problemFileName
C++ wrapper for propagators.
SCIP_Real getVarValueDownconflen(int i, int j)
SCIP_Real getDownvsids(int i)
SCIP_Real getUpcutoff(int i)
void setParametersInScip(SCIP *scip)
Event handlr for communication point.
virtual double getElapsedTime()=0
get elapsed time
virtual void waitNotificationIdMessage()
wait notification id message to synchronized with LoadCoordinator
int nParaTasksSolved
number of ParaTasks solved ( received ) in this ParaSolver
SCIP_Bool getFlagBoundDisjunctionLocal(int i)
ParaParamSet * paraParams
ParaParamSet object.
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...
SCIP_Real getBendersLinearRhs(int i)
SCIP_BOUNDTYPE getBoundTypesBoundDisjunction(int i, int j)
int nParaNodesSolvedAtRoot
number of ParaNodes solved at root node
SCIP_Real getVarValueDowninfer(int i, int j)
int lbBoundTightened(int source, int tag)
int nTotalRestarts
number of total restarts
int maxRestarts
maximum number of restarts
void prohibitCollectingMode()
virtual void unlockApp()=0
unlock UG application to synchronize with other threads
virtual int bcast(ParaComm *comm, int rank, int method)=0
broadcast function to all solvers
double getGlobalBestIncumbentValue()
get global best incumbent value
static const int InterruptedTerminationMode
int getNBoundDisjunctions()
SCIP_Real getBranchConsLinearRhs(int i)
bool isOriginalIndeciesMap()
ScipParaDiffSubproblemBranchSetppcCons * getBranchSetppcConss()
static const int RacingParamsDirPath
double globalBestIncumbentValue
global best incumbent value
bool isRacingInterruptRequested()
check if racing interrupt was requested or not
ParaDeterministicTimer * paraDetTimer
deterministic timer for this ParaSolver
int getNLinearCoefs(int i)
#define CONFLICTHDLR_PRIORITY
void setOffset(double time)
bool isRootTask()
check if root task or not
bool lightWeightRootNodeComputation
indicate that fast root node computation is required
SCIP_Real getDowncutoff(int i)
double previousIdleTimeToWaitToken
previous idle time to wait token
void setOriginalNodeSelectionStrategy()
SCIP_Real getVarValueUpconflen(int i, int j)
int getIdxBoundDisjunctionVars(int i, int j)
void createProblem(SCIP *scip, int method, bool noPreprocessingInLC, bool usetRootNodeCuts, ScipDiffParamSet *scipDiffParamSetRoot, ScipDiffParamSet *scipDiffParamSet, char *settingsNameLC, char *isolname)
int nTightenedInt
the number of tightened integral variable bounds in racing
int indexAmongSolvers(int index)
void saveOriginalPriority()
static const int ControlCollectingModeOnSolverSide
SCIP_Real getVarValueUpcutoff(int i, int j)
int totalNSolved
Counters related to this BbParaSolver.
virtual void iReceiveMessages()
non-blocking receive messages
bool isRacingStage()
check if Solver is in racing stage or not
int maxTransferredLocalCutsFromSolver
maximum number of local cuts transferred from this Solver
SCIP_Real getVarValueDowncutoff(int i, int j)
node selector for self-split ramp-up
int getBranchConsSetppcConsNames()
static const int TagLbBoundTightenedBound
C++ wrapper for propagators.
static const int TimeLimitTerminationMode
ParaDiffSubproblem * getDiffSubproblem()
getter of diffSubproblem
class for deterministic timer
SCIP_Bool getFlagBoundDisjunctionDynamic(int i)
ScipDiffParamSet * getScipDiffParamSet()
Base class for initial statistics collecting class.
#define PARA_COMM_CALL(paracommcall)
int getBranchConsSetppcNVars(int i)
static const int Deterministic
virtual int getRank()=0
get rank of this process or this thread depending on run-time environment
static const int CustomizedToSharedMemory
int nTightened
the number of tightened variable bounds in racing
SCIP_Real getDowninfer(int i)
static const int UseRootNodeCuts
SCIP * scipToCheckEffectOfRootNodeProcesses
int getNVarValueValues(int i)
int getGenerateBranchOrderSeed()
TaskId getTaskId()
getter of task id
static const int ParaDOUBLE
int getScipRacingParamSeed()
long long getNNodesSolved()
virtual double getElapsedTime()=0
getter of the deterministic time
virtual ParaInstance * createParaInstance()=0
create ParaInstance object by default constructor
void setTerminationMode(int tm)
set termination mode
virtual ~ScipParaSolver()
SCIP_Real * tightenedVarUbs
static const int CheckEffectOfRootNodePreprocesses
SCIP_MESSAGEHDLR * messagehdlr
virtual void bcast(ParaComm *comm, int root)=0
broadcast solution data
SCIP_Real getVarLb(int i)
void tryNewSolution(UG::ParaSolution *sol)
bool collectingModeIsProhibited
double solverDualBound
dual bound value achieved for a subproblem
SCIP_Real getBendersLinearCoefs(int i, int j)
int getIdxBendersLinearCoefsVars(int i, int j)
double getRealParamValue(int param)
for real parameters
SCIP_Real * tightenedVarLbs
ParaTask * getCurrentNode()
get current ParaNode object
int nParaNodesSolvedAtPreCheck
number of ParaNodes solved at pre-checking of root node solvability
bool isRacingWinner()
check if this solver is in racing ramp-up or not
int nParaTasksReceived
Counters related to this ParaSolver.
virtual void lockApp()=0
lock UG application to synchronize with other threads
virtual void newSubproblem(SCIP *scip, const ScipParaDiffSubproblemBranchLinearCons *linearConss, const ScipParaDiffSubproblemBranchSetppcCons *setppcConss)
int getBranchConsSetppcVars(int i, int j)
int * mapToSolverLocalIndecies
static const int NoSolverPresolvingAtRoot
int nTransferredBendersCutsFromSolver
number of benders cuts transferred from this Solver
double getInitialDualBoundValue()
getter of initial dual bound value
#define SCIP_MEMORY_COPY_FACTOR
int minRestarts
minimum number of restarts
Branching rule plug-in for SCIP solver.
SCIP_Real getBoundsBoundDisjunction(int i, int j)
ScipDiffParamSet * scipDiffParamSetRoot
SCIP_Bool getFlagBoundDisjunctionStickingatnode(int i)
void setUserPlugins(UG::ParaInstance *instance)
int nSolvedWithNoPreprocesses
number of nodes solved when it is solved with no preprocesses
double previousStopTime
Idle Times.
static const int ProvingRun
SCIP_Real getVarValue(int i, int j)
static const int NoUpperBoundTransferInRacing
void setRacingParams(UG::ParaRacingRampUpParamSet *inRacingParams, bool winnerParam)
virtual void createSubproblem()
double idleTimeAfterLastParaTask
idle time after the last ParaTask was solved
#define THROW_LOGICAL_ERROR1(msg1)
ScipParaInterruptMsgMonitor * interruptMsgMonitor
interrupt message monitor
std::list< LocalNodeInfoPtr > * conflictConsList
int terminationMode
indicate that termination mode 0: no termination mode 1: normal termination mode 2: interrupted termi...
SCIP_Real getVarVlaueUpvsids(int i, int j)
virtual void sendLocalSolution()
send solution found in this Solver
int maxNSolved
maximum number of subtree nodes rooted from ParaNode
ParaTimer * paraTimer
timer for this ParaSolver
virtual void send(ParaComm *comm, int destination, int tag)=0
send this object
struct ParaSCIP::LocalNodeInfo_t LocalNodeInfo
void setUserPlugins(ScipUserPlugins *inUi)
long long virtualMemUsedAtLc
void writeCurrentTaskProblem(const std::string &filename)
double eps
absolute values smaller than this are considered zero esp should be set in the constructor of the der...
int getOriginalMaxRestart()
virtual int receive(void *bufer, int count, const int datatypeId, int source, const int tag)=0
receive function for standard ParaData types
static const int NoAggressiveSeparatorInRacing
ScipParaObjCommPointHdlr * commPointHdlr
static const int TagUbBoundTightenedIndex
long long nPreviousNodesLeft
virtual ParaSolution * createParaSolution()=0
create ParaSolution object by default constructor
static const int TransferConflictCuts
void includeUserPlugins(SCIP *inScip)
int getNBranchConsSetppcConss()
SCIP_Real getUpconflen(int i)
SCIP_Real getLinearCoefs(int i, int j)
void dropSettingsForVariableBoundsExchnage()
void addBoundChange(SCIP *scip, SCIP_BOUNDTYPE boundType, int index, SCIP_Real bound)
ParaSolution * globalBestIncumbentSolution
global best solution. However, this is not always feasible for the current sub-MIP ...
double idleTimeBetweenParaTasks
idle time between ParaTasks processing
void setOriginalNodeSelectionStrategy()
double minRootNodeTime
minimum time consumed by root node process
#define THROW_LOGICAL_ERROR2(msg1, msg2)
ScipParaObjNodesel * nodesel
static const int InstanceTransferMethod
SCIP_Bool getFlagBoundDisjunctionInitial(int i)
ParaRacingRampUpParamSet extension for SCIP solver.
int getNBranchConsLinearConss()
virtual bool saveIfImprovedSolutionWasFound(ParaSolution *sol)
save improved solution if it was found in this Solver
static const int CompTerminatedNormally
SCIP_Real getLinearRhs(int i)
static const int DistributeBestPrimalSolution
BbParaSolver()
constructor
int getBranchConsLinearIdxCoefsVars(int i, int j)
std::list< LocalNodeInfoPtr > * getConflictConsList()
void solveToCheckEffectOfRootNodePreprocesses()
const char * getStringParamValue(int param)
for char parameters
int getNVarsBoundDisjunction(int i)
ScipParaObjProp * scipPropagator
ParaTask * currentTask
solving task
static const int TagTerminated
virtual bool passTermToken(int rank)
pass termination token from the rank to the next
SCIP_Real getBranchConsLinearCoefs(int i, int j)
C++ wrapper for primal heuristics.
SCIP message handler for ParaSCIP and FiberSCIP.
static const int MemoryLimit
static const int SetAllDefaultsAfterRacing
bool isOriginalIndeciesMap()
double idleTimeToWaitToken
idle time to wait token
void setLightWeightRootNodeProcess()
static const int NoTerminationMode
termination mode
void setWinnerRacingParams(UG::ParaRacingRampUpParamSet *inRacingParams)
SCIP_Real getVarValueDownvsids(int i, int j)
SCIP_Bool getFlagBoundDisjunctionPropagate(int i)
double getDualBoundValue()
getter of dual bound value
int getBranchConsSetppcType(int i)
double maxRootNodeTime
maximum time consumed by root node process
void resetCommPointHdlr()
SCIP_Real getUppscost(int i)
int * extractSolverLocalIndexMap()
int getIdxLinearCoefsVars(int i, int j)
double idleTimeToWaitNotificationId
idle time to wait a message within collecting mode
static const int RampUpPhaseProcess
static const int NoSolverPresolvingAtRootDefaultSet
bool isCollectingAllNodes()
check if Solver is sending all nodes to LoadCoordinaor or not
virtual void send(ParaComm *comm, int dest)=0
send function for ParaInitialStat object
int * mapToOriginalIndecies
static void runInterruptMsgMonitorThread(void *threadData)
ParaRacingRampUpParamSet * winnerRacingParams
Winner ParaRacingRampUpParamSet object.
int ubBoundTightened(int source, int tag)
static const int CommunicateTighterBoundsInRacing
ScipDiffParamSet * scipDiffParamSet
int getBranchConsLinearConsNames()
bool racingIsInterrupted
indicate whether if racing phases is interrupted or not: true - interrupted
static const int TagLbBoundTightenedIndex
TaskId getGeneratorTaskId()
getter of generator task id
int maxTransferredBendersCutsFromSolver
maximum number of benders cuts transferred from this Solver
int getNBendersLinearConss()
static const int TimeLimit
void saveOriginalSettings()
int * extractOrigProbIndexMap()
void issueInterruptSolve()
SCIP_Bool getFlagBoundDisjunctionRemovable(int i)
virtual int getSize()=0
get number of UG processes or UG threads depending on run-time environment
void setOriginalRootNodeProcess()
bool warmStarted
indicate whether if system is warm started or not
static const int RacingStatBranching
int getNBendersLinearCoefs(int i)
static const int TagUbBoundTightenedBound
void recoverOriginalSettings()
static SCIP_DECL_CONFLICTEXEC(conflictExecCollector)
double memoryLimitOfSolverSCIP
bool waitToken(int rank)
wait token for deterministic mode
ParaInstance * paraInstance
root problem instance
SCIP_Real getUpinfer(int i)
SCIP_Bool getFlagBoundDisjunctionCheck(int i)
int totalNImprovedIncumbent
accumulated number of improvements of incumbent value in this BbParaSolver
int getIntParamValue(int param)
for int parameters
ParaComm * paraComm
ParaCommunicator object.
ScipDiffParamSet * originalParamSet
bool copyIncreasedVariables
double totalRootNodeTime
accumulated root node process time solved by this solver so far
ParaParamSet * getParaParamSet()
get ParaParamSet object
static const int SelfSplitTreeDepth
bool isCopyIncreasedVariables()
int totalNSent
accumulated number of nodes sent from this BbParaSolver
class ParaRacingRampUpParamSet (parameter set for racing ramp-up)
int minTransferredLocalCutsFromSolver
minimum number of local cuts transferred from this Solver
static const int NoPreprocessingInLC
#define CONFLICTHDLR_NAME
SCIP_Bool getFlagBoundDisjunctionModifiable(int i)
void saveImprovedSolution()
SCIP_Real getBranchBound(int i)
SCIP_Real getUpvsids(int i)
SCIP_Real getBendersLinearLhs(int i)
class BbParaSolverTerminationState (Solver termination state in a ParaSolver)
ParaInitialStat extension for SCIP solver.
int getBranchConsNLinearCoefs(int i)
Base class of communicator object.
bool racingWinner
indicate racing ramp-up winner or not: true - winner
double idleTimeToWaitAckCompletion
idle time to wait acknowledgment of completion
virtual void freeSubproblem()
int getIdxLBranchStatsVars(int i)
void setOriginalMaxRestart()
SCIP_Real getVarUb(int i)
int minNSolved
minimum number of subtree nodes rooted from ParaNode
int nTransferredLocalCutsFromSolver
number of local cuts transferred from this Solver
#define DEF_SCIP_PARA_COMM(scip_para_comm, comm)
#define THROW_LOGICAL_ERROR3(msg1, msg2, msg3)
SCIP_Real getBranchConsLinearLhs(int i)
SCIP_Real getLinearLhs(int i)
bool getBoolParamValue(int param)
for bool parameters
bool restartingRacing
indicate that this solver is restarting racing