Skip to content

Action: CHECKPOINT

Module setup
Description Usage
Write a PLUMED checkpoint file for an exact restart. used in 0 tutorialsused in 0 eggs

Details and examples

Write a PLUMED checkpoint file for an exact restart.

With this directive PLUMED writes its own checkpoint file, separate from the one of the MD engine, whenever the MD engine writes its checkpoint (the MD engine tells PLUMED through the doCheckPoint command of the interface; the GROMACS patch does so) or, with STRIDE, every STRIDE steps for the engines that do not send this signal.

The checkpoint stores the internal state of the actions (hills, accumulators, random number generators, ...) at the start of the checkpointing step, together with the sizes of all the files that PLUMED has written up to that moment. When the simulation is restarted from it, every output file is truncated to the size it had at the checkpoint, so that the lines written after it by the interrupted run are removed, and the checkpointing step is computed again: this requires the MD engine to restart from its own checkpoint of the same step, as GROMACS does with -cpi. The result is an exact continuation of the interrupted run, at variance with a plain RESTART where files are only appended.

CHECKPOINT is a setup directive and must come before any action that writes a file, so put it at the top of the input. The file is written atomically and the previous checkpoint is kept with the suffix _prev (plumed_prev.cpt for plumed.cpt); with multiple replicas every replica writes its own file with the usual replica suffix.

Click on the labels of the actions for more information on what each action computes
tested on2.11
CHECKPOINTWrite a PLUMED checkpoint file for an exact restart. More details FILE the name of the checkpoint file=plumed.cpt
d: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d FILEthe name of the file on which to output these quantities=colvar

At restart, RESTART_FROM selects the checkpoint to read. The default, AUTO, reads FILE when the MD engine tells PLUMED that the run is restarted (or when RESTART comes before CHECKPOINT) and starts a new run otherwise. A file name reads that checkpoint unconditionally, NO never reads one (the checkpoint is only written). Restarting from a checkpoint implies RESTART.

Click on the labels of the actions for more information on what each action computes
tested on2.11
CHECKPOINTWrite a PLUMED checkpoint file for an exact restart. More details FILE the name of the checkpoint file=plumed.cpt STRIDE write a checkpoint every STRIDE steps, in addition to those requested by the MD engine=1000 RESTART_FROM the checkpoint to restart from: AUTO (FILE, if the MD engine is restarting), NO (never restart from a checkpoint), or the name of a checkpoint file=AUTO
d: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d FILEthe name of the file on which to output these quantities=colvar

The first step presented by the MD engine after the restart must be the one stored in the checkpoint, otherwise PLUMED stops with an error: this happens when the PLUMED checkpoint and the restart file of the MD engine do not come from the same moment of the simulation. With STRIDE, choose a stride that matches the checkpointing of the MD engine.

An action with the per-action keyword RESTART=NO starts from scratch at the restart step: its state is not restored from the checkpoint and its files, trimmed at the checkpoint like all the others, are backed up and rewritten instead of being appended. This is the way to add a new action with an internal state to a continuation, or to reset one (e.g. a METAD that starts depositing again from zero while everything else continues exactly). The global RESTART NO directive after CHECKPOINT is an error, since it contradicts the restart from the checkpoint.

The actions that store their state in the checkpoint include METAD, PBMETAD, OPES_METAD, OPES_METAD_EXPLORE, METAINFERENCE (and the ISDB collective variables with DOSCORE), EDS, DRR, MOVINGRESTRAINT, ABMD, EXTENDED_LAGRANGIAN, ACCUMULATE, COLLECT, COMMITTOR, MAXENT, READ, RANDOM_EXCHANGES, LOGMFD, FISST, RESCALE, EMMI, EMMIVOX and EFFECTIVE_ENERGY_DRIFT (exact with a single process, up to rounding with more): they restore their state from it, so that their hills, kernels or status files are not read (the growing ones are truncated). Actions that keep an internal state but do not store it in the checkpoint yet are listed in a warning in the log: for them the restart is the usual file-based one and an exact continuation is not guaranteed.

The content of a checkpoint can be inspected with plumed checkpoint --dump. Compressed (.gz) output files cannot be truncated and are not allowed together with CHECKPOINT.

Full list of keywords

The following table describes the keywords and options that can be used with this action

Keyword Type Default Description
FILE compulsory plumed.cpt the name of the checkpoint file
STRIDE compulsory 0 write a checkpoint every STRIDE steps, in addition to those requested by the MD engine
RESTART_FROM compulsory AUTO the checkpoint to restart from: AUTO (FILE, if the MD engine is restarting), NO (never restart from a checkpoint), or the name of a checkpoint file