ESyS-Particle  2.3.4
CheckPointController Class Reference

#include <CheckPointController.h>

Collaboration diagram for CheckPointController:

Public Member Functions

 CheckPointController ()
 
 CheckPointController (const std::string &fileNamePrefix, int beginTime, int endTime, int timeInterval, bool writeThroughMaster)
 
virtual ~CheckPointController ()
 
virtual void performCheckPoint (int currentTime)
 
virtual void performSnapShot (int currentTime)
 
virtual void issueCheckPointCmd (int currentTime)
 
virtual void issueCheckPointCmdWTM (int currentTime)
 
virtual void issueSnapShotCmd (int currentTime)
 
virtual void issueCheckPointLoadingCmd (const std::string &)
 
bool isCheckPoint (int time)
 
void setCheckPointParams (const std::string &fileNamePrefix, int beginTime, int endTime, int timeInterval, bool writeThroughMaster, int precision=12)
 
std::string getLatticeDataFileName (const std::string &fileNamePrefix, int timeStep, int rank, bool bin=false)
 
esys::lsm::StringVector getLatticeDataFiles (int timeStep, int size)
 
esys::lsm::StringVector getLatticeDataFiles (int timeStep)
 
void set_is2d (bool do2d)
 
void setLsmGeoVersion (float version)
 
void setPeriodicDimensions (esys::lsm::BoolVector periodicDimensions)
 
void setGeometryInfo (const esys::lsm::GeometryInfo &geoInfo)
 
void setSpatialDomain (const esys::lsm::BoundingBox &bBox)
 
esys::lsm::GeometryInfo getGeometryInfo () const
 
int getNumTimeSteps () const
 
void setNumTimeSteps (int numTimeSteps)
 
double getTimeStepSize () const
 
void setTimeStepSize (double timeStepSize)
 
void setPrecision (int precision)
 
bool spatialDomainHasBeenSet () const
 
MPI_Comm getMpiComm () const
 
void setMpiComm (MPI_Comm mpiComm)
 

Protected Attributes

MPI_Comm m_mpiComm
 
std::string m_fileNamePrefix
 
int m_beginTime
 
int m_endTime
 
int m_timeInterval
 
esys::lsm::GeometryInfo m_geoInfo
 
int m_numTimeSteps
 
double m_timeStepSize
 
bool m_spatialDomainHasBeenSet
 
bool m_writeThroughMaster
 
int m_precision
 

Detailed Description

Controls the issue of check-pointing commands to slave processes.

Constructor & Destructor Documentation

◆ CheckPointController() [1/2]

CheckPointController::CheckPointController ( )

Default constructor.

Default parameters cause isCheckPoint to return false.

default constructor

References m_spatialDomainHasBeenSet.

◆ CheckPointController() [2/2]

CheckPointController::CheckPointController ( const std::string &  fileNamePrefix,
int  beginTime,
int  endTime,
int  timeInterval,
bool  writeThroughMaster 
)

Instantiates and sets the parameters which determine when a check-point should occur.

See also
setCheckpointParams

References m_spatialDomainHasBeenSet.

◆ ~CheckPointController()

CheckPointController::~CheckPointController ( )
virtual

Member Function Documentation

◆ getGeometryInfo()

esys::lsm::GeometryInfo CheckPointController::getGeometryInfo ( ) const

Returns geometry info.

References m_geoInfo.

Referenced by issueCheckPointCmd(), issueCheckPointCmdWTM(), and issueSnapShotCmd().

Here is the caller graph for this function:

◆ getLatticeDataFileName()

std::string CheckPointController::getLatticeDataFileName ( const std::string &  fileNamePrefix,
int  timeStep,
int  rank,
bool  bin = false 
)

Generate the filename for the checkpoint file to be written by a given worker

Parameters
fileNamePrefixglobal filename prefix
timeStepcurrent time step
rankthe MPI rank of the worker

References CheckPointParams::getFileName().

Referenced by getLatticeDataFiles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLatticeDataFiles() [1/2]

esys::lsm::StringVector CheckPointController::getLatticeDataFiles ( int  timeStep)

Generate the filenames for the checkpoint files to be written by all workers

Parameters
timeStepcurrent time step

References getLatticeDataFiles(), and getMpiComm().

Here is the call graph for this function:

◆ getLatticeDataFiles() [2/2]

