QDP++
QDP::HDF5 Class Referenceabstract

HDF5 reader class. More...

#include <qdp_hdf5.h>

Inheritance diagram for QDP::HDF5:
QDP::HDF5Reader QDP::HDF5Writer

Public Member Functions

virtual void open (const std::string &filename)=0
int close ()
void set_stripesize (const int &stripesizee)
void set_profiling (const bool &profilee)
std::string pwd () const
std::string parentDir () const
void pop ()
void cd (const std::string &dirname)
void readAttribute (const std::string &obj_name, const std::string &attr_name, short &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, unsigned short &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, int &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, unsigned int &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, unsigned long long &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, float &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, double &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, std::string &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, multi1d< short > &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, multi1d< unsigned short > &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, multi1d< int > &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, multi1d< unsigned int > &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, multi1d< unsigned long long > &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, multi1d< float > &datum)
void readAttribute (const std::string &obj_name, const std::string &attr_name, multi1d< double > &datum)
void read (const std::string &obj_name, short &datum)
void read (const std::string &obj_name, unsigned short &datum)
void read (const std::string &obj_name, int &datum)
void read (const std::string &obj_name, unsigned int &datum)
void read (const std::string &obj_name, unsigned long long &datum)
void read (const std::string &obj_name, float &datum)
void read (const std::string &obj_name, double &datum)
void read (const std::string &dataname, std::string &datum)
void read (const std::string &obj_name, multi1d< short > &datum)
void read (const std::string &obj_name, multi1d< unsigned short > &datum)
void read (const std::string &obj_name, multi1d< int > &datum)
void read (const std::string &obj_name, multi1d< unsigned int > &datum)
void read (const std::string &obj_name, multi1d< unsigned long long > &datum)
void read (const std::string &obj_name, multi1d< float > &datum)
void read (const std::string &obj_name, multi1d< double > &datum)
void read (const std::string &obj_name, multi2d< short > &datum)
void read (const std::string &obj_name, multi2d< unsigned short > &datum)
void read (const std::string &obj_name, multi2d< int > &datum)
void read (const std::string &obj_name, multi2d< unsigned int > &datum)
void read (const std::string &obj_name, multi2d< unsigned long long > &datum)
void read (const std::string &obj_name, multi2d< float > &datum)
void read (const std::string &obj_name, multi2d< double > &datum)
template<class T>
void read (const std::string &name, OScalar< T > &scalar)
template<class T>
void read (const std::string &name, multi1d< OScalar< T > > &scalararray)
template<class T>
void read (const std::string &name, OLattice< T > &field, const HDF5Base::accessmode &accmode=HDF5Base::transpose_order)
template<class T>
void read (const std::string &name, multi1d< OLattice< T > > &fieldarray, const HDF5Base::accessmode &accmode=HDF5Base::transpose_order)
void readQlua (const std::string &name, multi1d< LatticeColorMatrixD3 > &field)
void readQlua (const std::string &name, LatticeDiracPropagatorD3 &prop)
template<>
void read (const std::string &dataname, ComplexF &datum)
template<>
void read (const std::string &dataname, ComplexD &datum)
template<>
void read (const std::string &dataname, multi1d< ComplexF > &datum)
template<>
void read (const std::string &dataname, multi1d< ComplexD > &datum)
template<>
void read (const std::string &name, LatticeColorMatrixD3 &field, const HDF5Base::accessmode &accmode)
template<>
void read (const std::string &name, LatticeDiracPropagatorF3 &field, const HDF5Base::accessmode &accmode)
template<>
void read (const std::string &name, LatticeDiracPropagatorD3 &field, const HDF5Base::accessmode &accmode)
template<>
void read (const std::string &name, multi1d< LatticeColorMatrixD3 > &field, const HDF5Base::accessmode &accmode)

Static Public Member Functions

static bool check_exists (const std::string &filename)

Protected Member Functions

 HDF5 (const long int &stripesizee=-1, const long int &maxalign=0)
