class Gambit::Printers::HDF5Printer
The main printer class for output to HDF5 format.
#include <hdf5printer.hpp>
Inherits from Gambit::Printers::BasePrinter, Gambit::Printers::BaseBasePrinter
Public Functions
Name | |
---|---|
bool | is_stream_managed(VBIDpair & key) const HDF5Printer-specific functions. |
hid_t | get_location() const Retrieve pointer to HDF5 location to which datasets are added. |
hid_t | get_RA_location() const |
hid_t | get_metadata_location() const |
void | insert_buffer(VBIDpair & key, VertexBufferBase & newbuffer) Add a pointer to a new buffer to the global list. |
unsigned long | get_sync_pos() const |
HDF5Printer(const Options & options, BasePrinter *const primary =NULL) Constructor (for construction via inifile options) | |
void | common_constructor(const Options & options) Tasks common to the various constructors. |
~HDF5Printer() Destructor. | |
virtual void | initialise(const std::vector< int > & ) Initialisation function. |
virtual void | flush() |
virtual void | reset(bool force =false) |
virtual void | finalise(bool abnormal =false) Perform final cleanup and write tasks. |
virtual Options | resume_reader_options() |
virtual void | _print_metadata(map_str_str datasets) Print metadata directly to file. |
template <typename T > void | _print(T const & , const std::string & label, const int vertexID, const uint, const ulong) Print functions. |
template <typename T > void | _print(T const & in, const std::string & label, const uint rank, const ulong pointID) Print functions. |
Protected Attributes
Name | |
---|---|
BaseBufferMap | all_buffers Things which other printers need access to. |
Additional inherited members
Public Functions inherited from Gambit::Printers::BasePrinter
Name | |
---|---|
BasePrinter() | |
BasePrinter(BasePrinter *const primary, bool is_aux_IN) | |
virtual | ~BasePrinter() Destructor. |
void | set_as_aux() Set this as an auxilliary printer. |
void | set_output_metadata(bool use_metadata) Set/Get whether to print the metadata. |
bool | get_output_metadata() |
virtual void | auxilliary_init() |
BasePrinter * | get_primary_printer() |
bool | is_auxilliary_printer() |
template <typename T > void | print(T const & in, const std::string & label, const int vertexID, const uint rank, const ulong pointID) |
template <typename T > void | print(T const & in, const std::string & label, const uint rank, const ulong pointID) |
Public Functions inherited from Gambit::Printers::BaseBasePrinter
Name | |
---|---|
BaseBasePrinter() | |
virtual | ~BaseBasePrinter() |
int | getRank() Retrieve/Set MPI rank (setting is useful for e.g. the postprocessor to re-print points from other ranks) |
void | setRank(int r) |
bool & | get_printUnitcube() |
void | set_printUnitcube(const bool & rflag) |
std::set< std::string > | getPrintList() |
void | setPrintList(const std::set< std::string > & in) |
void | addToPrintList(const std::string & in) |
bool | get_resume() |
void | set_resume(bool rflag) |
void | disable(int n =-1) |
void | enable() |
template <typename T > void | print(T const & in, const std::string & label, const int vertexID, const uint rank, const ulong pointID) |
template <typename T > void | print(T const & in, const std::string & label, const uint rank, const ulong pointID) |
void | print_metadata(map_str_str datasets) |
Protected Attributes inherited from Gambit::Printers::BaseBasePrinter
Name | |
---|---|
bool | printer_enabled Flag to check if print functions are enabled or disabled. |
int | printer_cooldown Counter for printer cooldown. If non-zero printer can be disabled for a fixed number of print calls. |
Public Functions Documentation
function is_stream_managed
bool is_stream_managed(
VBIDpair & key
) const
HDF5Printer-specific functions.
Check if an output stream is already managed by some buffer in any printer.
Check if an output stream is already managed by some buffer in some printer
function get_location
hid_t get_location() const
Retrieve pointer to HDF5 location to which datasets are added.
function get_RA_location
hid_t get_RA_location() const
function get_metadata_location
hid_t get_metadata_location() const
function insert_buffer
void insert_buffer(
VBIDpair & key,
VertexBufferBase & newbuffer
)
Add a pointer to a new buffer to the global list.
Add a pointer to a new buffer to the global list for this printer and also register it with the list global to all printers.
function get_sync_pos
inline unsigned long get_sync_pos() const
Get the number of pointIDs know to this printer (should correspond to the number of “appends” each active buffer has received)
function HDF5Printer
HDF5Printer(
const Options & options,
BasePrinter *const primary =NULL
)
Constructor (for construction via inifile options)
HDF5Printer member functions.
function common_constructor
void common_constructor(
const Options & options
)
Tasks common to the various constructors.
Check if combined output file exists
function ~HDF5Printer
~HDF5Printer()
Destructor.
function initialise
virtual void initialise(
const std::vector< int > &
)
Initialisation function.
Reimplements: Gambit::Printers::BasePrinter::initialise
Virtual function overloads:
function flush
virtual void flush()
Reimplements: Gambit::Printers::BasePrinter::flush
Empty all the buffers to disk Note: Empty sync buffers will not get flushed, to avoid writing extra buffer-lengths at the end of scan.
function reset
virtual void reset(
bool force =false
)
Reimplements: Gambit::Printers::BaseBasePrinter::reset
Invalidate all data on disk which has been printed by this printer so far, and reset all the buffers to write back to the first data slots. This is only allowed if this is an auxilliary printer with global=true, or if “force=true” is specified.
function finalise
virtual void finalise(
bool abnormal =false
)
Perform final cleanup and write tasks.
Reimplements: Gambit::Printers::BaseBasePrinter::finalise
Double-check that all the buffers are empty.
BEGIN DATA COMBINATION
function resume_reader_options
virtual Options resume_reader_options()
Reimplements: Gambit::Printers::BasePrinter::resume_reader_options
function _print_metadata
virtual void _print_metadata(
map_str_str datasets
)
Print metadata directly to file.
Reimplements: Gambit::Printers::BaseBasePrinter::_print_metadata
function _print
template <typename T >
inline void _print(
T const & ,
const std::string & label,
const int vertexID,
const uint,
const ulong
)
Print functions.
function _print
template <typename T >
inline void _print(
T const & in,
const std::string & label,
const uint rank,
const ulong pointID
)
Print functions.
Protected Attributes Documentation
variable all_buffers
BaseBufferMap all_buffers;
Things which other printers need access to.
Map containing pointers to all VertexBuffers, across all printers
Updated on 2024-07-18 at 13:53:32 +0000