esys::lsm::StringVector CheckPointController::getLatticeDataFiles ( int  timeStep,
int  size 
)

Generate the filenames for the checkpoint files to be written by all workers

Parameters
timeStepcurrent time step
sizenumber of workers

References getLatticeDataFileName(), and m_fileNamePrefix.

Referenced by getLatticeDataFiles(), issueCheckPointCmd(), issueCheckPointCmdWTM(), and issueSnapShotCmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMpiComm()

MPI_Comm CheckPointController::getMpiComm ( ) const

References m_mpiComm.

Referenced by getLatticeDataFiles(), issueCheckPointCmd(), issueCheckPointCmdWTM(), issueCheckPointLoadingCmd(), and issueSnapShotCmd().

Here is the caller graph for this function:

◆ getNumTimeSteps()

int CheckPointController::getNumTimeSteps ( ) const

References m_numTimeSteps.

Referenced by issueCheckPointCmd(), issueCheckPointCmdWTM(), and issueSnapShotCmd().

Here is the caller graph for this function:

◆ getTimeStepSize()

double CheckPointController::getTimeStepSize ( ) const

get time step size

References m_timeStepSize.

Referenced by issueCheckPointCmd(), issueCheckPointCmdWTM(), and issueSnapShotCmd().

Here is the caller graph for this function:

◆ isCheckPoint()

bool CheckPointController::isCheckPoint ( int  time)

Returns whether specified time is a check-point time.

Parameters
timeThis value is checked against the checkpoint parameters.

References m_beginTime, m_endTime, and m_timeInterval.

Referenced by performCheckPoint(), performSnapShot(), and CLatticeMaster::runOneStep().

Here is the caller graph for this function:

◆ issueCheckPointCmd()

void CheckPointController::issueCheckPointCmd ( int  currentTime)
virtual

Issues the check-point command to slave processes.

Parameters
currentTimeThe check-point time.

Broadcast checkpointing command to workers and write info file (*_0.txt)

Parameters
currentTimethe current time step

References CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), CVarMPIBuffer::clear(), CMD_SAVECHECKPOINT, CheckPointParams::getFileName(), getGeometryInfo(), getLatticeDataFiles(), getMpiComm(), getNumTimeSteps(), getTimeStepSize(), m_fileNamePrefix, m_precision, CheckPointParams::packInto(), esys::lsm::CheckPointInfo::setGeometryInfo(), esys::lsm::CheckPointInfo::setLatticeDataFiles(), esys::lsm::CheckPointInfo::setNumTimeSteps(), esys::lsm::CheckPointInfo::setTimeStep(), esys::lsm::CheckPointInfo::setTimeStepSize(), CMPIBarrier::wait(), and esys::lsm::CheckPointInfo::write().

Referenced by performCheckPoint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ issueCheckPointCmdWTM()

◆ issueCheckPointLoadingCmd()

void CheckPointController::issueCheckPointLoadingCmd ( const std::string &  metafile_name)
virtual

read meta-data and issue checkpoint loading command to worker processes

Parameters
metafile_namethe name of the file with the meta-data

References CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), CVarMPIBuffer::clear(), CMD_LOADCHECKPOINT, console, Console::Debug(), getMpiComm(), m_precision, CheckPointParams::packInto(), and CMPIBarrier::wait().

Referenced by CLatticeMaster::loadCheckPointData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ issueSnapShotCmd()

void CheckPointController::issueSnapShotCmd ( int  currentTime)
virtual

◆ performCheckPoint()

void CheckPointController::performCheckPoint ( int  currentTime)
virtual

Determines whether specified argument is a check-point time (see isCheckPoint). If currentTime is a check-point, issues commands to slave processes to perform check-point.

Parameters
currentTimeParameter used to determine whether a check point should occur.

Issue checkpointing command, i.e. broadcast command via MPI to worker processes, if currentTime is a time at which a checkpoint needs to be taken

Parameters
currentTimethe current time step

References isCheckPoint(), issueCheckPointCmd(), issueCheckPointCmdWTM(), and m_writeThroughMaster.

Referenced by CLatticeMaster::runOneStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ performSnapShot()

void CheckPointController::performSnapShot ( int  currentTime)
virtual

Issue snapshot command, i.e. broadcast command via MPI to worker processes, if currentTime is a time at which a snapshot needs to be taken