std::string getNameById (hid_t id) const
void tokenize (const ::std::string &str, ::std::vector< ::std::string > &tokens, const ::std::string &delimiters)
std::vector< std::string > splitPathname (const std::string &name)
bool objectExists (const std::string &name)
bool objectExists (hid_t loc_id, const std::string &name)
std::string objectType (const ::std::string &name)
std::string objectType (hid_t loc_id, const ::std::string &name)
void HDF5_error_exit (const std::string &message)
int prefetchLatticeCoordinates ()
template<class T>
void CvtToLayout (OLattice< T > &field, void *buf, const unsigned int &nodeSites, const unsigned int &elemSize)
template<class T>
void CvtToLayout (multi1d< OLattice< T > > &fieldarray, void *buf, const unsigned int &nodeSites, const unsigned int &arraySize, const unsigned int &elemSize)
template<class T>
void CvtToHost (void *buf, const OLattice< T > &field, const unsigned int &nodeSites, const unsigned int &elemSize)
template<class T>
void CvtToHost (void *buf, const multi1d< OLattice< T > > &fieldarray, const unsigned int &nodeSites, const unsigned int &arraySize, const unsigned int &elemSize)
hid_t createComplexType (const unsigned int &float_size)
bool checkComplexType (const hid_t &type_id, hid_t &base_type_id)
hid_t createColorMatrixType (const hid_t &complex_id, const unsigned int &rank)
bool checkColorMatrixType (const hid_t &type_id, const unsigned int &rank, hid_t &base_type_id)
hid_t createPropagatorType (const hid_t &colmat_id, const unsigned int &spinrank)
bool checkDiracPropagatorType (const hid_t &type_id, const unsigned int &spinrank, const unsigned int &colorrank, hid_t &base_type_id)
template<typename ctype>
void rdAtt (const std::string &obj_name, const std::string &attr_name, ctype &datum, const H5T_class_t &hdfclass, const bool &sign, const bool &rigid_checks=true)
template<typename ctype>
void rdAtt (const std::string &obj_name, const std::string &attr_name, multi1d< ctype > &datum, const H5T_class_t &hdfclass, const bool &sign, const bool &rigid_checks=true)
template<typename ctype>
void rd (const std::string &dataname, ctype &datum, const H5T_class_t &hdfclass, const bool &sign, const bool &rigid_checks=true)
template<typename ctype>
void rd (const std::string &dataname, multi1d< ctype > &datum, const H5T_class_t &hdfclass, const bool &sign, const bool &rigid_checks=true)
template<typename ctype>
void rd (const std::string &dataname, multi2d< ctype > &datum, const H5T_class_t &hdfclass, const bool &sign, const bool &rigid_checks=true)
void readPrepare (const std::string &name, hid_t &type_id)
void readPrepareLattice (const std::string &name, hid_t &type_id, multi1d< ullong > &sizes)
void readLattice (const std::string &name, const hid_t &type_id, const hid_t &base_type_id, const ullong &obj_size, const ullong &tot_size, char *buf, bool invert_order=true)

Static Protected Member Functions

static hid_t errorHandler (hid_t errstack, void *unused)

Protected Attributes

hid_t error_stack
hid_t file_id
hid_t file_comm
hid_t current_group
multi1d< int > reordermap
bool isprefetched
long int stripesize
long int maxalign
bool par_init
bool profile
MPI_Comm * mpicomm

Detailed Description

HDF5 reader class.

This is used to read data from an HDF5 file using.

Definition at line 41 of file qdp_hdf5.h.

Constructor & Destructor Documentation

◆ HDF5()

QDP::HDF5::HDF5 ( const long int & stripesizee = -1,
const long int & maxalign = 0 )
explicitprotected

References maxalign.

Member Function Documentation

◆ cd()

void QDP::HDF5::cd ( const std::string & dirname)

◆ check_exists()

bool QDP::HDF5::check_exists ( const std::string & filename)
static

◆ checkColorMatrixType()

bool QDP::HDF5::checkColorMatrixType ( const hid_t & type_id,
const unsigned int & rank,
hid_t & base_type_id )
protected

◆ checkComplexType()

bool QDP::HDF5::checkComplexType ( const hid_t & type_id,
hid_t & base_type_id )
protected

◆ checkDiracPropagatorType()

bool QDP::HDF5::checkDiracPropagatorType ( const hid_t & type_id,
const unsigned int & spinrank,
const unsigned int & colorrank,
hid_t & base_type_id )
protected

◆ close()

int QDP::HDF5::close ( )

Referenced by HDF5_error_exit().

◆ createColorMatrixType()

