37 #ifndef __BB_PARA_LOADCOORDINATOR_H__ 38 #define __BB_PARA_LOADCOORDINATOR_H__ 64 #include "ugs/ugsDef.h" 65 #include "ugs/ugsParaCommMpi.h" 406 virtual void updateCheckpointFiles(
412 virtual void writeLoadCoordinatorStatisticsToCheckpointFile(
413 gzstream::ogzstream &loadCoordinatorStatisticsStream,
415 double globalBestDualBoundValue,
416 double externalGlobalBestDualBoundValue
422 virtual void writePreviousStatisticsInformation(
466 virtual void restartInRampDownPhase(
500 int checkAndReadIncumbent(
538 UGS::UgsParaCommMpi *inComUgs,
560 virtual void warmStart(
592 #endif // __BB_PARA_LOADCOORDINATOR_H__ virtual void inactivateRacingSolverPool(int rank)
inactivate racing solver pool
std::ostream * osTabularSolvingStatus
ostream for solving status in tabular form to switch output location
BbParaNodePool * paraNodePoolBufferToGenerateCPF
This is used for GenerateReducedCheckpointFiles.
void terminateAllSolvers()
terminate all solvers
double averageDualBoundGain
average dual bound gain: could be negative value at restart
virtual int restartRacing()
restart racing
ParaTimer * paraTimer
Timers for LoadCoordinator.
std::deque< double > lastSeveralDualBoundGains
keep last several dual bound gains
virtual void outputTabularSolvingStatus(char incumbent)
output solving status in tabular form
static const double displayInfOverThisValue
if gap is over this value, Inf is displayed at gap TODO: this would move to inherited class ...
int breakingSolverId
all nodes collecting solver Id: -1: no collecting
virtual int processTagAllowToBeInCollectingMode(int source, int tag)
function to process TagAllowToBeInCollectingMode message
void setGlobalBestIncumbentSolution(ParaSolution *sol)
set global best incumbent solution
Class for LoadCoordinator termination state which contains calculation state in a ParaLoadCoordinator...
virtual int processTagLbBoundTightened(int source, int tag)
function to process TagLbBoundTightened message
size_t nCollectedSolvers
counter to check if all solvers are terminated or not
int racingWinner
racing winner information
BbParaNodePool * paraNodePool
Pools in LoadCorrdinator.
bool isBreakingFinised
indicate that breaking is finished or not if bootstrap ramp-up is not specified, this flag should be ...
int nAverageDualBoundGain
number of nodes whose dual bound gain are counted
BbParaNodePool * paraNodeToKeepCheckpointFileNodes
The first n nodes may always keep in checkpoint file, that is, the n nodes are not processed in this ...
virtual int processTagSelfSplitTermStateForInterruption(int source, int tag)
function to process TagSelfSplitTermStateForInterruption message
virtual int processTagAnotherNodeRequest(int source, int tag)
function to process TagAnotherNodeRequest message
ParaInitiator * paraInitiator
initiator
Base class of Calculation state in a ParaSolver.
bool outputTabularSolvingStatusFlag
output streams and flags which indicate the output is specified or not
bool aSolverTerminatedWithOptimality
indicate if a solver terminated with proving optimality of the problem
Base class for deterministic timer.
virtual void sendInterruptRequest()
send interrupt request to all solvers
int minDepthInWinnerSolverNodes
racing winner information
Defines for UG Framework.
int maxDepthInWinnerSolverNodes
maximum depth of open nodes in the winner solver tree
bool hugeImbalance
indicate that a huge imbalance in solvers is detected
int nBoundChangesOfBestNode
the number of fixed variables of the best node The followings are used temporary to generate merge no...
bool * racingSolversExist
indicate if racing solver exits or not, true: exists
BbParaNodePool * paraNodePoolBufferToRestart
ParaNode pool for buffering ParaNodes in huge imbalance situation.
double starvingTime
start time of starving active solvers
class for deterministic timer
bool logSubtreeInfoFlag
indicate if subtree info. is logged or not
bool warmStartNodeTransferring
indicate that the first node transferring at warm start (restart)
int(UG::BbParaLoadCoordinator::* BbMessageHandlerFunctionPointer)(int, int)
virtual ~BbParaLoadCoordinator()
destructor
BbParaNodePool * paraNodePoolToRestart
ParaNode pool to restart in ramp-down phase.
virtual int processRacingRampUpTagSolverState(int source, int tag)
message handlers specialized for racing ramp-up
int nNormalSelection
number of normal node selection to a random node selection
virtual int processTagReassignSelfSplitSubtreeRootNode(int source, int tag)
function to process TagReassignSelfSplitSubtreeRootNode message
virtual bool sendParaTasksToIdleSolvers()
send ParaNodes to idle solvers
BbParaLoadCoordinatorTerminationState lcts
LoadCoordinatorTerminationState: counters and times.
virtual void changeSearchStrategyOfAllSolversToOriginalSearch()
change search strategy of all solvers to original search strategy
virtual void sendIncumbentValue(int receivedRank)
send incumbent value
bool allCompInfeasibleAfterSolution
indicate that all computations are infeasible after a feasible solution
std::ofstream ofsTabularSolvingStatus
ofstream for solving status in tabular form
ParaParamSet * paraParams
UG parameter set.
virtual int processTagTermStateForInterruption(int source, int tag)
function to process TagTermStateForInterruption message
bool restartingRacing
indicate that racing ramp-up is restarting
std::set< int > * selfSplitFinisedSolvers
indicate selfSplit finished solvers
virtual void writeSubtreeInfo(int source, ParaCalculationState *calcState)
write subtree info.
bool merging
for merging nodes
virtual int processTagTask(int source, int tag)
Message handlers.
int firstCollectingModeState
status of first collecting mode -1 : have not been in collecting mode 0 : once in collecting mode 1 :...
bool givenGapIsReached
shows if specified gap is reached or not
Base class of communicator for UG Framework.
virtual void sendCutOffValue(int receivedRank)
send cut off value
virtual int processTagSolution(int source, int tag)
function to process TagSolution message
virtual void outputTabularSolvingStatusHeader()
output tabular solving status header
BbParaSolution * pendingSolution
pending solution during merging
virtual void run()
run function to start main process
virtual int processTagSelfSlpitNodeCalcuationState(int source, int tag)
function to process TagSelfSlpitNodeCalcuationState message
Class for LoadCoordinator.
bool winnerSolverNodesCollected
indicate that all winner solver nodes has been collected
virtual int processTagSolverState(int source, int tag)
function to process TagSolverState message
virtual void changeSearchStrategyOfAllSolversToBestBoundSearch()
change search strategy of all solvers to best bound bound search strategy
int nReplaceToBetterNode
the number of replacing to a better nodes
virtual void sendRetryRampUpToAllSolvers()
notify retry ramp-up to all solvers
RunningPhase runningPhase
status of LoadCoordinator
BbParaLoadCoordinator(int inNhanders, ParaComm *inComm, ParaParamSet *inParaParamSet, ParaInitiator *paraInitiator, bool *racingSolversExist, ParaTimer *paraTimer, ParaDeterministicTimer *detTimer)
constructor
static const int RampUpPhaseProcess
virtual int processTagUbBoundTightened(int source, int tag)
function to process TagUbBoundTightened message
virtual int processTagSubtreeRootNodeToBeRemoved(int source, int tag)
function to process TagSubtreeRootNodeToBeRemoved message
BbParaNodePool * unprocessedParaNodes
The last n nodes may always keep in checkpoint file, that is, the n nodes are not processed in this r...
double minmalDualBoundNormalTermSolvers
minimal dual bound for normal termination solvers
virtual int processTagSelfSplitFinished(int source, int tag)
function to process TagSelfSplitFinished message
virtual int processRacingRampUpTagCompletionOfCalculation(int source, int tag)
function to process TagCompletionOfCalculation message in racing ramp-up stage
std::ofstream ofsLogSubtreeInfo
ofstream for subtree info.
bool isCollectingModeRestarted
this flag indicate if a collecting mode is restarted or not
virtual void newRacing()
start a new racing
double statEmptyNodePoolTime
To measure how long does node pool stay in empty situation.
virtual int processTagNewSubtreeRootNode(int source, int tag)
function to process TagNewSubtreeRootNode message
double averageLastSeveralDualBoundGains
average dual bound gains of last several ones
virtual bool isRacingStage()
check if current stage is in racing or not
int getIntParamValue(int param)
for int parameters
bool isHeaderPrinted
indicate if heeader is printed or not
Class for LoadCoordinator.
virtual bool updateSolution(BbParaSolution *)
update incumbent solution
class ParaRacingRampUpParamSet (parameter set for racing ramp-up)
BbParaNodesMerger * nodesMerger
pointer to nodes merger object, which merges nodes
Base class of communicator object.
bool primalUpdated
indicate that primal solution was updated or not
virtual bool isGapReached()
check if Gap reached or not
virtual int processTagCompletionOfCalculation(int source, int tag)
function to process TagCompletionOfCalculation message
double previousTabularOutputTime
to keep tabular solving status output time
std::ostream * osLogSubtreeInfo
ostram for subtree info. to switch output location
bool initialNodesGenerated
indicates that initial nodes have been generated
double hugeImbalanceTime
start time of huge imbalance situation
virtual int processTagSubtreeRootNodeStartComputation(int source, int tag)
function to process TagSubtreeRootNodeStartComputation message
int nRestartedRacing
number of racing stages restarted