ESyS-Particle  4.0.1
Public Member Functions | Protected Attributes | List of all members
CheckPointController Class Reference

#include <CheckPointController.h>

Collaboration diagram for CheckPointController:
Collaboration graph
[legend]

Public Member Functions

 CheckPointController ()
 CheckPointController (const std::string &fileNamePrefix, int beginTime, int endTime, int timeInterval, bool writeThroughMaster=false)
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=false)
std::string getLatticeDataFileName (const std::string &fileNamePrefix, int timeStep, int rank)
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)
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

Detailed Description

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

Constructor & Destructor Documentation

CheckPointController::CheckPointController ( )

Default constructor.

Default parameters cause isCheckPoint to return false.

default constructor

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

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

See Also
setCheckpointParams

Member Function Documentation

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

Returns geometry info.

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

Here is the caller graph for this function:

std::string CheckPointController::getLatticeDataFileName ( const std::string &  fileNamePrefix,
int  timeStep,
int  rank 
)

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:

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:

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().

Here is the call graph for this function:

double CheckPointController::getTimeStepSize ( ) const

get time step size

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

Here is the caller graph for this function:

bool CheckPointController::isCheckPoint ( int  time)

Returns whether specified time is a check-point time.

Parameters
timeThis value is checked against the checkpoint parameters.

Referenced by performCheckPoint(), and performSnapShot().

Here is the caller graph for this function:

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(), CheckPointParams::getFileName(), getGeometryInfo(), getLatticeDataFiles(), getTimeStepSize(), m_fileNamePrefix, and CMPIBarrier::wait().

Referenced by performCheckPoint().

Here is the call graph for this function:

Here is the caller graph for this function:

void CheckPointController::issueCheckPointCmdWTM ( int  currentTime)
virtual

checkpointing with writing through master

Parameters
currentTimethe current time step

References CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), BasicCon::Debug(), TML_Comm::gather(), CheckPointParams::getFileName(), getGeometryInfo(), getLatticeDataFiles(), getTimeStepSize(), m_fileNamePrefix, and CMPIBarrier::wait().

Referenced by performCheckPoint().

Here is the call graph for this function:

Here is the caller graph for this function:

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(), BasicCon::Debug(), and CMPIBarrier::wait().

Here is the call graph for this function:

void CheckPointController::issueSnapShotCmd ( int  currentTime)
virtual

save meta-data and issue snapshot command to worker processes

Parameters
currentTimeThe current time step.

References CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), CheckPointParams::getFileName(), getGeometryInfo(), getLatticeDataFiles(), getTimeStepSize(), m_fileNamePrefix, and CMPIBarrier::wait().

Referenced by performSnapShot().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

void CheckPointController::set_is2d ( bool  do2d)

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

References esys::lsm::GeometryInfo::set_is2d().

Here is the call graph for this function:

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

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

References m_fileNamePrefix, and m_writeThroughMaster.

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

Sets the spatial extent in which particles are tracked.

void CheckPointController::setLsmGeoVersion ( float  version)

Set the LSMGeometry version for use in geometry files.

References esys::lsm::GeometryInfo::setLsmGeoVersion().

Here is the call graph for this function:

void CheckPointController::setNumTimeSteps ( int  numTimeSteps)

Sets the number of time steps.

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

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

References esys::lsm::GeometryInfo::setPeriodicDimensions().

Here is the call graph for this function:

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

Sets geometry info.

References esys::lsm::GeometryInfo::setBBox().

Here is the call graph for this function:

void CheckPointController::setTimeStepSize ( double  timeStepSize)

Sets the time step size.

bool CheckPointController::spatialDomainHasBeenSet ( ) const

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

Member Data Documentation

std::string CheckPointController::m_fileNamePrefix
protected
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: