The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::serialization::checkpoint::DatabaseCheckpoint Class Referencefinal

Checkpoint class optimized for use with database-backed checkpointers. More...

#include <DatabaseCheckpoint.hpp>

Inheritance diagram for sparta::serialization::checkpoint::DatabaseCheckpoint:
Collaboration diagram for sparta::serialization::checkpoint::DatabaseCheckpoint:

Public Member Functions

template<typename Archive >
void serialize (Archive &ar, const unsigned int version)
 
std::string stringize () const override
 Returns a string describing this object.
 
void dumpData (std::ostream &o) const override
 Writes all checkpoint raw data to an ostream.
 
uint64_t getTotalMemoryUse () const noexcept override
 Returns memory usage by this checkpoint.
 
uint64_t getContentMemoryUse () const noexcept override
 Returns memory usage by the content of this checkpoint.
 
std::stack< chkpt_id_tgetHistoryChain () const
 Returns a stack of checkpoints from this checkpoint as far back as possible until no previous link is found.
 
std::stack< chkpt_id_tgetRestoreChain () const
 Returns a stack of checkpoints that must be restored from top-to-bottom to fully restore the state associated with this checkpoint.
 
chkpt_id_t getPrevID () const override
 Get the ID of our previous checkpoint. Returns UNIDENTIFIED_CHECKPOINT only for the head checkpoint.
 
std::vector< chkpt_id_tgetNextIDs () const override
 Returns next checkpoints following this one. May be an empty vector if there are no later checkpoints.
 
void load (const std::vector< ArchData * > &dats) override
 Attempts to restore this checkpoint including any previous deltas (dependencies).
 
bool isSnapshot () const noexcept
 Is this checkpoint a snapshot? If true, this checkpoint has no dependencies and contains all simulator state.
 
uint32_t getDistanceToPrevSnapshot () const noexcept
 Determines how many checkpoints away the closest, earlier snapshot is.
 
void loadState (const std::vector< ArchData * > &dats)
 Loads delta state of this checkpoint to root.
 
- Public Member Functions inherited from sparta::serialization::checkpoint::CheckpointBase
tick_t getTick () const noexcept
 Returns the tick number at which this checkpoint was taken.
 
chkpt_id_t getID () const noexcept
 Returns the ID of this checkpoint.
 
virtual std::string getDeletedRepr () const
 Gets the representation of this deleted checkpoint as part of a checkpoint chain (if that checkpointer supports deletion)
 
 CheckpointBase (const CheckpointBase &)=delete
 Not copy constructable.
 
CheckpointBaseoperator= (const CheckpointBase &)=delete
 Non-assignable.
 
 CheckpointBase (CheckpointBase &&)=delete
 Not move constructable.
 
CheckpointBaseoperator= (CheckpointBase &&)=delete
 Not move assignable.
 
virtual ~CheckpointBase ()=default
 Destructor.
 
template<typename Archive >
void serialize (Archive &ar, const unsigned int)
 boost::serialization support
 

Friends

struct ChkptWindow
 
class DatabaseCheckpointer
 

Construction & Initialization

 DatabaseCheckpoint (const DatabaseCheckpoint &)=delete
 Not copy constructable.
 
DatabaseCheckpointoperator= (const DatabaseCheckpoint &)=delete
 Non-assignable.
 
 DatabaseCheckpoint (DatabaseCheckpoint &&)=delete
 Not move constructable.
 
DatabaseCheckpointoperator= (DatabaseCheckpoint &&)=delete
 Not move assignable.
 

Additional Inherited Members

- Public Types inherited from sparta::serialization::checkpoint::CheckpointBase
typedef sparta::Scheduler::Tick tick_t
 tick_t Tick type to which checkpoints will refer
 
typedef uint64_t chkpt_id_t
 tick_t Checkpoint ID type to which checkpoints will refer
 
- Static Public Attributes inherited from sparta::serialization::checkpoint::CheckpointBase
static const chkpt_id_t MIN_CHECKPOINT = 0
 Indicates the smallest valid checkpoint id.
 
static const chkpt_id_t UNIDENTIFIED_CHECKPOINT = ~(chkpt_id_t)0
 Indicates unidentified checkpoint (could mean 'invalid' or 'any') depending on context.
 
