class Gambit::Printers::VertexBufferNumeric1D

VertexBuffer for simple numerical types. More…

#include <VertexBufferNumeric1D.hpp>

Inherits from Gambit::Printers::VertexBufferBase

Public Functions

Name
VertexBufferNumeric1D()
Constructors.
VertexBufferNumeric1D(const std::string & label, const int vID, const unsigned int i, const bool sync, const bool sil, const bool resume, const char access)
~VertexBufferNumeric1D()
Destructor.
voidappend(const T & value, const PPIDpair pID =null_PPID)
Append a record to the buffer.
virtual unsigned longdset_head_pos() =0
Virtual for debugging; find out what the absolute sync position is from the derived class.
virtual voidupdate_dset_head_pos() =0
Virtual for debugging: Update the variables needed to track the currently target dset slot.
voidRA_write(const T & value, const PPIDpair pID, const std::map< PPIDpair, ulong > & PPID_to_dsetindex)
Queue up a desynchronised (“random access”) dataset write to previous scan iteration.
virtual voidskip_append()
No data to append this iteration; skip this slot.
virtual voidN_skip_append(ulong N)
virtual voidflush()
Either send sync buffer data to master node via MPI, or trigger the write to disk.
virtual voidRA_flush(const std::map< PPIDpair, ulong > & PPID_to_dsetindex)
Either send random-access buffer data to master node via MPI, or trigger the write to disk.
virtual voidwrite_to_disk() =0
virtual voidRA_write_to_disk(const std::map< PPIDpair, ulong > & PPID_to_dsetindex) =0
virtual voidwrite_external_to_disk(const T(&) values[LENGTH], const bool(&) isvalid[LENGTH]) =0
Write externally-supplied buffer to HDF5 dataset.
virtual uintget_RA_queue_length()
Tget_entry(const std::size_t i) const
Extract (copy) a record.
voidclear()
Clear the buffer.

Protected Attributes

Name
bool[LENGTH]buffer_valid
Buffer variables for sequential writing.
T[LENGTH]buffer_entries
T[LENGTH]RA_write_queue
PPIDpair[LENGTH]RA_write_locations
Target pointIDs for RA writes.
uintRA_queue_length
Current length of the RA write queue.
uintmyRank
MPI rank for this process.

Additional inherited members

Public Functions inherited from Gambit::Printers::VertexBufferBase

Name
characcess_mode() const
Buffer status getters.
boolsync_buffer_is_full() const
boolsync_buffer_is_empty() const
boolis_synchronised() const
boolis_silenced() const
boolresume_mode() const
boolMPI_mode() const
unsigned intget_head_position() const
VertexBufferBase()
VertexBufferBase(const std::string & l, const int vID, const uint i, const bool sync, const bool sil, const bool r, const bool mode, const char a)
virtual~VertexBufferBase()
intget_vertexID() const
uintget_index() const
std::stringget_label() const
voidMPImode_only(std::string local_info)
virtual voidsync_report() =0
virtual voidfinalise() =0
virtual std::size_tpostponed_RA_queue_length() =0
virtual voidreset(bool force =false) =0
virtual ulongget_dataset_length() =0
booldonepoint()
voidset_donepoint(bool flag)
voidmove_head_to_next_slot()
voidfast_forward(long target_pos)
voidreset_head()
voiderror_if_done()
virtual voidsynchronise_output_to_position(const unsigned long i) =0

Protected Attributes inherited from Gambit::Printers::VertexBufferBase

Name
boolsync_buffer_full
flag to indicate if the sync buffer is full (and ready for sending/dumping)
boolsync_buffer_empty

Detailed Description

template <class T ,
std::size_t LENGTH>
class Gambit::Printers::VertexBufferNumeric1D;

VertexBuffer for simple numerical types.

Public Functions Documentation

function VertexBufferNumeric1D

inline VertexBufferNumeric1D()

Constructors.

function VertexBufferNumeric1D

