Exact-restart checkpoint of a PLUMED run, configured by the CHECKPOINT action.
More...
|
| | Checkpointing (PlumedMain &plumed) |
| |
| | ~Checkpointing () |
| |
| void | atRunEnd (bool fromDestructor=false) |
| | At the end of the run (cmd "runFinalJobs", before the final jobs, or, if it was not called, when PLUMED is finalized, fromDestructor): if the MD engine never sent the checkpointing signal, write the state after the last step, i.e.
|
| |
| void | atStepEnd () |
| | To be called at the end of the update of a step.
|
| |
| void | atStepStart (bool signal) |
| | To be called before any computation of the current step, possibly more than once per step.
|
| |
| void | disableTrimming () |
| | RESTART NO_TRIM: the files are appended as they are.
|
| |
| bool | enabled () const |
| |
| long long int | getEngineRestartStep () const |
| |
| const std::string & | getPath () const |
| |
| bool | isRestartingFromCheckpoint () const |
| | True after restartFrom() has been called (a checkpoint restart is in progress or done).
|
| |
| void | markSnapshotFile (const std::string &fileName) |
| | Mark a file as rewritten from scratch at every write (called by OFile::rewind).
|
| |
| void | registerOutputFile (OFile &file) |
| | Record a file opened for writing (called by OFile::open) and, after a restart, restore the header of its last line so that it is not printed again.
|
| |
| void | restartFrom (const std::string &fileName) |
| | Read a checkpoint, trim the output files and switch restart on (called by the CHECKPOINT action, before any other action opens a file).
|
| |
| void | restoreLastFields (OFile &file) const |
| | After a restart, restore the field header of the last line of a file appended to (from the checkpoint, or found when trimming it), so that it is not printed again.
|
| |
| void | setEngineRestartStep (long long int step) |
| | Step from which the MD engine restarts (cmd "setRestartStep", before init).
|
| |
| void | setup (const std::string &fileName, long long int checkpointStride) |
| | Configure checkpoint writing (called by the CHECKPOINT action).
|
| |
| std::string | suffixedPath (const std::string &fileName) const |
| | Full path of the checkpoint file for this replica, given its base name.
|
| |
| void | trimAtRestart (const std::string &fileName, bool keepRestartStep=false) |
| | Remove from a file the lines written at or after the restart step, i.e.
|
| |
| void | trimOutputFileAtRestart (Action &action, const std::string &name, bool nosuffix=false) |
| | For an action that reads one of its output files at restart before appending to it (e.g.
|
| |
| bool | trimsAtRestart () const |
| | True when the files appended at restart are trimmed at the restart step: the MD engine gave the step, trimming was not switched off, and the run does not restart from a checkpoint (which trims the files to the recorded sizes).
|
| |
|
| long long int | engineRestartStep =-1 |
| | Step from which the MD engine restarts (cmd "setRestartStep"), -1 if not given.
|
| |
| bool | engineRestartStepChecked =false |
| | The first step presented after a restart has been compared with engineRestartStep.
|
| |
| std::string | file |
| | Base name given by the user (empty: checkpointing is off)
|
| |
| std::string | finalPath |
| | Path of the checkpoint written at the end of the run (atRunEnd)
|
| |
| std::map< std::string, std::string > | lastFields |
| | Field headers recorded in the checkpoint being restored, or found when trimming a file at the restart step, by path.
|
| |
| long long int | lastStep =-1 |
| | Last step presented and difference between the last two steps (to know the next one)
|
| |
| long long int | lastWrittenStep =-1 |
| |
| std::vector< std::string > | outputFiles |
| | Paths of all the files opened for writing in this run.
|
| |
| std::string | path |
| | Full path (with the replica suffix) and path of the previous checkpoint.
|
| |
| std::unique_ptr< CheckpointReader > | pending |
| | Checkpoint being restored, consumed at the first step.
|
| |
| PlumedMain & | plumed |
| |
| std::string | prevPath |
| |
| long long int | restartStep =-1 |
| | Step stored in the checkpoint being restored (-1: no restart)
|
| |
| bool | runEndHandled =false |
| | The end of the run has been handled (atRunEnd called)
|
| |
| bool | signalReceived =false |
| | A checkpointing signal was received from the MD engine in this run.
|
| |
| std::set< std::string > | snapshotFiles |
| | Files rewritten from scratch at every write (OFile::rewind): they are not trimmed at restart, since the next write replaces them anyway.
|
| |
| bool | stepComplete =false |
| | The last step presented has been completed (update done)
|
| |
| long long int | stepIncrement =1 |
| |
| long long int | stride =0 |
| |
| bool | trimEnabled =true |
| | False with RESTART NO_TRIM.
|
| |
| std::set< std::string > | trimmedFiles |
| | Files already trimmed at the restart step (or left as they are)
|
| |
| bool | warnedAboutUnportedState =false |
| |
Exact-restart checkpoint of a PLUMED run, configured by the CHECKPOINT action.
The checkpoint for step S captures the state at the start of S (after the update of step S-1 and before anything of S is computed) together with the sizes of all the output files after a flush at that moment. On restart the files are truncated to those sizes and the MD engine presents step S again, which is replayed in full. No action needs to know that a step is repeated.
The checkpoint is written when the MD engine sends the checkpointing signal (cmd "doCheckPoint") or, with STRIDE, every STRIDE steps. It is a separate file, one per replica (usual suffix), written atomically; the previous one is kept with a _prev suffix. If the MD engine never sends the signal, a checkpoint of the state after the last step (i.e. for the next step) is written at the end of the run (cmd "runFinalJobs", or the destructor of PlumedMain), with a _final suffix.
| void PLMD::Checkpointing::atRunEnd |
( |
bool | fromDestructor = false | ) |
|
At the end of the run (cmd "runFinalJobs", before the final jobs, or, if it was not called, when PLUMED is finalized, fromDestructor): if the MD engine never sent the checkpointing signal, write the state after the last step, i.e.
at the start of the next one, to FILE with the suffix _final (plumed_final.cpt). Only the first call does something; nothing is written if the last step was not completed or, from the destructor, if MPI is already finalized.
| void PLMD::Checkpointing::trimAtRestart |
( |
const std::string & | fileName, |
|
|
bool | keepRestartStep = false ) |
Remove from a file the lines written at or after the restart step, i.e.
the last lines whose time is not smaller than the time of the restart step (the earlier lines, also those of earlier runs whose time restarted from zero, are kept). Files without a time field, compressed files, and files where the time of these lines is not increasing are left as they are, with a line in the log. Each file is processed only once. To be called by one process only, before the file is read or written by this run (see OFile). keepRestartStep: the lines of the restart step itself are kept (e.g. the hill of that step, when the bias is read from a grid written at the checkpoint).