|
template<typename Container > |
Container | read () |
|
template<typename Container > |
Container | read_selection (const std::vector< hsize_t > &coordinates) |
|
template<typename Container > |
Container | read_hyperslab (const std::vector< hsize_t > &offset, const std::vector< hsize_t > &count) |
|
template<typename Container > |
Container | read_hyperslab (const std::vector< hsize_t > &data_dimensions, const std::vector< hsize_t > &offset, const std::vector< hsize_t > &stride, const std::vector< hsize_t > &count, const std::vector< hsize_t > &block) |
|
template<typename number > |
void | read_none () |
|
template<typename Container > |
void | write (const Container &data) |
|
template<typename Container > |
void | write_selection (const Container &data, const std::vector< hsize_t > &coordinates) |
|
template<typename Container > |
void | write_hyperslab (const Container &data, const std::vector< hsize_t > &offset, const std::vector< hsize_t > &count) |
|
template<typename Container > |
void | write_hyperslab (const Container &data, const std::vector< hsize_t > &data_dimensions, const std::vector< hsize_t > &offset, const std::vector< hsize_t > &stride, const std::vector< hsize_t > &count, const std::vector< hsize_t > &block) |
|
template<typename number > |
void | write_none () |
|
bool | get_query_io_mode () const |
|
void | set_query_io_mode (const bool new_query_io_mode) |
|
std::string | get_io_mode () |
|
H5D_mpio_actual_io_mode_t | get_io_mode_as_hdf5_type () |
|
std::string | get_local_no_collective_cause () |
|
std::uint32_t | get_local_no_collective_cause_as_hdf5_type () |
|
std::string | get_global_no_collective_cause () |
|
std::uint32_t | get_global_no_collective_cause_as_hdf5_type () |
|
std::vector< hsize_t > | get_dimensions () const |
|
unsigned int | get_size () const |
|
unsigned int | get_rank () const |
|
template<typename T > |
T | get_attribute (const std::string &attr_name) const |
|
template<> |
std::string | get_attribute (const std::string &attr_name) const |
|
template<typename T > |
void | set_attribute (const std::string &attr_name, const T value) |
|
template<> |
void | set_attribute (const std::string &attr_name, const std::string value) |
|
std::string | get_name () const |
|
This class implements an HDF5 DataSet.
Definition at line 425 of file hdf5.h.
template<typename Container >
Container HDF5::DataSet::read |
( |
| ) |
|
Reads all the data of the dataset.
Datatype conversion takes place at the time of the read operation and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
Container
can be std::vector<float>
, std::vector<double>
, std::vector<std::complex<float>>
, std::vector<std::complex<double>>
, std::vector<int>
, std::vector<unsigned int>
, Vector<float>
, Vector<double>
, Vector<std::complex<float>>
, Vector<std::complex<double>>
, FullMatrix<float>
, FullMatrix<double>
, FullMatrix<std::complex<float>>
or FullMatrix<std::complex<double>>
.
Definition at line 1769 of file hdf5.h.
template<typename Container >
Container HDF5::DataSet::read_selection |
( |
const std::vector< hsize_t > & | coordinates | ) |
|
Reads data of a subset of the dataset.
Datatype conversion takes place at the time of the read operation and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
The selected elements can be scattered and take any shape in the dataset. For example, in the case of a dataset with rank 4 a selection of 3 points will be described by a 3-by-4 array. Note the indexing is zero-based. To select the points (1,1,1,1), (14,6,12,18), and (8,22,30,22), the point selection array would be as follows:
0 0 0 0
13 5 11 17
7 21 29 21
Parallel HDF5 supports collective I/O on point selections.
Datatype conversion takes place at the time of the read operation and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
Definition at line 1804 of file hdf5.h.
template<typename Container >
Container HDF5::DataSet::read_hyperslab |
( |
const std::vector< hsize_t > & | offset, |
|
|
const std::vector< hsize_t > & | count ) |
Reads a hyperslab from the dataset. The parameters are summarized below:
offset:
The starting location for the hyperslab.
count:
The number of elements to select along each dimension.
When reading a hyperslab, HDF5 also allows to provide "stride" and "block" parameters (see the HDF5 documentation). These are not used by the current function and set to nullptr
. However these parameters can be used with the function read_hyperslab(const std::vector<hsize_t> &, const std::vector<hsize_t> &, const std::vector<hsize_t> &, const std::vector<hsize_t> &, const std::vector<hsize_t> &)
See the Dataspaces and Data Transfer section in the HDF5 User's Guide. See as well the H5Sselect_hyperslab definition.
Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
Container
can be std::vector<float>
, std::vector<double>
, std::vector<std::complex<float>>
, std::vector<std::complex<double>>
, std::vector<int>
, std::vector<unsigned int>
, Vector<float>
, Vector<double>
, Vector<std::complex<float>>
, Vector<std::complex<double>>
, FullMatrix<float>
, FullMatrix<double>
, FullMatrix<std::complex<float>>
or FullMatrix<std::complex<double>>
.
Definition at line 1856 of file hdf5.h.
template<typename Container >
Container HDF5::DataSet::read_hyperslab |
( |
const std::vector< hsize_t > & | data_dimensions, |
|
|
const std::vector< hsize_t > & | offset, |
|
|
const std::vector< hsize_t > & | stride, |
|
|
const std::vector< hsize_t > & | count, |
|
|
const std::vector< hsize_t > & | block ) |
Writes a data hyperslab to the dataset. The parameters are summarized below:
dataset_dimensions:
the dimensions of the data memory block.
offset:
The starting location for the hyperslab.
stride:
The number of elements to separate each element or block to be selected.
count:
The number of elements or blocks to select along each dimension.
block:
The size of the block selected from the dataspace.
See the Dataspaces and Data Transfer section in the HDF5 User's Guide. See as well the H5Sselect_hyperslab definition.
Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
Container
can be std::vector<float>
, std::vector<double>
, std::vector<std::complex<float>>
, std::vector<std::complex<double>>
, std::vector<int>
, std::vector<unsigned int>
, Vector<float>
, Vector<double>
, Vector<std::complex<float>>
, Vector<std::complex<double>>
, FullMatrix<float>
, FullMatrix<double>
, FullMatrix<std::complex<float>>
or FullMatrix<std::complex<double>>
.
Definition at line 1910 of file hdf5.h.
template<typename number >
void HDF5::DataSet::read_none |
( |
| ) |
|
This function does not read any data, but it can contribute to a collective read call. number
can be float
, double
, std::complex<float>
, std::complex<double>
, int
or unsigned int
.
Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
Definition at line 1963 of file hdf5.h.
template<typename Container >
void HDF5::DataSet::write |
( |
const Container & | data | ) |
|
Writes data in the dataset. number
can be float
, double
, std::complex<float>
, std::complex<double>
, int
or unsigned int
.
Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
Container
can be std::vector<float>
, std::vector<double>
, std::vector<std::complex<float>>
, std::vector<std::complex<double>>
, std::vector<int>
, std::vector<unsigned int>
, Vector<float>
, Vector<double>
, Vector<std::complex<float>>
, Vector<std::complex<double>>
, FullMatrix<float>
, FullMatrix<double>
, FullMatrix<std::complex<float>>
or FullMatrix<std::complex<double>>
.
Definition at line 2003 of file hdf5.h.
template<typename Container >
void HDF5::DataSet::write_selection |
( |
const Container & | data, |
|
|
const std::vector< hsize_t > & | coordinates ) |
Writes data to a subset of the dataset. number
can be float
, double
, std::complex<float>
, std::complex<double>
, int
or unsigned int
.
The selected elements can be scattered and take any shape in the dataset. For example, in the case of a dataset with rank 4 a selection of 3 points will be described by a 3-by-4 array. Note the indexing is zero-based. To select the points (1,1,1,1), (14,6,12,18), and (8,22,30,22), the point selection array would be as follows:
0 0 0 0
13 5 11 17
7 21 29 21
Parallel HDF5 supports collective I/O on point selections.
Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
Definition at line 2035 of file hdf5.h.
template<typename Container >
void HDF5::DataSet::write_hyperslab |
( |
const Container & | data, |
|
|
const std::vector< hsize_t > & | offset, |
|
|
const std::vector< hsize_t > & | count ) |
template<typename Container >
void HDF5::DataSet::write_hyperslab |
( |
const Container & | data, |
|
|
const std::vector< hsize_t > & | data_dimensions, |
|
|
const std::vector< hsize_t > & | offset, |
|
|
const std::vector< hsize_t > & | stride, |
|
|
const std::vector< hsize_t > & | count, |
|
|
const std::vector< hsize_t > & | block ) |
Writes a data hyperslab to the dataset. The parameters are summarized below:
dataset_dimensions:
the dimensions of the data memory block.
offset:
The starting location for the hyperslab.
stride:
The number of elements to separate each element or block to be selected.
count:
The number of elements or blocks to select along each dimension.
block:
The size of the block selected from the dataspace.
See the Dataspaces and Data Transfer section in the HDF5 User's Guide. See as well the H5Sselect_hyperslab definition.
Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
Container
can be std::vector<float>
, std::vector<double>
, std::vector<std::complex<float>>
, std::vector<std::complex<double>>
, std::vector<int>
, std::vector<unsigned int>
, Vector<float>
, Vector<double>
, Vector<std::complex<float>>
, Vector<std::complex<double>>
, FullMatrix<float>
, FullMatrix<double>
, FullMatrix<std::complex<float>>
or FullMatrix<std::complex<double>>
.
Definition at line 2141 of file hdf5.h.
template<typename number >
void HDF5::DataSet::write_none |
( |
| ) |
|
This function does not write any data, but it can contribute to a collective write call. In the context of a collective MPI write call, if a process does not write any data at all, the process should call this function because the operation is collective and all the MPI processes have to contribute to the call, even if they don't have data to write. number
can be float
, double
, std::complex<float>
, std::complex<double>
, int
or unsigned int
.
Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
An example of how to use this function can be found in step-62.
Definition at line 2193 of file hdf5.h.
bool HDF5::DataSet::get_query_io_mode |
( |
| ) |
const |
This function returns the boolean query_io_mode.
In cases where maximum performance has to be achieved, it is important to make sure that all MPI read/write operations are collective. The HDF5 library provides API routines that can be used after the read/write I/O operations to query the I/O mode. If query_io_mode is set to true, then after every read/write operation the deal.II's HDF5 interface calls the routines H5Pget_mpio_actual_io_mode() and H5Pget_mpio_no_collective_cause(). The results are stored in io_mode, local_no_collective_cause and global_no_collective_cause. We suggest to query the I/O mode only in Debug mode because it requires calling additional HDF5 routines.
Definition at line 305 of file hdf5.cc.
template<typename T >
T HDF5::HDF5Object::get_attribute |
( |
const std::string & | attr_name | ) |
const |
|
inherited |
Reads an attribute. T
can be float
, double
, std::complex<float>
, std::complex<double>
, int
, unsigned int
, bool
or std::string
. Note that the encoding of std::string
is UTF8 in order to be compatible with python3.
Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
Definition at line 1597 of file hdf5.h.
template<typename T >
void HDF5::HDF5Object::set_attribute |
( |
const std::string & | attr_name, |
|
|
const T | value ) |
|
inherited |
Writes an attribute. T
can be float
, double
, std::complex<float>
, std::complex<double>
, int
, unsigned int
, bool
or std::string
. Note that the encoding of std::string
is UTF8 in order to be compatible with python3.
Datatype conversion takes place at the time of a read or write and is automatic. See the Data Transfer: Datatype Conversion and Selection section in the HDF5 User's Guide.
Definition at line 1674 of file hdf5.h.