Scippy

UG

Ubiquity Generator framework

BbParaSolverPool Class Referenceabstract

class BbParaSolverPool (Solver Pool base class) More...

#include <bbParaSolverPool.h>

+ Inheritance diagram for BbParaSolverPool:

Public Member Functions

 BbParaSolverPool (double inMp, double inBgap, double inMBgap, int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer)
 constructor More...
 
 BbParaSolverPool (double inMp, double inBgap, double inMBgap, int inNSolvers, int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer)
 constructor More...
 
virtual ~BbParaSolverPool ()
 destructor More...
 
virtual void interruptRequested (int rank)
 set the Solver specified by rank is terminate requested More...
 
virtual void terminateRequested (int rank)
 set the Solver specified by rank is terminate requested More...
 
virtual bool isInterruptRequested (int rank)
 check if the Solver specified by rank is interrupt requested or not More...
 
virtual bool isTerminateRequested (int rank)
 check if the Solver specified by rank is terminate requested or not More...
 
virtual void terminated (int rank)
 set the Solver specified by rank is terminated More...
 
virtual bool isTerminated (int rank)
 check if the Solver specified by rank is terminated or not More...
 
virtual void reinitToRestart ()
 reinitialize to restart More...
 
virtual void activate ()
 activate this Solver pool More...
 
virtual bool isActive ()
 check if this Solver pool is active or not More...
 
virtual std::size_t getNSolvers ()
 get number of Solvers in this Solver pool More...
 
virtual unsigned long long getNnodesSolvedInSolvers ()
 get number of nodes solved in current running Solvers More...
 
virtual unsigned long long getTotalNodesSolved ()
 get number of nodes solved in all Solvers: updated at termination of subtree computation More...
 
virtual void addTotalNodesSolved (unsigned long long num)
 add number of nodes solved in all Solvers More...
 
virtual unsigned long long getNnodesInSolvers ()
 get number of nodes in all Solvers More...
 
virtual std::size_t getNumActiveSolvers ()
 get number of active Solvers More...
 
virtual std::size_t getNumInactiveSolvers ()
 get number of inactive Solvers More...
 
virtual bool isSolverActive (int rank)
 check if the Solver specified by rank is active or not More...
 
virtual ParaTaskgetCurrentTask (int rank)
 get current solving BbParaNode in the Solver specified by rank */ More...
 
virtual bool canIncreaseLimitNLimitCollectingModeSolvers ()
 check if the number of Solvers in collecting mode can be increased or not More...
 
virtual std::size_t getNLimitCollectingModeSolvers ()
 get limit number of Solvers that can be in collecting mode More...
 
virtual bool isInCollectingMode ()
 check if this system is in collecting mode or not More...
 
virtual bool isSolverInCollectingMode (int rank)
 get collecting mode of the Solver specified by rank More...
 
virtual BbParaNodeextractCurrentNodeAndInactivate (int rank, BbParaNodePool *paraNodePool)
 extract current solving BbParaNode in the Solver specified by rank and inactivate the Solver More...
 
virtual bool currentSolvingNodehaeDescendant (int rank)
 extract current solving BbParaNode in the Solver specified by rank and inactivate the Solver More...
 
virtual void addNumNodesSolved (long long numOfNodesSolved)
 add number of nodes solved More...
 
virtual long long getNumOfNodesSolved (int rank)
 get the number of nodes solved by the Solver specified More...
 
virtual int getNumOfNodesLeft (int rank)
 get the number of nodes left by the Solver specified More...
 
virtual int getNumOfNodesLeftInBestSolver ()
 get the number of nodes left in the Solver which has the best dual bound value More...
 
virtual int getBestSolver ()
 get rank of the Solver which has top priority in selection criteria More...
 
virtual int getGoodSolverSolvingEssentialNode ()
 get rank of the Solver which has top priority in selection criteria More...
 
virtual double getDualBoundValue (int rank)
 get dual bound value of solving BbParaNode by the Solver specified More...
 
virtual void setTermState (int rank, ParaSolverTerminationState *inTermState)
 set SolverTerminationState to the Solver specified More...
 
virtual ParaSolverTerminationStategetTermState (int rank)
 get SolverTermination state of the Solver specified More...
 
virtual void updateDualBoundsForSavingNodes ()
 update dual bound values of saving BbParaNodes by their dual bound values for subtrees More...
 
virtual void incNLimitCollectingModeSolvers ()
 increase the limit number of Solvers getting into collecting mode More...
 
virtual void setCollectingIsAllowed (int rank)
 set collecting mode is allowed to the Solver specified by rank More...
 
virtual int getInactiveSolverRank ()
 get an inactive Solver rank More...
 
virtual void activateSolver (int rank, BbParaNode *node, int nGoodNodesInNodePool, double averageDualBoundGain)
 activate the Solver specified by rank with specified node which has been sent More...
 
virtual void activateSolver (int rank, BbParaNode *node, int nNodesLeft)
 activate the Solver specified by rank with specified node which has been sent and nNodesLeft (This method is for the racing winner) TODO: Need to check how this function is used More...
 
virtual int activateSolver (BbParaNode *node, BbParaRacingSolverPool *paraRacingSolverPool, bool rampUpPhase, int nGoodNodesInNodePool, double averageDualBoundGain)
 activate a Solver with specified BbParaNode which is sent within this Solver pool More...
 
virtual void addNewSubtreeRootNode (int rank, BbParaNode *node)
 add new subtree root node to the active solver with the specified rank More...
 
