Scippy

UG

Ubiquity Generator framework

BbParaSolverPoolForMinimization Class Reference

class BbParaSolverPoolForMinimization (Solver Pool for Minimization Problems) More...

#include <bbParaSolverPool.h>

+ Inheritance diagram for BbParaSolverPoolForMinimization:

Public Member Functions

 BbParaSolverPoolForMinimization (double inMp, double inBgap, double inMBgap, int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer)
 constructor More...
 
 BbParaSolverPoolForMinimization (double inMp, double inBgap, double inMBgap, int inNSolvers, int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer)
 constructor More...
 
virtual ~BbParaSolverPoolForMinimization ()
 destructor More...
 
virtual double getGlobalBestDualBoundValue ()
 get global best dual bound value More...
 
virtual void switchInCollectingMode (BbParaNodePool *paraNodePool)
 switch in collecting mode More...
 
virtual void updateSolverStatus (int rank, long long numNodesSolved, int numNodesLeft, double solverLocalBestBound, BbParaNodePool *paraNodePool)
 update Solver status More...
 
- Public Member Functions inherited from BbParaSolverPool
 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 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...
 

Additional Inherited Members

- Protected Member Functions inherited from BbParaSolverPool
virtual void switchInCollectingToSolver (int rank, BbParaNodePool *paraNodePool)
 switch a Solver to be in collecting mode More...
 
- Protected Attributes inherited from BbParaSolverPool
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 BbParaSolverPoolForMinimization (Solver Pool for Minimization Problems)

Definition at line 2292 of file bbParaSolverPool.h.

Constructor & Destructor Documentation

◆ BbParaSolverPoolForMinimization() [1/2]

BbParaSolverPoolForMinimization ( 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 2300 of file bbParaSolverPool.h.

References nSolvers, and UG::SolverOrderInCollectingMode.

◆ BbParaSolverPoolForMinimization() [2/2]

BbParaSolverPoolForMinimization ( 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 2322 of file bbParaSolverPool.h.

References nSolvers, and UG::SolverOrderInCollectingMode.

◆ ~BbParaSolverPoolForMinimization()

virtual ~BbParaSolverPoolForMinimization ( )
virtual

destructor

Definition at line 2345 of file bbParaSolverPool.h.

Member Function Documentation

◆ getGlobalBestDualBoundValue()

virtual double getGlobalBestDualBoundValue ( )
virtual

get global best dual bound value

Returns
global best dual bound value

Implements BbParaSolverPool.

Definition at line 2356 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::rank.

Referenced by BbParaLoadCoordinator::sendParaTasksToIdleSolvers().

◆ switchInCollectingMode()

◆ updateSolverStatus()

void updateSolverStatus ( int  rank,
long long  numNodesSolved,
int  numNodesLeft,
double  solverLocalBestBound,
BbParaNodePool paraNodePool 
)
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

Implements BbParaSolverPool.

Definition at line 1964 of file bbParaSolverPool.cpp.

References BbParaNodePool::getNumOfGoodNodes(), BbParaNodePool::isEmpty(), UG::MultiplierForCollectingMode, UG::NChangeIntoCollectingMode, UG::NMaxCanditatesForCollecting, nSolvers, PARA_COMM_CALL, UG::ParaBYTE, UG::ParaINT, SOLVER_POOL_INDEX, UG::TagInCollectingMode, UG::TagNoWaitModeSend, THROW_LOGICAL_ERROR2, THROW_LOGICAL_ERROR3, and THROW_LOGICAL_ERROR4.