37#ifndef __BB_PARA_SOLVER_H__
38#define __BB_PARA_SOLVER_H__
55#define ENFORCED_THRESHOLD 5
442 std::cerr <<
"********** BbParaSolver does not use this function. **********" << std::endl;
452 int nSelfSplitNodesLeft
461 int nSelfSplitNodesLeft
873 long long nNodesSolved,
875 double bestDualBoundValue,
934 double estimateValue,
945 double estimateValue,
953 double bestDualBoundValue
1383 const std::string& filename
1399 std::cout <<
"*** virtual function BbParaSolver::setLightWeightRootNodeProcess is called ***" << std::endl;
1408 std::cout <<
"*** virtual function BbParaSolver::setOriginalRootNodeProcess is called ***" << std::endl;
Base class for BbParaNode.
Parameter set for UG framework.
virtual size_t getNumOfNodes()=0
get number of BbParaNodes in this pool
virtual void sendSolverState(long long nNodesSolved, int nNodesLeft, double bestDualBoundValue, double detTime)
send Solver state to LoadCoordinator
int minTransferredLocalCuts
minimum number of local cuts (including conflict cuts) transferred from a ParaNode
virtual bool wasTerminatedNormally()=0
check if Solver was terminated normally or not
int getSelfSplitNodesLeft()
get the number of nodes in slef-split node pool
virtual int getRank()
get rank of this Solver
virtual void sendCompletionOfCalculation(double stopTime)
send completion of calculation
double getCurrentSolvingNodeInitialDualBound()
get initial dual bound of current solving node
bool givenGapIsReached
indicate that the given gap is reached or not
virtual void setOriginalNodeSelectionStrategy()=0
set original node selection strategy
virtual void restartRacing()
restart racing
bool keepRacing
indicate if Solver needs to do racing ramp-up repeatedly in case of warm start
int minNSolved
minimum number of subtree nodes rooted from ParaNode
virtual int processTagSolution(int source, int tag)
process TagSolution
bool restartingRacing
indicate that this solver is restarting racing
int nSendInCollectingMode
number of nodes need to send in collecting mode
virtual long long getNNodesSolved()=0
get number of nodes solved
double globalBestCutOffValue
global best cut off value
virtual int processTagTerminateSolvingToRestart(int source, int tag)
process TagTerminateSolvingToRestart
virtual int processTagLCBestBoundValue(int source, int tag)
process TagLCBestBoundValue
bool isAggressivePresolvingSpecified()
check if aggressive presolving is specified
virtual void waitAckCompletion()
wait ack completion to synchronized with LoadCoordinator
virtual bool sendIfImprovedSolutionWasFound(ParaSolution *sol)
send improved solution if it was found in this Solver
virtual int processTagWinner(int source, int tag)
process TagWinner
int nTransferredBendersCuts
number of benders cuts transferred from a ParaNode
double getElapsedTimeOfNodeSolving()
the following functions may be called from callback routines of the target Solver
bool aggressiveCollecting
indicate that if this solver has two nodes, this solver sends one to LC
virtual void createSubproblem()=0
create subproblem
double globalBestDualBoundValueAtWarmStart
global best dual bound value which is set when system warm starts
void updateNTransferredLocalCuts(int n)
update number of transferred local cuts
int nSolved
Counters related to the current ParaNode.
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 isIterativeBreakDownApplied()
check if iterative break down is applied or not
int maxNSolved
maximum number of subtree nodes rooted from ParaNode
virtual bool updateGlobalBestCutOffValue(double newValue)
update global best cutoff value
bool collectingManyNodes
indicate that many nodes collecting is requested by LC
bool localIncumbentIsChecked
indicate if a local incumbent solution is checked or not
virtual bool updateGlobalBestIncumbentSolution(ParaSolution *sol)
update global best incumbent solution
BbParaSolver()
constructor
virtual int processTagGivenGapIsReached(int source, int tag)
process TagGivenGapIsReached
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
virtual void sendSolverTerminationState()
send Solver termination state
int maxRestarts
maximum number of restarts
virtual int processTagBreaking(int source, int tag)
process TagBreaking
virtual int processTagTaskReceived(int source, int tag)
process TagTaskReceived
bool collectingInterrupt
when the solver is interrupted, all nodes are collected to LC
int maxTransferredLocalCuts
maximum number of local cuts (including conflict cuts) transferred from a ParaNode
ParaTask * getCurrentNode()
get current ParaNode object
ParaComm * getParaComm()
get paraParaComm
virtual void solveToCheckEffectOfRootNodePreprocesses()
solve to check effect of root node preprocesses
int maxTransferredBendersCuts
maximum number of benders cuts transferred from a ParaNode
bool onceBreak
indicate that the sub-MIP is broken down once
virtual int processTagNoTestDualBoundGain(int source, int tag)
process TagNoTestDualBoundGain
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
virtual int processTagInterruptRequest(int source, int tag)
process TagInterruptRequest
int totalNSolved
Counters related to this BbParaSolver.
virtual int processTagKeepRacing(int source, int tag)
process TagKeepRacing
virtual int processTagCollectAllNodes(int source, int tag)
process TagCollectAllNodes
virtual int getNRestarts()
get number of restarts (Derived class for SCIP should override this function)
void globalIncumbnetValueIsReflected()
set global incumbent value is reflected
bool enoughGainObtained
indicate that the root node process improved dual bound enough or not
bool isCollecingInterrupt()
check if collecting interrupt (interrupt with collecting all nodes) is requested or not
void updateNTransferredBendersCuts(int n)
update number of transferred benders cuts
virtual bool updateGlobalBestIncumbentValue(double newValue)
update global best incumbent value
virtual void issueInterruptSolve()
issue interrupt to solve
virtual int processTagTerminateRequest(int source, int tag)
process TagTerminateRequest
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
int nParaNodesSolvedAtRoot
number of ParaNodes solved at root node
void setRootNodeSimplexIter(int iter)
set number of simplex iteration at root node
bool lightWeightRootNodeComputation
indicate that fast root node computation is required
void setNotEnoughGain()
set dual bound gain is not enough
virtual int processTagWinnerRacingRampUpParamSet(int source, int tag)
process TagWinnerRacingRampUpParamSet
virtual void writeCurrentTaskProblem(const std::string &filename)=0
write current node problem (this method is always useful for debugging, so we should implement this m...
virtual void run(ParaRacingRampUpParamSet *inRacingRampUpParamSet)
run this Solver with ParaNode object
int nSimplexIterRoot
number of simplex iteration at root node
void resetBreakingInfo()
reset breaking information
int maxNii
maximum number of integer infeasibility
int minTransferredBendersCuts
minimum number of benders cuts transferred from a ParaNode
virtual void waitNotificationIdMessage()
wait notification id message to synchronized with LoadCoordinator
virtual ~BbParaSolver()
destructor
virtual void notifySelfSplitFinished()
notify Self-Split finished
void setSendBackAllNodes()
set counter and flag to indicate that all nodes are sent to LoadCooordinator
int getCurrentSolivingNodeMergingStatus()
get current solving node merging status
double maxRootNodeTime
maximum time consumed by root node process
virtual int processTagUbBoundTightened(int source, int tag)
process TagUbBoundTightened
int getNStopSolvingMode()
get number of nodes to stop solving. This number is not used to decide stop solving....
int nCollectOnce
number of nodes need to collect once
void passToken(int rank)
pass token to the next process
virtual int processTagInCollectingMode(int source, int tag)
process TagInCollectingMode
virtual bool receiveNewTaskAndReactivate()
wait for receiving a new node and reactivate solver
double getCutOffValue()
get cut off value
virtual void changeSearchStrategy(int searchStrategy)
change search strategy
virtual void sendLocalSolution()
send solution found in this Solver
int(BbParaSolver::* BbMessageHandlerFunctionPointer)(int, int)
bool isAnotherNodeIsRequested()
check if another node is requested or not
virtual int processTagLbBoundTightened(int source, int tag)
process TagLbBoundTightened
virtual void setOriginalRootNodeProcess()
set original root node process
double getPendingIncumbentValue()
get pending incumbent value
double getGlobalBestIncumbentValue()
get global best incumbent value
virtual int processTagRampUp(int source, int tag)
process TagRampUp
bool isGivenGapReached()
check if given gap is reached or not
virtual int processTagRestart(int source, int tag)
process TagRestart
virtual void iReceiveMessages()
non-blocking receive messages
virtual int processTagNoNodes(int source, int tag)
process TagNoNodes
virtual void sendCompletionOfCalculationWithoutSolving(double stopTime, int tag, int nSelfSplitNodesLeft)
send completion of calculation with arguments
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 rootNodeTime
Times.
virtual void keepParaNode(long long n, int depth, double dualBound, double estimateValue, ParaDiffSubproblem *diffSubproblem)
keep a branch-and-bound node as ParaNode to LoadCoordinator
int nSolvedWithNoPreprocesses
number of nodes solved when it is solved with no preprocesses
bool collectingMode
indicate whether if this solver is in collecting mode or not
virtual int processTagGlobalBestDualBoundValueAtWarmStart(int source, int tag)
process TagGlobalBestDualBoundValueAtWarmStart
double lcBestDualBoundValue
LoadCoordinator best dual bound value.
virtual int processTagLightWeightRootNodeProcess(int source, int tag)
process TagLightWeightRootNodeProcess
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
double maxIisum
maximum sum of integer infeasibility
virtual void solve()=0
solve (sub)problem
int totalNSent
accumulated number of nodes sent from this BbParaSolver
bool isBreaking()
check if Solver is in racing stage or not
int minRestarts
minimum number of restarts
BbParaNodePool * selfSplitNodePool
Pool in Solver.
virtual int processTagTask(int source, int tag)
process TagNode
double getBoundGapForCollectingMode()
get bound gap for collecting mode
double solverDualBound
dual bound value achieved for a subproblem
int nTightenedInt
the number of tightened integral variable bounds in racing
virtual int processTagCutOffValue(int source, int tag)
process TagCutOffValue
bool isInCollectingMode()
check if Solver is in collecting mode or not
int nTransferredNodes
keep track number of transferred nodes for breaking
virtual void setLightWeightRootNodeProcess()
set light weight root node process
int nTransferredBendersCutsFromSolver
number of benders cuts transferred from this Solver
virtual int getNTightenedInt()
get number of tightened integral variables during racing
double targetBound
target bound value for breaking
virtual void writeSubproblem()=0
write subproblem
virtual double getDualBoundValue()=0
get dual bound value
double getRootNodeTime()
get root node computing time
virtual void setRacingParams(ParaRacingRampUpParamSet *racingParms, bool winnerParam)=0
set racing parameters
virtual int getNTightened()
get number of tightened variables during racing
bool isGlobalIncumbentUpdated()
check if global incumbent value is updated or not
bool isRacingStage()
check if Solver is in racing stage or not
double minRootNodeTime
minimum time consumed by root node process
int getSubMipDepth()
get depth of sub-MIP root node in global search tree
virtual void setRootNodeTime()
set root node computing time
bool anotherNodeIsRequested
indicate that another node is requested or not
bool testDualBoundGain
indicate that the dual bound gain needs to test or not
virtual int ubBoundTightened(int source, int tag)
upper bound of variable tightened
int minTransferredLocalCutsFromSolver
minimum number of local cuts transferred from this Solver
ParaInstance * getParaInstance()
get ParaInstance object
virtual int lbBoundTightened(int source, int tag)
lower bound of variable tightened
virtual int getNNodesLeft()=0
get number of nodes left
bool isEnoughGainObtained()
check if dual bound gains enough or not
virtual int processTagToken(int source, int tag)
process TagToken
double getGlobalBestDualBoundValueAtWarmStart()
get global best dual bound value at warm start (restart)
double getTargetBound()
get target bound for breaking
virtual void setWinnerRacingParams(ParaRacingRampUpParamSet *racingParms)=0
set winner racing parameters
virtual long long getSimplexIter()=0
get number of simplex iterations
double averageDualBoundGain
average dual bound gain
virtual int processTagIncumbentValue(int source, int tag)
process TagIncumbentValue
int minTransferredBendersCutsFromSolver
minimum number of benders cuts transferred from this Solver
int getAggresivePresolvingStopDepth()
get depth to stop aggressive presolving
int nParaNodesSolvedAtPreCheck
number of ParaNodes solved at pre-checking of root node solvability
virtual int processTagRetryRampUp(int source, int tag)
process TagRetryRampUp
double minIisum
minimum sum of integer infeasibility
virtual int processTagTestDualBoundGain(int source, int tag)
process TagTestDualBoundGain
virtual int processTagNoWaitModeSend(int source, int tag)
process TagNoWaitModeSend
virtual void tryNewSolution(ParaSolution *sol)=0
try to enter solution to base solver environment
double getLcBestDualBoundValue()
get LoadCorrdinator best dual bound value
void setKeepRacing(bool value)
set keep racing value
int minNii
minimum number of integer infeasibility
int maxTransferredBendersCutsFromSolver
maximum number of benders cuts transferred from this Solver
int nTransferLimit
limit number of transferring nodes for breaking
virtual void freeSubproblem()=0
free subproblem
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
int nSent
number of ParaNodes sent from this subtree rooted from the current ParaNode
int maxTransferredLocalCutsFromSolver
maximum number of local cuts transferred from this Solver
bool isOnceBreak()
check if once breaking procedure worked or not
int nTransferredLocalCuts
number of local cuts (including conflict cuts) transferred from a ParaNode
double totalRootNodeTime
accumulated root node process time solved by this solver so far
virtual int processTagOutCollectingMode(int source, int tag)
process TagOutCollectingMode
int totalNImprovedIncumbent
accumulated number of improvements of incumbent value in this BbParaSolver
virtual bool canGenerateSpecialCutOffValue()
check if base solver can generate special cut off value or not
void countInPrecheckSolvedParaNodes()
count ParaNode solved at root node in pre-check
void setOnceBreak()
set once braking procedure worked
virtual bool notificationIsNecessary()
check if a notification message needs to send or not
int getAggresivePresolvingDepth()
get depth to apply aggressive presolving
void setII(double sum, int count)
set sum and number of integer infeasibility
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 nTotalRestarts
number of total restarts
int getNSendInCollectingMode()
get number of ParaNodes already sent in a collecting mode
virtual int processTagNotificationId(int source, int tag)
process TagNotificationId
bool noWaitModeSend
indicate that no wait mode sending is applied
bool waitToken(int rank)
wait token for deterministic mode
bool getNotificaionProcessed()
check if Solver is in notification process or not TODO: function name should be changed
Base class of communicator object.
virtual void passToken(int rank)
pass token to from the rank to the next
virtual bool waitToken(int rank)
wait token when UG runs with deterministic mode
virtual ParaTask * createParaTask()=0
create ParaTask 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
Class for the difference between instance and subproblem.
bool getBoolParamValue(int param)
get bool parameter value
double getRealParamValue(int param)
get real parameter value
int getIntParamValue(int param)
get int parameter value
class ParaRacingRampUpParamSet (parameter set for racing ramp-up)
ParaParamSet * paraParams
ParaParamSet object.
ParaComm * paraComm
ParaCommunicator object.
virtual void run()=0
run this Solver
double paraTaskStartTime
start time of current ParaTask
ParaTask * currentTask
solving task
bool notificationProcessed
if true, notification is issued but not receive the corresponding LCB
bool racingInterruptIsRequested
indicate a racing interrupt is requested
int nParaTasksReceived
Counters related to this ParaSolver.
double pendingIncumbentValue
incumbent value which is pending to update in case of deterministic runs
double idleTimeToWaitToken
idle time to wait token
ParaTimer * paraTimer
timer for this ParaSolver
ParaRacingRampUpParamSet * racingParams
ParaRacingRampUpParamSet object. This is also a flag to indicate running with racing ramp-up.
ParaTask * newTask
new task to solve
double globalBestIncumbentValue
global best incumbent value
bool globalIncumbnetValueUpdateFlag
indicate that global incumbent value is updated in iReceiveMessages() routine
int nHandlers
number of valid message handlers
ParaInstance * paraInstance
root problem instance
virtual int bcast(ParaComm *comm, int root)=0
broadcast this object
virtual double getElapsedTime()=0
get elapsed time
static ScipParaCommTh * comm
static const int TimeStopSolvingMode
static const int AggressivePresolveDepth
static const int BigDualGapSubtreeHandling
static const int AggressivePresolveStopDepth
static const int Deterministic
static const int RampUpPhaseProcess
static const int BgapStopSolvingMode
static const int BgapCollectingMode
static const int NStopSolvingMode
static const int IterativeBreakDown
Base class of communicator for UG Framework.
#define PARA_COMM_CALL(paracommcall)
Defines for UG Framework.
#define THROW_LOGICAL_ERROR1(msg1)
Base class for deterministic timer.
Base class for racing ramp-up parameter set.
Base class for solver: Generic parallelized solver.