virtual void makeSubtreeRootNodeCurrent (int rank, BbParaNode *node)
 make subtree root node as current task for the specified rank More...
 
virtual void removeSubtreeRootNode (int rank, BbParaNode *node)
 remove subtree root node from the active solver with the specified rank More...
 
virtual BbParaNodeextractSelfSplitSubtreeRootNode (int rank, BbParaNode *node)
 extract self-split subtree root node from the active solver with the specified rank More...
 
virtual BbParaNodegetSelfSplitSubtreeRootNodes (int rank)
 get self-split subtree root node from the active solver with the specified rank More...
 
virtual BbParaNodeextractSelfSplitSubtreeRootNodes (int rank)
 extract self-split subtree root node from the active solver with the specified rank More...
 
virtual void deleteCurrentSubtreeRootNode (int rank)
 delete current self-split subtree root node from the active solver with the specified rank More...
 
virtual void inactivateSolver (int rank, long long numOfNodesSolved, BbParaNodePool *paraNodePool)
 inactivate the Solver specified by rank More...
 
virtual void resetCountersInSolver (int rank, long long numOfNodesSolved, int numOfSelfSplitNodesLeft, BbParaNodePool *paraNodePool)
 reset counters in the Solver specified by rank More...
 
virtual BbParaNodesolverDied (int rank)
 kill the Solver specified by rank More...
 
virtual void switchOutCollectingMode ()
 switch out collecting mode More...
 
virtual void enforcedSwitchOutCollectingMode (int rank)
 enforced to switch out collecting mode of the Solver specified by rank if it is necessary More...
 
virtual void sendSwitchOutCollectingModeIfNecessary (int rank)
 switch out collecting mode of the Solver specified by rank if it is necessary More...
 
virtual double getGlobalBestDualBoundValue ()=0
 get global best dual bound value More...
 
virtual void switchInCollectingMode (BbParaNodePool *paraNodePool)=0
 switch in collecting mode More...
 
virtual void updateSolverStatus (int rank, long long numNodesSolved, int numNodesLeft, double solverLocalBestBound, BbParaNodePool *paraNodePool)=0
 update Solver status More...
 
virtual int getMCollectingNodes ()
 get multiplier of collecting BbParaNodes More...
 
virtual int getMMaxCollectingNodes ()
 get maximum multiplier for the number of collecting BbParaNodes More...
 
virtual double getSwichOutTime ()
 the following functions are to omit rebooting collecting mode process More...
 
virtual void setSwichOutTime (double time)
 set time of switching out collecting mode More...
 
virtual bool isDualBounGainTesting (int rank)
 check if dual bound gain testing is proceeding or not in the Solver specified More...
 
- Public Member Functions inherited from ParaSolverPool
 ParaSolverPool (int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer)
 constructor More...
 
virtual ~ParaSolverPool ()
 destructor More...
 
std::size_t getNSolvers ()
 get number of Solvers in this Solver pool More...
 

Protected Member Functions

virtual void switchInCollectingToSolver (int rank, BbParaNodePool *paraNodePool)
 switch a Solver to be in collecting mode More...
 

Protected Attributes

bool active
 indicate if this pool is active or not More...
 
double bgap
 threshold value of gap More...
 
double mp
 multiplier of the threshold value p More...
 
double mBgap
 multiplier of the bgap value More...
 
double absoluteGap
 allowable absolute dual bound gap to the best Solver More...
 
std::size_t nGenerator
 number of generators More...
 
std::size_t nCollectingModeSolvers
 number of collecting mode Solvers More...
 
std::size_t nMaxCollectingModeSolvers
 maximum number of Solvers that can be in collecting mode More...
 
std::size_t nLimitCollectingModeSolvers
 limit number of Solvers that can be in collecting mode More...
 
unsigned long long nNodesSolvedInSolvers
 number of nodes solved in current running Solvers More...
 
unsigned long long nTotalNodesSolved
 number of nodes solved : updated at termination of subtree computation More...
 
unsigned long long nNodesInSolvers
 number of nodes in all Solvers More...
 
bool collectingMode
 indicate that this system is in collecting mode or not More...
 
bool breakingFirstSubtree
 breaking the first subtree More...
 
bool beforeInitialCollect
 before initial collecting mode More...
 
bool beforeFinishingFirstCollect
 before finishing first collecting mode More...
 
std::map< int, BbParaSolverPoolElementPtrinactiveSolvers
 pointers to inactive Solvers More...
 
std::map< int, BbParaSolverPoolElementPtractiveSolvers
 pointers to active Solvers More...
 
std::map< int, BbParaSolverPoolElementPtrdeadSolvers
 pointers to dead Solvers More...
 
std::multimap< double, BbParaSolverPoolElementPtrcandidatesOfCollectingModeSolvers
 pointers to candidates of collecting mode Solvers More...
 
BbParaSolverPoolElementPtrpool
 Solver pool indexed by Solver's rank. More...
 
SelectionHeapselectionHeap
 pointers to active Solvers in ascending or descending order More...
 
CollectingModeSolverHeapcollectingModeSolverHeap
 pointers to collecting mode Solvers in ascending or descending order More...
 
double switchOutTime
 switch out time More...
 
int mCollectingNodes
 multiplier for the number of collecting BbParaNodes More...
 
int mMaxCollectingNodes
 maximum multiplier for the number of collecting BbParaNodes More...
 
int nDualBoundGainTesting
 the number of dual bound gain testing Solvers More...
 
