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

#include <hdf5.hh>

Inheritance diagram for gem5::statistics::Hdf5:
gem5::statistics::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 gem5::statistics::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 60 of file hdf5.hh.

Constructor & Destructor Documentation

◆ Hdf5() [1/3]

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

Definition at line 66 of file hdf5.cc.

◆ ~Hdf5()

gem5::statistics::Hdf5::~Hdf5 ( )

Definition at line 78 of file hdf5.cc.

◆ Hdf5() [2/3]

gem5::statistics::Hdf5::Hdf5 ( )
delete

◆ Hdf5() [3/3]

gem5::statistics::Hdf5::Hdf5 ( const Hdf5 other)
delete

Member Function Documentation

◆ addMetaData() [1/4]

void gem5::statistics::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 310 of file hdf5.cc.

References name(), and gem5::X86ISA::type.

◆ addMetaData() [2/4]

void gem5::statistics::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 288 of file hdf5.cc.

References name(), and gem5::X86ISA::type.

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

◆ addMetaData() [3/4]

void gem5::statistics::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 299 of file hdf5.cc.

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

◆ addMetaData() [4/4]

void gem5::statistics::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 321 of file hdf5.cc.

References name().

◆ appendStat()

H5::DataSet gem5::statistics::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 224 of file hdf5.cc.

References addMetaData(), data, gem5::statistics::Info::desc, DPRINTF, dumpCount, gem5::ArmISA::e, enableDescriptions, gem5::ArmISA::err, gem5::statistics::Info::name, path, and timeChunk.

Referenced by appendVectorInfo(), and visit().

◆ appendVectorInfo()

H5::DataSet gem5::statistics::Hdf5::appendVectorInfo ( const VectorInfo info)
protected

Helper function to append vector stats and set their metadata.

Definition at line 203 of file hdf5.cc.

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

Referenced by visit().

◆ begin()

void gem5::statistics::Hdf5::begin ( )
overridevirtual

Implements gem5::statistics::Output.

Definition at line 84 of file hdf5.cc.

References dumpCount, fname, h5File, and path.

◆ beginGroup()

void gem5::statistics::Hdf5::beginGroup ( const char *  name)
overridevirtual

Implements gem5::statistics::Output.

Definition at line 108 of file hdf5.cc.

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

◆ end()

void gem5::statistics::Hdf5::end ( )
overridevirtual

Implements gem5::statistics::Output.

Definition at line 93 of file hdf5.cc.

References dumpCount, and valid().

◆ endGroup()

void gem5::statistics::Hdf5::endGroup ( )
overridevirtual

Implements gem5::statistics::Output.

Definition at line 127 of file hdf5.cc.

References path.

◆ valid()

bool gem5::statistics::Hdf5::valid ( ) const
overridevirtual

Implements gem5::statistics::Output.

Definition at line 101 of file hdf5.cc.

Referenced by end().

◆ visit() [1/7]

void gem5::statistics::Hdf5::visit ( const DistInfo info)
overridevirtual

Implements gem5::statistics::Output.

Definition at line 152 of file hdf5.cc.

References warn_once.

◆ visit() [2/7]

void gem5::statistics::Hdf5::visit ( const FormulaInfo info)
overridevirtual

◆ visit() [3/7]

void gem5::statistics::Hdf5::visit ( const ScalarInfo info)
overridevirtual

Implements gem5::statistics::Output.

Definition at line 134 of file hdf5.cc.

References appendStat(), data, and gem5::statistics::ScalarInfo::result().

◆ visit() [4/7]

void gem5::statistics::Hdf5::visit ( const SparseHistInfo info)
overridevirtual

Implements gem5::statistics::Output.

Definition at line 197 of file hdf5.cc.

References warn_once.

◆ visit() [5/7]

void gem5::statistics::Hdf5::visit ( const Vector2dInfo info)
overridevirtual

◆ visit() [6/7]

void gem5::statistics::Hdf5::visit ( const VectorDistInfo info)
overridevirtual

Implements gem5::statistics::Output.

Definition at line 158 of file hdf5.cc.

References warn_once.

◆ visit() [7/7]

void gem5::statistics::Hdf5::visit ( const VectorInfo info)
overridevirtual

Implements gem5::statistics::Output.

Definition at line 146 of file hdf5.cc.

References appendVectorInfo().

Member Data Documentation

◆ dumpCount

unsigned gem5::statistics::Hdf5::dumpCount
protected

Definition at line 153 of file hdf5.hh.

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

◆ enableDescriptions

const bool gem5::statistics::Hdf5::enableDescriptions
protected

Definition at line 148 of file hdf5.hh.

Referenced by appendStat().

◆ enableFormula

const bool gem5::statistics::Hdf5::enableFormula
protected

Definition at line 149 of file hdf5.hh.

Referenced by visit().

◆ fname

const std::string gem5::statistics::Hdf5::fname
protected

Definition at line 146 of file hdf5.hh.

Referenced by begin().

◆ h5File

H5::H5File gem5::statistics::Hdf5::h5File
protected

Definition at line 154 of file hdf5.hh.

Referenced by begin().

◆ path

std::stack<H5::Group> gem5::statistics::Hdf5::path
protected

Definition at line 151 of file hdf5.hh.

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

◆ timeChunk

const hsize_t gem5::statistics::Hdf5::timeChunk
protected

Definition at line 147 of file hdf5.hh.

Referenced by appendStat().


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

Generated on Wed Dec 21 2022 10:24:27 for gem5 by doxygen 1.9.1