PetaVision  Alpha
PV::CheckpointerDataInterface Class Reference

#include <CheckpointerDataInterface.hpp>

Inheritance diagram for PV::CheckpointerDataInterface:
PV::Observer PV::AdaptiveTimeScaleController PV::BaseObject PV::BatchIndexer PV::CheckpointableFileStream PV::KneeTimeScaleController PV::LogTimeScaleController PV::ArborList PV::BaseConnection PV::BaseDelivery PV::BaseInitV PV::BaseLayer PV::BaseProbe PV::BaseWeightUpdater PV::ConnectionData PV::InitWeights PV::NormalizeBase PV::ObjectMapComponent PV::OriginalConnNameParam PV::PatchSize PV::SharedWeights PV::StrengthParam PV::WeightsPairInterface

Public Member Functions

std::string const & getDescription () const
 
char const * getDescription_c () const
 
MPIBlock const * getMPIBlock ()
 
virtual Response::Status readStateFromCheckpoint (Checkpointer *checkpointer)
 
virtual Response::Status registerData (Checkpointer *checkpointer)
 
virtual Response::Status respond (std::shared_ptr< BaseMessage const > message) override
 

Protected Member Functions

virtual Response::Status prepareCheckpointWrite ()
 
virtual Response::Status processCheckpointRead ()
 
Response::Status respondPrepareCheckpointWrite (std::shared_ptr< PrepareCheckpointWriteMessage const > message)
 
Response::Status respondProcessCheckpointRead (std::shared_ptr< ProcessCheckpointReadMessage const > message)
 
Response::Status respondReadStateFromCheckpoint (std::shared_ptr< ReadStateFromCheckpointMessage< Checkpointer > const > message)
 
Response::Status respondRegisterData (std::shared_ptr< RegisterDataMessage< Checkpointer > const > message)
 

Protected Attributes

std::string description
 

Private Attributes

MPIBlock const * mMPIBlock = nullptr
 

Detailed Description

CheckpointerDataInterface provides a virtual method intended for interfacing with Checkpointer register methods. An object that does checkpointing should derive from CheckpointerDataInterface and override the following methods:

  • registerData should call Checkpointer::registerCheckpointEntry once for each piece of data that should be read when restarting a run from a checkpoint. Note that for simple data, where CheckpointEntryData is the appropriate derived class of CheckpointEntry to use, it is convenient to use the Checkpointer::registerCheckpointData method template, which handles creating the shared_ptr needed by registerCheckpointEntry(). Note that CheckpointerDataInterface::registerData sets mMPIBlock. Derived classes that override registerData should call CheckpointerDataInterface::registerData in order to use this data member.
  • readStateFromCheckpoint should call one of the readNamedCheckpointEntry methods for each piece of data that should be read when the object's initializeFromCheckpointFlag is set. The data read by readStateFromCheckpoint must be a subset of the data registered by the registerData function member.

BaseObject derives from CheckpointerDataInterface, and calls registerData when it receives a RegisterDataMessage (which HyPerCol::run calls after AllocateDataMessage and before InitializeStateMessage); and calls readStateFromCheckpoint when it receives a ReadStateFromCheckpointMessage (which HyPerCol::run calls after InitializeStateMessage if CheckpointReadDirectory is not set).

Definition at line 45 of file CheckpointerDataInterface.hpp.


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