- Protected Attributes inherited from ParaSolverPool
int originRank
 origin rank of Solvers managed by this Solver pool More...
 
std::size_t nSolvers
 number of Solvers More...
 
ParaCommparaComm
 communicator More...
 
ParaParamSetparaParams
 runtime parameters for parallelization More...
 
ParaTimerparaTimer
 timer More...
 

Detailed Description

class BbParaSolverPool (Solver Pool base class)

Definition at line 1347 of file bbParaSolverPool.h.

Constructor & Destructor Documentation

◆ BbParaSolverPool() [1/2]

BbParaSolverPool ( double  inMp,
double  inBgap,
double  inMBgap,
int  inOriginRank,
ParaComm inParaComm,
ParaParamSet inParaParams,
ParaTimer inParaTimer 
)

constructor

Parameters
inMpmultiplier of the threshold value p
inBgapthreshold value of gap
inMBgapmultiplier of the bgap value
inOriginRankorigin rank of Solvers managed by this Solver pool
inParaCommcommunicator used
inParaParamsparaParamSet used
inParaTimertimer used

Definition at line 1394 of file bbParaSolverPool.h.

References UG::ABgapForSwitchingToBestSolver, BbParaSolverPoolElement::BbParaSolverPoolElement(), UG::BreakFirstSubtree, UG::MaxNumberOfCollectingModeSolvers, UG::MinNumberOfCollectingModeSolvers, nSolvers, and BbParaSolverPoolElement::setNoGenerator().

◆ BbParaSolverPool() [2/2]

BbParaSolverPool ( double  inMp,
double  inBgap,
double  inMBgap,
int  inNSolvers,
int  inOriginRank,
ParaComm inParaComm,
ParaParamSet inParaParams,
ParaTimer inParaTimer 
)

constructor

Parameters
inMpmultiplier of the threshold value p
inBgapthreshold value of gap
inMBgapmultiplier of the bgap value
inNSolversnumber of solvers
inOriginRankorigin rank of Solvers managed by this Solver pool
inParaCommcommunicator used
inParaParamsparaParamSet used
inParaTimertimer used

Definition at line 1457 of file bbParaSolverPool.h.

References UG::ABgapForSwitchingToBestSolver, BbParaSolverPoolElement::BbParaSolverPoolElement(), UG::BreakFirstSubtree, UG::MaxNumberOfCollectingModeSolvers, UG::MinNumberOfCollectingModeSolvers, nSolvers, and BbParaSolverPoolElement::setNoGenerator().

◆ ~BbParaSolverPool()

virtual ~BbParaSolverPool ( )
virtual

destructor

Definition at line 1521 of file bbParaSolverPool.h.

References nSolvers.

Member Function Documentation

◆ activate()

virtual void activate ( )
virtual

activate this Solver pool

Definition at line 1630 of file bbParaSolverPool.h.

◆ activateSolver() [1/3]

void activateSolver ( int  rank,
BbParaNode paraNode,
int  nGoodNodesInNodePool,
double  averageDualBoundGain 
)
virtual

activate the Solver specified by rank with specified node which has been sent

activate Solver specified by its rank

Parameters
rankrank of the Solver to be activated
paraNodepointer to BbParaNode object to be sent to the Solver
nGoodNodesInNodePoolnumber of good nodes in BbParaNodePool object
averageDualBoundGaincurrent average dual bound gain

Definition at line 662 of file bbParaSolverPool.cpp.

References UG::ControlCollectingModeOnSolverSide, UG::DualBoundGainTest, UG::Inactive, UG::MultiplierForCollectingMode, UG::NChangeIntoCollectingMode, nSolvers, PARA_COMM_CALL, UG::ParaBYTE, UG::ParaDOUBLE, BbParaNode::send(), SOLVER_POOL_INDEX, UG::TagNoTestDualBoundGain, UG::TagTestDualBoundGain, and THROW_LOGICAL_ERROR2.

Referenced by BbParaLoadCoordinator::run(), and BbParaLoadCoordinator::sendParaTasksToIdleSolvers().

◆ activateSolver() [2/3]

void activateSolver ( int  rank,
BbParaNode paraNode,
int  nNodesLeft 
)
virtual

activate the Solver specified by rank with specified node which has been sent and nNodesLeft (This method is for the racing winner) TODO: Need to check how this function is used

activate Solver specified by its rank and number of nodes left. This is for the racing winner.

DO NOT PROHIBIT COLLECTING MODE. THIS IS ACTIVATION ROUTIN FOR RACING WIINGER

Parameters
rankrank of the Solver to be activated
paraNodepointer to BbParaNode object to be sent to the Solver
nNodesLeftthe number of nodes left in the Solver

Definition at line 735 of file bbParaSolverPool.cpp.

References UG::Inactive, nSolvers, SOLVER_POOL_INDEX, and THROW_LOGICAL_ERROR2.

◆ activateSolver() [3/3]

int activateSolver ( BbParaNode paraNode,
BbParaRacingSolverPool paraRacingSolverPool,
bool  rampUpPhase,
int  nGoodNodesInNodePool,
double  averageDualBoundGain 
)
virtual

activate a Solver with specified BbParaNode which is sent within this Solver pool

Returns
rank of Solver which is activated

activate any Solver which is idle

Parameters
paraNodepointer to BbParaNode object to be sent to a Solver
paraRacingSolverPoolpointer to paraRacingSolverPool object to check if the Solver is not solving root node
rampUpPhaseindicate if ramp-up phase or not
nGoodNodesInNodePoolnumber of good BbParaNodes in BbParaNodePool
averageDualBoundGaincurrent average bound gain

