gem5  v20.1.0.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Stats::Hdf5 Class Reference

#include <hdf5.hh>

Inheritance diagram for Stats::Hdf5:
Stats::Output

Public Member Functions

 Hdf5 (const std::string &file, unsigned chunking, bool desc, bool formulas)
 
 ~Hdf5 ()
 
 Hdf5 ()=delete
 
 Hdf5 (const Hdf5 &other)=delete
 
void begin () override
 
void end () override
 
bool valid () const override
 
void beginGroup (const char *name) override
 
void endGroup () override
 
void visit (const ScalarInfo &info) override
 
void visit (const VectorInfo &info) override
 
void visit (const DistInfo &info) override
 
void visit (const VectorDistInfo &info) override
 
void visit (const Vector2dInfo &info) override
 
void visit (const FormulaInfo &info) override
 
void visit (const SparseHistInfo &info) override
 
- Public Member Functions inherited from Stats::Output
virtual ~Output ()
 

Protected Member Functions

H5::DataSet appendVectorInfo (const VectorInfo &info)
 Helper function to append vector stats and set their metadata. More...
 
H5::DataSet appendStat (const Info &info, int rank, hsize_t *dims, const double *data)
 Helper function to append an n-dimensional double stat to the file. More...
 
void addMetaData (H5::DataSet &loc, const char *name, const std::vector< const char * > &values)
 Helper function to add a string vector attribute to a stat. More...
 
void addMetaData (H5::DataSet &loc, const char *name, const std::vector< std::string > &values)
 Helper function to add a string vector attribute to a stat. More...
 
void addMetaData (H5::DataSet &loc, const char *name, const std::string &value)
 Helper function to add a string attribute to a stat. More...
 
void addMetaData (H5::DataSet &loc, const char *name, double value)
 Helper function to add a double attribute to a stat. More...
 

Protected Attributes

const std::string fname
 
const hsize_t timeChunk
 
const bool enableDescriptions
 
const bool enableFormula
 
std::stack< H5::Group > path
 
unsigned dumpCount
 
H5::H5File h5File
 

Detailed Description

Definition at line 54 of file hdf5.hh.

Constructor & Destructor Documentation

◆ Hdf5() [1/3]

Stats::Hdf5::Hdf5 ( const std::string &  file,
unsigned  chunking,
bool  desc,
bool  formulas 
)

Definition at line 59 of file hdf5.cc.

◆ ~Hdf5()

Stats::Hdf5::~Hdf5 ( )

Definition at line 71 of file hdf5.cc.

◆ Hdf5() [2/3]

Stats::Hdf5::Hdf5 ( )
delete

◆ Hdf5() [3/3]

Stats::Hdf5::Hdf5 ( const Hdf5 other)
delete

Member Function Documentation

◆ addMetaData() [1/4]

void Stats::Hdf5::addMetaData ( H5::DataSet &  loc,
const char *  name,
const std::string &  value 
)
protected

Helper function to add a string attribute to a stat.

Parameters
locParent location in the file.
nameAttribute name.
valueAttribute value.

Definition at line 294 of file hdf5.cc.

References name(), and type.

◆ addMetaData() [2/4]

void Stats::Hdf5::addMetaData ( H5::DataSet &  loc,
const char *  name,
const std::vector< const char * > &  values 
)
protected

Helper function to add a string vector attribute to a stat.

Parameters
locParent location in the file.
nameAttribute name.
valuesAttribute value.

Definition at line 272 of file hdf5.cc.

References name(), and type.

Referenced by addMetaData(), appendStat(), appendVectorInfo(), and visit().

◆ addMetaData() [3/4]

void Stats::Hdf5::addMetaData ( H5::DataSet &  loc,
const char *  name,
const std::vector< std::string > &  values 
)
protected

Helper function to add a string vector attribute to a stat.

Parameters
locParent location in the file.
nameAttribute name.
valuesAttribute value.

Definition at line 283 of file hdf5.cc.

References addMetaData(), ArmISA::i, and name().

◆ addMetaData() [4/4]

void Stats::Hdf5::addMetaData ( H5::DataSet &  loc,
const char *  name,
double  value 
)
protected

Helper function to add a double attribute to a stat.

Parameters
locParent location in the file.
nameAttribute name.
valueAttribute value.

Definition at line 305 of file hdf5.cc.

References name().

◆ appendStat()

H5::DataSet Stats::Hdf5::appendStat ( const Info info,
int  rank,
hsize_t *  dims,
const double *  data 
)
protected

Helper function to append an n-dimensional double stat to the file.

This helper function assumes that all stats include a time component. I.e., a Stat::Scalar is a 1-dimensional stat.

