The Sparta Modeling Framework
|
Sparta supports Checkpoint of its functional components. Objects in the Sparta framework as well as user derived objects of sparta::ArchData are automatically checkpointable. Objects that are not derivatives of sparta::ArchData can still be checkpointed – see below.
Checkpoints are binary files and are not expected to be human readable.
Class | Brief Derivatives |
---|---|
sparta::serialization::checkpoint::CheckpointError | Indicates that there was an issue operating on checkpoints within the SPARTA framework. |
sparta::serialization::checkpoint::Checkpoint | Single checkpoint object interface with a tick number and an ID unique to the owning Checkpointer instance. |
sparta::serialization::checkpoint::DeltaCheckpoint | Single delta checkpoint object containing all simulator state which changed since some previous DeltaCheckpoint. Can contain all simulator state if it has no previous DeltaCheckpoint. The previous delta can be referenced by getPrev(). |
sparta::serialization::checkpoint::Checkpointer | Checkpointer interface. Defines an ID-based checkpointing API for tree of related checkpoints which could be stored as ordered deltas internally. |
sparta::serialization::checkpoint::FastCheckpointer | Implements quick checkpointing through delta-checkpoint trees which store state-deltas in a compact format. State is retrieved through a sparta tree from ArchDatas associated with any TreeNodes. |
sparta::serialization::checkpoint::PersistentFastCheckpointer | Implements a Persistent FastCheckpointer, i.e. implements an interface to save checkpoints to disk. |
Checkpointing is performed through the model and not from the command line (unless added by the modeler). Modelers using checkpoints usually trigger the saving/restoring of a checkpoint by an event or an activity in the model. For example, saving a checkpoint after the model detects that Linux has booted to its login prompt. Restoring can be performed via the model directly, a command line option supplied by the modeler, a python shell command (if the model is embedded into a python environment), or possibly from a parameter if the modeler defines one:
There is really only one type of checkpointer – the sparta::serialization::checkpoint::FastCheckpointer. This checkpointer class implements the sparta::serialization::checkpoint::Checkpointer interface providing in memory checkpointing. If the modeler desires to save checkpoints to disk, the modeler should use sparta::serialization::checkpoint::PersistentFastCheckpointer, which derives from sparta::serialization::checkpoint::FastCheckpointer.