43 #include "scip/struct_nodesel.h" 44 #include "scip/tree.h" 45 #ifdef UG_DEBUG_SOLUTION 46 #ifndef WITH_DEBUG_SOLUTION 47 #define WITH_DEBUG_SOLUTION 49 #include "scip/debug.h" 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;
204 previousLpIter = 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;
224 previousLpIter = 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);
429 if( SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS )
431 assert( SCIPisFeasIntegral(scip, newbound) );
432 newbound = SCIPfeasFloor(scip, newbound);
434 #ifdef UG_DEBUG_SOLUTION 435 SCIP_Real solvalue = 0.0;
436 SCIP_CALL(SCIPdebugGetSolVal(scip,var, &solvalue));
437 std::cout <<
"Sender side SolValue: " << SCIPvarGetName(var) <<
" = " << solvalue << std::endl;
438 std::cout <<
"Sender side (SCIP_BOUNDTYPE_UPPER): " << SCIPvarGetName(var) <<
" = " << newbound << std::endl;
439 SCIP_CALL_ABORT( SCIPdebugCheckUbGlobal(scip,var,newbound) );
450 int orgIndex = SCIPvarGetIndex(var);
495 if( SCIPgetStage(subScip) != SCIP_STAGE_INITSOLVE )
497 SCIP_CALL_ABORT( SCIPinterruptSolve(subScip) );
503 if( SCIPgetStage(scip) != SCIP_STAGE_INITSOLVE )
509 #ifdef UG_DEBUG_SOLUTION 513 if( SCIPdebugSolIsEnabled(scip) )
515 throw "Optimal solution going to be lost!";
518 SCIPdebugSolDisable(scip);
519 std::cout <<
"R." <<
paraComm->
getRank() <<
": disable debug, this solver is interrupted." << std::endl;
521 SCIP_CALL_ABORT( SCIPinterruptSolve(scip) );
541 SCIP_CALL( SCIPgetIntParam(scip,
"presolving/maxrestarts", &maxrestarts) );
542 if( SCIPgetNRuns( scip ) >= maxrestarts )
563 SCIP_Longint nNodes = 0;
564 if( SCIPgetStage(scip) != SCIP_STAGE_PRESOLVING
565 && SCIPgetStage(scip) != SCIP_STAGE_INITSOLVE
568 nNodes = SCIPgetNTotalNodes(scip);
593 if( nNodes == 2 && SCIPgetNNodes(scip) == 2 )
610 SCIPgetDualbound(scip) <
617 SCIP_CALL_ABORT( SCIPinterruptSolve(subScip) );
622 SCIP_CALL_ABORT( SCIPinterruptSolve(scip) );
634 double bestDualBoundValue = -SCIPinfinity(scip);
635 if( SCIPgetStage(scip) == SCIP_STAGE_TRANSFORMED ||
636 SCIPgetStage(scip) == SCIP_STAGE_PRESOLVING ||
637 SCIPgetStage(scip) == SCIP_STAGE_INITSOLVE
644 bestDualBoundValue = std::max(SCIPgetDualbound(scip), dynamic_cast<UG::BbParaNode *>(
scipParaSolver->
getCurrentNode())->getDualBoundValue());
675 if( SCIPgetStage(subScip) != SCIP_STAGE_INITSOLVE )
677 SCIP_CALL_ABORT( SCIPinterruptSolve(subScip) );
683 if( SCIPgetStage(scip) != SCIP_STAGE_INITSOLVE )
685 #ifdef UG_DEBUG_SOLUTION 689 if( SCIPdebugSolIsEnabled(scip) )
691 throw "Optimal solution going to be lost!";
694 SCIPdebugSolDisable(scip);
695 std::cout <<
"R." <<
paraComm->
getRank() <<
": disable debug, this solver is interrupted." << std::endl;
697 SCIP_CALL_ABORT( SCIPinterruptSolve(scip) );
720 if( bestDualBoundValue >= -1e+10 )
723 if( SCIPgetStage(scip) != SCIP_STAGE_TRANSFORMED &&
724 SCIPgetStage(scip) != SCIP_STAGE_PRESOLVING &&
725 SCIPgetStage(scip) != SCIP_STAGE_INITSOLVE )
727 nNodesLeft = SCIPgetNNodesLeft(scip);
735 SCIP_CALL_ABORT( SCIPinterruptSolve(scip) );
818 ( SCIPeventGetType(event) != SCIP_EVENTTYPE_NODEFOCUSED
843 if( SCIPnodeGetDepth( SCIPgetCurrentNode( scip ) )
857 ( SCIPgetNNodesLeft( scip ) > 1 &&
903 assert( nNodes <=2 );
990 SCIP_NODESEL *nodesel = SCIPgetNodesel(scip);
991 SCIP_CALL_ABORT( SCIPsetNodeselStdPriority(scip, nodesel,
1010 SCIP_NODE* node = SCIPgetCurrentNode( scip );
1011 int depth = SCIPnodeGetDepth( node );
1012 SCIP_VAR **branchVars =
new SCIP_VAR*[depth];
1013 SCIP_Real *branchBounds =
new SCIP_Real[depth];
1014 SCIP_BOUNDTYPE *boundTypes =
new SCIP_BOUNDTYPE[depth];
1016 SCIPnodeGetAncestorBranchings( node, branchVars, branchBounds, boundTypes, &nBranchVars, depth );
1017 if( nBranchVars > depth )
1019 delete [] branchVars;
1020 delete [] branchBounds;
1021 delete [] boundTypes;
1022 branchVars =
new SCIP_VAR*[nBranchVars];
1023 branchBounds =
new SCIP_Real[nBranchVars];
1024 boundTypes =
new SCIP_BOUNDTYPE[nBranchVars];
1025 SCIPnodeGetAncestorBranchings( node, branchVars, branchBounds, boundTypes, &nBranchVars, nBranchVars );
1032 int nVars = SCIPgetNVars(scip);
1033 SCIP_VAR **vars = SCIPgetVars(scip);
1034 int *iBranchVars =
new int[nBranchVars];
1036 SCIP_HASHMAP* varmapLb;
1037 SCIP_HASHMAP* varmapUb;
1038 SCIP_CALL_ABORT( SCIPhashmapCreate(&varmapLb, SCIPblkmem(scip), nVars) );
1039 SCIP_CALL_ABORT( SCIPhashmapCreate(&varmapUb, SCIPblkmem(scip), nVars) );
1040 for(
int i = 0; i < nBranchVars; i++ )
1043 if( boundTypes[i] == SCIP_BOUNDTYPE_LOWER )
1045 if( !SCIPhashmapGetImage(varmapLb, branchVars[i]) )
1047 SCIP_CALL_ABORT( SCIPhashmapInsert(varmapLb, branchVars[i], &iBranchVars[i] ) );
1052 if( !SCIPhashmapGetImage(varmapUb, branchVars[i]) )
1054 SCIP_CALL_ABORT( SCIPhashmapInsert(varmapUb, branchVars[i], &iBranchVars[i] ) );
1058 SCIP_VAR **preBranchVars = branchVars;
1059 SCIP_Real *preBranchBounds = branchBounds;
1060 SCIP_BOUNDTYPE *preBboundTypes = boundTypes;
1061 branchVars =
new SCIP_VAR*[nBranchVars+nVars*2];
1062 branchBounds =
new SCIP_Real[nBranchVars+nVars*2];
1063 boundTypes =
new SCIP_BOUNDTYPE[nBranchVars+nVars*2];
1064 for(
int i = 0; i < nBranchVars; i++ )
1066 branchVars[i] = preBranchVars[i];
1067 branchBounds[i] = preBranchBounds[i];
1068 boundTypes[i] = preBboundTypes[i];
1070 int *iBranchVar = NULL;
1071 for(
int i = 0; i < nVars; i++ )
1078 iBranchVar = (
int *)SCIPhashmapGetImage(varmapLb, vars[i]);
1084 branchBounds[*iBranchVar] = SCIPvarGetLbLocal(vars[i]);
1090 if(
EPSGT( SCIPvarGetLbLocal(vars[i]), SCIPvarGetLbGlobal(vars[i]),
MINEPSILON ) )
1092 branchVars[nBranchVars] = vars[i];
1093 branchBounds[nBranchVars] = SCIPvarGetLbLocal(vars[i]);
1094 boundTypes[nBranchVars] = SCIP_BOUNDTYPE_LOWER;
1099 iBranchVar = (
int *)SCIPhashmapGetImage(varmapUb, vars[i]);
1105 branchBounds[*iBranchVar] = SCIPvarGetUbLocal(vars[i]);
1111 if(
EPSLT( SCIPvarGetUbLocal(vars[i]), SCIPvarGetUbGlobal(vars[i]),
MINEPSILON ) )
1113 branchVars[nBranchVars] = vars[i];
1114 branchBounds[nBranchVars] = SCIPvarGetUbLocal(vars[i]);
1115 boundTypes[nBranchVars] = SCIP_BOUNDTYPE_UPPER;
1121 SCIPhashmapFree(&varmapLb);
1122 SCIPhashmapFree(&varmapUb);
1123 delete [] preBranchVars;
1124 delete [] preBranchBounds;
1125 delete [] preBboundTypes;
1126 delete [] iBranchVars;
1134 for(
int v = 0; v < nBranchVars; v++)
1136 int index = SCIPvarGetProbindex(branchVars[v]);
1137 assert(index != -1);
1138 assert(std::string(SCIPvarGetName(branchVars[v]))==std::string(SCIPvarGetName(copyVars[index])));
1139 if( boundTypes[v] == SCIP_BOUNDTYPE_LOWER )
1143 else if (boundTypes[v] == SCIP_BOUNDTYPE_UPPER)
1160 case SCIP_STATUS_OPTIMAL :
1162 SCIP_SOL *bestSol = SCIPgetBestSol( scip );
1163 int nVars = SCIPgetNOrigVars(scip);
1164 SCIP_VAR **vars = SCIPgetOrigVars(scip);
1165 SCIP_Real *vals =
new SCIP_Real[nVars];
1166 SCIP_CALL_ABORT( SCIPgetSolVals(scip, bestSol, nVars, vars, vals) );
1169 scipParaComm->createScipParaSolution(
1171 SCIPgetSolOrigObj(scip, bestSol),
1179 SCIP_CALL_ABORT( SCIPcutoffNode( scip, node) );
1185 case SCIP_STATUS_INFEASIBLE :
1186 case SCIP_STATUS_INFORUNBD :
1189 SCIP_CALL_ABORT( SCIPcutoffNode( scip, node ) );
1195 case SCIP_STATUS_NODELIMIT :
1197 sendNode(scip, node, depth, nBranchVars, branchVars, branchBounds, boundTypes);
1201 THROW_LOGICAL_ERROR2(
"Invalid status after root solvability check: status = ", static_cast<int>(status));
1212 delete [] branchVars;
1213 delete [] branchBounds;
1214 delete [] boundTypes;
1218 sendNode(scip, node, depth, nBranchVars, branchVars, branchBounds, boundTypes);
1221 delete [] branchVars;
1222 delete [] branchBounds;
1223 delete [] boundTypes;
1234 SCIP_VAR **newBranchVars,
1235 SCIP_Real *newBranchBounds,
1236 SCIP_BOUNDTYPE *newBoundTypes
1240 SCIP_CONS** addedcons = 0;
1241 int addedconsssize = SCIPnodeGetNAddedConss(node);
1242 int naddedconss = 0;
1243 if( addedconsssize > 0 )
1245 SCIP_CALL_ABORT( SCIPallocBufferArray(scip, &addedcons, addedconsssize) );
1246 SCIPnodeGetAddedConss(node, addedcons, &naddedconss, addedconsssize);
1264 SCIPfreeBufferArray(scip, &addedcons);
1268 long long n = SCIPnodeGetNumber( node );
1269 double dualBound = SCIPgetDualbound(scip);
1274 assert(SCIPisFeasGE(scip, SCIPnodeGetLowerbound(node) , SCIPgetLowerbound(scip)));
1275 double estimateValue = SCIPnodeGetEstimate( node );
1276 assert(SCIPisFeasGE(scip, estimateValue, SCIPnodeGetLowerbound(node) ));
1277 #ifdef UG_DEBUG_SOLUTION 1278 SCIP_Bool valid = 0;
1279 SCIP_CALL_ABORT( SCIPdebugSolIsValidInSubtree(scip, &valid) );
1280 diffSubproblem->setOptimalSolIndicator(valid);
1281 std::cout <<
"* R." <<
scipParaSolver->
getRank() <<
", debug = " << SCIPdebugSolIsEnabled(scip) <<
", valid = " << valid << std::endl;
1286 #ifdef UG_DEBUG_SOLUTION 1289 SCIPdebugSolDisable(scip);
1290 std::cout <<
"R." <<
paraComm->
getRank() <<
": disable debug, node which contains optmal solution is sent." << std::endl;
1293 SCIP_CALL_ABORT( SCIPcutoffNode( scip, node) );
1302 int numnodesels = SCIPgetNNodesels( scip );
1303 SCIP_NODESEL** nodesels = SCIPgetNodesels( scip );
1305 for( i = 0; i < numnodesels; ++i )
1307 std::string nodeselname(SCIPnodeselGetName(nodesels[i]));
1310 SCIP_CALL_ABORT( SCIPsetNodeselStdPriority(scip, nodesels[i], 536870911 ) );
1313 SCIP_CALL_ABORT( SCIPgetIntParam(scip,
"presolving/maxrestarts", &maxrestarts) );
1314 if( maxrestarts != 0 )
1316 SCIP_CALL_ABORT( SCIPsetIntParam(scip,
"presolving/maxrestarts", 0) );
1321 assert( i != numnodesels );
1328 SCIP_VAR **newBranchVars,
1329 SCIP_Real *newBranchBounds)
1332 bool feasible =
true;
1333 SCIP_Real *branchBounds =
new SCIP_Real[nNewBranchVars];
1334 for(
int v = nNewBranchVars -1 ; v >= 0; --v )
1336 SCIP_VAR *transformVar = newBranchVars[v];
1337 SCIP_Real scalar = 1.0;
1338 SCIP_Real constant = 0.0;
1339 SCIP_CALL_ABORT( SCIPvarGetOrigvarSum(&transformVar, &scalar, &constant ) );
1340 if( transformVar == NULL )
continue;
1342 branchBounds[v] = ( newBranchBounds[v] - constant ) / scalar;
1343 if( SCIPvarGetType(transformVar) != SCIP_VARTYPE_CONTINUOUS
1354 delete [] branchBounds;
bool newParaNodeExists()
check if a new ParaNode was received or not
void setTightenedVarUb(int i, double v)
double getOrgVarLb(int i)
ScipParaObjLimitUpdator * scipParaObjLimitUpdator
static const int NumberOfNodesKeepingInRootSolver
int getOriginalIndex(int index)
double getLcBestDualBoundValue()
get LoadCorrdinator best dual bound value
int getProbIndex(int index)
bool isBreaking()
check if Solver is in racing stage or not
static const int GenerateReducedCheckpointFiles
void changeSearchStrategy(SCIP *scip)
double getBoundGapForStopSolving()
get bound gap for stop solving. This value is not used to decide stop solving. It is used a part of c...
#define DEFAULT_NUM_EPSILON
bool isAggressivePresolvingSpecified()
check if aggressive presolving is specified
ParaInitialStat extension for SCIP solver.
static const int FinalCheckpointGeneratingTime
Event handlr for communication point.
void countInPrecheckSolvedParaNodes()
count ParaNode solved at root node in pre-check
SCIP_Longint previousLpIter
static const int RootNodeSolvabilityCheck
void setRootNodeSimplexIter(int iter)
set number of simplex iteration at root node
double getGlobalBestIncumbentValue()
get global best incumbent value
bool isRacingRampUp()
check if this solver is in racing ramp-up or not
bool startedCollectingNodesForInitialRampUp
bool isOriginalIndeciesMap()
int getSubMipDepth()
get depth of sub-MIP root node in global search tree
int getBigDualGapSubtreeHandlingStrategy()
get big dual gap subtree handling strategy
bool isAggressiveCollecting()
check if Solver is in aggressive collecting mode or not
bool isRacingInterruptRequested()
check if racing interrupt was requested or not
bool isRootTask()
check if root task or not
ParaSolution extension for SCIP solver.
int getAggresivePresolvingDepth()
get depth to apply aggressive presolving
static const int ControlCollectingModeOnSolverSide
virtual void iReceiveMessages()
non-blocking receive messages
bool isRacingStage()
check if Solver is in racing stage or not
double getOrgVarUb(int i)
double getTimeStopSolvingMode()
get time to stop solving. This value is not used to decide stop solving. It is used a part of conditi...
virtual void setRootNodeTime()
set root node computing time
void setNotEnoughGain()
set dual bound gain is not enough
bool isCollecingInterrupt()
check if collecting interrupt (interrupt with collecting all nodes) is requested or not ...
static const int TagLbBoundTightenedBound
ParaDeterministicTimer * getDeterministicTimer()
get deterministic timer object
double getTightenedVarUb(int i)
virtual void sendAnotherNodeRequest(double bestDualBoundValue)
send another node request
#define PARA_COMM_CALL(paracommcall)
static const int Deterministic
virtual int getRank()=0
get rank of this process or this thread depending on run-time environment
bool checkRootNodeSolvabilityAndSendParaNode(SCIP *scip)
SCIP * scipToCheckRootSolvability
bool isTerminationRequested()
check if termination was requested or not
int getCurrentSolivingNodeMergingStatus()
get current solving node merging status
int getAggresivePresolvingStopDepth()
get depth to stop aggressive presolving
void allowCollectingMode()
static const int ParaDOUBLE
double getTargetBound()
get target bound for breaking
SCIP_Longint previousNNodesSolved
virtual double getElapsedTime()=0
getter of the deterministic time
void passToken(int rank)
pass token to the next process
bool isGivenGapReached()
check if given gap is reached or not
static const int NoAlternateSolving
double getRealParamValue(int param)
for real parameters
bool ifFeasibleInOriginalProblem(SCIP *scip, int nNewBranchVars, SCIP_VAR **newBranchVars, SCIP_Real *newBranchBounds)
ParaTask * getCurrentNode()
get current ParaNode object
bool isRacingWinner()
check if this solver is in racing ramp-up or not
bool originalSelectionStrategy
virtual void waitMessageIfNecessary()
wait a notification id message if it is needed to synchronize with LoadCoordinaor ...
virtual void sendLocalSolution()
send solution found in this Solver
long long getSimplexIter()
virtual int getRank()
get rank of this Solver
static const int DualBoundGainBranchRatio
void resetBreakingInfo()
reset breaking information
double getPreviousCommTime()
get previous communication time for deterministic execution
static const int TagUbBoundTightenedIndex
void setPreviousCommTime(double detTime)
set previous communication time for deterministic execution
void setTightenedVarLb(int i, double v)
double getCurrentSolvingNodeInitialDualBound()
get initial dual bound of current solving node
bool isInCollectingMode()
check if Solver is in collecting mode or not
double getTightenedVarLb(int i)
static const int TagAllowToBeInCollectingMode
#define THROW_LOGICAL_ERROR2(msg1, msg2)
double getElapsedTimeOfNodeSolving()
the following functions may be called from callback routines of the target Solver ...
virtual bool saveIfImprovedSolutionWasFound(ParaSolution *sol)
save improved solution if it was found in this Solver
static const int NoAllBoundChangesTransferInRacing
virtual int getThresholdValue(int nNodes)
get threshold value to send ParaNodes to LoadCoordinator
double getAverageDualBoundGain()
get average dual bound gain
bool isCollectingModeProhibited()
static const int ParaBYTE
double getBoundGapForCollectingMode()
get bound gap for collecting mode
bool isRampUp()
check if this solver is ramp-up or not
static const int NotificationInterval
void processNewSolution(SCIP *scip, SCIP_EVENT *event)
static const int AllowableRegressionRatioInMerging
void sendNode(SCIP *scip, SCIP_NODE *node, int depth, int nBranchVars, SCIP_VAR **branchVars, SCIP_Real *branchBounds, SCIP_BOUNDTYPE *boundTypes)
virtual void updatePendingSolution()
update pending solution
bool isDualBoundGainTestNeeded()
check if dual bound gain needs to be tested or not
const char * changeNodeSelName
static const int RampUpPhaseProcess
bool isCollectingAllNodes()
check if Solver is sending all nodes to LoadCoordinaor or not
virtual bool notificationIsNecessary()
check if a notification message needs to send or not
static const int CommunicateTighterBoundsInRacing
virtual int send(void *bufer, int count, const int datatypeId, int dest, const int tag)=0
send function for standard ParaData types
static const int TagLbBoundTightenedIndex
void setSendBackAllNodes()
set counter and flag to indicate that all nodes are sent to LoadCooordinator
int getNStopSolvingMode()
get number of nodes to stop solving. This number is not used to decide stop solving. It is used a part of conditions.
int getOriginalPriority()
static const int TagUbBoundTightenedBound
void setNPreviousNodesLeft(long long n)
virtual SCIP_RETCODE scip_exec(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENT *event, SCIP_EVENTDATA *eventdata)
ScipParaSolver * scipParaSolver
bool waitToken(int rank)
wait token for deterministic mode
int getIntParamValue(int param)
for int parameters
virtual void sendSolverState(long long nNodesSolved, int nNodesLeft, double bestDualBoundValue, double detTime)
send Solver state to LoadCoordinator
bool isGlobalIncumbentUpdated()
check if global incumbent value is updated or not
ParaParamSet * getParaParamSet()
get ParaParamSet object
static const int BreakFirstSubtree
static const int EventWeightedDeterministic
bool isCopyIncreasedVariables()
virtual void update(double value)=0
update function of the deterministic time. the deterministic time is a kind of counter ...
virtual void sendParaNode(long long n, int depth, double dualBound, double estimateValue, ParaDiffSubproblem *diffSubproblem)
send a branch-and-bound node as ParaNode to LoadCoordinator
static const int AllBoundChangesTransfer
static const int DualBoundGainTest
bool isAnotherNodeIsRequested()
check if another node is requested or not
int getNSendInCollectingMode()
get number of ParaNodes already sent in a collecting mode
static const int KeepNodesDepth
bool isManyNodesCollectionRequested()
check if many nodes collection was requested or not
#define DEF_SCIP_PARA_COMM(scip_para_comm, comm)
bool isEnoughGainObtained()
check if dual bound gains enough or not
bool getBoolParamValue(int param)
for bool parameters
bool isTransferLimitReached()
check if the number of ParaNodes sent is reached to transfer limit specified