mstk.ommhelper.reporter.CheckpointReporter

class mstk.ommhelper.reporter.CheckpointReporter(file, reportInterval, xml=None)

CheckpointReporter saves periodic checkpoints of a simulation. The checkpoints will overwrite old files – only the latest three will be kept. State XML files can be saved together, in case the checkpoint files are broken.

Parameters:
  • file (string) – The file to write to. Any current contents will be overwritten. The latest three checkpoint will be kept with the step appended to the file name.

  • reportInterval (int) – The interval (in time steps) at which to write checkpoints.

  • xml (string, optional) – If provided, the state will be serialized into XML format and saved together with checkpoint. Any current contents will be overwritten. The latest three XML files will be kept with the step appended to the file name.

Methods

__init__(file, reportInterval[, xml])

describeNextReport(simulation)

Get information about the next report this object will generate.

report(simulation, state)

Generate a report.

describeNextReport(simulation)

Get information about the next report this object will generate.

Parameters:

simulation (Simulation) – The Simulation to generate a report for

Returns:

A five element tuple. The first element is the number of steps until the next report. The remaining elements specify whether that report will require positions, velocities, forces, and energies respectively.

Return type:

tuple

report(simulation, state)

Generate a report.

Parameters:
  • simulation (Simulation) – The Simulation to generate a report for

  • state (State) – The current state of the simulation