hid_t QDP::HDF5::createColorMatrixType ( const hid_t & complex_id,
const unsigned int & rank )
protected

◆ createComplexType()

hid_t QDP::HDF5::createComplexType ( const unsigned int & float_size)
protected

◆ createPropagatorType()

hid_t QDP::HDF5::createPropagatorType ( const hid_t & colmat_id,
const unsigned int & spinrank )
protected

◆ CvtToHost() [1/2]

template<class T>
void QDP::HDF5::CvtToHost ( void * buf,
const multi1d< OLattice< T > > & fieldarray,
const unsigned int & nodeSites,
const unsigned int & arraySize,
const unsigned int & elemSize )
inlineprotected

Definition at line 118 of file qdp_hdf5.h.

References reordermap.

◆ CvtToHost() [2/2]

template<class T>
void QDP::HDF5::CvtToHost ( void * buf,
const OLattice< T > & field,
const unsigned int & nodeSites,
const unsigned int & elemSize )
inlineprotected

Definition at line 110 of file qdp_hdf5.h.

References QDP::OLattice< T >::elem(), and reordermap.

Referenced by QDP::HDF5Writer::write(), and QDP::HDF5Writer::write().

◆ CvtToLayout() [1/2]

template<class T>
void QDP::HDF5::CvtToLayout ( multi1d< OLattice< T > > & fieldarray,
void * buf,
const unsigned int & nodeSites,
const unsigned int & arraySize,
const unsigned int & elemSize )
inlineprotected

Definition at line 99 of file qdp_hdf5.h.

References reordermap.

◆ CvtToLayout() [2/2]

template<class T>
void QDP::HDF5::CvtToLayout ( OLattice< T > & field,
void * buf,
const unsigned int & nodeSites,
const unsigned int & elemSize )
inlineprotected

Definition at line 91 of file qdp_hdf5.h.

References QDP::OLattice< T >::elem(), and reordermap.

Referenced by read(), and read().

◆ errorHandler()

hid_t QDP::HDF5::errorHandler ( hid_t errstack,
void * unused )
staticprotected

◆ getNameById()

std::string QDP::HDF5::getNameById ( hid_t id) const
protected

◆ HDF5_error_exit()

void QDP::HDF5::HDF5_error_exit ( const std::string & message)
inlineprotected

◆ objectExists() [1/2]

bool QDP::HDF5::objectExists ( const std::string & name)
protected

Referenced by rd(), rd(), rd(), rdAtt(), and rdAtt().

◆ objectExists() [2/2]

bool QDP::HDF5::objectExists ( hid_t loc_id,
const std::string & name )
protected

◆ objectType() [1/2]

std::string QDP::HDF5::objectType ( const ::std::string & name)
protected

◆ objectType() [2/2]

std::string QDP::HDF5::objectType ( hid_t loc_id,
const ::std::string & name )
protected

◆ open()

virtual void QDP::HDF5::open ( const std::string & filename)
pure virtual

Implemented in QDP::HDF5Reader, and QDP::HDF5Writer.

◆ parentDir()

std::string QDP::HDF5::parentDir ( ) const

◆ pop()

void QDP::HDF5::pop ( )

◆ prefetchLatticeCoordinates()

int QDP::HDF5::prefetchLatticeCoordinates ( )
protected

◆ pwd()

std::string QDP::HDF5::pwd ( ) const

◆ rd() [1/3]

template<typename ctype>
void QDP::HDF5::rd ( const std::string & dataname,
ctype & datum,
const H5T_class_t & hdfclass,
const bool & sign,
const bool & rigid_checks = true )
inlineprotected

Definition at line 272 of file qdp_hdf5.h.

References current_group, HDF5_error_exit(), and objectExists().

◆ rd() [2/3]

template<typename ctype>
void QDP::HDF5::rd ( const std::string & dataname,
multi1d< ctype > & datum,
const H5T_class_t & hdfclass,
const bool & sign,
const bool & rigid_checks = true )
inlineprotected

◆ rd() [3/3]

template<typename ctype>
void QDP::HDF5::rd ( const std::string & dataname,
multi2d< ctype > & datum,
const H5T_class_t & hdfclass,
const bool & sign,
const bool & rigid_checks = true )
inlineprotected

◆ rdAtt() [1/2]

