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 void | sync_report() |
virtual unsigned long | dset_head_pos() |
virtual void | write_to_disk() Write sync buffer to HDF5 dataset. |
virtual void | write_external_to_disk(const T(&) values[CHUNKLENGTH], const bool(&) isvalid[CHUNKLENGTH]) Write externally-supplied buffer to HDF5 dataset. |
virtual void | reset(bool force =false) Reset the output (non-synchronised datasets only, unless force=true) |
virtual void | finalise() |
virtual void | RA_write_to_disk(const std::map< PPIDpair, ulong > & PPID_to_dsetindex) Send random access write queue to dataset interfaces for writing. |
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. |
virtual void | update_dset_head_pos() |
void | synchronise_output_to_position(const ulong i) |
virtual std::size_t | postponed_RA_queue_length() |
virtual ulong | get_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. | |
void | append(const T & value, const PPIDpair pID =null_PPID) Append a record to the buffer. |
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 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 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. |
uint | RA_queue_length Current length of the RA write queue. |
uint | myRank MPI rank for this process. |
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 | flush() =0 |
virtual void | RA_flush(const std::map< PPIDpair, ulong > & PPID_to_dsetindex) =0 |
virtual uint | get_RA_queue_length() =0 |
virtual void | skip_append() =0 |
virtual void | N_skip_append(ulong N) =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() |
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 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