37#ifndef __BB_PARA_SOLVER_POOL_H__
38#define __BB_PARA_SOLVER_POOL_H__
52class BbParaSolverPoolElement;
185 int removeBoundedNodes(
186 double incumbentValue ///< incumbent value
190 BbParaNode *preNode = selfSplitNodes;
191 BbParaNode *node = selfSplitNodes;
194 if( node->getDualBoundValue() > incumbentValue )
196 if( preNode == selfSplitNodes ) // head
198 selfSplitNodes = node->next;
199 preNode = selfSplitNodes;
201 node = selfSplitNodes;
205 preNode->next = node->next;
207 node = preNode->next;
274 THROW_LOGICAL_ERROR1(
"Should not be called. If whole subtrees are removed, TagComleation should be sent and should be inactivated.");
318 THROW_LOGICAL_ERROR1(
"Should not be called. If whole subtrees are removed, TagComleation should be sent and should be inactivated.");
358 THROW_LOGICAL_ERROR1(
"Should not be called. If whole subtrees are removed, TagComleation should be sent and should be inactivated.");
470 long long inNumOfNodesSolved
511 double dualBoundValue
552 double inBestDualBoundValue
1340class BbParaRacingSolverPool;
1402 :
ParaSolverPool(inOriginRank, inParaComm, inParaParams, inParaTimer),
1426 for(
unsigned int i = 0; i <
nSolvers; i++ )
1466 :
ParaSolverPool(inOriginRank, inParaComm, inParaParams, inParaTimer),
1490 for(
unsigned int i = 0; i <
nSolvers; i++ )
1523 for(
unsigned int i = 0; i < (
unsigned int)
nSolvers; i++ )
1592 std::map<int, BbParaSolverPoolElementPtr>::iterator p;
1677 unsigned long long num
1832 long long numOfNodesSolved
1978 gzstream::ogzstream &out
2008 gzstream::ogzstream &out
2052 std::map<int, BbParaSolverPoolElementPtr>::iterator p;
2058 return p->second->getRank();
2067 int nGoodNodesInNodePool,
2068 double averageDualBoundGain
2092 int nGoodNodesInNodePool,
2093 double averageDualBoundGain
2163 long long numOfNodesSolved,
2172 long long numOfNodesSolved,
2173 int numOfSelfSplitNodesLeft,
2224 long long numNodesSolved,
2226 double solverLocalBestBound,
2308 :
BbParaSolverPool(inMp, inBgap, inMBgap, inOriginRank, inParaComm, inParaParams, inParaTimer)
2331 :
BbParaSolverPool(inMp, inBgap, inMBgap, inNSolvers, inOriginRank, inParaComm, inParaParams, inParaTimer)
2380 long long numNodesSolved,
2382 double solverLocalBestBound,
2391 int removeBoundedNodes(
2392 double incumbentValue ///< incumbent value
2396 for( int rank = originRank; rank < (originRank + static_cast<int>(nSolvers)); rank++ )
2398 if( pool[SOLVER_POOL_INDEX( rank )]->getSelfSplitNodes() )
2400 n += pool[SOLVER_POOL_INDEX( rank )]->removeBoundedNodes(incumbentValue);
2453 for(
int i = 0; i <
nSolvers; i++ )
2484 for(
int i = 0; i <
nSolvers; i++ )
2498 for(
int i = 0; i <
nSolvers; i++ )
2591 for(
int i = 0; i <
nSolvers; i++ )
2598 for(
int i = 0; i <
nSolvers; i++ )
2764 long long numNodesSolved,
2766 double solverLocalBestBound
2838 std::ostringstream oss;
This class contains solver termination state which is transferred form Solver to LC.
virtual void updateDualBoundValue(BbParaSolverPoolElementPtr solver, double value)
update CollectingModeSolver heap by a new dual bound value of this Solver
AscendingCollectingModeSolverHeap(std::size_t size)
constructor
virtual ~AscendingCollectingModeSolverHeap()
destructor
virtual void deleteElement(BbParaSolverPoolElementPtr solver)
delete BbParaSolverPoolElementPtr from CollectingModeSolver Heap
virtual void downHeap(std::size_t pos)
down heap
virtual void upHeap(std::size_t pos)
up heap
class AscendingSelectionHeap
virtual void updateDualBoundValue(BbParaSolverPoolElementPtr solver, double value)
update selection heap by a new dual bound value of this Solver
AscendingSelectionHeap(std::size_t size)
constructor
virtual void deleteElement(BbParaSolverPoolElementPtr solver)
delete BbParaSolverPoolElementPtr from Selection Heap
virtual void downHeap(std::size_t pos)
down heap
virtual ~AscendingSelectionHeap()
destructor
virtual void upHeap(std::size_t pos)
up heap
bool isSameNodeIdAs(const BbParaNode &inNode)
check if this node's id is the same as that of argument ParaNode's task id
void setDualBoundValue(double inDualBoundValue)
setter of dual bound value
void write(gzstream::ogzstream &out)
write to checkpoint file
ParaTaskGenealogicalPtr * getAncestor()
getter of ancestor
virtual BbParaNode * clone(ParaComm *comm)=0
clone this BbParaNode
BbParaNode * next
this pointer is used in case of self-split ramp-up in LC this field is not transferred
double getDualBoundValue()
getter of dual bound value
void setInitialDualBoundValue(double inTrueDualBoundValue)
setter of initial dual bound value
class BbParaRacingSolverPool (Racing Solver Pool)
virtual std::string getStrActiveSolerNumbers()
get active Solver number string
virtual std::size_t getNumInactiveSolvers()
get number of inactive Solvers
double bestDualBoundInSolvers
best dual bound value in Solvers
virtual double getGlobalBestDualBoundValue()
get global best dual bound value
long long nNodesSolvedInBestSolver
number of nodes solved in the best Solver
BbParaSolverPoolElementPtr * pool
Solver pool indexed by Solver's rank.
long long nNodesInBestSolver
number of nodes in the best Solver
BbParaNode * rootNode
root BbParaNode
virtual bool isSolverActive(int rank)
check if the specified Solver is active or not
virtual long long getNnodesSolvedInBestSolver()
get winner Solver rank
virtual long long getNnodesLeftInBestSolver()
get number of nodes left in the best Solver
size_t nInactiveSolvers
number of inactive Solvers
int nEvaluationStage
number of Solvers that are in evaluation stage
double bestDualBound
current best dual bound value
virtual void terminated(int rank)
set the Solver specified by rank is terminated
virtual int getNumNodesLeft(int rank)
get number of nodes left in the Solver specified by rank
virtual void reset()
reset racing solver pool
virtual void activate(BbParaNode *node)
activate racing ramp-up Solver pool with root BbParaNode object
BbParaRacingSolverPool(int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer, ParaDeterministicTimer *inParaDetTimer)
constructor
size_t nActiveSolvers
number of active Solvers
virtual bool isTerminateRequested(int rank)
check if the Solver specified by rank is terminate requested or not
virtual BbParaNode * extractNode()
extract racing root BbParaNode
virtual void updateSolverStatus(int rank, long long numNodesSolved, int numNodesLeft, double solverLocalBestBound)
update Solver status
BbParaRacingSolverPool(int inNSolvers, int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer, ParaDeterministicTimer *inParaDetTimer)
constructor
virtual void terminateRequested(int rank)
set the Solver specified by rank is terminate requested
virtual ParaTask * getCurrentTask(int rank)
get root BbParaNode object of the Solver specified
virtual double getBestDualBoundInInactivatedSolvers()
get best dual bound value in inactivated Solvers
virtual double getDualBoundValue(int rank)
get dual bound value of solving BbParaNode in the Solver specified by rank
virtual std::size_t getNumActiveSolvers()
get number of active Solvers
virtual bool isInterruptRequested(int rank)
check if the Solver specified by rank is interrupt requested or not
~BbParaRacingSolverPool()
destructor
virtual void interruptRequested(int rank)
set the Solver specified by rank is terminate requested
virtual long long getNumOfNodesSolved(int rank)
get number of nodes solved in the Solver specified by rank
SelectionHeap * selectionHeap
pointers to active Solvers in ascending or descending order
virtual bool isWinnerDecided(bool feasibleSol)
check racing termination criteria
virtual void inactivateSolver(int rank)
inactivate the Solver specified by rank
virtual bool isEvaluationStage(int rank)
check if the Solver specified in an argument is evaluation stage or not
virtual bool isTerminated(int rank)
check if the Solver specified by rank is terminated or not
class BbParaSolverPoolElement (This class includes information about a Solver status)
BbParaSolverPoolElementPtr * selectionHeapElement
pointer to selection heap element
void setTermState(ParaSolverTerminationState *inTermState)
set termination state
long long getNumOfNodesSolved()
get number of nodes solved
void setDualBoundGainTesting(bool value)
set dual bound gain is testing value
bool isEvaluationStage()
check if this Solver is in evaluation stage
bool generator
this Solver can generate subproblems
void activate(BbParaNode *inNode)
activate this Solver
void setCollectingModeSolverHeapElement(BbParaSolverPoolElementPtr *inCollectingModeSolverHeapElement)
set collecting mode Solver heap element
int getNumOfNodesLeft()
get number of nodes left
BbParaSolverPoolElementPtr * collectingModeSolverHeapElement
bool isOutCollectingMode()
check if this Solver is out of collecting mode or not
void setCollectingMode(bool b)
set collecting mode
void setSelectionHeapElement(BbParaSolverPoolElementPtr *inSelectionHeapElement)
set selection heap element
bool isCandidateOfCollecting()
check if this Solver is candidate of collecting mode Solver
BbParaSolverPoolElementPtr * getSelectionHeapElement()
extract current solving BbParaNode
void interruptRequested()
set TerminateRequseted on Solver status
void setCollectingIsAllowed()
allows to be in collecting mode
void setNumOfDiffNodesSolved(int inNumOfDiff)
set number of nodes left difference between current number and that in the previous notification time
ParaTask * getCurrentNode()
get current solving BbParaNode
bool candidateOfCollecting
indicate that this Solver is a candidate of collecting mode Solver
BbParaSolverPoolElement(int inRank)
constructor
void switchIntoEvaluation()
switch into evaluation stage
void setBestDualBoundValue(double inBestDualBoundValue)
set best dual bound value
void racingActivate()
activate this Solver as a racing Solver
void setNumOfNodesSolved(long long inNumOfNodesSolved)
set number of nodes solved
BbParaNode * selfSplitNodes
list of nodes generated by self-split ramp-up
int numOfDiffNodesLeft
number of nodes left difference between current number and that in the previous notification time
void setDualBoundValue(double dualBoundValue)
set dual bound value on paraNode
void addSubtreeRoot(BbParaNode *inNode)
add subtree root node
void setNumOfNodesLeft(int inNumOfNodesLeft)
set number of nodes left
void deleteCurrentNode()
delete current solving BbParaNode
void switchOutEvaluation()
switch out of evaluation stage
int rank
rank of the Solver
void makeSubtreeRootCurrent(BbParaNode *inNode)
make subtree root node current
int numOfNodesLeft
number of nodes left
BbParaNode * currentNode
solving node
double bestDualBoundValue
best dual bound value of the Solver
BbParaNode * extractCurrentNode()
extract current solving BbParaNode
~BbParaSolverPoolElement()
destractor
bool isGenerator()
check if this Solver is generator or not */
int numOfDiffNodesSolved
number of nodes solved difference between current number and that in the previous notification time
bool isDualBoundGainTesting()
check if dual bound gain is testing in this Solver or not
int getNumOfDiffNodesSolved()
get number of nodes left difference between current number and that in the previous notification time
void terminated()
set Terminated on Solver status
void terminateRequested()
set TerminateRequseted on Solver status
void removeSubtreeRoot(BbParaNode *inNode)
remove subtree root node in self-split nodes list
BbParaNode * died()
kill this Solver
bool collectingMode
indicate if current Solver is in collecting mode or not
int getRank()
get rank of the Solver
void setCandidateOfCollecting(bool b)
set candidate of collecting mode Solver
BbParaNode * extractSubtreeRoot(BbParaNode *inNode)
extract subtree root node
bool isActive()
check if this Solver is active or not
SolverStatus getStatus()
get Solver status
BbParaNode * getSelfSplitNodes()
get a list of nodes which are generated by self-split ramp-up
bool isCollectingProhibited()
check if this Solver cannot be allowed in collecting mode
long long numOfNodesSolved
number of nodes solved. -1 is the special value which means never updated in racing
bool dualBoundGainTesting
indicate that dual bound gain is testing or not
void setNumOfDiffNodesLeft(int inNumOfDiff)
set number of nodes left difference between current number and that in the previous notification time
bool isInCollectingMode()
check if this Solver is in collecting mode or not
ParaSolverTerminationState * termState
Solver termination statistics: for checkpoint.
double getBestDualBoundValue()
get best dual bound value
bool isRacingStage()
check if this Solver is in racing stage
void prohibitCollectingMode()
prohibits to be in collecting mode
BbParaNode * extractSelfSplitNodes()
extract a list of nodes which are generated by self-split ramp-up
void inactivate()
inactivate this Solver
ParaSolverTerminationState * getTermState()
get termination state
bool collectingIsProhibited
collecting is temporary prohibited
void setNoGenerator()
make this Solver No generator
BbParaSolverPoolElementPtr * getCollectingModeSolverHeapElement()
get collecting mode Solver heap element
int getNumOfDiffNodesLeft()
get number of nodes left difference between current number and that in the previous notification time
SolverStatus status
status of the Solver
class BbParaSolverPool (Solver Pool base class)
virtual void activateSolver(int rank, BbParaNode *node, int nGoodNodesInNodePool, double averageDualBoundGain)
activate the Solver specified by rank with specified node which has been sent
virtual void switchInCollectingMode(BbParaNodePool *paraNodePool)=0
switch in collecting mode
bool active
indicate if this pool is active or not
virtual void updateSolverStatus(int rank, long long numNodesSolved, int numNodesLeft, double solverLocalBestBound, BbParaNodePool *paraNodePool)=0
update Solver status
BbParaSolverPool(double inMp, double inBgap, double inMBgap, int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer)
constructor
int mCollectingNodes
multiplier for the number of collecting BbParaNodes
virtual std::size_t getNumInactiveSolvers()
get number of inactive Solvers
virtual void deleteCurrentSubtreeRootNode(int rank)
delete current self-split subtree root node from the active solver with the specified rank
virtual void switchInCollectingToSolver(int rank, BbParaNodePool *paraNodePool)
switch a Solver to be in collecting mode
virtual BbParaNode * extractSelfSplitSubtreeRootNode(int rank, BbParaNode *node)
extract self-split subtree root node from the active solver with the specified rank
std::size_t nLimitCollectingModeSolvers
limit number of Solvers that can be in collecting mode
double bgap
threshold value of gap
virtual int getMCollectingNodes()
get multiplier of collecting BbParaNodes
virtual int getGoodSolverSolvingEssentialNode()
get rank of the Solver which has top priority in selection criteria
int mMaxCollectingNodes
maximum multiplier for the number of collecting BbParaNodes
virtual void switchOutCollectingMode()
switch out collecting mode
BbParaSolverPoolElementPtr * pool
Solver pool indexed by Solver's rank.
unsigned long long nNodesSolvedInSolvers
number of nodes solved in current running Solvers
std::size_t nGenerator
number of generators
virtual int getBestSolver()
get rank of the Solver which has top priority in selection criteria
virtual bool isSolverActive(int rank)
check if the Solver specified by rank is active or not
BbParaSolverPool(double inMp, double inBgap, double inMBgap, int inNSolvers, int inOriginRank, ParaComm *inParaComm, ParaParamSet *inParaParams, ParaTimer *inParaTimer)
constructor
bool breakingFirstSubtree
breaking the first subtree
virtual void activate()
activate this Solver pool
virtual unsigned long long getNnodesInSolvers()
get number of nodes in all Solvers
unsigned long long nTotalNodesSolved
number of nodes solved : updated at termination of subtree computation
double switchOutTime
switch out time
virtual bool isDualBounGainTesting(int rank)
check if dual bound gain testing is proceeding or not in the Solver specified
virtual bool isInCollectingMode()
check if this system is in collecting mode or not
virtual void setSwichOutTime(double time)
set time of switching out collecting mode
virtual void sendSwitchOutCollectingModeIfNecessary(int rank)
switch out collecting mode of the Solver specified by rank if it is necessary
virtual void terminated(int rank)
set the Solver specified by rank is terminated
virtual int writeSolverStatisticsToCheckpointFile(gzstream::ogzstream &out)
write Solver statistics to checkpoint file
virtual bool isActive()
check if this Solver pool is active or not
virtual std::size_t getNLimitCollectingModeSolvers()
get limit number of Solvers that can be in collecting mode
std::map< int, BbParaSolverPoolElementPtr > deadSolvers
pointers to dead Solvers
bool beforeFinishingFirstCollect
before finishing first collecting mode
virtual ParaSolverTerminationState * getTermState(int rank)
get SolverTermination state of the Solver specified
virtual void reinitToRestart()
reinitialize to restart
virtual double getGlobalBestDualBoundValue()=0
get global best dual bound value
virtual bool isSolverInCollectingMode(int rank)
get collecting mode of the Solver specified by rank
double absoluteGap
allowable absolute dual bound gap to the best Solver
virtual void updateDualBoundsForSavingNodes()
update dual bound values of saving BbParaNodes by their dual bound values for subtrees
virtual void makeSubtreeRootNodeCurrent(int rank, BbParaNode *node)
make subtree root node as current task for the specified rank
virtual void setTermState(int rank, ParaSolverTerminationState *inTermState)
set SolverTerminationState to the Solver specified
virtual bool canIncreaseLimitNLimitCollectingModeSolvers()
check if the number of Solvers in collecting mode can be increased or not
virtual bool isTerminateRequested(int rank)
check if the Solver specified by rank is terminate requested or not
virtual BbParaNode * extractSelfSplitSubtreeRootNodes(int rank)
extract self-split subtree root node from the active solver with the specified rank
virtual int getInactiveSolverRank()
get an inactive Solver rank
virtual void resetCountersInSolver(int rank, long long numOfNodesSolved, int numOfSelfSplitNodesLeft, BbParaNodePool *paraNodePool)
reset counters in the Solver specified by rank
bool collectingMode
indicate that this system is in collecting mode or not
virtual BbParaNode * getSelfSplitSubtreeRootNodes(int rank)
get self-split subtree root node from the active solver with the specified rank
virtual void terminateRequested(int rank)
set the Solver specified by rank is terminate requested
virtual int getNumOfNodesLeftInBestSolver()
get the number of nodes left in the Solver which has the best dual bound value
virtual ParaTask * getCurrentTask(int rank)
get current solving BbParaNode in the Solver specified by rank */
virtual int writeParaNodesToCheckpointFile(gzstream::ogzstream &out)
write BbParaNodes to checkpoint file
virtual unsigned long long getTotalNodesSolved()
get number of nodes solved in all Solvers: updated at termination of subtree computation
virtual double getSwichOutTime()
the following functions are to omit rebooting collecting mode process
virtual void addTotalNodesSolved(unsigned long long num)
add number of nodes solved in all Solvers
virtual void enforcedSwitchOutCollectingMode(int rank)
enforced to switch out collecting mode of the Solver specified by rank if it is necessary
virtual void inactivateSolver(int rank, long long numOfNodesSolved, BbParaNodePool *paraNodePool)
inactivate the Solver specified by rank
virtual BbParaNode * extractCurrentNodeAndInactivate(int rank, BbParaNodePool *paraNodePool)
extract current solving BbParaNode in the Solver specified by rank and inactivate the Solver
virtual double getDualBoundValue(int rank)
get dual bound value of solving BbParaNode by the Solver specified
virtual ~BbParaSolverPool()
destructor
unsigned long long nNodesInSolvers
number of nodes in all Solvers
bool beforeInitialCollect
before initial collecting mode
virtual bool currentSolvingNodehaeDescendant(int rank)
extract current solving BbParaNode in the Solver specified by rank and inactivate the Solver
virtual std::size_t getNumActiveSolvers()
get number of active Solvers
double mBgap
multiplier of the bgap value
virtual std::size_t getNSolvers()
get number of Solvers in this Solver pool
virtual void setCollectingIsAllowed(int rank)
set collecting mode is allowed to the Solver specified by rank
virtual bool isInterruptRequested(int rank)
check if the Solver specified by rank is interrupt requested or not
virtual int getMMaxCollectingNodes()
get maximum multiplier for the number of collecting BbParaNodes
std::map< int, BbParaSolverPoolElementPtr > inactiveSolvers
pointers to inactive Solvers
virtual void interruptRequested(int rank)
set the Solver specified by rank is terminate requested
virtual unsigned long long getNnodesSolvedInSolvers()
get number of nodes solved in current running Solvers
virtual int getNumOfNodesLeft(int rank)
get the number of nodes left by the Solver specified
virtual BbParaNode * solverDied(int rank)
kill the Solver specified by rank
virtual long long getNumOfNodesSolved(int rank)
get the number of nodes solved by the Solver specified
SelectionHeap * selectionHeap
pointers to active Solvers in ascending or descending order
std::map< int, BbParaSolverPoolElementPtr > activeSolvers
pointers to active Solvers
std::multimap< double, BbParaSolverPoolElementPtr > candidatesOfCollectingModeSolvers
pointers to candidates of collecting mode Solvers
virtual void addNumNodesSolved(long long numOfNodesSolved)
add number of nodes solved
virtual void addNewSubtreeRootNode(int rank, BbParaNode *node)
add new subtree root node to the active solver with the specified rank
int nDualBoundGainTesting
the number of dual bound gain testing Solvers
double mp
multiplier of the threshold value p
virtual void removeSubtreeRootNode(int rank, BbParaNode *node)
remove subtree root node from the active solver with the specified rank
CollectingModeSolverHeap * collectingModeSolverHeap
pointers to collecting mode Solvers in ascending or descending order
std::size_t nCollectingModeSolvers
number of collecting mode Solvers
std::size_t nMaxCollectingModeSolvers
maximum number of Solvers that can be in collecting mode
virtual void incNLimitCollectingModeSolvers()
increase the limit number of Solvers getting into collecting mode
virtual bool isTerminated(int rank)
check if the Solver specified by rank is terminated or not
class CollectingModeSolverHeap
virtual void upHeap(std::size_t pos)=0
up heap
const std::string toString()
stringfy of this object for debugging
virtual ~CollectingModeSolverHeap()
destructor
CollectingModeSolverHeap(std::size_t size)
constructor
BbParaSolverPoolElementPtr remove()
remove top priority BbParaSolverPoolElementPtr from CollectingModeSolver Heap */
ResultOfInsert
results of insert
@ FAILED_BY_FULL
FAILED_BY_FULL.
virtual void deleteElement(BbParaSolverPoolElementPtr solver)=0
delete BbParaSolverPoolElementPtr from CollectingModeSolver Heap
std::size_t maxHeapSize
maximum size of this heap
virtual void updateDualBoundValue(BbParaSolverPoolElementPtr solver, double value)=0
update CollectingModeSolver heap by a new dual bound value of this Solver
std::size_t heapSize
current used heap size
ResultOfInsert insert(BbParaSolverPoolElementPtr solver)
insert BbParaSolverPoolElementPtr to CollectingModeSolver Heap
void resize(std::size_t size)
resize CollectingModeSolver Heap
std::size_t getHeapSize() const
get current used heap size
virtual void downHeap(std::size_t pos)=0
down heap
BbParaSolverPoolElementPtr * heap
heap : contents are BbParaSolverPoolElementPtr
BbParaSolverPoolElementPtr top() const
obtain top priority BbParaSolverPoolElementPtr
std::size_t getMaxHeapSize() const
get max heap size
class DescendingCollectingModeSolverHeap
virtual void updateDualBoundValue(BbParaSolverPoolElementPtr solver, double value)
update CollectingModeSolver heap by a new dual bound value of this Solver
virtual void deleteElement(BbParaSolverPoolElementPtr solver)
delete BbParaSolverPoolElementPtr from CollectingModeSolver Heap
virtual ~DescendingCollectingModeSolverHeap()
destructor
virtual void downHeap(std::size_t pos)
down heap
DescendingCollectingModeSolverHeap(std::size_t size)
constructor
virtual void upHeap(std::size_t pos)
up heap
class DescendingSelectionHeap
virtual void updateDualBoundValue(BbParaSolverPoolElementPtr solver, double value)
update selection heap by a new dual bound value of this Solver
DescendingSelectionHeap(std::size_t size)
constructor
virtual void deleteElement(BbParaSolverPoolElementPtr solver)
delete BbParaSolverPoolElementPtr from Selection Heap
virtual ~DescendingSelectionHeap()
destructor
virtual void downHeap(std::size_t pos)
down heap
virtual void upHeap(std::size_t pos)
up heap
Base class of communicator object.
virtual int getSize()=0
get number of UG processes or UG threads depending on run-time environment
class for deterministic timer
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 ParaRacingSolverPool (Racing Solver Pool)
int originRank
origin rank of Solvers managed by this Solver pool
ParaComm * paraComm
communicator
int nSolvers
number of Solvers
class ParaSolverPool (Solver Pool base class)
int originRank
origin rank of Solvers managed by this Solver pool
ParaParamSet * paraParams
runtime parameters for parallelization
ParaComm * paraComm
communicator
std::size_t nSolvers
number of Solvers
class ParaSolverTerminationState (Solver termination state in a ParaSolver)
virtual void write(gzstream::ogzstream &out)=0
write ParaSolverTerminationState to checkpoint file
bool isRootTask()
check if root task or not
bool hasDescendant()
check if this task has descendant or not
ParaTaskGenealogicalPtr * getAncestor()
getter of ancestor
virtual void upHeap(std::size_t pos)=0
up heap
const std::string toString()
stringfy of this object for debugging
BbParaSolverPoolElementPtr remove()
remove top priority BbParaSolverPoolElementPtr from Selection Heap
SelectionHeap(std::size_t size)
constructor
ResultOfInsert
results of insert
@ FAILED_BY_FULL
FAILED_BY_FULL.
BbParaSolverPoolElementPtr get(int i) const
obtain i-th in heap BbParaSolverPoolElementPtr
virtual void deleteElement(BbParaSolverPoolElementPtr solver)=0
delete BbParaSolverPoolElementPtr from Selection Heap
std::size_t maxHeapSize
maximum size of this heap
virtual void updateDualBoundValue(BbParaSolverPoolElementPtr solver, double value)=0
update selection heap by a new dual bound value of this Solver
std::size_t heapSize
current used heap size
void resize(std::size_t size)
resize Selection Heap
ResultOfInsert insert(BbParaSolverPoolElementPtr solver)
insert BbParaSolverPoolElementPtr to Selection Heap
std::size_t getHeapSize() const
get current used heap size
virtual void downHeap(std::size_t pos)=0
down heap
BbParaSolverPoolElementPtr * heap
heap : contents are BbParaSolverPoolElementPtr
BbParaSolverPoolElementPtr top() const
obtain top priority BbParaSolverPoolElementPtr
virtual ~SelectionHeap()
destructor
std::size_t getMaxHeapSize() const
get max heap size
static const int BreakFirstSubtree
static const int SolverOrderInCollectingMode
static const int MaxNumberOfCollectingModeSolvers
static const int MinNumberOfCollectingModeSolvers
static const int ABgapForSwitchingToBestSolver
BbParaSolverPoolElement * BbParaSolverPoolElementPtr
#define THROW_LOGICAL_ERROR1(msg1)
#define THROW_LOGICAL_ERROR2(msg1, msg2)
Base class for deterministic timer.
Base class for racing ramp-up parameter set.
#define SOLVER_POOL_INDEX(rank)