template<typename ctype>
void QDP::HDF5::rdAtt ( const std::string & obj_name,
const std::string & attr_name,
ctype & datum,
const H5T_class_t & hdfclass,
const bool & sign,
const bool & rigid_checks = true )
inlineprotected

Definition at line 157 of file qdp_hdf5.h.

References current_group, HDF5_error_exit(), and objectExists().

◆ rdAtt() [2/2]

template<typename ctype>
void QDP::HDF5::rdAtt ( const std::string & obj_name,
const std::string & attr_name,
multi1d< ctype > & datum,
const H5T_class_t & hdfclass,
const bool & sign,
const bool & rigid_checks = true )
inlineprotected

◆ read() [1/34]

template<>
void QDP::HDF5::read ( const std::string & dataname,
ComplexD & datum )

References read().

◆ read() [2/34]

template<>
void QDP::HDF5::read ( const std::string & dataname,
ComplexF & datum )

References read().

◆ read() [3/34]

template<>
void QDP::HDF5::read ( const std::string & dataname,
multi1d< ComplexD > & datum )

References read().

◆ read() [4/34]

template<>
void QDP::HDF5::read ( const std::string & dataname,
multi1d< ComplexF > & datum )

References read().

◆ read() [5/34]

void QDP::HDF5::read ( const std::string & dataname,
std::string & datum )

◆ read() [6/34]

template<>
void QDP::HDF5::read ( const std::string & name,
LatticeColorMatrixD3 & field,
const HDF5Base::accessmode & accmode )

References read().

◆ read() [7/34]

template<>
void QDP::HDF5::read ( const std::string & name,
LatticeDiracPropagatorD3 & field,
const HDF5Base::accessmode & accmode )

References read().

◆ read() [8/34]

template<>
void QDP::HDF5::read ( const std::string & name,
LatticeDiracPropagatorF3 & field,
const HDF5Base::accessmode & accmode )

References read().

◆ read() [9/34]

template<>
void QDP::HDF5::read ( const std::string & name,
multi1d< LatticeColorMatrixD3 > & field,
const HDF5Base::accessmode & accmode )

References read().

◆ read() [10/34]

◆ read() [11/34]

template<class T>
void QDP::HDF5::read ( const std::string & name,
multi1d< OScalar< T > > & scalararray )
inline

Definition at line 604 of file qdp_hdf5.h.

References HDF5_error_exit(), read(), readPrepareLattice(), and QDP::multi1d< T >::size().

◆ read() [12/34]

◆ read() [13/34]

template<class T>
void QDP::HDF5::read ( const std::string & name,
OScalar< T > & scalar )
inline

◆ read() [14/34]

void QDP::HDF5::read ( const std::string & obj_name,
double & datum )

◆ read() [15/34]

void QDP::HDF5::read ( const std::string & obj_name,
float & datum )

◆ read() [16/34]

void QDP::HDF5::read ( const std::string & obj_name,
int & datum )

◆ read() [17/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi1d< double > & datum )

◆ read() [18/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi1d< float > & datum )

◆ read() [19/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi1d< int > & datum )

◆ read() [20/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi1d< short > & datum )

◆ read() [21/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi1d< unsigned int > & datum )

◆ read() [22/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi1d< unsigned long long > & datum )

◆ read() [23/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi1d< unsigned short > & datum )

◆ read() [24/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi2d< double > & datum )

◆ read() [25/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi2d< float > & datum )

◆ read() [26/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi2d< int > & datum )

◆ read() [27/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi2d< short > & datum )

◆ read() [28/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi2d< unsigned int > & datum )

◆ read() [29/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi2d< unsigned long long > & datum )

◆ read() [30/34]

void QDP::HDF5::read ( const std::string & obj_name,
multi2d< unsigned short > & datum )

◆ read() [31/34]

void QDP::HDF5::read ( const std::string & obj_name,
short & datum )

◆ read() [32/34]

void QDP::HDF5::read ( const std::string & obj_name,
unsigned int & datum )

◆ read() [33/34]

void QDP::HDF5::read ( const std::string & obj_name,
unsigned long long & datum )

◆ read() [34/34]

void QDP::HDF5::read ( const std::string & obj_name,
unsigned short & datum )

◆ readAttribute() [1/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
double & datum )

◆ readAttribute() [2/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
float & datum )

