The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::serialization::checkpoint::CherryPickFastCheckpointer Class Referencefinal
Inheritance diagram for sparta::serialization::checkpoint::CherryPickFastCheckpointer:
Collaboration diagram for sparta::serialization::checkpoint::CherryPickFastCheckpointer:

Classes

struct  ChkptWindow
 
struct  ChkptWindowBytes
 

Public Types

using checkpoint_type = typename FastCheckpointer::checkpoint_type
 
using checkpoint_ptr = typename FastCheckpointer::checkpoint_ptr
 
using checkpoint_ptrs = typename FastCheckpointer::checkpoint_ptrs
 
using chkpt_id_t = typename Checkpointer::chkpt_id_t
 
using arch_id_t = uint64_t
 
using tick_t = typename Checkpointer::tick_t
 

Public Member Functions

 CherryPickFastCheckpointer (simdb::DatabaseManager *db_mgr, const std::vector< TreeNode * > &roots, Scheduler *sched=nullptr)
 CherryPickFastCheckpointer constructor.
 
void createPipeline (simdb::pipeline::PipelineManager *pipeline_mgr) override
 Instantiate the async processing pipeline to save checkpoints to the DB.
 
FastCheckpointergetFastCheckpointer () noexcept
 Use the FastCheckpointer to create checkpoints / checkpoint branches.
 
void commitCurrentBranch (bool force_new_head_chkpt=false)
 When satisfied with the outstanding/uncommitted checkpoints, call this method to commit them to the database.
 
void saveCheckpoints (checkpoint_ptrs &&checkpoints)
 Send the committed checkpoints down the pipeline to the database.
 
size_t getNumCheckpoints () const
 Get the total number of checkpoints sent to the database thus far.
 
std::string stringize () const
 Returns a string describing this object.
 

Static Public Member Functions

static void defineSchema (simdb::Schema &schema)
 Define the SimDB schema for this checkpointer.
 

Static Public Attributes

static constexpr auto NAME = "cherry-pick-fast-checkpointer"
 

Detailed Description

Definition at line 25 of file CherryPickFastCheckpointer.hpp.

Member Typedef Documentation

◆ arch_id_t

using sparta::serialization::checkpoint::CherryPickFastCheckpointer::arch_id_t = uint64_t

Definition at line 32 of file CherryPickFastCheckpointer.hpp.

◆ checkpoint_ptr

using sparta::serialization::checkpoint::CherryPickFastCheckpointer::checkpoint_ptr = typename FastCheckpointer::checkpoint_ptr

Definition at line 29 of file CherryPickFastCheckpointer.hpp.

◆ checkpoint_ptrs

using sparta::serialization::checkpoint::CherryPickFastCheckpointer::checkpoint_ptrs = typename FastCheckpointer::checkpoint_ptrs

Definition at line 30 of file CherryPickFastCheckpointer.hpp.

◆ checkpoint_type

using sparta::serialization::checkpoint::CherryPickFastCheckpointer::checkpoint_type = typename FastCheckpointer::checkpoint_type

Definition at line 28 of file CherryPickFastCheckpointer.hpp.

◆ chkpt_id_t

using sparta::serialization::checkpoint::CherryPickFastCheckpointer::chkpt_id_t = typename Checkpointer::chkpt_id_t

Definition at line 31 of file CherryPickFastCheckpointer.hpp.

◆ tick_t

using sparta::serialization::checkpoint::CherryPickFastCheckpointer::tick_t = typename Checkpointer::tick_t

Definition at line 33 of file CherryPickFastCheckpointer.hpp.

Constructor & Destructor Documentation

◆ CherryPickFastCheckpointer()

sparta::serialization::checkpoint::CherryPickFastCheckpointer::CherryPickFastCheckpointer ( simdb::DatabaseManager * db_mgr,
const std::vector< TreeNode * > & roots,
Scheduler * sched = nullptr )

CherryPickFastCheckpointer constructor.

Parameters
db_mgrSimDB instance to use as a backing store for all checkpoints.
rootsTreeNodes at which checkpoints will be taken. These cannot be changed later. These do not necessarily need to be RootTreeNodes. Before the first checkpoint is taken, these nodes must be finalized (see sparta::TreeNode::isFinalized). At the point of construction, the nodes do not need to be finalized.
schedScheduler to read and restart on checkpoint restore (if not nullptr)

Member Function Documentation

◆ commitCurrentBranch()

void sparta::serialization::checkpoint::CherryPickFastCheckpointer::commitCurrentBranch ( bool force_new_head_chkpt = false)

When satisfied with the outstanding/uncommitted checkpoints, call this method to commit them to the database.

Parameters
force_new_head_chkptIf false, then this checkpoint chain: S1 -> D1 -> D2 -> D3 -> S2 -> D4 -> D5 (current) Would result in this being saved to disk: S1 -> D1 -> D2 -> D3 While the S2 checkpoint becomes the new head checkpoint in memory, and D4/D5 are retained in the FastCheckpointer.

If true, then everything from S1 to D5 will be saved to disk, and a new head checkpoint S3 will be created in memory at the current tick.

◆ getFastCheckpointer()

FastCheckpointer & sparta::serialization::checkpoint::CherryPickFastCheckpointer::getFastCheckpointer ( )
inlinenoexcept

Use the FastCheckpointer to create checkpoints / checkpoint branches.

Definition at line 69 of file CherryPickFastCheckpointer.hpp.

◆ getNumCheckpoints()

size_t sparta::serialization::checkpoint::CherryPickFastCheckpointer::getNumCheckpoints ( ) const

Get the total number of checkpoints sent to the database thus far.

Note
Do not call this in the critical path, as it will flush the whole pipeline before querying the database.

Member Data Documentation

◆ NAME

auto sparta::serialization::checkpoint::CherryPickFastCheckpointer::NAME = "cherry-pick-fast-checkpointer"
staticconstexpr

Definition at line 35 of file CherryPickFastCheckpointer.hpp.


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