inline VertexBufferNumeric1D(
    const std::string & label,
    const int vID,
    const unsigned int i,
    const bool sync,
    const bool sil,
    const bool resume,
    const char access
)

function ~VertexBufferNumeric1D

inline ~VertexBufferNumeric1D()

Destructor.

function append

void append(
    const T & value,
    const PPIDpair pID =null_PPID
)

Append a record to the buffer.

VertexBufferNumeric1D function definitions.

Append a record to the buffer

function dset_head_pos

virtual unsigned long dset_head_pos() =0

Virtual for debugging; find out what the absolute sync position is from the derived class.

Reimplements: Gambit::Printers::VertexBufferBase::dset_head_pos

Reimplemented by: Gambit::Printers::VertexBufferNumeric1D_HDF5::dset_head_pos

function update_dset_head_pos

virtual void update_dset_head_pos() =0

Virtual for debugging: Update the variables needed to track the currently target dset slot.

Reimplemented by: Gambit::Printers::VertexBufferNumeric1D_HDF5::update_dset_head_pos

function RA_write

void RA_write(
    const T & value,
    const PPIDpair pID,
    const std::map< PPIDpair, ulong > & PPID_to_dsetindex
)

Queue up a desynchronised (“random access”) dataset write to previous scan iteration.

function skip_append

virtual void skip_append()

No data to append this iteration; skip this slot.

Reimplements: Gambit::Printers::VertexBufferBase::skip_append

function N_skip_append

virtual void N_skip_append(
    ulong N
)

Reimplements: Gambit::Printers::VertexBufferBase::N_skip_append

Skip several/many positions NOTE! This is meant for initialising new buffers to the correct position. If buffer overflows it may get cleared without data being written, so don’t use this in other contexts.

TODO: Deprecated. Skip several/many positions NOTE! This is meant for initialising new buffers to the correct position. If buffer overflows it will be cleared without data being written, so don’t use this in other contexts.

function flush

virtual void flush()

Either send sync buffer data to master node via MPI, or trigger the write to disk.

Reimplements: Gambit::Printers::VertexBufferBase::flush

function RA_flush

virtual void RA_flush(
    const std::map< PPIDpair, ulong > & PPID_to_dsetindex
)

Either send random-access buffer data to master node via MPI, or trigger the write to disk.

Reimplements: Gambit::Printers::VertexBufferBase::RA_flush

function write_to_disk

virtual void write_to_disk() =0

Reimplemented by: Gambit::Printers::VertexBufferNumeric1D_HDF5::write_to_disk

function RA_write_to_disk

virtual void RA_write_to_disk(
    const std::map< PPIDpair, ulong > & PPID_to_dsetindex
) =0

Reimplemented by: Gambit::Printers::VertexBufferNumeric1D_HDF5::RA_write_to_disk

function write_external_to_disk

virtual void write_external_to_disk(
    const T(&) values[LENGTH],
    const bool(&) isvalid[LENGTH]
) =0

Write externally-supplied buffer to HDF5 dataset.

function get_RA_queue_length

inline virtual uint get_RA_queue_length()

Reimplements: Gambit::Printers::VertexBufferBase::get_RA_queue_length

function get_entry

T get_entry(
    const std::size_t i
) const

Extract (copy) a record.

function clear

void clear()

Clear the buffer.

Protected Attributes Documentation

variable buffer_valid

bool[LENGTH] buffer_valid;

Buffer variables for sequential writing.

variable buffer_entries

T[LENGTH] buffer_entries;

variable RA_write_queue

T[LENGTH] RA_write_queue;

Buffer variables for random access writing Queue for random access writes to dataset (independent of main buffer)

variable RA_write_locations

PPIDpair[LENGTH] RA_write_locations;

Target pointIDs for RA writes.

variable RA_queue_length

uint RA_queue_length = 0;

Current length of the RA write queue.

variable myRank

uint myRank = 0;

MPI rank for this process.


Updated on 2023-06-26 at 21:36:52 +0000