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. | |
void | append(const T & value, const PPIDpair pID =null_PPID) Append a record to the buffer. |
virtual unsigned long | dset_head_pos() =0 Virtual for debugging; find out what the absolute sync position is from the derived class. |
virtual void | update_dset_head_pos() =0 Virtual for debugging: Update the variables needed to track the currently target dset slot. |
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. |
virtual void | skip_append() No data to append this iteration; skip this slot. |
virtual void | N_skip_append(ulong N) |
virtual void | flush() Either send sync buffer data to master node via MPI, or trigger the write to disk. |
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. |
virtual void | write_to_disk() =0 |
virtual void | RA_write_to_disk(const std::map< PPIDpair, ulong > & PPID_to_dsetindex) =0 |
virtual void | write_external_to_disk(const T(&) values[LENGTH], const bool(&) isvalid[LENGTH]) =0 Write externally-supplied buffer to HDF5 dataset. |
virtual uint | get_RA_queue_length() |
T | get_entry(const std::size_t i) const Extract (copy) a record. |
void | clear() 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. |
uint | RA_queue_length Current length of the RA write queue. |
uint | myRank MPI rank for this process. |
Additional inherited members
Public Functions inherited from Gambit::Printers::VertexBufferBase
Name | |
---|---|
char | access_mode() const Buffer status getters. |
bool | sync_buffer_is_full() const |
bool | sync_buffer_is_empty() const |
bool | is_synchronised() const |
bool | is_silenced() const |
bool | resume_mode() const |
bool | MPI_mode() const |
unsigned int | get_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() |
int | get_vertexID() const |
uint | get_index() const |
std::string | get_label() const |
void | MPImode_only(std::string local_info) |
virtual void | sync_report() =0 |
virtual void | finalise() =0 |
virtual std::size_t | postponed_RA_queue_length() =0 |
virtual void | reset(bool force =false) =0 |
virtual ulong | get_dataset_length() =0 |
bool | donepoint() |
void | set_donepoint(bool flag) |
void | move_head_to_next_slot() |
void | fast_forward(long target_pos) |
void | reset_head() |
void | error_if_done() |
virtual void | synchronise_output_to_position(const unsigned long i) =0 |
Protected Attributes inherited from Gambit::Printers::VertexBufferBase
Name | |
---|---|
bool | sync_buffer_full flag to indicate if the sync buffer is full (and ready for sending/dumping) |
bool | sync_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 2024-07-18 at 13:53:32 +0000