class BbParaRacingSolverPool (Racing Solver Pool) More...
#include <bbParaSolverPool.h>
Public Member Functions | |
| BbParaRacingSolverPool (int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer, ParaDeterministicTimer *inParaDetTimer) | |
| constructor More... | |
| BbParaRacingSolverPool (int inNSolvers, int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer, ParaDeterministicTimer *inParaDetTimer) | |
| constructor More... | |
| ~BbParaRacingSolverPool () | |
| 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 | reset () |
| reset racing solver pool More... | |
| virtual BbParaNode * | extractNode () |
| extract racing root BbParaNode More... | |
| virtual ParaTask * | getCurrentTask (int rank) |
| get root BbParaNode object of the Solver specified More... | |
| virtual double | getDualBoundValue (int rank) |
| get dual bound value of solving BbParaNode in the Solver specified by rank More... | |
| virtual long long | getNumOfNodesSolved (int rank) |
| get number of nodes solved in the Solver specified by rank More... | |
| virtual int | getNumNodesLeft (int rank) |
| get number of nodes left in the Solver specified by rank More... | |
| virtual double | getGlobalBestDualBoundValue () |
| get global best dual bound value More... | |
| virtual long long | getNnodesSolvedInBestSolver () |
| get winner Solver rank More... | |
| virtual long long | getNnodesLeftInBestSolver () |
| get number of nodes left in the best Solver More... | |
| virtual double | getBestDualBoundInInactivatedSolvers () |
| get best dual bound value in inactivated Solvers More... | |
| virtual void | activate (BbParaNode *node) |
| activate racing ramp-up Solver pool with root BbParaNode object More... | |
| virtual bool | isSolverActive (int rank) |
| check if the specified Solver is active or not More... | |
| virtual void | updateSolverStatus (int rank, long long numNodesSolved, int numNodesLeft, double solverLocalBestBound) |
| update Solver status More... | |
| virtual bool | isWinnerDecided (bool feasibleSol) |
| check racing termination criteria More... | |
| virtual void | inactivateSolver (int rank) |
| inactivate the Solver specified by rank 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 | isEvaluationStage (int rank) |
| check if the Solver specified in an argument is evaluation stage or not More... | |
| virtual std::string | getStrActiveSolerNumbers () |
| get active Solver number string More... | |
Public Member Functions inherited from ParaRacingSolverPool | |
| ParaRacingSolverPool (int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer, ParaDeterministicTimer *inParaDetTimer) | |
| constructor More... | |
| virtual | ~ParaRacingSolverPool () |
| destructor More... | |
| virtual ParaTask * | getCurrentTask (int rank)=0 |
| get root ParaTask object of the Solver specified More... | |
| virtual std::size_t | getNumActiveSolvers ()=0 |
| get number of active Solvers More... | |
| virtual std::size_t | getNumInactiveSolvers ()=0 |
| get number of inactive Solvers More... | |
| virtual bool | isSolverActive (int rank)=0 |
| check if the specified Solver is active or not More... | |
| int | getWinner () |
| get winner Solver rank More... | |
| std::size_t | getNSolvers () |
| get number of Solvers in this Solver pool More... | |
Protected Attributes | |
| int | nEvaluationStage |
| number of Solvers that are in evaluation stage More... | |
| long long | nNodesSolvedInBestSolver |
| number of nodes solved in the best Solver More... | |
| long long | nNodesInBestSolver |
| number of nodes in the best Solver More... | |
| size_t | nActiveSolvers |
| number of active Solvers More... | |
| size_t | nInactiveSolvers |
| number of inactive Solvers More... | |
| double | bestDualBound |
| current best dual bound value More... | |
| double | bestDualBoundInSolvers |
| best dual bound value in Solvers More... | |
| BbParaSolverPoolElementPtr * | pool |
| Solver pool indexed by Solver's rank. More... | |
| SelectionHeap * | selectionHeap |
| pointers to active Solvers in ascending or descending order More... | |
| BbParaNode * | rootNode |
| root BbParaNode More... | |
Protected Attributes inherited from ParaRacingSolverPool | |
| int | winnerRank |
| winner rank of racing ramp-up, -1: not decided yet More... | |
| int | originRank |
| origin rank of Solvers managed by this Solver pool More... | |
| int | nSolvers |
| number of Solvers More... | |
| ParaComm * | paraComm |
| communicator More... | |
| ParaParamSet * | paraParams |
| runtime parameters for parallelization More... | |
| ParaTimer * | paraTimer |
| timer used More... | |
| ParaDeterministicTimer * | paraDetTimer |
| deterministic timer used More... | |
class BbParaRacingSolverPool (Racing Solver Pool)
Definition at line 2413 of file bbParaSolverPool.h.
| BbParaRacingSolverPool | ( | int | inOriginRank, |
| ParaComm * | inParaComm, | ||
| ParaParamSet * | inParaParams, | ||
| ParaTimer * | inParaTimer, | ||
| ParaDeterministicTimer * | inParaDetTimer | ||
| ) |
constructor
| inOriginRank | origin rank of Solvers managed by this Solver pool |
| inParaComm | communicator used |
| inParaParams | paraParamSet used |
| inParaTimer | timer used |
| inParaDetTimer | deterministic timer used |
Definition at line 2434 of file bbParaSolverPool.h.
References ParaRacingSolverPool::nSolvers, ParaRacingSolverPool::originRank, BbParaRacingSolverPool::pool, and BbParaRacingSolverPool::selectionHeap.
| BbParaRacingSolverPool | ( | int | inNSolvers, |
| int | inOriginRank, | ||
| ParaComm * | inParaComm, | ||
| ParaParamSet * | inParaParams, | ||
| ParaTimer * | inParaTimer, | ||
| ParaDeterministicTimer * | inParaDetTimer | ||
| ) |
constructor
| inNSolvers | the number of racing solvers |
| inOriginRank | origin rank of Solvers managed by this Solver pool |
| inParaComm | communicator used |
| inParaParams | paraParamSet used |
| inParaTimer | timer used |
| inParaDetTimer | deterministic timer used |
Definition at line 2463 of file bbParaSolverPool.h.
References ParaRacingSolverPool::nSolvers, ParaRacingSolverPool::originRank, BbParaRacingSolverPool::pool, and BbParaRacingSolverPool::selectionHeap.
destructor
Definition at line 2494 of file bbParaSolverPool.h.
References ParaRacingSolverPool::nSolvers, BbParaRacingSolverPool::pool, BbParaRacingSolverPool::rootNode, and BbParaRacingSolverPool::selectionHeap.
|
virtual |
activate racing ramp-up Solver pool with root BbParaNode object
| node | pointer to root BbParaNode object |
Definition at line 2720 of file bbParaSolverPool.h.
References SelectionHeap::insert(), BbParaRacingSolverPool::nActiveSolvers, BbParaRacingSolverPool::nInactiveSolvers, BbParaRacingSolverPool::nNodesInBestSolver, ParaRacingSolverPool::nSolvers, ParaRacingSolverPool::originRank, BbParaRacingSolverPool::pool, BbParaSolverPoolElement::racingActivate(), BbParaRacingSolverPool::rootNode, BbParaRacingSolverPool::selectionHeap, and SOLVER_POOL_INDEX.
Referenced by BbParaLoadCoordinator::newRacing(), and BbParaLoadCoordinator::run().
|
virtual |
extract racing root BbParaNode
Definition at line 2608 of file bbParaSolverPool.h.
References BbParaNode::clone(), BbParaRacingSolverPool::getGlobalBestDualBoundValue(), ParaRacingSolverPool::paraComm, BbParaRacingSolverPool::rootNode, BbParaNode::setDualBoundValue(), and BbParaNode::setInitialDualBoundValue().
Referenced by BbParaLoadCoordinator::run().
|
virtual |
get best dual bound value in inactivated Solvers
Definition at line 2711 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::bestDualBoundInSolvers.
|
virtual |
get root BbParaNode object of the Solver specified
| rank | rank of the Solver |
Implements ParaRacingSolverPool.
Definition at line 2619 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::rootNode.
|
virtual |
get dual bound value of solving BbParaNode in the Solver specified by rank
| rank | rank of the Solver |
Definition at line 2630 of file bbParaSolverPool.h.
References BbParaSolverPoolElement::getBestDualBoundValue(), BbParaRacingSolverPool::pool, and SOLVER_POOL_INDEX.
|
virtual |
get global best dual bound value
Definition at line 2663 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::bestDualBound, SelectionHeap::getHeapSize(), and BbParaRacingSolverPool::selectionHeap.
Referenced by BbParaRacingSolverPool::extractNode().
|
virtual |
get number of nodes left in the best Solver
Definition at line 2701 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::nNodesInBestSolver.
|
virtual |
get winner Solver rank
Definition at line 2691 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::nNodesSolvedInBestSolver.
Referenced by BbParaLoadCoordinator::~BbParaLoadCoordinator().
|
virtual |
get number of active Solvers
Implements ParaRacingSolverPool.
Definition at line 2804 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::nActiveSolvers.
|
virtual |
get number of inactive Solvers
Implements ParaRacingSolverPool.
Definition at line 2814 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::nInactiveSolvers.
Referenced by BbParaLoadCoordinator::processTagCompletionOfCalculation().
|
virtual |
get number of nodes left in the Solver specified by rank
| rank | rank of the Solver |
Definition at line 2652 of file bbParaSolverPool.h.
References BbParaSolverPoolElement::getNumOfNodesLeft(), BbParaRacingSolverPool::pool, and SOLVER_POOL_INDEX.
Referenced by BbParaLoadCoordinator::run().
|
virtual |
get number of nodes solved in the Solver specified by rank
| rank | rank of the Solver |
Definition at line 2641 of file bbParaSolverPool.h.
References BbParaSolverPoolElement::getNumOfNodesSolved(), BbParaRacingSolverPool::pool, and SOLVER_POOL_INDEX.
Referenced by BbParaRacingSolverPool::updateSolverStatus().
|
virtual |
get active Solver number string
Definition at line 2835 of file bbParaSolverPool.h.
References BbParaSolverPoolElement::isRacingStage(), ParaRacingSolverPool::nSolvers, ParaRacingSolverPool::originRank, BbParaRacingSolverPool::pool, and SOLVER_POOL_INDEX.
|
virtual |
inactivate the Solver specified by rank
| rank | rank of the Solver |
Definition at line 2779 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::bestDualBoundInSolvers, BbParaSolverPoolElement::getBestDualBoundValue(), BbParaSolverPoolElement::inactivate(), BbParaRacingSolverPool::isEvaluationStage(), BbParaRacingSolverPool::nActiveSolvers, BbParaRacingSolverPool::nInactiveSolvers, BbParaRacingSolverPool::pool, SOLVER_POOL_INDEX, and THROW_LOGICAL_ERROR2.
Referenced by BbParaLoadCoordinator::run().
|
virtual |
set the Solver specified by rank is terminate requested
| rank | rank of the Solver |
Definition at line 2509 of file bbParaSolverPool.h.
References BbParaSolverPoolElement::interruptRequested(), BbParaRacingSolverPool::pool, and SOLVER_POOL_INDEX.
|
virtual |
check if the Solver specified in an argument is evaluation stage or not
Definition at line 2824 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::isEvaluationStage(), BbParaRacingSolverPool::pool, and SOLVER_POOL_INDEX.
Referenced by BbParaRacingSolverPool::inactivateSolver(), BbParaRacingSolverPool::isEvaluationStage(), BbParaRacingSolverPool::isSolverActive(), and BbParaRacingSolverPool::updateSolverStatus().
|
virtual |
check if the Solver specified by rank is interrupt requested or not
| rank | rank of the Solver |
Definition at line 2532 of file bbParaSolverPool.h.
References UG::InterruptRequested, BbParaRacingSolverPool::pool, and SOLVER_POOL_INDEX.
|
virtual |
check if the specified Solver is active or not
| rank | rank of the Solver |
Implements ParaRacingSolverPool.
Definition at line 2744 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::isEvaluationStage(), BbParaRacingSolverPool::pool, and SOLVER_POOL_INDEX.
Referenced by BbParaSolverPool::activateSolver(), and BbParaRacingSolverPool::terminated().
|
virtual |
check if the Solver specified by rank is terminated or not
| rank | rank of the Solver |
Definition at line 2569 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::pool, SOLVER_POOL_INDEX, and UG::Terminated.
|
virtual |
check if the Solver specified by rank is terminate requested or not
| rank | rank of the Solver |
Definition at line 2543 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::pool, SOLVER_POOL_INDEX, and UG::TerminateRequested.
|
virtual |
check racing termination criteria
stop racing at the number of nodes left in a solver reached to the value
stop racing at time limit
stop racing at the Solver with the best bound value has a certain number of nodes left
node left first adaptive
time limit first adaptive
node left first adaptive - adaptive node left (Default settings): this is for FiberSCIP
time limit first adaptive - adaptive node left
time limit first adaptive and node limit also checked - adaptive node left
| feasibleSol | indicate if a feasible solution was generagted or not |
Definition at line 2401 of file bbParaSolverPool.cpp.
References UG::CountingSolverRatioInRacing, UG::Deterministic, ParaParamSet::getBoolParamValue(), ParaDeterministicTimer::getElapsedTime(), ParaTimer::getElapsedTime(), ParaParamSet::getIntParamValue(), BbParaSolverPoolElement::getNumOfNodesLeft(), BbParaSolverPoolElement::getRank(), ParaParamSet::getRealParamValue(), UG::KeepRacingUntilToFindFirstSolution, UG::NEvaluationSolversToStopRacing, BbParaRacingSolverPool::nEvaluationStage, ParaRacingSolverPool::nSolvers, ParaRacingSolverPool::paraDetTimer, ParaRacingSolverPool::paraParams, ParaRacingSolverPool::paraTimer, UG::RacingRampUpTerminationCriteria, BbParaRacingSolverPool::selectionHeap, UG::StopRacingNumberOfNodesLeft, UG::StopRacingNumberOfNodesLeftMultiplier, UG::StopRacingTimeLimit, UG::StopRacingTimeLimitMultiplier, THROW_LOGICAL_ERROR1, SelectionHeap::top(), and ParaRacingSolverPool::winnerRank.
Referenced by BbParaLoadCoordinator::run().
|
virtual |
reset racing solver pool
Definition at line 2579 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::bestDualBound, BbParaRacingSolverPool::bestDualBoundInSolvers, BbParaRacingSolverPool::nActiveSolvers, BbParaRacingSolverPool::nEvaluationStage, BbParaRacingSolverPool::nInactiveSolvers, BbParaRacingSolverPool::nNodesInBestSolver, BbParaRacingSolverPool::nNodesSolvedInBestSolver, ParaRacingSolverPool::nSolvers, ParaRacingSolverPool::originRank, BbParaRacingSolverPool::pool, BbParaRacingSolverPool::rootNode, and BbParaRacingSolverPool::selectionHeap.
Referenced by BbParaLoadCoordinator::newRacing().
|
virtual |
set the Solver specified by rank is terminated
| rank | rank of the Solver |
Definition at line 2553 of file bbParaSolverPool.h.
References UG::Inactive, UG::InterruptRequested, BbParaRacingSolverPool::isSolverActive(), BbParaRacingSolverPool::pool, SOLVER_POOL_INDEX, BbParaSolverPoolElement::terminated(), and UG::TerminateRequested.
|
virtual |
set the Solver specified by rank is terminate requested
| rank | rank of the Solver |
Definition at line 2520 of file bbParaSolverPool.h.
References BbParaRacingSolverPool::pool, SOLVER_POOL_INDEX, and BbParaSolverPoolElement::terminateRequested().
|
virtual |
update Solver status
| rank | rank of the Solver |
| numNodesSolved | number of nodes solved |
| numNodesLeft | number of nodes left |
| solverLocalBestBound | best bound value in the Solver |
Definition at line 2331 of file bbParaSolverPool.cpp.
References BbParaRacingSolverPool::bestDualBound, BbParaRacingSolverPool::bestDualBoundInSolvers, BbParaSolverPoolElement::getBestDualBoundValue(), SelectionHeap::getHeapSize(), ParaParamSet::getIntParamDefaultValue(), BbParaSolverPoolElement::getNumOfNodesLeft(), BbParaSolverPoolElement::getNumOfNodesSolved(), BbParaRacingSolverPool::getNumOfNodesSolved(), BbParaRacingSolverPool::isEvaluationStage(), BbParaRacingSolverPool::nEvaluationStage, BbParaRacingSolverPool::nNodesInBestSolver, BbParaRacingSolverPool::nNodesSolvedInBestSolver, ParaRacingSolverPool::paraParams, BbParaRacingSolverPool::pool, UG::Racing, UG::RacingEvaluation, UG::RacingRampUpTerminationCriteria, BbParaRacingSolverPool::selectionHeap, BbParaSolverPoolElement::setNumOfDiffNodesLeft(), BbParaSolverPoolElement::setNumOfDiffNodesSolved(), BbParaSolverPoolElement::setNumOfNodesLeft(), BbParaSolverPoolElement::setNumOfNodesSolved(), SOLVER_POOL_INDEX, UG::StopRacingNumberOfNodesLeft, BbParaSolverPoolElement::switchIntoEvaluation(), BbParaSolverPoolElement::switchOutEvaluation(), SelectionHeap::top(), and SelectionHeap::updateDualBoundValue().
|
protected |
current best dual bound value
Definition at line 2423 of file bbParaSolverPool.h.
Referenced by BbParaRacingSolverPool::getGlobalBestDualBoundValue(), BbParaRacingSolverPool::reset(), and BbParaRacingSolverPool::updateSolverStatus().
|
protected |
best dual bound value in Solvers
Definition at line 2424 of file bbParaSolverPool.h.
Referenced by BbParaRacingSolverPool::getBestDualBoundInInactivatedSolvers(), BbParaRacingSolverPool::inactivateSolver(), BbParaRacingSolverPool::reset(), and BbParaRacingSolverPool::updateSolverStatus().
|
protected |
number of active Solvers
Definition at line 2421 of file bbParaSolverPool.h.
Referenced by BbParaRacingSolverPool::activate(), BbParaRacingSolverPool::getNumActiveSolvers(), BbParaRacingSolverPool::inactivateSolver(), and BbParaRacingSolverPool::reset().
|
protected |
number of Solvers that are in evaluation stage
Definition at line 2418 of file bbParaSolverPool.h.
Referenced by BbParaRacingSolverPool::isWinnerDecided(), BbParaRacingSolverPool::reset(), and BbParaRacingSolverPool::updateSolverStatus().
|
protected |
number of inactive Solvers
Definition at line 2422 of file bbParaSolverPool.h.
Referenced by BbParaRacingSolverPool::activate(), BbParaRacingSolverPool::getNumInactiveSolvers(), BbParaRacingSolverPool::inactivateSolver(), and BbParaRacingSolverPool::reset().
|
protected |
number of nodes in the best Solver
Definition at line 2420 of file bbParaSolverPool.h.
Referenced by BbParaRacingSolverPool::activate(), BbParaRacingSolverPool::getNnodesLeftInBestSolver(), BbParaRacingSolverPool::reset(), and BbParaRacingSolverPool::updateSolverStatus().
|
protected |
number of nodes solved in the best Solver
Definition at line 2419 of file bbParaSolverPool.h.
Referenced by BbParaRacingSolverPool::getNnodesSolvedInBestSolver(), BbParaRacingSolverPool::reset(), and BbParaRacingSolverPool::updateSolverStatus().
|
protected |
Solver pool indexed by Solver's rank.
Definition at line 2425 of file bbParaSolverPool.h.
Referenced by BbParaRacingSolverPool::activate(), BbParaRacingSolverPool::BbParaRacingSolverPool(), BbParaRacingSolverPool::getDualBoundValue(), BbParaRacingSolverPool::getNumNodesLeft(), BbParaRacingSolverPool::getNumOfNodesSolved(), BbParaRacingSolverPool::getStrActiveSolerNumbers(), BbParaRacingSolverPool::inactivateSolver(), BbParaRacingSolverPool::interruptRequested(), BbParaRacingSolverPool::isEvaluationStage(), BbParaRacingSolverPool::isInterruptRequested(), BbParaRacingSolverPool::isSolverActive(), BbParaRacingSolverPool::isTerminated(), BbParaRacingSolverPool::isTerminateRequested(), BbParaRacingSolverPool::reset(), BbParaRacingSolverPool::terminated(), BbParaRacingSolverPool::terminateRequested(), BbParaRacingSolverPool::updateSolverStatus(), and BbParaRacingSolverPool::~BbParaRacingSolverPool().
|
protected |
root BbParaNode
Definition at line 2427 of file bbParaSolverPool.h.
Referenced by BbParaRacingSolverPool::activate(), BbParaRacingSolverPool::extractNode(), BbParaRacingSolverPool::getCurrentTask(), BbParaRacingSolverPool::reset(), and BbParaRacingSolverPool::~BbParaRacingSolverPool().
|
protected |
pointers to active Solvers in ascending or descending order
Definition at line 2426 of file bbParaSolverPool.h.
Referenced by BbParaRacingSolverPool::activate(), BbParaRacingSolverPool::BbParaRacingSolverPool(), BbParaRacingSolverPool::getGlobalBestDualBoundValue(), BbParaRacingSolverPool::isWinnerDecided(), BbParaRacingSolverPool::reset(), BbParaRacingSolverPool::updateSolverStatus(), and BbParaRacingSolverPool::~BbParaRacingSolverPool().