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