37 #ifndef __PARA_LOADCOORDINATOR_H__ 38 #define __PARA_LOADCOORDINATOR_H__ 55 #include "ugs/ugsDef.h" 56 #include "ugs/ugsParaCommMpi.h" 88 UGS::UgsParaCommMpi *commUgs;
373 virtual void updateCheckpointFiles(
385 UGS::UgsParaCommMpi *inComUgs,
391 bool *racingSolversExist,
416 interruptedFromControlTerminal =
true;
425 virtual void warmStart(
466 #endif // __PARA_LOADCOORDINATOR_H__ Base class for calculation state.
ParaSolution * pendingSolution
pending solution during merging
MessageHandlerFunctionPointer * messageHandler
message handlers table for primary phase
virtual int processTagSolution(int source, int tag)=0
function to process TagSolution message
bool memoryLimitIsReached
indicate if memory limit is reached or not in a solver, when base solver has memory management featur...
ParaTimer * paraTimer
Timers for LoadCoordinator.
std::ostream * osStatisticsFinalRun
ostream for statistics of the final run
This class has solver state to be transferred.
virtual void sendInterruptRequest()=0
send interrupt request to all solvers
ParaSolverPool * paraSolverPool
Pools in LoadCorrdinator.
std::ostream * osStatisticsRacingRampUp
ostream for statistics for racing solvers to switch output location
class ParaRacingSolverPool (Racing Solver Pool)
std::ofstream ofsStatisticsRacingRampUp
ofstream for statistics for racing solvers
long long nSolvedInInterruptedRacingSolvers
number of tasks solved of the winner solver in the racing solvers
virtual void writeTransferLogInRacing(int rank, ParaCalculationState *state)
write transfer log in racing
int racingWinner
racing winner information
bool restarted
indicates that this run is restarted from checkpoint files
int(UG::ParaLoadCoordinator::* MessageHandlerFunctionPointer)(int, int)
ParaInitiator * paraInitiator
initiator
virtual int processRacingRampUpTagSolverState(int source, int tag)=0
message handlers specialized for racing ramp-up
int nSolvedRacingTermination
number of tasks solved at the racing termination solver
std::ostream * osLogSolvingStatus
ostram for solving status to switch output location
bool interruptedFromControlTerminal
interrupted from control terminal
virtual void sendRetryRampUpToAllSolvers()
notify retry ramp-up to all solvers (Maybe, this remove from this base class)
long long nTasksLeftInInterruptedRacingSolvers
number of of tasks remains of the the winner solver in the racing solvers
Base class of Calculation state in a ParaSolver.
virtual int processTagSolverState(int source, int tag)=0
function to process TagSolverState message
Base class for deterministic timer.
void sendTagToAllSolvers(const int tag)
check if current stage is in racing or not
virtual void parallelDispatch()
execute UG parallel solver totally solver dependent way
Defines for UG Framework.
virtual int processTagTerminated(int source, int tag)
function to process TagTerminated message
bool * racingSolversExist
indicate if racing solver exits or not, true: exists
ParaRacingSolverPool * paraRacingSolverPool
racing solver pool
ParaDeterministicTimer * paraDetTimer
deterministic timer used in case of deterministic mode this timer need to be created in case of deter...
class for deterministic timer
virtual void terminateAllSolvers()
terminate all solvers
virtual ~ParaLoadCoordinator()
destructor
double previousCheckpointTime
For checkpoint.
virtual int processTagTask(int source, int tag)=0
Message handlers.
std::ofstream ofsLogTasksTransfer
ofstream for task transfer info.
std::ofstream ofsLogSolvingStatus
ofstream for solving status
std::mutex routineMutex
used to exclusive control of routines
bool interruptIsRequested
indicate that all solver interrupt message is requested or not
ParaParamSet * paraParams
UG parameter set.
virtual int processTagToken(int source, int tag)
function to process TagToken message
int createNewGlobalSubtreeId()
create a new global subtree Id
Base class of communicator for UG Framework.
virtual int processTagHardTimeLimit(int source, int tag)
function to process TagHardTimeLimit message
virtual void run()=0
run function to start main process
ParaComm * paraComm
communicator used
ParaLoadCoordinator(int nHandlers, ParaComm *inComm, ParaParamSet *inParaParamSet, ParaInitiator *paraInitiator, bool *racingSolversExist, ParaTimer *paraTimer, ParaDeterministicTimer *detTimer)
constructor
virtual bool sendParaTasksToIdleSolvers()=0
send ParaTasks to idle solvers
bool logTasksTransferFlag
indicate if task transfer info. is logged or not
std::ostream * osLogTasksTransfer
ostream for task transfer info. to switch output location
virtual void interrupt()
interrupt from out side
Class for LoadCoordinator.
RunningPhase
running phase definition
virtual int processTagCompletionOfCalculation(int source, int tag)=0
function to process TagCompletionOfCalculation message
bool computationIsInterrupted
indicate that current computation is interrupted or not
Base class of initiator that maintains original problem and incumbent solution.
termination phase, includes interrupting phase
bool hardTimeLimitIsReached
indicate that hard time limit is reached or not
class ParaSolverPool (Solver Pool base class)
bool racingTermination
racing termination information
normal running phase (primary phase)
RunningPhase runningPhase
status of LoadCoordinator
virtual void writeTransferLog(int rank, ParaCalculationState *state)
write transfer log
MessageHandlerFunctionPointer * racingRampUpMessageHandler
message handlers table for racing stage
virtual void sendRampUpToAllSolvers()
notify ramp-up to all solvers
ParaRacingRampUpParamSet * racingWinnerParams
racing winner parameter set
int globalSubtreeIdGen
global subtree id generator
bool logSolvingStatusFlag
output streams and flags which indicate the output is specified or not
virtual void run(ParaTask *paraTask, int nRacingSolvers, ParaRacingRampUpParamSet **racingRampUpParams)
run for racing ramp-up
int nHandlers
number of valid handlers
bool terminationIssued
indicate termination request is issued
size_t nTerminated
counter to check if all solvers are terminated or not
class ParaRacingRampUpParamSet (parameter set for racing ramp-up)
std::ofstream ofsStatisticsFinalRun
ofstream for statistics of the final run
char lastCheckpointTimeStr[26]
lastCheckpointTimeStr[0] == ' ' means no checkpoint
Base class of communicator object.
virtual void run(ParaTask *paraTask)
run for normal ramp-up
virtual int processRacingRampUpTagCompletionOfCalculation(int source, int tag)=0
function to process TagCompletionOfCalculation message in racing ramp-up stage