Parameters
infoStat info structure.
rankStat dimensionality (including time).
dimsSize of each of the dimensions.

Definition at line 217 of file hdf5.cc.

References addMetaData(), data, Stats::Info::desc, dumpCount, enableDescriptions, Stats::Info::name, path, and timeChunk.

Referenced by appendVectorInfo(), and visit().

◆ appendVectorInfo()

H5::DataSet Stats::Hdf5::appendVectorInfo ( const VectorInfo info)
protected

Helper function to append vector stats and set their metadata.

Definition at line 196 of file hdf5.cc.

References addMetaData(), appendStat(), dumpCount, emptyStrings(), Stats::VectorInfo::result(), Stats::VectorInfo::subdescs, and Stats::VectorInfo::subnames.

Referenced by visit().

◆ begin()

void Stats::Hdf5::begin ( )
overridevirtual

Implements Stats::Output.

Definition at line 77 of file hdf5.cc.

References dumpCount, fname, h5File, and path.

◆ beginGroup()

void Stats::Hdf5::beginGroup ( const char *  name)
overridevirtual

Implements Stats::Output.

Definition at line 101 of file hdf5.cc.

References X86ISA::base, ArmISA::e, name(), and path.

◆ end()

void Stats::Hdf5::end ( )
overridevirtual

Implements Stats::Output.

Definition at line 86 of file hdf5.cc.

References dumpCount, and valid().

◆ endGroup()

void Stats::Hdf5::endGroup ( )
overridevirtual

Implements Stats::Output.

Definition at line 120 of file hdf5.cc.

References path.

◆ valid()

bool Stats::Hdf5::valid ( ) const
overridevirtual

Implements Stats::Output.

Definition at line 94 of file hdf5.cc.

Referenced by end().

◆ visit() [1/7]

void Stats::Hdf5::visit ( const DistInfo info)
overridevirtual

Implements Stats::Output.

Definition at line 145 of file hdf5.cc.

References warn_once.

◆ visit() [2/7]

void Stats::Hdf5::visit ( const FormulaInfo info)
overridevirtual

Implements Stats::Output.

Definition at line 178 of file hdf5.cc.

References addMetaData(), appendVectorInfo(), dumpCount, enableFormula, and Stats::FormulaInfo::str().

◆ visit() [3/7]

void Stats::Hdf5::visit ( const ScalarInfo info)
overridevirtual

Implements Stats::Output.

Definition at line 127 of file hdf5.cc.

References appendStat(), data, and Stats::ScalarInfo::result().

◆ visit() [4/7]

void Stats::Hdf5::visit ( const SparseHistInfo info)
overridevirtual

Implements Stats::Output.

Definition at line 190 of file hdf5.cc.

References warn_once.

◆ visit() [5/7]

void Stats::Hdf5::visit ( const Vector2dInfo info)
overridevirtual

◆ visit() [6/7]

void Stats::Hdf5::visit ( const VectorDistInfo info)
overridevirtual

Implements Stats::Output.

Definition at line 151 of file hdf5.cc.

References warn_once.

◆ visit() [7/7]

void Stats::Hdf5::visit ( const VectorInfo info)
overridevirtual

Implements Stats::Output.

Definition at line 139 of file hdf5.cc.

References appendVectorInfo().

Member Data Documentation

◆ dumpCount

unsigned Stats::Hdf5::dumpCount
protected

Definition at line 147 of file hdf5.hh.

Referenced by appendStat(), appendVectorInfo(), begin(), end(), and visit().

◆ enableDescriptions

const bool Stats::Hdf5::enableDescriptions
protected

Definition at line 142 of file hdf5.hh.

Referenced by appendStat().

◆ enableFormula

const bool Stats::Hdf5::enableFormula
protected

Definition at line 143 of file hdf5.hh.

Referenced by visit().

◆ fname

const std::string Stats::Hdf5::fname
protected

Definition at line 140 of file hdf5.hh.

Referenced by begin().

◆ h5File

H5::H5File Stats::Hdf5::h5File
protected

Definition at line 148 of file hdf5.hh.

Referenced by begin().

◆ path

std::stack<H5::Group> Stats::Hdf5::path
protected

Definition at line 145 of file hdf5.hh.

Referenced by appendStat(), begin(), beginGroup(), and endGroup().

◆ timeChunk

const hsize_t Stats::Hdf5::timeChunk
protected

Definition at line 141 of file hdf5.hh.

Referenced by appendStat().


The documentation for this class was generated from the following files:

Generated on Wed Sep 30 2020 14:03:12 for gem5 by doxygen 1.8.17