Definition at line 781 of file bbParaSolverPool.cpp.

References UG::ControlCollectingModeOnSolverSide, UG::DualBoundGainTest, BbParaNode::getMergeNodeInfo(), BbParaNode::getMergingStatus(), BbParaRacingSolverPool::isSolverActive(), UG::LightWeightRootNodeProcess, UG::MultiplierForCollectingMode, UG::NChangeIntoCollectingMode, nSolvers, PARA_COMM_CALL, UG::ParaBYTE, UG::ParaDOUBLE, UG::RatioToApplyLightWeightRootProcess, BbParaNode::send(), SOLVER_POOL_INDEX, UG::TagLightWeightRootNodeProcess, UG::TagNoTestDualBoundGain, UG::TagTestDualBoundGain, and THROW_LOGICAL_ERROR1.

◆ addNewSubtreeRootNode()

void addNewSubtreeRootNode ( int  rank,
BbParaNode node 
)
virtual

add new subtree root node to the active solver with the specified rank

Parameters
rankthe active solver rank
nodenew subtree root node

Definition at line 870 of file bbParaSolverPool.cpp.

References UG::Active, UG::InterruptRequested, nSolvers, SOLVER_POOL_INDEX, UG::Terminated, UG::TerminateRequested, THROW_LOGICAL_ERROR2, and THROW_LOGICAL_ERROR3.

◆ addNumNodesSolved()

virtual void addNumNodesSolved ( long long  numOfNodesSolved)
virtual

add number of nodes solved

Parameters
numOfNodesSolvednumber of nodes solved

Definition at line 1832 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::numOfNodesSolved.

◆ addTotalNodesSolved()

virtual void addTotalNodesSolved ( unsigned long long  num)
virtual

add number of nodes solved in all Solvers

Parameters
numnumber of nodes solved

Definition at line 1677 of file bbParaSolverPool.h.

Referenced by BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ canIncreaseLimitNLimitCollectingModeSolvers()

virtual bool canIncreaseLimitNLimitCollectingModeSolvers ( )
virtual

check if the number of Solvers in collecting mode can be increased or not

Returns
true if the number can be increased, false otherwise

Definition at line 1739 of file bbParaSolverPool.h.

◆ currentSolvingNodehaeDescendant()

virtual bool currentSolvingNodehaeDescendant ( int  rank)
virtual

extract current solving BbParaNode in the Solver specified by rank and inactivate the Solver

Returns
pointer to BbParaNode object check if solving BbParaNode in the Solver specified has descendant or not
true if the Solver has descendant, false otherwise
Parameters
ranksolver rank to be checked

Definition at line 1822 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getCurrentNode(), ParaTask::hasDescendant(), and SOLVER_POOL_INDEX.

◆ deleteCurrentSubtreeRootNode()

void deleteCurrentSubtreeRootNode ( int  rank)
virtual

delete current self-split subtree root node from the active solver with the specified rank

Parameters
rankthe active solver rank

Definition at line 1142 of file bbParaSolverPool.cpp.

References UG::Active, UG::InterruptRequested, nSolvers, SOLVER_POOL_INDEX, UG::Terminated, UG::TerminateRequested, and THROW_LOGICAL_ERROR2.

Referenced by BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ enforcedSwitchOutCollectingMode()

void enforcedSwitchOutCollectingMode ( int  rank)
virtual

enforced to switch out collecting mode of the Solver specified by rank if it is necessary

switch out collecting mode to the specified rank if it is necessary

sending TagOutCollectingMode is harmless

pool[SOLVER_POOL_INDEX(rank)]->isOutCollectingMode() should be true

Parameters
rankrank of the Solver

Definition at line 1470 of file bbParaSolverPool.cpp.

References PARA_COMM_CALL, UG::ParaBYTE, SOLVER_POOL_INDEX, and UG::TagOutCollectingMode.

◆ extractCurrentNodeAndInactivate()

virtual BbParaNode* extractCurrentNodeAndInactivate ( int  rank,
BbParaNodePool paraNodePool 
)
virtual

extract current solving BbParaNode in the Solver specified by rank and inactivate the Solver

Returns
pointer to BbParaNode object
Parameters
rankrank of the Solver to be inactivated
paraNodePoolpointer to BbParaNodePool to pass it to inactivateSolver routine

Definition at line 1785 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::extractCurrentNode(), and SOLVER_POOL_INDEX.

◆ extractSelfSplitSubtreeRootNode()

BbParaNode * extractSelfSplitSubtreeRootNode ( int  rank,
BbParaNode node 
)
virtual

extract self-split subtree root node from the active solver with the specified rank

Parameters
rankthe active solver rank
nodesubtree root node to be removed

Definition at line 1049 of file bbParaSolverPool.cpp.

References UG::Active, BbParaNode::next, nSolvers, SOLVER_POOL_INDEX, and THROW_LOGICAL_ERROR2.

◆ extractSelfSplitSubtreeRootNodes()

BbParaNode * extractSelfSplitSubtreeRootNodes ( int  rank)
virtual

extract self-split subtree root node from the active solver with the specified rank

Parameters
rankthe active solver rank

Definition at line 1130 of file bbParaSolverPool.cpp.

References nSolvers, SOLVER_POOL_INDEX, and THROW_LOGICAL_ERROR2.

◆ getBestSolver()

virtual int getBestSolver ( )
virtual

