Gromacs  2025-dev-20240718-982dfdc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::CheckpointHelper Class Referencefinal

#include <gromacs/modularsimulator/checkpointhelper.h>

+ Inheritance diagram for gmx::CheckpointHelper:
+ Collaboration diagram for gmx::CheckpointHelper:


Checkpoint helper.

The CheckpointHelper is responsible to write checkpoints. In the longer term, it will also be responsible to read checkpoints, but this is not yet implemented.

Writing checkpoints is done just before neighbor-searching (NS) steps, or after the last step. Checkpointing occurs periodically (by default, every 15 minutes), and needs two NS steps to take effect - on the first NS step, the checkpoint helper on main rank signals to all other ranks that checkpointing is about to occur. At the next NS step, the checkpoint is written. On the last step, checkpointing happens immediately before the step (no signalling). To be able to react to last step being signalled, the CheckpointHelper does also implement the ISimulatorElement interface, but does only register a function if the last step has been called. It should be placed on top of the simulator loop.

Checkpointing happens at the end of a simulation step, which gives a straightforward re-entry point at the top of the simulator loop.

Checkpoint writing is done by passing sub-objects of a WriteCheckpointDataHolder object to the clients. Checkpoint reading is done by passing sub-objects of a ReadCheckpointDataHolder object (passed in from runner level) do the clients.

See Also

Public Member Functions

 CheckpointHelper (std::vector< std::tuple< std::string, ICheckpointHelperClient * >> &&clients, std::unique_ptr< CheckpointHandler > checkpointHandler, int initStep, TrajectoryElement *trajectoryElement, FILE *fplog, t_commrec *cr, ObservablesHistory *observablesHistory, gmx_walltime_accounting *walltime_accounting, t_state *state_global, bool writeFinalCheckpoint)
void run (Step step, Time time)
 Run checkpointing. More...
void scheduleTask (Step step, Time time, const RegisterRunFunction &registerRunFunction) override
 Register run function for step / time. More...
void elementSetup () override
 No element setup needed.
void elementTeardown () override
 No element teardown needed.
- Public Member Functions inherited from gmx::ILastStepSignallerClient
virtual ~ILastStepSignallerClient ()=default
 Standard virtual destructor.
- Public Member Functions inherited from gmx::ISimulatorElement
virtual ~ISimulatorElement ()=default
 Standard virtual destructor.

Additional Inherited Members

Member Function Documentation

void gmx::CheckpointHelper::run ( Step  step,
Time  time 

Run checkpointing.

Sets signal and / or performs checkpointing at neighbor searching steps

stepThe step number
timeThe time
void gmx::CheckpointHelper::scheduleTask ( Step  step,
Time  time,
const RegisterRunFunction registerRunFunction 

Register run function for step / time.

Performs checkpointing at the last step. This is part of the element call list, as the checkpoint helper need to be able to react to the last step being signalled.

stepThe step number
timeThe time
registerRunFunctionFunction allowing to register a run function

Implements gmx::ISimulatorElement.

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