- Protected Member Functions inherited from sparta::serialization::checkpoint::CheckpointBase
void setID_ (chkpt_id_t id)
 Sets the checkpoint ID.
 
 CheckpointBase (chkpt_id_t id, tick_t tick)
 

Detailed Description

Checkpoint class optimized for use with database-backed checkpointers.

Definition at line 52 of file DatabaseCheckpoint.hpp.

Member Function Documentation

◆ dumpData()

void sparta::serialization::checkpoint::DatabaseCheckpoint::dumpData ( std::ostream & o) const
overridevirtual

Writes all checkpoint raw data to an ostream.

Parameters
oostream to which raw data will be written.
Note
No newlines or other extra characters will be appended.

Implements sparta::serialization::checkpoint::CheckpointBase.

◆ getContentMemoryUse()

uint64_t sparta::serialization::checkpoint::DatabaseCheckpoint::getContentMemoryUse ( ) const
overridevirtualnoexcept

Returns memory usage by the content of this checkpoint.

Implements sparta::serialization::checkpoint::CheckpointBase.

◆ getDistanceToPrevSnapshot()

uint32_t sparta::serialization::checkpoint::DatabaseCheckpoint::getDistanceToPrevSnapshot ( ) const
noexcept

Determines how many checkpoints away the closest, earlier snapshot is.

Returns
distance to closest snapshot. If this node is a snapshot, returns 0; if immediate getPrev() is a snapshot, returns 1; and so on.

◆ getHistoryChain()

std::stack< chkpt_id_t > sparta::serialization::checkpoint::DatabaseCheckpoint::getHistoryChain ( ) const

Returns a stack of checkpoints from this checkpoint as far back as possible until no previous link is found.

Note
Since this checkpointer enforces a linear chain of checkpoints with no gaps, this always reaches the head checkpoint.

◆ getNextIDs()

std::vector< chkpt_id_t > sparta::serialization::checkpoint::DatabaseCheckpoint::getNextIDs ( ) const
overridevirtual

Returns next checkpoints following this one. May be an empty vector if there are no later checkpoints.

Note
Since this checkpointer enforces a linear chain of checkpoints with no gaps, this vector will always have 0 or 1 elements.

Implements sparta::serialization::checkpoint::CheckpointBase.

◆ getPrevID()

chkpt_id_t sparta::serialization::checkpoint::DatabaseCheckpoint::getPrevID ( ) const
overridevirtual

Get the ID of our previous checkpoint. Returns UNIDENTIFIED_CHECKPOINT only for the head checkpoint.

Implements sparta::serialization::checkpoint::CheckpointBase.

◆ getTotalMemoryUse()

uint64_t sparta::serialization::checkpoint::DatabaseCheckpoint::getTotalMemoryUse ( ) const
overridevirtualnoexcept

Returns memory usage by this checkpoint.

Implements sparta::serialization::checkpoint::CheckpointBase.

◆ load()

void sparta::serialization::checkpoint::DatabaseCheckpoint::load ( const std::vector< ArchData * > & dats)
overridevirtual

Attempts to restore this checkpoint including any previous deltas (dependencies).

Note
Uses loadState to restore state from each checkpoint in the restore chain.

Implements sparta::serialization::checkpoint::CheckpointBase.

◆ loadState()

void sparta::serialization::checkpoint::DatabaseCheckpoint::loadState ( const std::vector< ArchData * > & dats)

Loads delta state of this checkpoint to root.

Note
Does not look at any other checkpoints.
See also
DatabaseCheckpointer::load

◆ serialize()

template<typename Archive >
void sparta::serialization::checkpoint::DatabaseCheckpoint::serialize ( Archive & ar,
const unsigned int version )
inline

Definition at line 97 of file DatabaseCheckpoint.hpp.

◆ stringize()

std::string sparta::serialization::checkpoint::DatabaseCheckpoint::stringize ( ) const
overridevirtual

Returns a string describing this object.

Reimplemented from sparta::serialization::checkpoint::CheckpointBase.

Friends And Related Symbol Documentation

◆ ChkptWindow

friend struct ChkptWindow
friend

Definition at line 88 of file DatabaseCheckpoint.hpp.

◆ DatabaseCheckpointer

friend class DatabaseCheckpointer
friend

Definition at line 89 of file DatabaseCheckpoint.hpp.


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