class Gambit::Printers::VertexBufferNumeric1D_HDF5

VertexBuffer for simple numerical types - derived version that handles output to hdf5. More…

#include <VertexBufferNumeric1D_HDF5.hpp>

Inherits from Gambit::Printers::VertexBufferNumeric1D< T, CHUNKLENGTH >, Gambit::Printers::VertexBufferBase

Public Functions

Name
VertexBufferNumeric1D_HDF5()
Constructors.
VertexBufferNumeric1D_HDF5(hid_t location_id, const std::string & name, const int vID, const unsigned int i, const bool sync, const bool silence, const bool resume, const char access)
~VertexBufferNumeric1D_HDF5()
Destructor.
virtual voidsync_report()
virtual unsigned longdset_head_pos()
virtual voidwrite_to_disk()
Write sync buffer to HDF5 dataset.
virtual voidwrite_external_to_disk(const T(&) values[CHUNKLENGTH], const bool(&) isvalid[CHUNKLENGTH])
Write externally-supplied buffer to HDF5 dataset.
virtual voidreset(bool force =false)
Reset the output (non-synchronised datasets only, unless force=true)
virtual voidfinalise()
virtual voidRA_write_to_disk(const std::map< PPIDpair, ulong > & PPID_to_dsetindex)
Send random access write queue to dataset interfaces for writing.
voidattempt_postponed_RA_write_to_disk(const std::map< PPIDpair, ulong > & PPID_to_dsetindex)
Attempt to write any postponed RA_write attempts to disk.
virtual voidupdate_dset_head_pos()
voidsynchronise_output_to_position(const ulong i)
virtual std::size_tpostponed_RA_queue_length()
virtual ulongget_dataset_length()

Additional inherited members

Public Functions inherited from Gambit::Printers::VertexBufferNumeric1D< T, CHUNKLENGTH >

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.
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 uintget_RA_queue_length()
Tget_entry(const std::size_t i) const
Extract (copy) a record.
voidclear()
Clear the buffer.

Protected Attributes inherited from Gambit::Printers::VertexBufferNumeric1D< T, CHUNKLENGTH >

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.

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 voidflush() =0
virtual voidRA_flush(const std::map< PPIDpair, ulong > & PPID_to_dsetindex) =0
virtual uintget_RA_queue_length() =0
virtual voidskip_append() =0
virtual voidN_skip_append(ulong N) =0
booldonepoint()
voidset_donepoint(bool flag)
voidmove_head_to_next_slot()
voidfast_forward(long target_pos)
voidreset_head()
voiderror_if_done()

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 CHUNKLENGTH>
class Gambit::Printers::VertexBufferNumeric1D_HDF5;

VertexBuffer for simple numerical types - derived version that handles output to hdf5.

Public Functions Documentation

function VertexBufferNumeric1D_HDF5

VertexBufferNumeric1D_HDF5()

Constructors.

VertexBufferNumeric1D_HDF5 member function definitions.

Constructors

function VertexBufferNumeric1D_HDF5

VertexBufferNumeric1D_HDF5(
    hid_t location_id,
    const std::string & name,
    const int vID,
    const unsigned int i,
    const bool sync,
    const bool silence,
    const bool resume,
    const char access
)

function ~VertexBufferNumeric1D_HDF5

~VertexBufferNumeric1D_HDF5()

Destructor.

Destructor Make sure buffer contents are written to file when buffer object is destroyed

function sync_report

virtual void sync_report()

Reimplements: Gambit::Printers::VertexBufferBase::sync_report

function dset_head_pos

inline virtual unsigned long dset_head_pos()

Reimplements: Gambit::Printers::VertexBufferNumeric1D::dset_head_pos

(virtual for debugging purposes) Current absolute “write head” position for synchronised buffers

function write_to_disk

virtual void write_to_disk()

Write sync buffer to HDF5 dataset.

Reimplements: Gambit::Printers::VertexBufferNumeric1D::write_to_disk

Override of buffer dump function to handle HDF5 output.

function write_external_to_disk

virtual void write_external_to_disk(
    const T(&) values[CHUNKLENGTH],
    const bool(&) isvalid[CHUNKLENGTH]
)

Write externally-supplied buffer to HDF5 dataset.

Manual command to send an arbitrary buffer to be written to disk.

function reset

virtual void reset(
    bool force =false
)

Reset the output (non-synchronised datasets only, unless force=true)

Reimplements: Gambit::Printers::VertexBufferBase::reset

Reset the output (non-synchronised datasets only)

Empty the queue of postponed writes, because it would now be erased had we gotten around to writing it.

Invalidate the contents of the linked datasets This can be done by simply resetting the all validity bools to “false”

function finalise

virtual void finalise()

Reimplements: Gambit::Printers::VertexBufferBase::finalise

function RA_write_to_disk

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

Send random access write queue to dataset interfaces for writing.

Reimplements: Gambit::Printers::VertexBufferNumeric1D::RA_write_to_disk

Use the provided PPIDpair–>dset_location map to locate the target parameter points in the output dataset. (Temp RA buffers for immediate writes)

function attempt_postponed_RA_write_to_disk

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

Attempt to write any postponed RA_write attempts to disk.

Attempt to write postponed RA entries to disk.

Use the provided PPIDpair–>dset_location map to locate the target parameter points in the output dataset. (Temp RA buffers for immediate writes)

Postponed entries which still cannot be written will be added here.

Need to go through the postponed entries one CHUNKLENGTH at a time

function update_dset_head_pos

inline virtual void update_dset_head_pos()

Reimplements: Gambit::Printers::VertexBufferNumeric1D::update_dset_head_pos

Update the variables needed to tracks the currently target dset slot (really just updates the nextemptyslab variable)

function synchronise_output_to_position

void synchronise_output_to_position(
    const ulong i
)

Ensure dataset “write head” (i.e. next append) is prepared to write to the supplied absolute dataset index (e.g. by inserting blank entries if need)

Ensure dataset “write head” (i.e. next append) is prepared to write to the supplied absolute dataset index (e.g. by inserting blank entries if need)

NEW MEANING: Ensure that the supplied index has been written to, and that the next append will happen to the next index above it.

function postponed_RA_queue_length

inline virtual std::size_t postponed_RA_queue_length()

Reimplements: Gambit::Printers::VertexBufferBase::postponed_RA_queue_length

Check how many RA writes are waiting in the postpone queue (mostly for debugging purposes)

function get_dataset_length

virtual ulong get_dataset_length()

Reimplements: Gambit::Printers::VertexBufferBase::get_dataset_length


Updated on 2024-07-18 at 13:53:32 +0000