get rank of the Solver which has top priority in selection criteria

Returns
rank of the Solver

Definition at line 1884 of file bbParaSolverPool.h.

References SelectionHeap::getHeapSize(), BbParaSolverPoolElement::getRank(), and SelectionHeap::top().

◆ getCurrentTask()

virtual ParaTask* getCurrentTask ( int  rank)
virtual

get current solving BbParaNode in the Solver specified by rank */

Returns
pointer to BbParaNode object
Parameters
rankrank of the Solver

Implements ParaSolverPool.

Definition at line 1728 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getCurrentNode(), and SOLVER_POOL_INDEX.

Referenced by BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ getDualBoundValue()

virtual double getDualBoundValue ( int  rank)
virtual

get dual bound value of solving BbParaNode by the Solver specified

Returns
dual bound value
Parameters
rankrank of the Solver

Definition at line 1927 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getBestDualBoundValue(), and SOLVER_POOL_INDEX.

◆ getGlobalBestDualBoundValue()

virtual double getGlobalBestDualBoundValue ( )
pure virtual

get global best dual bound value

Returns
global best dual bound value

Implemented in BbParaSolverPoolForMinimization.

◆ getGoodSolverSolvingEssentialNode()

virtual int getGoodSolverSolvingEssentialNode ( )
virtual

get rank of the Solver which has top priority in selection criteria

Returns
rank of the Solver

Definition at line 1901 of file bbParaSolverPool.h.

References SelectionHeap::get(), SelectionHeap::getHeapSize(), BbParaSolverPoolElement::getRank(), and BbParaSolverPoolElement::rank.

◆ getInactiveSolverRank()

virtual int getInactiveSolverRank ( )
virtual

get an inactive Solver rank

Returns
rank of inactivate Solver

Definition at line 2050 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::numOfNodesSolved, and BbParaSolverPoolElement::rank.

◆ getMCollectingNodes()

virtual int getMCollectingNodes ( )
virtual

get multiplier of collecting BbParaNodes

Returns
multiplier of collecting BbParaNodes

Definition at line 2235 of file bbParaSolverPool.h.

◆ getMMaxCollectingNodes()

virtual int getMMaxCollectingNodes ( )
virtual

get maximum multiplier for the number of collecting BbParaNodes

Returns
maximum multiplier for the number of collecting BbParaNodes

Definition at line 2245 of file bbParaSolverPool.h.

◆ getNLimitCollectingModeSolvers()

virtual std::size_t getNLimitCollectingModeSolvers ( )
virtual

get limit number of Solvers that can be in collecting mode

Returns
limit number of Solvers that can be in collecting mode

Definition at line 1749 of file bbParaSolverPool.h.

◆ getNnodesInSolvers()

virtual unsigned long long getNnodesInSolvers ( )
virtual

get number of nodes in all Solvers

Definition at line 1687 of file bbParaSolverPool.h.

◆ getNnodesSolvedInSolvers()

virtual unsigned long long getNnodesSolvedInSolvers ( )
virtual

get number of nodes solved in current running Solvers

Definition at line 1659 of file bbParaSolverPool.h.

◆ getNSolvers()

virtual std::size_t getNSolvers ( )
virtual

get number of Solvers in this Solver pool

Returns
number of Solvers

Definition at line 1650 of file bbParaSolverPool.h.

References nSolvers.

◆ getNumActiveSolvers()

virtual std::size_t getNumActiveSolvers ( )
virtual

get number of active Solvers

Returns
number of active Solvers

Implements ParaSolverPool.

Definition at line 1697 of file bbParaSolverPool.h.

◆ getNumInactiveSolvers()

virtual std::size_t getNumInactiveSolvers ( )
virtual

get number of inactive Solvers

Returns
number of inactive Solvers

Implements ParaSolverPool.

Definition at line 1707 of file bbParaSolverPool.h.

◆ getNumOfNodesLeft()

virtual int getNumOfNodesLeft ( int  rank)
virtual

get the number of nodes left by the Solver specified

Returns
the number of nodes left
Parameters
rankrank of the Solver

Definition at line 1855 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getNumOfNodesLeft(), and SOLVER_POOL_INDEX.

◆ getNumOfNodesLeftInBestSolver()

virtual int getNumOfNodesLeftInBestSolver ( )
virtual

get the number of nodes left in the Solver which has the best dual bound value

Returns
the number of nodes left

Definition at line 1867 of file bbParaSolverPool.h.

References SelectionHeap::getHeapSize(), BbParaSolverPoolElement::getNumOfNodesLeft(), and SelectionHeap::top().

◆ getNumOfNodesSolved()

virtual long long getNumOfNodesSolved ( int  rank)
virtual

get the number of nodes solved by the Solver specified

Returns
the number of nodes solved
Parameters
rankrank of the Solver

Definition at line 1843 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getNumOfNodesSolved(), and SOLVER_POOL_INDEX.

◆ getSelfSplitSubtreeRootNodes()

BbParaNode * getSelfSplitSubtreeRootNodes ( int  rank)
virtual

get self-split subtree root node from the active solver with the specified rank

Parameters
rankthe active solver rank

Definition at line 1092 of file bbParaSolverPool.cpp.

References UG::Active, nSolvers, SOLVER_POOL_INDEX, and THROW_LOGICAL_ERROR2.

Referenced by BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ getSwichOutTime()

virtual double getSwichOutTime ( )
virtual

the following functions are to omit rebooting collecting mode process

