Gromacs  2024.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::CheckpointHandler Class Referencefinal

#include <gromacs/mdlib/checkpointhandler.h>


Class handling the checkpoint signal.

Main rank sets the checkpointing signal periodically All ranks receive checkpointing signal and set the respective flag

Public Member Functions

 CheckpointHandler (compat::not_null< SimulationSignal * > signal, bool simulationsShareState, bool neverUpdateNeighborList, bool isMain, bool writeFinalCheckpoint, real checkpointingPeriod)
 CheckpointHandler constructor. More...
void setSignal (gmx_walltime_accounting *walltime_accounting) const
 Decides whether a checkpointing signal needs to be set. More...
void decideIfCheckpointingThisStep (bool bNS, bool bFirstStep, bool bLastStep)
 Decides whether a checkpoint shall be written at this step. More...
bool isCheckpointingStep () const
 Query decision in decideIfCheckpointingThisStep()

Constructor & Destructor Documentation

gmx::CheckpointHandler::CheckpointHandler ( compat::not_null< SimulationSignal * >  signal,
bool  simulationsShareState,
bool  neverUpdateNeighborList,
bool  isMain,
bool  writeFinalCheckpoint,
real  checkpointingPeriod 

CheckpointHandler constructor.

Needs a non-null pointer to the signal which is reduced by compute_globals, and (const) references to data it needs to determine whether a signal needs to be set or handled.

Member Function Documentation

void gmx::CheckpointHandler::decideIfCheckpointingThisStep ( bool  bNS,
bool  bFirstStep,
bool  bLastStep 

Decides whether a checkpoint shall be written at this step.

Checkpointing is done if this is not the initial step, and

  • a signal has been set and the current step is a neighborlist creation step, or
  • the current step is the last step and a the simulation is writing configurations.
Change these bools to enums to make calls more self-explanatory
void gmx::CheckpointHandler::setSignal ( gmx_walltime_accounting *  walltime_accounting) const

Decides whether a checkpointing signal needs to be set.

Checkpointing signal is set based on the elapsed run time and the checkpointing interval.

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