class Gambit::Printers::HDF5Printer2

The main printer class for output to HDF5 format.

#include <hdf5printer_v2.hpp>

Inherits from Gambit::Printers::BasePrinter, Gambit::Printers::BaseBasePrinter

Public Functions

Name
HDF5Printer2(const Options & options, BasePrinter *const primary =NULL)
Constructor (for construction via inifile options)
~HDF5Printer2()
Destructor.
std::stringget_filename()
Report name (inc. path) of output file.
std::stringget_groupname()
Report group in output HDF5 file of output datasets.
std::stringget_metadata_groupname()
Report metadata group in HDF5 file.
std::size_tget_buffer_length()
Report length of buffer for HDF5 output.
voidadd_aux_buffer(HDF5MasterBuffer & aux_buffermaster)
Add buffer to the primary printers records.
HDF5Printer2 *get_HDF5_primary_printer()
virtual voidinitialise(const std::vector< int > & )
virtual voidflush()
virtual voidreset(bool force =false)
Function to signal to the printer to write buffer contents to disk.
virtual voidfinalise(bool abnormal =false)
Signal printer that scan is finished, and final output needs to be performed.
virtual Optionsresume_reader_options()
virtual void_print_metadata(map_str_str datasets)
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.

Additional inherited members

Public Functions inherited from Gambit::Printers::BasePrinter

Name
BasePrinter()
BasePrinter(BasePrinter *const primary, bool is_aux_IN)
virtual~BasePrinter()
Destructor.
voidset_as_aux()
Set this as an auxilliary printer.
voidset_output_metadata(bool use_metadata)
Set/Get whether to print the metadata.
boolget_output_metadata()
virtual voidauxilliary_init()
BasePrinter *get_primary_printer()
boolis_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()
intgetRank()
Retrieve/Set MPI rank (setting is useful for e.g. the postprocessor to re-print points from other ranks)
voidsetRank(int r)
bool &get_printUnitcube()
voidset_printUnitcube(const bool & rflag)
std::set< std::string >getPrintList()
voidsetPrintList(const std::set< std::string > & in)
voidaddToPrintList(const std::string & in)
boolget_resume()
voidset_resume(bool rflag)
voiddisable(int n =-1)
voidenable()
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)
voidprint_metadata(map_str_str datasets)

Protected Attributes inherited from Gambit::Printers::BaseBasePrinter

Name
boolprinter_enabled
Flag to check if print functions are enabled or disabled.
intprinter_cooldown
Counter for printer cooldown. If non-zero printer can be disabled for a fixed number of print calls.

Public Functions Documentation

function HDF5Printer2

HDF5Printer2(
    const Options & options,
    BasePrinter *const primary =NULL
)

Constructor (for construction via inifile options)

Constructor.

Check if combined output file exists

function ~HDF5Printer2

~HDF5Printer2()

Destructor.

function get_filename

std::string get_filename()

Report name (inc. path) of output file.

function get_groupname

std::string get_groupname()

Report group in output HDF5 file of output datasets.

function get_metadata_groupname

std::string get_metadata_groupname()

Report metadata group in HDF5 file.

Report the name of the metadata group on this file.

function get_buffer_length

std::size_t get_buffer_length()

Report length of buffer for HDF5 output.

function add_aux_buffer

void add_aux_buffer(
    HDF5MasterBuffer & aux_buffermaster
)

Add buffer to the primary printers records.

function get_HDF5_primary_printer

HDF5Printer2 * get_HDF5_primary_printer()

Get pointer to primary printer of this class type (get_primary_printer returns a pointer-to-base)

function initialise

virtual void initialise(
    const std::vector< int > & 
)

Reimplements: Gambit::Printers::BasePrinter::initialise

Base class virtual function overloads (the public virtual interface)

function flush

virtual void flush()

Reimplements: Gambit::Printers::BasePrinter::flush

Signal printer to flush data in buffers to disk Printers should do this automatically as needed, but this is useful if a scanner is printing a bunch of data as a batch, to make sure it is all on disk after the batch is done.

function reset

virtual void reset(
    bool force =false
)

Function to signal to the printer to write buffer contents to disk.

Reimplements: Gambit::Printers::BaseBasePrinter::reset

Signal printer to reset contents, i.e. delete old data in preperation for replacement

function finalise

virtual void finalise(
    bool abnormal =false
)

Signal printer that scan is finished, and final output needs to be performed.

Reimplements: Gambit::Printers::BaseBasePrinter::finalise

Need to finalise output of the sync buffers for all printers before we do the RA buffers.

Need to know final nominal dataset size to ensure unsynchronised datasets match synchronised ones.

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
)

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.


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