◆ readAttribute() [3/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
int & datum )

◆ readAttribute() [4/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
multi1d< double > & datum )

◆ readAttribute() [5/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
multi1d< float > & datum )

◆ readAttribute() [6/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
multi1d< int > & datum )

◆ readAttribute() [7/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
multi1d< short > & datum )

◆ readAttribute() [8/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
multi1d< unsigned int > & datum )

◆ readAttribute() [9/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
multi1d< unsigned long long > & datum )

◆ readAttribute() [10/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
multi1d< unsigned short > & datum )

◆ readAttribute() [11/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
short & datum )

◆ readAttribute() [12/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
std::string & datum )

◆ readAttribute() [13/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
unsigned int & datum )

◆ readAttribute() [14/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
unsigned long long & datum )

◆ readAttribute() [15/15]

void QDP::HDF5::readAttribute ( const std::string & obj_name,
const std::string & attr_name,
unsigned short & datum )

◆ readLattice()

void QDP::HDF5::readLattice ( const std::string & name,
const hid_t & type_id,
const hid_t & base_type_id,
const ullong & obj_size,
const ullong & tot_size,
char * buf,
bool invert_order = true )
protected

Referenced by read(), and read().

◆ readPrepare()

void QDP::HDF5::readPrepare ( const std::string & name,
hid_t & type_id )
protected

◆ readPrepareLattice()

void QDP::HDF5::readPrepareLattice ( const std::string & name,
hid_t & type_id,
multi1d< ullong > & sizes )
protected

Referenced by read(), read(), read(), and read().

◆ readQlua() [1/2]

void QDP::HDF5::readQlua ( const std::string & name,
LatticeDiracPropagatorD3 & prop )

◆ readQlua() [2/2]

void QDP::HDF5::readQlua ( const std::string & name,
multi1d< LatticeColorMatrixD3 > & field )

◆ set_profiling()

void QDP::HDF5::set_profiling ( const bool & profilee)
inline

Definition at line 489 of file qdp_hdf5.h.

References profile.

◆ set_stripesize()

void QDP::HDF5::set_stripesize ( const int & stripesizee)
inline

Definition at line 486 of file qdp_hdf5.h.

References stripesize.

◆ splitPathname()

std::vector< std::string > QDP::HDF5::splitPathname ( const std::string & name)
protected

◆ tokenize()

void QDP::HDF5::tokenize ( const ::std::string & str,
::std::vector< ::std::string > & tokens,
const ::std::string & delimiters )
protected

Member Data Documentation

◆ current_group

hid_t QDP::HDF5::current_group
protected

Definition at line 44 of file qdp_hdf5.h.

Referenced by rd(), rd(), rd(), rdAtt(), and rdAtt().

◆ error_stack

hid_t QDP::HDF5::error_stack
protected

Definition at line 44 of file qdp_hdf5.h.

◆ file_comm

hid_t QDP::HDF5::file_comm
protected

Definition at line 44 of file qdp_hdf5.h.

◆ file_id

hid_t QDP::HDF5::file_id
protected

Definition at line 44 of file qdp_hdf5.h.

◆ isprefetched

bool QDP::HDF5::isprefetched
protected

Definition at line 46 of file qdp_hdf5.h.

◆ maxalign

long int QDP::HDF5::maxalign
protected

Definition at line 49 of file qdp_hdf5.h.

Referenced by HDF5(), QDP::HDF5Reader::HDF5Reader(), and QDP::HDF5Writer::HDF5Writer().

◆ mpicomm

MPI_Comm* QDP::HDF5::mpicomm
protected

Definition at line 55 of file qdp_hdf5.h.

◆ par_init

bool QDP::HDF5::par_init
protected

Definition at line 52 of file qdp_hdf5.h.

◆ profile

bool QDP::HDF5::profile
protected

Definition at line 53 of file qdp_hdf5.h.

Referenced by read(), read(), set_profiling(), QDP::HDF5Writer::write(), and QDP::HDF5Writer::write().

◆ reordermap

multi1d<int> QDP::HDF5::reordermap
protected

Definition at line 45 of file qdp_hdf5.h.

Referenced by CvtToHost(), CvtToHost(), CvtToLayout(), and CvtToLayout().

◆ stripesize

long int QDP::HDF5::stripesize
protected

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