get time of switching out collecting mode

Returns
time of switching out collecting mode

Definition at line 2259 of file bbParaSolverPool.h.

Referenced by BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ getTermState()

virtual ParaSolverTerminationState* getTermState ( int  rank)
virtual

get SolverTermination state of the Solver specified

Returns
pointer to SolverTermination object
Parameters
rankrank of the Solver

Definition at line 1950 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getTermState(), and SOLVER_POOL_INDEX.

◆ getTotalNodesSolved()

virtual unsigned long long getTotalNodesSolved ( )
virtual

get number of nodes solved in all Solvers: updated at termination of subtree computation

Definition at line 1668 of file bbParaSolverPool.h.

Referenced by BbParaLoadCoordinator::~BbParaLoadCoordinator().

◆ inactivateSolver()

void inactivateSolver ( int  rank,
long long  numOfNodesSolved,
BbParaNodePool paraNodePool 
)
virtual

inactivate the Solver specified by rank

inactivate the Solver specified by rank

need to have dual bound, so should be before inactivate()

Parameters
rankrank of the Solver to be inactivated
numOfNodesSolvednumber of nodes solved
paraNodePoolpointer to BbParaNodePool to change into collecting mode

Definition at line 1187 of file bbParaSolverPool.cpp.

References UG::Active, UG::ControlCollectingModeOnSolverSide, UG::InterruptRequested, nSolvers, SOLVER_POOL_INDEX, UG::TerminateRequested, and THROW_LOGICAL_ERROR2.

◆ incNLimitCollectingModeSolvers()

virtual void incNLimitCollectingModeSolvers ( )
virtual

increase the limit number of Solvers getting into collecting mode

Definition at line 2029 of file bbParaSolverPool.h.

References nSolvers.

◆ interruptRequested()

virtual void interruptRequested ( int  rank)
virtual

set the Solver specified by rank is terminate requested

Parameters
rankrank of the Solver

Implements ParaSolverPool.

Definition at line 1534 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getRank(), BbParaSolverPoolElement::interruptRequested(), and SOLVER_POOL_INDEX.

◆ isActive()

virtual bool isActive ( )
virtual

check if this Solver pool is active or not

Returns
true if this Solver pool is active, false otherwise

Definition at line 1640 of file bbParaSolverPool.h.

◆ isDualBounGainTesting()

virtual bool isDualBounGainTesting ( int  rank)
virtual

check if dual bound gain testing is proceeding or not in the Solver specified

Returns
true if dual bound gain testing is proceeding, false otherwise
Parameters
rankrank of the Solver

Definition at line 2279 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::isDualBoundGainTesting(), and SOLVER_POOL_INDEX.

◆ isInCollectingMode()

virtual bool isInCollectingMode ( )
virtual

check if this system is in collecting mode or not

Returns
true if this system is in collecting mode, false otherwise

Definition at line 1761 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::collectingMode.

◆ isInterruptRequested()

virtual bool isInterruptRequested ( int  rank)
virtual

check if the Solver specified by rank is interrupt requested or not

Returns
return true if the Solver is interrupt requested, false otherwise
Parameters
rankrank of the Solver

Implements ParaSolverPool.

Definition at line 1557 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getStatus(), UG::InterruptRequested, and SOLVER_POOL_INDEX.

◆ isSolverActive()

virtual bool isSolverActive ( int  rank)
virtual

check if the Solver specified by rank is active or not

Returns
true if the Solver is active, false otherwise
Parameters
rankrank of the Solver to be checked

Implements ParaSolverPool.

Definition at line 1717 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::isActive(), and SOLVER_POOL_INDEX.

◆ isSolverInCollectingMode()

virtual bool isSolverInCollectingMode ( int  rank)
virtual

get collecting mode of the Solver specified by rank

Returns
true if the Solver is in collecting mode, false otherwise
Parameters
rankrank of the Solver to be checked

Definition at line 1771 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::isInCollectingMode(), and SOLVER_POOL_INDEX.

Referenced by BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ isTerminated()

virtual bool isTerminated ( int  rank)
virtual

check if the Solver specified by rank is terminated or not

Returns
return true if the Solver is terminated, false otherwise
Parameters
rankrank of the Solver

Implements ParaSolverPool.

Definition at line 1607 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getStatus(), SOLVER_POOL_INDEX, and UG::Terminated.

◆ isTerminateRequested()

virtual bool isTerminateRequested ( int  rank)
virtual

check if the Solver specified by rank is terminate requested or not

Returns
return true if the Solver is terminate requested, false otherwise
Parameters
rankrank of the Solver

Implements ParaSolverPool.

Definition at line 1568 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getStatus(), SOLVER_POOL_INDEX, and UG::TerminateRequested.

◆ makeSubtreeRootNodeCurrent()

void makeSubtreeRootNodeCurrent ( int  rank,
BbParaNode node 
)
virtual

make subtree root node as current task for the specified rank

Parameters
rankthe active solver rank
nodesubtree root node to make it current

Definition at line 915 of file bbParaSolverPool.cpp.

References UG::Active, UG::InterruptRequested, nSolvers, SOLVER_POOL_INDEX, UG::Terminated, UG::TerminateRequested, and THROW_LOGICAL_ERROR2.

◆ reinitToRestart()

virtual void reinitToRestart ( )
virtual

reinitialize to restart

Definition at line 1617 of file bbParaSolverPool.h.

References UG::MinNumberOfCollectingModeSolvers.

◆ removeSubtreeRootNode()

