|
ESyS-Particle
2.3.4
|
#include <CheckPointController.h>

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 |
Controls the issue of check-pointing commands to slave processes.
| CheckPointController::CheckPointController | ( | ) |
Default constructor.
Default parameters cause isCheckPoint to return false.
default constructor
References m_spatialDomainHasBeenSet.
| 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.
References m_spatialDomainHasBeenSet.
|
virtual |
| esys::lsm::GeometryInfo CheckPointController::getGeometryInfo | ( | ) | const |
Returns geometry info.
References m_geoInfo.
Referenced by issueCheckPointCmd(), issueCheckPointCmdWTM(), and issueSnapShotCmd().

| 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
| fileNamePrefix | global filename prefix |
| timeStep | current time step |
| rank | the MPI rank of the worker |
References CheckPointParams::getFileName().
Referenced by getLatticeDataFiles().


| esys::lsm::StringVector CheckPointController::getLatticeDataFiles | ( | int | timeStep | ) |
Generate the filenames for the checkpoint files to be written by all workers
| timeStep | current time step |
References getLatticeDataFiles(), and getMpiComm().

| esys::lsm::StringVector CheckPointController::getLatticeDataFiles | ( | int | timeStep, |
| int | size | ||
| ) |
Generate the filenames for the checkpoint files to be written by all workers
| timeStep | current time step |
| size | number of workers |
References getLatticeDataFileName(), and m_fileNamePrefix.
Referenced by getLatticeDataFiles(), issueCheckPointCmd(), issueCheckPointCmdWTM(), and issueSnapShotCmd().


| MPI_Comm CheckPointController::getMpiComm | ( | ) | const |
References m_mpiComm.
Referenced by getLatticeDataFiles(), issueCheckPointCmd(), issueCheckPointCmdWTM(), issueCheckPointLoadingCmd(), and issueSnapShotCmd().

| int CheckPointController::getNumTimeSteps | ( | ) | const |
References m_numTimeSteps.
Referenced by issueCheckPointCmd(), issueCheckPointCmdWTM(), and issueSnapShotCmd().

| double CheckPointController::getTimeStepSize | ( | ) | const |
get time step size
References m_timeStepSize.
Referenced by issueCheckPointCmd(), issueCheckPointCmdWTM(), and issueSnapShotCmd().

| bool CheckPointController::isCheckPoint | ( | int | time | ) |
Returns whether specified time is a check-point time.
| time | This value is checked against the checkpoint parameters. |
References m_beginTime, m_endTime, and m_timeInterval.
Referenced by performCheckPoint(), performSnapShot(), and CLatticeMaster::runOneStep().

|
virtual |
Issues the check-point command to slave processes.
| currentTime | The check-point time. |
Broadcast checkpointing command to workers and write info file (*_0.txt)
| currentTime | the 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().


|
virtual |
checkpointing with writing through master
| currentTime | the current time step |
References CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), CVarMPIBuffer::clear(), CMD_SAVECHECKPOINTWTM, console, Console::Debug(), TML_Comm::gather(), 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().


|
virtual |
read meta-data and issue checkpoint loading command to worker processes
| metafile_name | the 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().


|
virtual |
save meta-data and issue snapshot command to worker processes N.B.: the "binary" flag is forced to false of non-restart snapshots
| currentTime | The current time step. |
References CMPILCmdBuffer::broadcast(), CVarMPIBuffer::broadcast(), CVarMPIBuffer::clear(), CMD_SAVESNAPSHOT, CheckPointParams::getFileName(), getGeometryInfo(), getLatticeDataFiles(), getMpiComm(), getNumTimeSteps(), getTimeStepSize(), m_fileNamePrefix, 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 performSnapShot().


|
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.
| currentTime | Parameter 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
| currentTime | the current time step |
References isCheckPoint(), issueCheckPointCmd(), issueCheckPointCmdWTM(), and m_writeThroughMaster.
Referenced by CLatticeMaster::runOneStep().


|
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
| currentTime | the current time step |
References isCheckPoint(), and issueSnapShotCmd().
Referenced by CLatticeMaster::runOneStep().


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


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

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

| void CheckPointController::setLsmGeoVersion | ( | float | version | ) |
Set the LSMGeometry version for use in geometry files.
References m_geoInfo, and esys::lsm::GeometryInfo::setLsmGeoVersion().

| void CheckPointController::setMpiComm | ( | MPI_Comm | mpiComm | ) |
References m_mpiComm.
Referenced by CLatticeMaster::initSnapShotController(), CLatticeMaster::performCheckPoints(), and CLatticeMaster::performCheckPointsThroughMaster().

| void CheckPointController::setNumTimeSteps | ( | int | numTimeSteps | ) |
Sets the number of time steps.
References m_numTimeSteps.
Referenced by CLatticeMaster::setNumSteps().

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

|
inline |
References m_precision.
| void CheckPointController::setSpatialDomain | ( | const esys::lsm::BoundingBox & | bBox | ) |
Sets geometry info.
References esys::lsm::BoundingBox::getMaxPt(), esys::lsm::BoundingBox::getMinPt(), m_geoInfo, m_spatialDomainHasBeenSet, and esys::lsm::GeometryInfo::setBBox().

| void CheckPointController::setTimeStepSize | ( | double | timeStepSize | ) |
Sets the time step size.
References m_timeStepSize.
Referenced by CLatticeMaster::setTimeStepSize().

| bool CheckPointController::spatialDomainHasBeenSet | ( | ) | const |
return true if the spatial domain has been set, false otherwise
References m_spatialDomainHasBeenSet.
|
protected |
Referenced by isCheckPoint(), and setCheckPointParams().
|
protected |
Referenced by isCheckPoint(), and setCheckPointParams().
|
protected |
Prefix of check-point files.
Referenced by getLatticeDataFiles(), issueCheckPointCmd(), issueCheckPointCmdWTM(), issueSnapShotCmd(), and setCheckPointParams().
|
protected |
Referenced by getGeometryInfo(), set_is2d(), setGeometryInfo(), setLsmGeoVersion(), setPeriodicDimensions(), and setSpatialDomain().
|
protected |
Referenced by getMpiComm(), and setMpiComm().
|
protected |
Referenced by getNumTimeSteps(), and setNumTimeSteps().
|
protected |
Referenced by issueCheckPointCmd(), issueCheckPointCmdWTM(), issueCheckPointLoadingCmd(), setCheckPointParams(), and setPrecision().
|
protected |
Referenced by CheckPointController(), setSpatialDomain(), and spatialDomainHasBeenSet().
|
protected |
Referenced by isCheckPoint(), and setCheckPointParams().
|
protected |
Referenced by getTimeStepSize(), and setTimeStepSize().
|
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().