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