void removeSubtreeRootNode ( int  rank,
BbParaNode node 
)
virtual

remove subtree root node from the active solver with the specified rank

Parameters
rankthe active solver rank
nodesubtree root node to be removed

Definition at line 961 of file bbParaSolverPool.cpp.

References UG::Active, UG::InterruptRequested, nSolvers, SOLVER_POOL_INDEX, UG::Terminated, UG::TerminateRequested, and THROW_LOGICAL_ERROR2.

◆ resetCountersInSolver()

void resetCountersInSolver ( int  rank,
long long  numOfNodesSolved,
int  numOfSelfSplitNodesLeft,
BbParaNodePool paraNodePool 
)
virtual

reset counters in the Solver specified by rank

reset counters in the Solver specified by rank

need to have dual bound, so should be before inactivate()

Parameters
rankrank of the Solver to reset counters
numOfNodesSolvednumber of nodes solved
numOfSelfSplitNodesLeftnumber of self-split nodes left
paraNodePoolpointer to BbParaNodePool to change into collecting mode

Definition at line 1284 of file bbParaSolverPool.cpp.

References UG::Active, UG::ControlCollectingModeOnSolverSide, nSolvers, SOLVER_POOL_INDEX, and THROW_LOGICAL_ERROR2.

Referenced by BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ sendSwitchOutCollectingModeIfNecessary()

void sendSwitchOutCollectingModeIfNecessary ( int  rank)
virtual

switch out collecting mode of the Solver specified by rank if it is necessary

switch out collecting mode to the specified rank

Parameters
rankrank of the Solver

Definition at line 1492 of file bbParaSolverPool.cpp.

References PARA_COMM_CALL, UG::ParaBYTE, SOLVER_POOL_INDEX, and UG::TagOutCollectingMode.

◆ setCollectingIsAllowed()

virtual void setCollectingIsAllowed ( int  rank)
virtual

set collecting mode is allowed to the Solver specified by rank

Definition at line 2039 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::setCollectingIsAllowed(), and SOLVER_POOL_INDEX.

◆ setSwichOutTime()

virtual void setSwichOutTime ( double  time)
virtual

set time of switching out collecting mode

Parameters
timetime of switching out collecting mode

Definition at line 2268 of file bbParaSolverPool.h.

Referenced by BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ setTermState()

virtual void setTermState ( int  rank,
ParaSolverTerminationState inTermState 
)
virtual

set SolverTerminationState to the Solver specified

Parameters
rankrank of the Solver
inTermStatepointer to ParaSolverTerminationState object

Definition at line 1938 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::setTermState(), and SOLVER_POOL_INDEX.

◆ solverDied()

BbParaNode * solverDied ( int  rank)
virtual

kill the Solver specified by rank

Returns
pointer to BbParaNode object assigned to the Solver

solver specified by rank died

need to have dual bound, so should be before died()

Parameters
rankrank of the Solver

Definition at line 1388 of file bbParaSolverPool.cpp.

References UG::Active, nSolvers, SOLVER_POOL_INDEX, and THROW_LOGICAL_ERROR2.

◆ switchInCollectingMode()

virtual void switchInCollectingMode ( BbParaNodePool paraNodePool)
pure virtual

switch in collecting mode

Parameters
paraNodePoolpointer to BbParaNodePool object

Implemented in BbParaSolverPoolForMinimization.

Referenced by BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ switchInCollectingToSolver()

void switchInCollectingToSolver ( int  rank,
BbParaNodePool paraNodePool 
)
protectedvirtual

switch a Solver to be in collecting mode

send switch in-collecting mode to a specific solver

Parameters
rankSolver rank to be in collecting mode
paraNodePoolpointer to BbParaNodePool object

Definition at line 1512 of file bbParaSolverPool.cpp.

References BbParaNodePool::getNumOfGoodNodes(), BbParaNodePool::isEmpty(), UG::MultiplierForCollectingMode, UG::NChangeIntoCollectingMode, PARA_COMM_CALL, UG::ParaBYTE, UG::ParaINT, SOLVER_POOL_INDEX, UG::TagInCollectingMode, and UG::TagNoWaitModeSend.

◆ switchOutCollectingMode()

void switchOutCollectingMode ( )
virtual

switch out collecting mode

switch out collecting mode

clear candidatesOfCollectingModeSolvers in below

Definition at line 1431 of file bbParaSolverPool.cpp.

References UG::DualBoundGainTest, PARA_COMM_CALL, UG::ParaBYTE, SOLVER_POOL_INDEX, and UG::TagNoTestDualBoundGain.

Referenced by BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState().

◆ terminated()

virtual void terminated ( int  rank)
virtual

set the Solver specified by rank is terminated

Parameters
rankrank of the Solver

Implements ParaSolverPool.

Definition at line 1578 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getRank(), BbParaSolverPoolElement::getStatus(), UG::Inactive, UG::InterruptRequested, SOLVER_POOL_INDEX, BbParaSolverPoolElement::terminated(), and UG::TerminateRequested.

◆ terminateRequested()

virtual void terminateRequested ( int  rank)
virtual

set the Solver specified by rank is terminate requested

Parameters
rankrank of the Solver

Implements ParaSolverPool.

Definition at line 1545 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::getRank(), SOLVER_POOL_INDEX, and BbParaSolverPoolElement::terminateRequested().

◆ updateDualBoundsForSavingNodes()

virtual void updateDualBoundsForSavingNodes ( )
virtual