Parameters
currentTimethe current time step

References isCheckPoint(), and issueSnapShotCmd().

Referenced by CLatticeMaster::runOneStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_is2d()

void CheckPointController::set_is2d ( bool  do2d)

Set 2-D information to true if the particle data are two-dimensional; otherwise set to false.

References m_geoInfo, and esys::lsm::GeometryInfo::set_is2d().

Referenced by CLatticeMaster::do2dCalculations().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCheckPointParams()

void CheckPointController::setCheckPointParams ( const std::string &  fileNamePrefix,
int  beginTime,
int  endTime,
int  timeInterval,
bool  writeThroughMaster,
int  precision = 12 
)

Sets the parameters which determine when a check-point should occur.

References m_beginTime, m_endTime, m_fileNamePrefix, m_precision, m_timeInterval, and m_writeThroughMaster.

Referenced by CLatticeMaster::initSnapShotController(), CLatticeMaster::performCheckPoints(), and CLatticeMaster::performCheckPointsThroughMaster().

Here is the caller graph for this function:

◆ setGeometryInfo()

void CheckPointController::setGeometryInfo ( const esys::lsm::GeometryInfo geoInfo)

Sets the spatial extent in which particles are tracked.

References m_geoInfo.

Referenced by CLatticeMaster::initSnapShotController(), CLatticeMaster::performCheckPoints(), and CLatticeMaster::performCheckPointsThroughMaster().

Here is the caller graph for this function:

◆ setLsmGeoVersion()

void CheckPointController::setLsmGeoVersion ( float  version)

Set the LSMGeometry version for use in geometry files.

References m_geoInfo, and esys::lsm::GeometryInfo::setLsmGeoVersion().

Here is the call graph for this function:

◆ setMpiComm()

void CheckPointController::setMpiComm ( MPI_Comm  mpiComm)

◆ setNumTimeSteps()

void CheckPointController::setNumTimeSteps ( int  numTimeSteps)

Sets the number of time steps.

References m_numTimeSteps.

Referenced by CLatticeMaster::setNumSteps().

Here is the caller graph for this function:

◆ setPeriodicDimensions()

void CheckPointController::setPeriodicDimensions ( esys::lsm::BoolVector  periodicDimensions)

Set the periodicity of the x, y and z dimensions.

References m_geoInfo, and esys::lsm::GeometryInfo::setPeriodicDimensions().

Here is the call graph for this function:

◆ setPrecision()

void CheckPointController::setPrecision ( int  precision)
inline

References m_precision.

◆ setSpatialDomain()

void CheckPointController::setSpatialDomain ( const esys::lsm::BoundingBox bBox)

◆ setTimeStepSize()

void CheckPointController::setTimeStepSize ( double  timeStepSize)

Sets the time step size.

References m_timeStepSize.

Referenced by CLatticeMaster::setTimeStepSize().

Here is the caller graph for this function:

◆ spatialDomainHasBeenSet()

bool CheckPointController::spatialDomainHasBeenSet ( ) const

return true if the spatial domain has been set, false otherwise

References m_spatialDomainHasBeenSet.

Member Data Documentation

◆ m_beginTime

int CheckPointController::m_beginTime
protected

◆ m_endTime

int CheckPointController::m_endTime
protected

◆ m_fileNamePrefix

std::string CheckPointController::m_fileNamePrefix
protected

◆ m_geoInfo

◆ m_mpiComm

MPI_Comm CheckPointController::m_mpiComm
protected

Referenced by getMpiComm(), and setMpiComm().

◆ m_numTimeSteps

int CheckPointController::m_numTimeSteps
protected

Referenced by getNumTimeSteps(), and setNumTimeSteps().

◆ m_precision

int CheckPointController::m_precision
protected

◆ m_spatialDomainHasBeenSet

bool CheckPointController::m_spatialDomainHasBeenSet
protected

◆ m_timeInterval

int CheckPointController::m_timeInterval
protected

◆ m_timeStepSize

double CheckPointController::m_timeStepSize
protected

Referenced by getTimeStepSize(), and setTimeStepSize().

◆ m_writeThroughMaster

bool CheckPointController::m_writeThroughMaster
protected

If set, pipe all write operations through master process. Useful on installations where only proc. 0 can write to files

Referenced by performCheckPoint(), and setCheckPointParams().


The documentation for this class was generated from the following files: