Skip to content

VelocMemoryBackend

nphtan edited this page May 19, 2021 · 1 revision

KokkosResilience::VeloCMemoryBackend

Checkpoint/restart backend for VeloC (Memory).

Header File: VelocBackend.hpp

Synopsis

class VeloCMemoryBackend
{
public:

  VeloCMemoryBackend( ContextBase &ctx, MPI_Comm mpi_comm );
  ~VeloCMemoryBackend();

  VeloCMemoryBackend( const VeloCMemoryBackend & ) = delete;
  VeloCMemoryBackend( VeloCMemoryBackend && ) noexcept = default;

  VeloCMemoryBackend &operator=( const VeloCMemoryBackend & ) = delete;
  VeloCMemoryBackend &operator=( VeloCMemoryBackend && ) = default;

  void checkpoint( const std::string &label, int version,
                   const std::vector< std::unique_ptr< Kokkos::ViewHolderBase > > &views );

  bool restart_available( const std::string &label, int version );
  int latest_version (const std::string &label) const noexcept;

  void restart( const std::string &label, int version,
                const std::vector< std::unique_ptr< Kokkos::ViewHolderBase > > &views );

  void clear_checkpoints();

  void register_hashes( const std::vector< std::unique_ptr< Kokkos::ViewHolderBase > > &views,
    const std::vector< Detail::CrefImpl > &crefs );

  void reset();
  void register_alias( const std::string &original, const std::string &alias );
};

Public Class Members

Constructors

  • explicit VeloCMemoryBackend(ContextBase &ctx, MPI_Comm mpi_comm);

    Construct a VeloCMemoryBackend with the supplied communicator and context.

  • VeloCMemoryBackend(const VeloCMemoryBackend &) = delete;

    Copy constructor is deleted.

  • VeloCMemoryBackend(VeloCMemoryBackend &&) noexcept = default;

    Move constructor.

Operators

  • VeloCMemoryBackend &operator=(const VeloCMemoryBackend &) = delete;

    Copy constructor is deleted.

  • VeloCMemoryBackend &operator=(VeloCMemoryBackend &&) = default;

    Move constructor.

Functions

  • void register_hashes(
        const std::vector<std::unique_ptr<Kokkos::ViewHolderBase>> &views,
        const std::vector<Detail::CrefImpl> &crefs);

    Register Views.

  • bool restart_available(const std::string &label, int version);

    Check if an existing restart is available. Searches based on the supplied label. version determines the most recent version to search for. For example, setting version to 5 will search for any restart up to version 5. Setting version to 0 will search for the most recent restart.

  • void restart(const std::string &label, int version,
                 const std::vector<std::unique_ptr<Kokkos::ViewHolderBase>>
                     &views);

    Restart the specified Views from the checkpoint determined by the label and version.

  • void checkpoint(const std::string &label, int version,
                    const std::vector<std::unique_ptr<Kokkos::ViewHolderBase>>
                        &views)

    Create a checkpoint of the specified Views.

  • int latest_version(const std::string &label) const noexcept;

    Get the latest version of the checkpoint with the name label.

  • void register_alias( const std::string &original, const std::string &alias );

    Register a new alias.

  • void reset();

    Reset the context.

  • voic clear_checkpoints();

    Clear existing checkpoints. Currently does nothing.