43#include "scip/struct_nodesel.h"
45#ifdef UG_DEBUG_SOLUTION
46#ifndef WITH_DEBUG_SOLUTION
47#define WITH_DEBUG_SOLUTION
49#include "scip/debug.h"
58ScipParaObjCommPointHdlr::processNewSolution(
63 SCIP_SOL *sol = SCIPeventGetSol(event);
64 int nVars = SCIPgetNOrigVars(scip);
65 SCIP_VAR **vars = SCIPgetOrigVars(scip);
66 SCIP_Real *vals =
new SCIP_Real[nVars];
67 SCIP_CALL_ABORT( SCIPgetSolVals(scip, sol, nVars, vars, vals) );
71 SCIP_CALL_ABORT( SCIPcheckSolOrig(scip,sol,&feasible,1,1 ) );
77 SCIP_VAR **varsInOrig =
new SCIP_VAR*[nVars];
78 SCIP_Real *valsInOrig =
new SCIP_Real[nVars]();
80 for(
int i = 0; i < nVars; i++ )
84 varsInOrig[nVarsInOrig] = vars[i];
85 valsInOrig[nVarsInOrig] = vals[i];
91 scipParaComm->createScipParaSolution(
93 SCIPgetSolOrigObj(scip, sol),
100 delete [] valsInOrig;
105 scipParaComm->createScipParaSolution(
107 SCIPgetSolOrigObj(scip, sol),
123 SCIP_EVENTHDLR* eventhdlr,
125 SCIP_EVENTDATA* eventdata
131 scipParaComm->lockInterruptMsg();
133 assert(eventhdlr != NULL);
134 assert(strcmp(SCIPeventhdlrGetName(eventhdlr),
"ScipParaObjCommPointHdlr") == 0);
135 assert(event != NULL);
136#ifdef SCIP_EVENTTYPE_COMM
137 assert(SCIPeventGetType(event) &
138 ( SCIP_EVENTTYPE_GBDCHANGED |
139 SCIP_EVENTTYPE_BOUNDTIGHTENED |
140 SCIP_EVENTTYPE_LPEVENT |
141 SCIP_EVENTTYPE_ROWEVENT |
143 SCIP_EVENTTYPE_NODEEVENT |
144 SCIP_EVENTTYPE_BESTSOLFOUND |
149 assert(SCIPeventGetType(event) &
150 ( SCIP_EVENTTYPE_GBDCHANGED |
151 SCIP_EVENTTYPE_BOUNDTIGHTENED |
152 SCIP_EVENTTYPE_LPEVENT |
153 SCIP_EVENTTYPE_ROWEVENT |
155 SCIP_EVENTTYPE_NODEEVENT |
156 SCIP_EVENTTYPE_BESTSOLFOUND
161#if SCIP_VERSION == 211 && SCIP_SUBVERSION == 0
162 if( SCIPgetStage(scip) >= SCIP_STAGE_FREESOLVE )
164 if( SCIPgetStage(scip) >= SCIP_STAGE_EXITSOLVE )
169 scipParaComm->unlockInterruptMsg();
174 double detTime = -1.0;
187 if( SCIPeventGetType(event) == SCIP_EVENTTYPE_FIRSTLPSOLVED )
189 SCIP_Longint totalLpIter = 0;
192 totalLpIter = SCIPgetNLPIterations(subScip);
196 totalLpIter = SCIPgetNLPIterations(scip);
201 lpIter = totalLpIter;
207 else if ( SCIPeventGetType(event) == SCIP_EVENTTYPE_LPSOLVED )
209 SCIP_Longint totalLpIter = 0;
212 totalLpIter = SCIPgetNLPIterations(subScip);
216 totalLpIter = SCIPgetNLPIterations(scip);
221 lpIter = totalLpIter;
226 else if ( SCIPeventGetType(event) == SCIP_EVENTTYPE_BESTSOLFOUND
227 || SCIPeventGetType(event) == SCIP_EVENTTYPE_NODEFOCUSED )
237 if ( SCIPeventGetType(event) != SCIP_EVENTTYPE_BESTSOLFOUND
238 && SCIPeventGetType(event) != SCIP_EVENTTYPE_NODEFOCUSED )
247 if( SCIPeventGetType(event) == SCIP_EVENTTYPE_BESTSOLFOUND )
253 scipParaComm->unlockInterruptMsg();
270 if( SCIPeventGetType(event) == SCIP_EVENTTYPE_BESTSOLFOUND )
276 scipParaComm->unlockInterruptMsg();
297 scipParaComm->unlockInterruptMsg();
307 SCIPgetStage(scip) != SCIP_STAGE_PRESOLVING
308 && SCIPgetStage(scip) != SCIP_STAGE_INITSOLVE )
314 ( SCIPeventGetType(event) & (SCIP_EVENTTYPE_NODEEVENT | SCIP_EVENTTYPE_LPEVENT)
331#ifdef UG_DEBUG_SOLUTION
332 if( SCIPdebugSolIsEnabled(scip) )
334 throw "Optimal solution going to be lost!";
337 SCIP_CALL_ABORT( SCIPinterruptSolve(scip) );
349 && (SCIPeventGetType(event) & SCIP_EVENTTYPE_GBDCHANGED )
350 && (SCIPvarGetStatus(SCIPeventGetVar(event)) != SCIP_VARSTATUS_LOOSE )
351 && (SCIPvarGetStatus(SCIPeventGetVar(event)) != SCIP_VARSTATUS_AGGREGATED )
355 SCIP_BOUNDTYPE boundtype;
356 SCIP_Var *var = SCIPeventGetVar(event);
357 switch( SCIPeventGetType(event) )
359 case SCIP_EVENTTYPE_GLBCHANGED:
360 boundtype = SCIP_BOUNDTYPE_LOWER;
362 case SCIP_EVENTTYPE_GUBCHANGED:
363 boundtype = SCIP_BOUNDTYPE_UPPER;
369 SCIP_Real newbound = SCIPeventGetNewbound(event);
370 SCIP_Real constant = 0.0;
371 SCIP_Real scalar = 1.0;
372 SCIP_CALL_ABORT( SCIPvarGetOrigvarSum(&var, &scalar, &constant) );
375 assert(SCIPvarIsOriginal(var));
376 int index = SCIPvarGetIndex(var);
377 boundtype = scalar < 0.0 ? (SCIP_BOUNDTYPE)(1 - boundtype) : boundtype;
378 newbound = (newbound - constant) / scalar;
383 if( index < scipParaSolver->getNOrgVars() )
385 if( boundtype == SCIP_BOUNDTYPE_LOWER )
387 if( SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS )
389 assert( SCIPisFeasIntegral(scip, newbound) );
390 newbound = SCIPfeasCeil(scip, newbound);
392 #ifdef UG_DEBUG_SOLUTION
393 SCIP_Real solvalue = 0.0;
394 SCIP_CALL(SCIPdebugGetSolVal(scip,var, &solvalue));
395 std::cout <<
"Sender side SolValue: " << SCIPvarGetName(var) <<
" = " << solvalue << std::endl;
396 std::cout <<
"Sender side (SCIP_BOUNDTYPE_LOWER): " << SCIPvarGetName(var) <<
" = " << newbound << std::endl;
397 SCIP_CALL_ABORT( SCIPdebugCheckLbGlobal(scip,var,newbound) );
408 int orgIndex = SCIPvarGetIndex(var);
415 orgIndex >= 0 && orgIndex < scipParaSolver->getNOrgVars() ) )
434 if( SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS )
436 assert( SCIPisFeasIntegral(scip, newbound) );
437 newbound = SCIPfeasFloor(scip, newbound);
439 #ifdef UG_DEBUG_SOLUTION
440 SCIP_Real solvalue = 0.0;
441 SCIP_CALL(SCIPdebugGetSolVal(scip,var, &solvalue));
442 std::cout <<
"Sender side SolValue: " << SCIPvarGetName(var) <<
" = " << solvalue << std::endl;
443 std::cout <<
"Sender side (SCIP_BOUNDTYPE_UPPER): " << SCIPvarGetName(var) <<
" = " << newbound << std::endl;
444 SCIP_CALL_ABORT( SCIPdebugCheckUbGlobal(scip,var,newbound) );
455 int orgIndex = SCIPvarGetIndex(var);
500 if( SCIPgetStage(subScip) != SCIP_STAGE_INITSOLVE )
502 SCIP_CALL_ABORT( SCIPinterruptSolve(subScip) );
508 if( SCIPgetStage(scip) != SCIP_STAGE_INITSOLVE )
514 #ifdef UG_DEBUG_SOLUTION
518 if( SCIPdebugSolIsEnabled(scip) )
520 throw "Optimal solution going to be lost!";
523 SCIPdebugSolDisable(scip);
524 std::cout <<
"R." <<
paraComm->
getRank() <<
": disable debug, this solver is interrupted." << std::endl;
526 SCIP_CALL_ABORT( SCIPinterruptSolve(scip) );
546 SCIP_CALL( SCIPgetIntParam(scip,
"presolving/maxrestarts", &maxrestarts) );
547 if( SCIPgetNRuns( scip ) >= maxrestarts )
568 SCIP_Longint nNodes = 0;
569 if( SCIPgetStage(scip) != SCIP_STAGE_PRESOLVING
570 && SCIPgetStage(scip) != SCIP_STAGE_INITSOLVE
573 nNodes = SCIPgetNTotalNodes(scip);
598 if( nNodes == 2 && SCIPgetNNodes(scip) == 2 )
615 SCIPgetDualbound(scip) <
622 SCIP_CALL_ABORT( SCIPinterruptSolve(subScip) );
627 SCIP_CALL_ABORT( SCIPinterruptSolve(scip) );
639 double bestDualBoundValue = -SCIPinfinity(scip);
640 if( SCIPgetStage(scip) == SCIP_STAGE_TRANSFORMED ||
641 SCIPgetStage(scip) == SCIP_STAGE_PRESOLVING ||
642 SCIPgetStage(scip) == SCIP_STAGE_INITSOLVE
680 if( SCIPgetStage(subScip) != SCIP_STAGE_INITSOLVE )
682 SCIP_CALL_ABORT( SCIPinterruptSolve(subScip) );
688 if( SCIPgetStage(scip) != SCIP_STAGE_INITSOLVE )
690#ifdef UG_DEBUG_SOLUTION
694 if( SCIPdebugSolIsEnabled(scip) )
696 throw "Optimal solution going to be lost!";
699 SCIPdebugSolDisable(scip);
700 std::cout <<
"R." <<
paraComm->
getRank() <<
": disable debug, this solver is interrupted." << std::endl;
702 SCIP_CALL_ABORT( SCIPinterruptSolve(scip) );
728 if( SCIPgetStage(scip) != SCIP_STAGE_TRANSFORMED &&
729 SCIPgetStage(scip) != SCIP_STAGE_PRESOLVING &&
730 SCIPgetStage(scip) != SCIP_STAGE_INITSOLVE )
732 nNodesLeft = SCIPgetNNodesLeft(scip);
740 SCIP_CALL_ABORT( SCIPinterruptSolve(scip) );
761 ( nNodes < scipParaSolver->getNStopSolvingMode() ) &&
800 nNodes < scipParaSolver->getNStopSolvingMode() ) )
823 ( SCIPeventGetType(event) != SCIP_EVENTTYPE_NODEFOCUSED
848 if( SCIPnodeGetDepth( SCIPgetCurrentNode( scip ) )
862 ( SCIPgetNNodesLeft( scip ) > 1 &&
908 assert( nNodes <=2 );
995 SCIP_NODESEL *nodesel = SCIPgetNodesel(scip);
996 SCIP_CALL_ABORT( SCIPsetNodeselStdPriority(scip, nodesel,
1015 SCIP_NODE* node = SCIPgetCurrentNode( scip );
1016 int depth = SCIPnodeGetDepth( node );
1017 SCIP_VAR **branchVars =
new SCIP_VAR*[depth];
1018 SCIP_Real *branchBounds =
new SCIP_Real[depth];
1019 SCIP_BOUNDTYPE *boundTypes =
new SCIP_BOUNDTYPE[depth];
1021 SCIPnodeGetAncestorBranchings( node, branchVars, branchBounds, boundTypes, &nBranchVars, depth );
1022 if( nBranchVars > depth )
1024 delete [] branchVars;
1025 delete [] branchBounds;
1026 delete [] boundTypes;
1027 branchVars =
new SCIP_VAR*[nBranchVars];
1028 branchBounds =
new SCIP_Real[nBranchVars];
1029 boundTypes =
new SCIP_BOUNDTYPE[nBranchVars];
1030 SCIPnodeGetAncestorBranchings( node, branchVars, branchBounds, boundTypes, &nBranchVars, nBranchVars );
1037 int nVars = SCIPgetNVars(scip);
1038 SCIP_VAR **vars = SCIPgetVars(scip);
1039 int *iBranchVars =
new int[nBranchVars];
1041 SCIP_HASHMAP* varmapLb;
1042 SCIP_HASHMAP* varmapUb;
1043 SCIP_CALL_ABORT( SCIPhashmapCreate(&varmapLb, SCIPblkmem(scip), nVars) );
1044 SCIP_CALL_ABORT( SCIPhashmapCreate(&varmapUb, SCIPblkmem(scip), nVars) );
1045 for(
int i = 0; i < nBranchVars; i++ )
1048 if( boundTypes[i] == SCIP_BOUNDTYPE_LOWER )
1050 if( !SCIPhashmapGetImage(varmapLb, branchVars[i]) )
1052 SCIP_CALL_ABORT( SCIPhashmapInsert(varmapLb, branchVars[i], &iBranchVars[i] ) );
1057 if( !SCIPhashmapGetImage(varmapUb, branchVars[i]) )
1059 SCIP_CALL_ABORT( SCIPhashmapInsert(varmapUb, branchVars[i], &iBranchVars[i] ) );
1063 SCIP_VAR **preBranchVars = branchVars;
1064 SCIP_Real *preBranchBounds = branchBounds;
1065 SCIP_BOUNDTYPE *preBboundTypes = boundTypes;
1066 branchVars =
new SCIP_VAR*[nBranchVars+nVars*2];
1067 branchBounds =
new SCIP_Real[nBranchVars+nVars*2];
1068 boundTypes =
new SCIP_BOUNDTYPE[nBranchVars+nVars*2];
1069 for(
int i = 0; i < nBranchVars; i++ )
1071 branchVars[i] = preBranchVars[i];
1072 branchBounds[i] = preBranchBounds[i];
1073 boundTypes[i] = preBboundTypes[i];
1075 int *iBranchVar = NULL;
1076 for(
int i = 0; i < nVars; i++ )
1083 iBranchVar = (
int *)SCIPhashmapGetImage(varmapLb, vars[i]);
1089 branchBounds[*iBranchVar] = SCIPvarGetLbLocal(vars[i]);
1095 if(
EPSGT( SCIPvarGetLbLocal(vars[i]), SCIPvarGetLbGlobal(vars[i]),
MINEPSILON ) )
1097 branchVars[nBranchVars] = vars[i];
1098 branchBounds[nBranchVars] = SCIPvarGetLbLocal(vars[i]);
1099 boundTypes[nBranchVars] = SCIP_BOUNDTYPE_LOWER;
1104 iBranchVar = (
int *)SCIPhashmapGetImage(varmapUb, vars[i]);
1110 branchBounds[*iBranchVar] = SCIPvarGetUbLocal(vars[i]);
1116 if(
EPSLT( SCIPvarGetUbLocal(vars[i]), SCIPvarGetUbGlobal(vars[i]),
MINEPSILON ) )
1118 branchVars[nBranchVars] = vars[i];
1119 branchBounds[nBranchVars] = SCIPvarGetUbLocal(vars[i]);
1120 boundTypes[nBranchVars] = SCIP_BOUNDTYPE_UPPER;
1126 SCIPhashmapFree(&varmapLb);
1127 SCIPhashmapFree(&varmapUb);
1128 delete [] preBranchVars;
1129 delete [] preBranchBounds;
1130 delete [] preBboundTypes;
1131 delete [] iBranchVars;
1139 for(
int v = 0; v < nBranchVars; v++)
1141 int index = SCIPvarGetProbindex(branchVars[v]);
1142 assert(index != -1);
1143 assert(std::string(SCIPvarGetName(branchVars[v]))==std::string(SCIPvarGetName(copyVars[index])));
1144 if( boundTypes[v] == SCIP_BOUNDTYPE_LOWER )
1148 else if (boundTypes[v] == SCIP_BOUNDTYPE_UPPER)
1165 case SCIP_STATUS_OPTIMAL :
1167 SCIP_SOL *bestSol = SCIPgetBestSol( scip );
1168 int nVars = SCIPgetNOrigVars(scip);
1169 SCIP_VAR **vars = SCIPgetOrigVars(scip);
1170 SCIP_Real *vals =
new SCIP_Real[nVars];
1171 SCIP_CALL_ABORT( SCIPgetSolVals(scip, bestSol, nVars, vars, vals) );
1174 scipParaComm->createScipParaSolution(
1176 SCIPgetSolOrigObj(scip, bestSol),
1184 SCIP_CALL_ABORT( SCIPcutoffNode( scip, node) );
1190 case SCIP_STATUS_INFEASIBLE :
1191 case SCIP_STATUS_INFORUNBD :
1194 SCIP_CALL_ABORT( SCIPcutoffNode( scip, node ) );
1200 case SCIP_STATUS_NODELIMIT :
1202 sendNode(scip, node, depth, nBranchVars, branchVars, branchBounds, boundTypes);
1206 THROW_LOGICAL_ERROR2(
"Invalid status after root solvability check: status = ",
static_cast<int>(status));
1217 delete [] branchVars;
1218 delete [] branchBounds;
1219 delete [] boundTypes;
1223 sendNode(scip, node, depth, nBranchVars, branchVars, branchBounds, boundTypes);
1226 delete [] branchVars;
1227 delete [] branchBounds;
1228 delete [] boundTypes;
1239 SCIP_VAR **newBranchVars,
1240 SCIP_Real *newBranchBounds,
1241 SCIP_BOUNDTYPE *newBoundTypes
1245 SCIP_CONS** addedcons = 0;
1246 int addedconsssize = SCIPnodeGetNAddedConss(node);
1247 int naddedconss = 0;
1248 if( addedconsssize > 0 )
1250 SCIP_CALL_ABORT( SCIPallocBufferArray(scip, &addedcons, addedconsssize) );
1251 SCIPnodeGetAddedConss(node, addedcons, &naddedconss, addedconsssize);
1269 SCIPfreeBufferArray(scip, &addedcons);
1273 long long n = SCIPnodeGetNumber( node );
1274 double dualBound = SCIPgetDualbound(scip);
1279 assert(SCIPisFeasGE(scip, SCIPnodeGetLowerbound(node) , SCIPgetLowerbound(scip)));
1280 double estimateValue = SCIPnodeGetEstimate( node );
1281 assert(SCIPisFeasGE(scip, estimateValue, SCIPnodeGetLowerbound(node) ));
1282#ifdef UG_DEBUG_SOLUTION
1283 SCIP_Bool valid = 0;
1284 SCIP_CALL_ABORT( SCIPdebugSolIsValidInSubtree(scip, &valid) );
1285 diffSubproblem->setOptimalSolIndicator(valid);
1286 std::cout <<
"* R." <<
scipParaSolver->
getRank() <<
", debug = " << SCIPdebugSolIsEnabled(scip) <<
", valid = " << valid << std::endl;
1291#ifdef UG_DEBUG_SOLUTION
1294 SCIPdebugSolDisable(scip);
1295 std::cout <<
"R." <<
paraComm->
getRank() <<
": disable debug, node which contains optmal solution is sent." << std::endl;
1298 SCIP_CALL_ABORT( SCIPcutoffNode( scip, node) );
1307 int numnodesels = SCIPgetNNodesels( scip );
1308 SCIP_NODESEL** nodesels = SCIPgetNodesels( scip );
1310 for( i = 0; i < numnodesels; ++i )
1312 std::string nodeselname(SCIPnodeselGetName(nodesels[i]));
1315 SCIP_CALL_ABORT( SCIPsetNodeselStdPriority(scip, nodesels[i], 536870911 ) );
1318 SCIP_CALL_ABORT( SCIPgetIntParam(scip,
"presolving/maxrestarts", &maxrestarts) );
1319 if( maxrestarts != 0 )
1321 SCIP_CALL_ABORT( SCIPsetIntParam(scip,
"presolving/maxrestarts", 0) );
1326 assert( i != numnodesels );
1333 SCIP_VAR **newBranchVars,
1334 SCIP_Real *newBranchBounds)
1337 bool feasible =
true;
1338 SCIP_Real *branchBounds =
new SCIP_Real[nNewBranchVars];
1339 for(
int v = nNewBranchVars -1 ; v >= 0; --v )
1341 SCIP_VAR *transformVar = newBranchVars[v];
1342 SCIP_Real scalar = 1.0;
1343 SCIP_Real constant = 0.0;
1344 SCIP_CALL_ABORT( SCIPvarGetOrigvarSum(&transformVar, &scalar, &constant ) );
1345 if( transformVar == NULL )
continue;
1347 branchBounds[v] = ( newBranchBounds[v] - constant ) / scalar;
1348 if( SCIPvarGetType(transformVar) != SCIP_VARTYPE_CONTINUOUS
1359 delete [] branchBounds;
ScipParaObjLimitUpdator * scipParaObjLimitUpdator
SCIP_Longint previousNNodesSolved
ScipParaSolver * scipParaSolver
bool originalSelectionStrategy
const char * changeNodeSelName
void processNewSolution(SCIP *scip, SCIP_EVENT *event)
SCIP * scipToCheckRootSolvability
SCIP_Longint previousLpIter
bool checkRootNodeSolvabilityAndSendParaNode(SCIP *scip)
void sendNode(SCIP *scip, SCIP_NODE *node, int depth, int nBranchVars, SCIP_VAR **branchVars, SCIP_Real *branchBounds, SCIP_BOUNDTYPE *boundTypes)
void changeSearchStrategy(SCIP *scip)
bool ifFeasibleInOriginalProblem(SCIP *scip, int nNewBranchVars, SCIP_VAR **newBranchVars, SCIP_Real *newBranchBounds)
virtual SCIP_RETCODE scip_exec(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENT *event, SCIP_EVENTDATA *eventdata)
bool startedCollectingNodesForInitialRampUp
int getOriginalPriority()
bool isCopyIncreasedVariables()
int getOriginalIndex(int index)
long long getSimplexIter()
void allowCollectingMode()
void setNPreviousNodesLeft(long long n)
double getOrgVarLb(int i)
double getTightenedVarUb(int i)
void setTightenedVarUb(int i, double v)
bool isCollectingModeProhibited()
void setTightenedVarLb(int i, double v)
double getTightenedVarLb(int i)
int getProbIndex(int index)
double getOrgVarUb(int i)
bool isOriginalIndeciesMap()
double getDualBoundValue()
getter of dual bound value
virtual void sendSolverState(long long nNodesSolved, int nNodesLeft, double bestDualBoundValue, double detTime)
send Solver state to LoadCoordinator
virtual int getRank()
get rank of this Solver
double getCurrentSolvingNodeInitialDualBound()
get initial dual bound of current solving node
bool isAggressivePresolvingSpecified()
check if aggressive presolving is specified
double getElapsedTimeOfNodeSolving()
the following functions may be called from callback routines of the target Solver
bool isRacingRampUp()
check if this solver is in racing ramp-up or not
bool isManyNodesCollectionRequested()
check if many nodes collection was requested or not
bool isRacingInterruptRequested()
check if racing interrupt was requested or not
bool isCollectingAllNodes()
check if Solver is sending all nodes to LoadCoordinaor or not
ParaTask * getCurrentNode()
get current ParaNode object
bool isTransferLimitReached()
check if the number of ParaNodes sent is reached to transfer limit specified
bool isAggressiveCollecting()
check if Solver is in aggressive collecting mode or not
bool isCollecingInterrupt()
check if collecting interrupt (interrupt with collecting all nodes) is requested or not
virtual void waitMessageIfNecessary()
wait a notification id message if it is needed to synchronize with LoadCoordinaor
bool newParaNodeExists()
check if a new ParaNode was received or not
ParaParamSet * getParaParamSet()
get ParaParamSet object
void setRootNodeSimplexIter(int iter)
set number of simplex iteration at root node
void setNotEnoughGain()
set dual bound gain is not enough
void resetBreakingInfo()
reset breaking information
void setSendBackAllNodes()
set counter and flag to indicate that all nodes are sent to LoadCooordinator
int getCurrentSolivingNodeMergingStatus()
get current solving node merging status
int getNStopSolvingMode()
get number of nodes to stop solving. This number is not used to decide stop solving....
void passToken(int rank)
pass token to the next process
virtual void sendLocalSolution()
send solution found in this Solver
bool isAnotherNodeIsRequested()
check if another node is requested or not
double getGlobalBestIncumbentValue()
get global best incumbent value
bool isGivenGapReached()
check if given gap is reached or not
virtual void iReceiveMessages()
non-blocking receive messages
double getTimeStopSolvingMode()
get time to stop solving. This value is not used to decide stop solving. It is used a part of conditi...
bool isDualBoundGainTestNeeded()
check if dual bound gain needs to be tested or not
double getAverageDualBoundGain()
get average dual bound gain
virtual void sendParaNode(long long n, int depth, double dualBound, double estimateValue, ParaDiffSubproblem *diffSubproblem)
send a branch-and-bound node as ParaNode to LoadCoordinator
int getBigDualGapSubtreeHandlingStrategy()
get big dual gap subtree handling strategy
virtual void sendAnotherNodeRequest(double bestDualBoundValue)
send another node request
bool isBreaking()
check if Solver is in racing stage or not
double getBoundGapForCollectingMode()
get bound gap for collecting mode
bool isInCollectingMode()
check if Solver is in collecting mode or not
bool isGlobalIncumbentUpdated()
check if global incumbent value is updated or not
bool isRacingStage()
check if Solver is in racing stage or not
int getSubMipDepth()
get depth of sub-MIP root node in global search tree
virtual void setRootNodeTime()
set root node computing time
bool isEnoughGainObtained()
check if dual bound gains enough or not
double getTargetBound()
get target bound for breaking
int getAggresivePresolvingStopDepth()
get depth to stop aggressive presolving
double getLcBestDualBoundValue()
get LoadCorrdinator best dual bound value
virtual bool saveIfImprovedSolutionWasFound(ParaSolution *sol)
save improved solution if it was found in this Solver
virtual int getThresholdValue(int nNodes)
get threshold value to send ParaNodes to LoadCoordinator
void countInPrecheckSolvedParaNodes()
count ParaNode solved at root node in pre-check
virtual bool notificationIsNecessary()
check if a notification message needs to send or not
int getAggresivePresolvingDepth()
get depth to apply aggressive presolving
double getBoundGapForStopSolving()
get bound gap for stop solving. This value is not used to decide stop solving. It is used a part of c...
int getNSendInCollectingMode()
get number of ParaNodes already sent in a collecting mode
bool waitToken(int rank)
wait token for deterministic mode
virtual int send(void *bufer, int count, const int datatypeId, int dest, const int tag)=0
send function for standard ParaData types
virtual int getRank()=0
get rank of this process or this thread depending on run-time environment
virtual void update(double value)=0
update function of the deterministic time. the deterministic time is a kind of counter
virtual double getElapsedTime()=0
getter of the deterministic time
bool getBoolParamValue(int param)
get bool parameter value
double getRealParamValue(int param)
get real parameter value
int getIntParamValue(int param)
get int parameter value
virtual void updatePendingSolution()
update pending solution
void setPreviousCommTime(double detTime)
set previous communication time for deterministic execution
bool isRampUp()
check if this solver is ramp-up or not
ParaDeterministicTimer * getDeterministicTimer()
get deterministic timer object
bool isRacingWinner()
check if this solver is in racing ramp-up or not
bool isTerminationRequested()
check if termination was requested or not
double getPreviousCommTime()
get previous communication time for deterministic execution
bool isRootTask()
check if root task or not
static const int RootNodeSolvabilityCheck
static const int BreakFirstSubtree
static const int NoAllBoundChangesTransferInRacing
static const int DualBoundGainTest
static const int TagLbBoundTightenedBound
static const int NumberOfNodesKeepingInRootSolver
static const int TagAllowToBeInCollectingMode
static const int FinalCheckpointGeneratingTime
static const int EventWeightedDeterministic
static const int NotificationInterval
static const int TagLbBoundTightenedIndex
static const int TagUbBoundTightenedIndex
static const int ParaBYTE
static const int ControlCollectingModeOnSolverSide
static const int NoAlternateSolving
static const int GenerateReducedCheckpointFiles
static const int Deterministic
static const int RampUpPhaseProcess
static const int TagUbBoundTightenedBound
static const int DualBoundGainBranchRatio
static const int AllBoundChangesTransfer
static const int KeepNodesDepth
static const int AllowableRegressionRatioInMerging
static const int ParaDOUBLE
static const int CommunicateTighterBoundsInRacing
#define PARA_COMM_CALL(paracommcall)
#define THROW_LOGICAL_ERROR2(msg1, msg2)
#define DEFAULT_NUM_EPSILON
#define DEF_SCIP_PARA_COMM(scip_para_comm, comm)
ParaInitialStat extension for SCIP solver.
Event handlr for communication point.
ParaSolution extension for SCIP solver.