update dual bound values of saving BbParaNodes by their dual bound values for subtrees

Definition at line 1960 of file bbParaSolverPool.h.

References BbParaNode::getAncestor(), BbParaSolverPoolElement::getTermState(), BbParaNode::next, and SOLVER_POOL_INDEX.

◆ updateSolverStatus()

virtual void updateSolverStatus ( int  rank,
long long  numNodesSolved,
int  numNodesLeft,
double  solverLocalBestBound,
BbParaNodePool paraNodePool 
)
pure virtual

update Solver status

Parameters
rankrank of the Solver
numNodesSolvednumber of nodes solved
numNodesLeftnumber of nodes left
solverLocalBestBoundbest bound value in the Solver
paraNodePoolpointer to BbParaNodePool object

Implemented in BbParaSolverPoolForMinimization.

Member Data Documentation

◆ absoluteGap

double absoluteGap
protected

allowable absolute dual bound gap to the best Solver

Definition at line 1356 of file bbParaSolverPool.h.

◆ active

bool active
protected

indicate if this pool is active or not

Definition at line 1352 of file bbParaSolverPool.h.

◆ activeSolvers

std::map< int, BbParaSolverPoolElementPtr > activeSolvers
protected

pointers to active Solvers

Definition at line 1369 of file bbParaSolverPool.h.

◆ beforeFinishingFirstCollect

bool beforeFinishingFirstCollect
protected

before finishing first collecting mode

Definition at line 1367 of file bbParaSolverPool.h.

◆ beforeInitialCollect

bool beforeInitialCollect
protected

before initial collecting mode

Definition at line 1366 of file bbParaSolverPool.h.

◆ bgap

double bgap
protected

threshold value of gap

Definition at line 1353 of file bbParaSolverPool.h.

◆ breakingFirstSubtree

bool breakingFirstSubtree
protected

breaking the first subtree

Definition at line 1365 of file bbParaSolverPool.h.

◆ candidatesOfCollectingModeSolvers

std::multimap< double, BbParaSolverPoolElementPtr > candidatesOfCollectingModeSolvers
protected

pointers to candidates of collecting mode Solvers

Definition at line 1371 of file bbParaSolverPool.h.

◆ collectingMode

bool collectingMode
protected

indicate that this system is in collecting mode or not

Definition at line 1364 of file bbParaSolverPool.h.

◆ collectingModeSolverHeap

CollectingModeSolverHeap* collectingModeSolverHeap
protected

pointers to collecting mode Solvers in ascending or descending order

Definition at line 1375 of file bbParaSolverPool.h.

◆ deadSolvers

std::map< int, BbParaSolverPoolElementPtr > deadSolvers
protected

pointers to dead Solvers

Definition at line 1370 of file bbParaSolverPool.h.

◆ inactiveSolvers

std::map< int, BbParaSolverPoolElementPtr > inactiveSolvers
protected

pointers to inactive Solvers

Definition at line 1368 of file bbParaSolverPool.h.

◆ mBgap

double mBgap
protected

multiplier of the bgap value

Definition at line 1355 of file bbParaSolverPool.h.

◆ mCollectingNodes

int mCollectingNodes
protected

multiplier for the number of collecting BbParaNodes

Definition at line 1377 of file bbParaSolverPool.h.

◆ mMaxCollectingNodes

int mMaxCollectingNodes
protected

maximum multiplier for the number of collecting BbParaNodes

Definition at line 1378 of file bbParaSolverPool.h.

◆ mp

double mp
protected

multiplier of the threshold value p

Definition at line 1354 of file bbParaSolverPool.h.

◆ nCollectingModeSolvers

std::size_t nCollectingModeSolvers
protected

number of collecting mode Solvers

Definition at line 1358 of file bbParaSolverPool.h.

◆ nDualBoundGainTesting

int nDualBoundGainTesting
protected

the number of dual bound gain testing Solvers

Definition at line 1379 of file bbParaSolverPool.h.

◆ nGenerator

std::size_t nGenerator
protected

number of generators

Definition at line 1357 of file bbParaSolverPool.h.

◆ nLimitCollectingModeSolvers

std::size_t nLimitCollectingModeSolvers
protected

limit number of Solvers that can be in collecting mode

Definition at line 1360 of file bbParaSolverPool.h.

◆ nMaxCollectingModeSolvers

std::size_t nMaxCollectingModeSolvers
protected

maximum number of Solvers that can be in collecting mode

Definition at line 1359 of file bbParaSolverPool.h.

◆ nNodesInSolvers

unsigned long long nNodesInSolvers
protected

number of nodes in all Solvers

Definition at line 1363 of file bbParaSolverPool.h.

◆ nNodesSolvedInSolvers

unsigned long long nNodesSolvedInSolvers
protected

number of nodes solved in current running Solvers

Definition at line 1361 of file bbParaSolverPool.h.

◆ nTotalNodesSolved

unsigned long long nTotalNodesSolved
protected

number of nodes solved : updated at termination of subtree computation

Definition at line 1362 of file bbParaSolverPool.h.

◆ pool

BbParaSolverPoolElementPtr* pool
protected

Solver pool indexed by Solver's rank.

Definition at line 1373 of file bbParaSolverPool.h.

◆ selectionHeap

SelectionHeap* selectionHeap
protected

pointers to active Solvers in ascending or descending order

Definition at line 1374 of file bbParaSolverPool.h.

◆ switchOutTime

double switchOutTime
protected

switch out time

Definition at line 1376 of file bbParaSolverPool.h.