* HDF5::File::Mode::open);
* hdf5::Group data = data_file.group("data");
*
- * auto nb_frequency_points = data.attr<int>("nb_frequency_points");
- * auto rho = data.attr<double>("rho");
- * auto save_vtk_files = data.attr<bool>("save_vtk_files");
- * auto simulation_type = data.attr<std::string>("simulation_type");
+ * auto nb_frequency_points = data.get_attribute<int>("nb_frequency_points");
+ * auto rho = data.get_attribute<double>("rho");
+ * auto save_vtk_files = data.get_attribute<bool>("save_vtk_files");
+ * auto simulation_type = data.get_attribute<std::string>("simulation_type");
*
* std::vector<std::complex<double>> displacement = {...};
*
* auto some_data = data.write_dataset("displacement", displacement);
*
* // Write the simulation metadata
- * data.write_attr("active_cells", triangulation.n_active_cells());
+ * data.set_attribute("active_cells", triangulation.n_active_cells());
* @endcode
*
* Read the simulation results with python:
* In addition, attributes can be attached to the root file, a group or a
* dataset. An [HDF5
* attribute](https://bitbucket.hdfgroup.org/pages/HDFFV/hdf5doc/master/browse/html/UG/HDF5_Users_Guide-Responsive%20HTML5/HDF5_Users_Guide/Attributes/HDF5_Attributes.htm)
- * is a small meta data. The methods HDF5Object::attr(const std::string) and
- * HDF5Object::write_attr(const std::string, const T) have been instantiated for
- * the types: `float`, `double`, `std::complex<float>`, `std::complex<double>`,
- * `int`, `unsigned int`, `bool`, and `std::string`.
+ * is a small meta data. The methods
+ * HDF5Object::get_attribute(const std::string) and
+ * HDF5Object::set_attribute(const std::string, const T) have
+ * been instantiated for the types: `float`, `double`, `std::complex<float>`,
+ * `std::complex<double>`, `int`, `unsigned int`, `bool`, and `std::string`.
*
* Below an example code can be found. Note that, if the group already exists
* the method Group::group(std::string) should be used instead of
* @code
* HDF5::File data_file(filename, HDF5::File::Mode::create);
* double double_attribute = 2.2;
- * data_file.write_attr("double_attribute", double attribute);
+ * data_file.set_attribute("double_attribute", double attribute);
* auto group = data_file.create_group("group");
- * group.write_attr("simulation_type", std::string("elastic_equation"));
+ * group.set_attribute("simulation_type", std::string("elastic_equation"));
* auto dataset = group.create_dataset<double>("dataset_name", dimensions);
- * dataset.write_attr("complex_double_attribute", std::complex<double>(2,2.3));
+ * dataset.set_attribute("complex_double_attribute",
+ * std::complex<double>(2,2.3));
* @endcode
*
* # MPI I/O
* [H5Pget_mpio_no_collective_cause()](https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMpioNoCollectiveCause).
* The results are stored in DataSet::io_mode(),
* DataSet::local_no_collective_cause() and
- * DataSet::global_no_collective_cause(). We suggest to query the I/O mode only
- * in Debug mode because it requires calling additional HDF5 routines.
+ * DataSet::get_global_no_collective_cause(). We suggest to query the I/O mode
+ * only in Debug mode because it requires calling additional HDF5 routines.
*
* The following code can be used to query the I/O method.
* @code
* pcout << "Local no collective cause: "
* << dataset.local_no_collective_cause<std::string>() << std::endl;
* pcout << "Global no collective cause: "
- * << dataset.global_no_collective_cause<std::string>() << std::endl;
+ * << dataset.get_global_no_collective_cause<std::string>() <<
+ * std::endl;
* }
* @endcode
*
* Global no collective cause: H5D_MPIO_COLLECTIVE
* @endcode
* See DataSet::io_mode(), DataSet::local_no_collective_cause() and
- * DataSet::global_no_collective_cause() for all the possible returned codes.
+ * DataSet::get_global_no_collective_cause() for all the possible returned
+ * codes.
*
* # Rank of the HDF5 datasets and hyperslabs
* The deal.ii HDF5 interface can be used to write/read data to datasets and
*/
template <typename T>
T
- attr(const std::string &attr_name);
+ get_attribute(const std::string &attr_name);
/**
* Writes an attribute. @p T can be `float`, `double`, `std::complex<float>`,
*/
template <typename T>
void
- write_attr(const std::string &attr_name, const T value);
+ set_attribute(const std::string &attr_name, const T value);
const std::string name;
*/
template <typename T>
T
- io_mode();
+ get_io_mode();
/**
* This funcion retrieves the local causes that broke collective I/O on the
*/
template <typename T>
T
- local_no_collective_cause();
+ get_local_no_collective_cause();
/**
* This funcion retrieves the global causes that broke collective I/O on the
*/
template <typename T>
T
- global_no_collective_cause();
+ get_global_no_collective_cause();
/**
- * This function retrieves the boolean query_io_mode().
+ * This function retrieves 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
+ * operations to query the I/O mode. If query_io_mode is set to true, then
* after every read/write operation the HDF5 deal.ii interface calls the
* routines
* [H5Pget_mpio_actual_io_mode()](https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMpioActualIoMode)
* and
* [H5Pget_mpio_no_collective_cause()](https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMpioNoCollectiveCause).
- * 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
+ * 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.
*/
bool
- query_io_mode() const;
+ get_query_io_mode() const;
/**
* This function sets the boolean query_io_mode().
*/
void
- query_io_mode(bool query_io_mode);
+ set_query_io_mode(bool query_io_mode);
/**
* This funcion returns the dimensions of the dataset.
*/
std::vector<hsize_t>
- dimensions() const;
+ get_dimensions() const;
/**
* This funcion returns the total number of elements in the dataset.
*/
unsigned int
- size() const;
+ get_size() const;
/**
* This funcion returns the rank of the dataset.
*/
unsigned int
- rank() const;
+ get_rank() const;
private:
- unsigned int _rank;
- std::vector<hsize_t> _dimensions;
- std::shared_ptr<hid_t> dataspace;
- unsigned int _size;
- bool _query_io_mode;
- H5D_mpio_actual_io_mode_t _io_mode;
- uint32_t _local_no_collective_cause;
- uint32_t _global_no_collective_cause;
+ /**
+ * Rank of the DataSet
+ */
+ unsigned int rank;
+
+ /**
+ * This vector dimensions is a one-dimensional array of size rank specifying
+ * the size of each dimension of the dataset.
+ */
+ std::vector<hsize_t> dimensions;
+
+ /**
+ * HDF5 dataspace identifier
+ */
+ std::shared_ptr<hid_t> dataspace;
+
+ /**
+ * Total number of elements in the dataset.
+ */
+ unsigned int size;
+
+ /**
+ * If query_io_mode is set to true, then after every read/write operation
+ * the HDF5 deal.ii interface calls the routines
+ * [H5Pget_mpio_actual_io_mode()](https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMpioActualIoMode)
+ * and
+ * [H5Pget_mpio_no_collective_cause()](https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMpioNoCollectiveCause).
+ * The results are stored in io_mode, local_no_collective_cause and
+ * global_no_collective_cause.
+ */
+ bool query_io_mode;
+
+ /**
+ * I/O mode that was performed on the last parallel I/O call.
+ */
+ H5D_mpio_actual_io_mode_t io_mode;
+
+ /**
+ * Local causes that broke collective I/O on the
+ * last parallel I/O call. See <a
+ * href="https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMpioNoCollectiveCause">H5Pget_mpio_no_collective_cause</a>.
+ */
+ uint32_t local_no_collective_cause;
+
+ /**
+ * Global causes that broke collective I/O on the
+ * last parallel I/O call. See <a
+ * href="https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMpioNoCollectiveCause">H5Pget_mpio_no_collective_cause</a>.
+ */
+ uint32_t global_no_collective_cause;
};
/**
template <typename T>
T
- HDF5Object::attr(const std::string &attr_name)
+ HDF5Object::get_attribute(const std::string &attr_name)
{
std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<T>();
T value;
template <>
bool
- HDF5Object::attr(const std::string &attr_name)
+ HDF5Object::get_attribute(const std::string &attr_name)
{
// The enum field generated by h5py can be casted to int
int int_value;
template <>
std::string
- HDF5Object::attr(const std::string &attr_name)
+ HDF5Object::get_attribute(const std::string &attr_name)
{
// Reads a UTF8 variable string
//
template <typename T>
void
- HDF5Object::write_attr(const std::string &attr_name, const T value)
+ HDF5Object::set_attribute(const std::string &attr_name, const T value)
{
hid_t attr;
hid_t aid;
template <>
void
- HDF5Object::write_attr(const std::string &attr_name, const std::string value)
+ HDF5Object::set_attribute(const std::string &attr_name,
+ const std::string value)
{
// Writes a UTF8 variable string
//
const hid_t & parent_group_id,
const bool mpi)
: HDF5Object(name, mpi)
- , _query_io_mode(false)
- , _io_mode(H5D_MPIO_NO_COLLECTIVE)
- , _local_no_collective_cause(H5D_MPIO_SET_INDEPENDENT)
- , _global_no_collective_cause(H5D_MPIO_SET_INDEPENDENT)
+ , query_io_mode(false)
+ , io_mode(H5D_MPIO_NO_COLLECTIVE)
+ , local_no_collective_cause(H5D_MPIO_SET_INDEPENDENT)
+ , global_no_collective_cause(H5D_MPIO_SET_INDEPENDENT)
{
hdf5_reference = std::shared_ptr<hid_t>(new hid_t, [](auto pointer) {
// Relase the HDF5 resource
});
// rank_ret can take a negative value if the functions
- // H5Sget_simple_extent_ndims and H5Sget_simple_extent_dims fail. _rank is
+ // H5Sget_simple_extent_ndims and H5Sget_simple_extent_dims fail. rank is
// unsigned int therefore it can not be used to store the return value of
// H5Sget_simple_extent_ndims and H5Sget_simple_extent_dims
int rank_ret;
Assert(*dataspace >= 0, ExcMessage("Error at H5Dget_space"));
rank_ret = H5Sget_simple_extent_ndims(*dataspace);
Assert(rank_ret >= 0, ExcInternalError());
- _rank = rank_ret;
- hsize_t *dims = (hsize_t *)malloc(_rank * sizeof(hsize_t));
+ rank = rank_ret;
+ hsize_t *dims = (hsize_t *)malloc(rank * sizeof(hsize_t));
rank_ret = H5Sget_simple_extent_dims(*dataspace, dims, NULL);
- AssertDimension(rank_ret, static_cast<int>(_rank));
- _dimensions.assign(dims, dims + _rank);
+ AssertDimension(rank_ret, static_cast<int>(rank));
+ dimensions.assign(dims, dims + rank);
free(dims);
- _size = 1;
- for (auto &&dimension : _dimensions)
+ size = 1;
+ for (auto &&dimension : dimensions)
{
- _size *= dimension;
+ size *= dimension;
}
}
std::shared_ptr<hid_t> t_type,
const bool mpi)
: HDF5Object(name, mpi)
- , _rank(dimensions.size())
- , _dimensions(dimensions)
- , _query_io_mode(false)
- , _io_mode(H5D_MPIO_NO_COLLECTIVE)
- , _local_no_collective_cause(H5D_MPIO_SET_INDEPENDENT)
- , _global_no_collective_cause(H5D_MPIO_SET_INDEPENDENT)
+ , rank(dimensions.size())
+ , dimensions(dimensions)
+ , query_io_mode(false)
+ , io_mode(H5D_MPIO_NO_COLLECTIVE)
+ , local_no_collective_cause(H5D_MPIO_SET_INDEPENDENT)
+ , global_no_collective_cause(H5D_MPIO_SET_INDEPENDENT)
{
hdf5_reference = std::shared_ptr<hid_t>(new hid_t, [](auto pointer) {
// Relase the HDF5 resource
delete pointer;
});
- *dataspace = H5Screate_simple(_rank, dimensions.data(), NULL);
+ *dataspace = H5Screate_simple(rank, dimensions.data(), NULL);
Assert(*dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
*hdf5_reference = H5Dcreate2(parent_group_id,
H5P_DEFAULT);
Assert(*hdf5_reference >= 0, ExcMessage("Error at H5Dcreate2"));
- _size = 1;
+ size = 1;
for (auto &&dimension : dimensions)
{
- _size *= dimension;
+ size *= dimension;
}
}
internal::get_hdf5_datatype<typename Container::value_type>();
hid_t plist;
- Container data = internal::initialize_container<Container>(_dimensions);
+ Container data = internal::initialize_container<Container>(dimensions);
if (mpi)
{
if (mpi)
{
- if (_query_io_mode)
+ if (query_io_mode)
{
- ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode);
+ ret = H5Pget_mpio_actual_io_mode(plist, &io_mode);
Assert(ret >= 0, ExcInternalError());
ret = H5Pget_mpio_no_collective_cause(plist,
- &_local_no_collective_cause,
- &_global_no_collective_cause);
+ &local_no_collective_cause,
+ &global_no_collective_cause);
Assert(ret >= 0, ExcInternalError());
}
ret = H5Pclose(plist);
std::vector<number>
DataSet::read_selection(const std::vector<hsize_t> &coordinates)
{
- Assert(coordinates.size() % _rank == 0,
+ Assert(coordinates.size() % rank == 0,
ExcMessage(
"The dimension of coordinates has to be divisible by the rank"));
std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<number>();
hid_t memory_dataspace;
std::vector<hsize_t> data_dimensions{
- static_cast<hsize_t>(coordinates.size() / _rank)};
+ static_cast<hsize_t>(coordinates.size() / rank)};
std::vector<number> data(
- static_cast<unsigned int>(coordinates.size() / _rank));
+ static_cast<unsigned int>(coordinates.size() / rank));
memory_dataspace = H5Screate_simple(1, data_dimensions.data(), NULL);
Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple"));
if (mpi)
{
- if (_query_io_mode)
+ if (query_io_mode)
{
- ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode);
+ ret = H5Pget_mpio_actual_io_mode(plist, &io_mode);
Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode"));
ret = H5Pget_mpio_no_collective_cause(plist,
- &_local_no_collective_cause,
- &_global_no_collective_cause);
+ &local_no_collective_cause,
+ &global_no_collective_cause);
Assert(ret >= 0,
ExcMessage("Error at H5Pget_mpio_no_collective_cause"));
}
if (mpi)
{
- if (_query_io_mode)
+ if (query_io_mode)
{
- ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode);
+ ret = H5Pget_mpio_actual_io_mode(plist, &io_mode);
Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode"));
ret = H5Pget_mpio_no_collective_cause(plist,
- &_local_no_collective_cause,
- &_global_no_collective_cause);
+ &local_no_collective_cause,
+ &global_no_collective_cause);
Assert(ret >= 0,
ExcMessage("Error at H5Pget_mpio_no_collective_cause"));
}
if (mpi)
{
- if (_query_io_mode)
+ if (query_io_mode)
{
- ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode);
+ ret = H5Pget_mpio_actual_io_mode(plist, &io_mode);
Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode"));
ret = H5Pget_mpio_no_collective_cause(plist,
- &_local_no_collective_cause,
- &_global_no_collective_cause);
+ &local_no_collective_cause,
+ &global_no_collective_cause);
Assert(ret >= 0,
ExcMessage("Error at H5Pget_mpio_no_collective_cause"));
}
void
DataSet::write(const Container &data)
{
- AssertDimension(_size, internal::get_container_size(data));
+ AssertDimension(size, internal::get_container_size(data));
std::shared_ptr<hid_t> t_type =
internal::get_hdf5_datatype<typename Container::value_type>();
hid_t plist;
if (mpi)
{
- if (_query_io_mode)
+ if (query_io_mode)
{
- ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode);
+ ret = H5Pget_mpio_actual_io_mode(plist, &io_mode);
Assert(ret >= 0, ExcInternalError());
ret = H5Pget_mpio_no_collective_cause(plist,
- &_local_no_collective_cause,
- &_global_no_collective_cause);
+ &local_no_collective_cause,
+ &global_no_collective_cause);
Assert(ret >= 0, ExcInternalError());
}
ret = H5Pclose(plist);
DataSet::write_selection(const std::vector<number> & data,
const std::vector<hsize_t> &coordinates)
{
- AssertDimension(coordinates.size(), data.size() * _rank);
+ AssertDimension(coordinates.size(), data.size() * rank);
std::shared_ptr<hid_t> t_type = internal::get_hdf5_datatype<number>();
std::vector<hsize_t> data_dimensions = {data.size()};
if (mpi)
{
- if (_query_io_mode)
+ if (query_io_mode)
{
- ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode);
+ ret = H5Pget_mpio_actual_io_mode(plist, &io_mode);
Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode"));
ret = H5Pget_mpio_no_collective_cause(plist,
- &_local_no_collective_cause,
- &_global_no_collective_cause);
+ &local_no_collective_cause,
+ &global_no_collective_cause);
Assert(ret >= 0,
ExcMessage("Error at H5Pget_mpio_no_collective_cause"));
}
if (mpi)
{
- if (_query_io_mode)
+ if (query_io_mode)
{
- ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode);
+ ret = H5Pget_mpio_actual_io_mode(plist, &io_mode);
Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode"));
ret = H5Pget_mpio_no_collective_cause(plist,
- &_local_no_collective_cause,
- &_global_no_collective_cause);
+ &local_no_collective_cause,
+ &global_no_collective_cause);
Assert(ret >= 0,
ExcMessage("Error at H5Pget_mpio_no_collective_cause"));
}
if (mpi)
{
- if (_query_io_mode)
+ if (query_io_mode)
{
- ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode);
+ ret = H5Pget_mpio_actual_io_mode(plist, &io_mode);
Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode"));
ret = H5Pget_mpio_no_collective_cause(plist,
- &_local_no_collective_cause,
- &_global_no_collective_cause);
+ &local_no_collective_cause,
+ &global_no_collective_cause);
Assert(ret >= 0,
ExcMessage("Error at H5Pget_mpio_no_collective_cause"));
}
if (mpi)
{
- if (_query_io_mode)
+ if (query_io_mode)
{
- ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode);
+ ret = H5Pget_mpio_actual_io_mode(plist, &io_mode);
Assert(ret >= 0, ExcInternalError());
ret = H5Pget_mpio_no_collective_cause(plist,
- &_local_no_collective_cause,
- &_global_no_collective_cause);
+ &local_no_collective_cause,
+ &global_no_collective_cause);
Assert(ret >= 0, ExcInternalError());
}
ret = H5Pclose(plist);
template <>
H5D_mpio_actual_io_mode_t
- DataSet::io_mode()
+ DataSet::get_io_mode()
{
- Assert(_query_io_mode,
+ Assert(query_io_mode,
ExcMessage(
- "query_io_mode() should be true in order to use io_mode()"));
- return _io_mode;
+ "query_io_mode should be true in order to use get_io_mode"));
+ return io_mode;
}
template <>
std::string
- DataSet::io_mode()
+ DataSet::get_io_mode()
{
- Assert(_query_io_mode,
- ExcMessage(
- "query_io_mode() should be true in order to use io_mode()"));
- switch (_io_mode)
+ Assert(query_io_mode,
+ ExcMessage("query_io_mode should be true in order to use io_mode"));
+ switch (io_mode)
{
case (H5D_MPIO_NO_COLLECTIVE):
return std::string("H5D_MPIO_NO_COLLECTIVE");
template <>
uint32_t
- DataSet::local_no_collective_cause()
+ DataSet::get_local_no_collective_cause()
{
Assert(
- _query_io_mode,
+ query_io_mode,
ExcMessage(
- "query_io_mode() should be true in order to use local_no_collective_cause()"));
- return _local_no_collective_cause;
+ "query_io_mode should be true in order to use get_local_no_collective_cause()"));
+ return local_no_collective_cause;
}
template <>
std::string
- DataSet::local_no_collective_cause()
+ DataSet::get_local_no_collective_cause()
{
Assert(
- _query_io_mode,
+ query_io_mode,
ExcMessage(
- "query_io_mode() should be true in order to use local_no_collective_cause()"));
- return internal::no_collective_cause_to_string(_local_no_collective_cause);
+ "query_io_mode should be true in order to use get_local_no_collective_cause()"));
+ return internal::no_collective_cause_to_string(local_no_collective_cause);
}
template <>
uint32_t
- DataSet::global_no_collective_cause()
+ DataSet::get_global_no_collective_cause()
{
Assert(
- _query_io_mode,
+ query_io_mode,
ExcMessage(
- "query_io_mode() should be true in order to use global_no_collective_cause()"));
- return _global_no_collective_cause;
+ "query_io_mode should be true in order to use get_global_no_collective_cause()"));
+ return global_no_collective_cause;
}
template <>
std::string
- DataSet::global_no_collective_cause()
+ DataSet::get_global_no_collective_cause()
{
Assert(
- _query_io_mode,
+ query_io_mode,
ExcMessage(
- "query_io_mode() should be true in order to use global_no_collective_cause()"));
- return internal::no_collective_cause_to_string(_global_no_collective_cause);
+ "query_io_mode should be true in order to use get_global_no_collective_cause()"));
+ return internal::no_collective_cause_to_string(global_no_collective_cause);
}
bool
- DataSet::query_io_mode() const
+ DataSet::get_query_io_mode() const
{
- return _query_io_mode;
+ return query_io_mode;
}
void
- DataSet::query_io_mode(bool query_io_mode)
+ DataSet::set_query_io_mode(bool new_query_io_mode)
{
- _query_io_mode = query_io_mode;
+ query_io_mode = new_query_io_mode;
}
std::vector<hsize_t>
- DataSet::dimensions() const
+ DataSet::get_dimensions() const
{
- return _dimensions;
+ return dimensions;
}
unsigned int
- DataSet::size() const
+ DataSet::get_size() const
{
- return _size;
+ return size;
}
unsigned int
- DataSet::rank() const
+ DataSet::get_rank() const
{
- return _rank;
+ return rank;
}
// std::complex<float> and std::complex<double> in hdf5.inst
template int
- HDF5Object::attr<int>(const std::string &attr_name);
+ HDF5Object::get_attribute<int>(const std::string &attr_name);
template unsigned int
- HDF5Object::attr<unsigned int>(const std::string &attr_name);
- // The specializations of HDF5Object::attr<std::string>
- // and HDF5Object::attr<bool> have been defined above
+ HDF5Object::get_attribute<unsigned int>(const std::string &attr_name);
+ // The specializations of HDF5Object::get_attribute<std::string>
+ // and HDF5Object::get_attribute<bool> have been defined above
template void
- HDF5Object::write_attr<int>(const std::string &attr_name, int value);
+ HDF5Object::set_attribute<int>(const std::string &attr_name, int value);
template void
- HDF5Object::write_attr<unsigned int>(const std::string &attr_name,
- unsigned int value);
+ HDF5Object::set_attribute<unsigned int>(const std::string &attr_name,
+ unsigned int value);
template std::vector<int>
DataSet::read<std::vector<int>>();
for (number : REAL_AND_COMPLEX_SCALARS)
{
- template number HDF5Object::attr<number>(const std::string &attr_name);
- template void HDF5Object::write_attr<number>(const std::string &attr_name,
- number value);
+ template number HDF5Object::get_attribute<number>(
+ const std::string &attr_name);
+ template void HDF5Object::set_attribute<number>(
+ const std::string &attr_name, number value);
template std::vector<number> DataSet::read<std::vector<number>>();
template Vector<number> DataSet::read<Vector<number>>();
const double root_double = 6.234542e3;
const int root_int = -56;
const unsigned int root_unsigned_int = 22;
- data_file.write_attr("root_float", root_float);
- data_file.write_attr("root_double", root_double);
- data_file.write_attr("root_int", root_int);
- data_file.write_attr("root_unsigned_int", root_unsigned_int);
- data_file.write_attr("root_total",
- (root_float + root_double) * root_int *
- root_unsigned_int);
+ data_file.set_attribute("root_float", root_float);
+ data_file.set_attribute("root_double", root_double);
+ data_file.set_attribute("root_int", root_int);
+ data_file.set_attribute("root_unsigned_int", root_unsigned_int);
+ data_file.set_attribute("root_total",
+ (root_float + root_double) * root_int *
+ root_unsigned_int);
// Create attributes attached to a group
auto test_group = data_file.create_group("test_group");
const std::complex<float> group_complex_float = {2.45681934e5, 45e2};
const std::complex<double> group_complex_double = {6.234542e3, 2};
- test_group.write_attr("group_complex_float", group_complex_float);
- test_group.write_attr("group_complex_double", group_complex_double);
- test_group.write_attr("group_complex_total",
- group_complex_float * group_complex_double);
- test_group.write_attr("group_string", std::string("test_string_attribute"));
+ test_group.set_attribute("group_complex_float", group_complex_float);
+ test_group.set_attribute("group_complex_double", group_complex_double);
+ test_group.set_attribute("group_complex_total",
+ group_complex_float * group_complex_double);
+ test_group.set_attribute("group_string",
+ std::string("test_string_attribute"));
// Create attributes attached to a dataset
const std::vector<hsize_t> dimensions = {50, 30};
auto test_dataset =
test_group.create_dataset<double>("test_dataset", dimensions);
- test_dataset.write_attr("dataset_double", 20.2);
- test_dataset.write_attr("dataset_string",
- std::string("test_dataset_attribute"));
+ test_dataset.set_attribute("dataset_double", 20.2);
+ test_dataset.set_attribute("dataset_string",
+ std::string("test_dataset_attribute"));
}
// Read data
{
// Read attributes attached to the root
HDF5::File data_file(filename, HDF5::File::Mode::open);
- auto root_float = data_file.attr<float>("root_float");
- auto root_double = data_file.attr<double>("root_double");
- auto root_int = data_file.attr<int>("root_int");
- auto root_unsigned_int = data_file.attr<unsigned int>("root_unsigned_int");
+ auto root_float = data_file.get_attribute<float>("root_float");
+ auto root_double = data_file.get_attribute<double>("root_double");
+ auto root_int = data_file.get_attribute<int>("root_int");
+ auto root_unsigned_int =
+ data_file.get_attribute<unsigned int>("root_unsigned_int");
// calculated and read should be the same
deallog << "root_total calculated:"
<< (root_float + root_double) * root_int * root_unsigned_int
<< std::endl;
- deallog << "root_total read:" << data_file.attr<double>("root_total")
- << std::endl;
+ deallog << "root_total read:"
+ << data_file.get_attribute<double>("root_total") << std::endl;
// Read attributes attached to a group
auto test_group = data_file.group("test_group");
auto group_complex_float =
- test_group.attr<std::complex<float>>("group_complex_float");
+ test_group.get_attribute<std::complex<float>>("group_complex_float");
auto group_complex_double =
- test_group.attr<std::complex<double>>("group_complex_double");
+ test_group.get_attribute<std::complex<double>>("group_complex_double");
deallog << "group_complex_total calculated:"
<< (group_complex_float * group_complex_double) << std::endl;
deallog << "group_complex_total read:"
- << test_group.attr<std::complex<double>>("group_complex_total")
+ << test_group.get_attribute<std::complex<double>>(
+ "group_complex_total")
<< std::endl;
deallog << "group_string read:"
- << test_group.attr<std::string>("group_string") << std::endl;
+ << test_group.get_attribute<std::string>("group_string")
+ << std::endl;
// Read attributes attached to a dataset
auto test_dataset = test_group.dataset("test_dataset");
deallog << "dataset_double read:"
- << test_dataset.attr<double>("dataset_double") << std::endl;
+ << test_dataset.get_attribute<double>("dataset_double")
+ << std::endl;
deallog << "dataset_string read:"
- << test_dataset.attr<std::string>("dataset_string") << std::endl;
+ << test_dataset.get_attribute<std::string>("dataset_string")
+ << std::endl;
}
}
const double root_double = 6.234542e3;
const int root_int = -56;
const unsigned int root_unsigned_int = 22;
- data_file.write_attr("root_float", root_float);
- data_file.write_attr("root_double", root_double);
- data_file.write_attr("root_int", root_int);
- data_file.write_attr("root_unsigned_int", root_unsigned_int);
- data_file.write_attr("root_total",
- (root_float + root_double) * root_int *
- root_unsigned_int);
+ data_file.set_attribute("root_float", root_float);
+ data_file.set_attribute("root_double", root_double);
+ data_file.set_attribute("root_int", root_int);
+ data_file.set_attribute("root_unsigned_int", root_unsigned_int);
+ data_file.set_attribute("root_total",
+ (root_float + root_double) * root_int *
+ root_unsigned_int);
// Create attributes attached to a group
auto test_group = data_file.create_group("test_group");
const std::complex<float> group_complex_float = {2.45681934e5, 45e2};
const std::complex<double> group_complex_double = {6.234542e3, 2};
- test_group.write_attr("group_complex_float", group_complex_float);
- test_group.write_attr("group_complex_double", group_complex_double);
- test_group.write_attr("group_complex_total",
- group_complex_float * group_complex_double);
- test_group.write_attr("group_string", std::string("test_string_attribute"));
+ test_group.set_attribute("group_complex_float", group_complex_float);
+ test_group.set_attribute("group_complex_double", group_complex_double);
+ test_group.set_attribute("group_complex_total",
+ group_complex_float * group_complex_double);
+ test_group.set_attribute("group_string",
+ std::string("test_string_attribute"));
// Create attributes attached to a dataset
const std::vector<hsize_t> dimensions = {50, 30};
auto test_dataset =
test_group.create_dataset<double>("test_dataset", dimensions);
- test_dataset.write_attr("dataset_double", 20.2);
- test_dataset.write_attr("dataset_string",
- std::string("test_dataset_attribute"));
+ test_dataset.set_attribute("dataset_double", 20.2);
+ test_dataset.set_attribute("dataset_string",
+ std::string("test_dataset_attribute"));
}
// Read data
{
// Read attributes attached to the root
HDF5::File data_file(filename, MPI_COMM_WORLD, HDF5::File::Mode::open);
- auto root_float = data_file.attr<float>("root_float");
- auto root_double = data_file.attr<double>("root_double");
- auto root_int = data_file.attr<int>("root_int");
- auto root_unsigned_int = data_file.attr<unsigned int>("root_unsigned_int");
+ auto root_float = data_file.get_attribute<float>("root_float");
+ auto root_double = data_file.get_attribute<double>("root_double");
+ auto root_int = data_file.get_attribute<int>("root_int");
+ auto root_unsigned_int =
+ data_file.get_attribute<unsigned int>("root_unsigned_int");
// calculated and read should be the same
deallog << "root_total calculated:"
<< (root_float + root_double) * root_int * root_unsigned_int
<< std::endl;
- deallog << "root_total read:" << data_file.attr<double>("root_total")
- << std::endl;
+ deallog << "root_total read:"
+ << data_file.get_attribute<double>("root_total") << std::endl;
// Read attributes attached to a group
auto test_group = data_file.group("test_group");
auto group_complex_float =
- test_group.attr<std::complex<float>>("group_complex_float");
+ test_group.get_attribute<std::complex<float>>("group_complex_float");
auto group_complex_double =
- test_group.attr<std::complex<double>>("group_complex_double");
+ test_group.get_attribute<std::complex<double>>("group_complex_double");
deallog << "group_complex_total calculated:"
<< (group_complex_float * group_complex_double) << std::endl;
deallog << "group_complex_total read:"
- << test_group.attr<std::complex<double>>("group_complex_total")
+ << test_group.get_attribute<std::complex<double>>(
+ "group_complex_total")
<< std::endl;
deallog << "group_string read:"
- << test_group.attr<std::string>("group_string") << std::endl;
+ << test_group.get_attribute<std::string>("group_string")
+ << std::endl;
// Read attributes attached to a dataset
auto test_dataset = test_group.dataset("test_dataset");
deallog << "dataset_double read:"
- << test_dataset.attr<double>("dataset_double") << std::endl;
+ << test_dataset.get_attribute<double>("dataset_double")
+ << std::endl;
deallog << "dataset_string read:"
- << test_dataset.attr<std::string>("dataset_string") << std::endl;
+ << test_dataset.get_attribute<std::string>("dataset_string")
+ << std::endl;
}
}
std::string dataset_name("dataset_1");
auto dataset =
group.create_dataset<Number>(dataset_name, dataset_dimensions);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.dimensions() << std::endl;
+ << " (Write): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.size() << std::endl;
+ << " (Write): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.rank() << std::endl;
+ << " (Write): " << dataset.get_rank() << std::endl;
auto data = initialize_container<Container, Number>(dataset_dimensions);
assign_data(data);
if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)
<< " (Write): " << container_sum(data) << std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.template io_mode<std::string>()
+ << " (Write): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
std::string dataset_name("dataset_2");
auto dataset =
group.create_dataset<Number>(dataset_name, dataset_dimensions);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.dimensions() << std::endl;
+ << " (Write): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.size() << std::endl;
+ << " (Write): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.rank() << std::endl;
+ << " (Write): " << dataset.get_rank() << std::endl;
std::vector<hsize_t> coordinates_a = {0,
0, // first point
<< std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.template io_mode<std::string>()
+ << " (Write): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
std::string dataset_name("dataset_3");
auto dataset =
group.create_dataset<Number>(dataset_name, dataset_dimensions);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.dimensions() << std::endl;
+ << " (Write): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.size() << std::endl;
+ << " (Write): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.rank() << std::endl;
+ << " (Write): " << dataset.get_rank() << std::endl;
auto data = initialize_container<Container, double>(dataset_dimensions);
assign_data(data);
if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)
std::string dataset_name("dataset_3");
auto dataset =
group.create_dataset<Number>(dataset_name, dataset_dimensions);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
auto data = initialize_container<Container, float>(dataset_dimensions);
assign_data(data);
if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)
<< " (Write): " << container_sum(data) << std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.template io_mode<std::string>()
+ << " (Write): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
}
std::string dataset_name("dataset_4");
auto dataset =
group.create_dataset<Number>(dataset_name, dataset_dimensions);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.dimensions() << std::endl;
+ << " (Write): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.size() << std::endl;
+ << " (Write): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.rank() << std::endl;
+ << " (Write): " << dataset.get_rank() << std::endl;
const std::vector<hsize_t> hyperslab_dimensions_a = {2, 5};
const std::vector<hsize_t> hyperslab_offset_a = {0, 0};
auto hyperslab_data_a =
<< " (Write): " << container_sum(hyperslab_data_b) << std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.template io_mode<std::string>()
+ << " (Write): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
}
{
std::string dataset_name("dataset_1");
auto dataset = group.dataset(dataset_name);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.dimensions() << std::endl;
+ << " (Read): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.size() << std::endl;
+ << " (Read): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.rank() << std::endl;
+ << " (Read): " << dataset.get_rank() << std::endl;
Container<Number> data = dataset.read<Container<Number>>();
deallog << "Sum " + dataset_name << " " << container_name << "<"
<< type_name << ">"
<< " (Read): " << container_sum(data) << std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
{
std::string dataset_name("dataset_2");
auto dataset = group.dataset(dataset_name);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.dimensions() << std::endl;
+ << " (Read): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.size() << std::endl;
+ << " (Read): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.rank() << std::endl;
+ << " (Read): " << dataset.get_rank() << std::endl;
{
Container<Number> data = dataset.read<Container<Number>>();
deallog << "Sum " + dataset_name << " " << container_name << "<"
<< " (Read): " << container_sum(data) << std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
<< data_a[2] << ", " << data_a[3] << std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
}
{
std::string dataset_name("dataset_3");
auto dataset = group.dataset(dataset_name);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.dimensions() << std::endl;
+ << " (Read): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.size() << std::endl;
+ << " (Read): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.rank() << std::endl;
+ << " (Read): " << dataset.get_rank() << std::endl;
Container<Number> data = dataset.read<Container<Number>>();
deallog << "Sum " + dataset_name << " " << container_name << "<"
<< type_name << ">"
<< " (Read): " << container_sum(data) << std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
}
{
std::string dataset_name("dataset_4");
auto dataset = group.dataset(dataset_name);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.dimensions() << std::endl;
+ << " (Read): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.size() << std::endl;
+ << " (Read): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.rank() << std::endl;
+ << " (Read): " << dataset.get_rank() << std::endl;
{
Container<Number> data = dataset.read<Container<Number>>();
deallog << "Sum " + dataset_name << " " << container_name << "<"
<< " (Read): " << container_sum(data) << std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
<< " (Read): " << container_sum(data_a) << std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
<< " (Read): " << container_sum(data_b) << std::endl;
pcout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
pcout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
pcout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
}
std::string dataset_name("dataset_1");
auto dataset =
group.create_dataset<Number>(dataset_name, dataset_dimensions);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.dimensions() << std::endl;
+ << " (Write): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.size() << std::endl;
+ << " (Write): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.rank() << std::endl;
+ << " (Write): " << dataset.get_rank() << std::endl;
auto data = initialize_container<Container, Number>(dataset_dimensions);
assign_data(data);
dataset.write(data);
<< " (Write): " << container_sum(data) << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.template io_mode<std::string>()
+ << " (Write): " << dataset.template get_io_mode<std::string>()
<< std::endl;
std::cout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
std::cout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
std::string dataset_name("dataset_2");
auto dataset =
group.create_dataset<Number>(dataset_name, dataset_dimensions);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.dimensions() << std::endl;
+ << " (Write): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.size() << std::endl;
+ << " (Write): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.rank() << std::endl;
+ << " (Write): " << dataset.get_rank() << std::endl;
std::vector<hsize_t> coordinates_a = {0,
0, // first point
<< std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.template io_mode<std::string>()
+ << " (Write): " << dataset.template get_io_mode<std::string>()
<< std::endl;
std::cout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
std::cout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
std::string dataset_name("dataset_3");
auto dataset =
group.create_dataset<Number>(dataset_name, dataset_dimensions);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.dimensions() << std::endl;
+ << " (Write): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.size() << std::endl;
+ << " (Write): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.rank() << std::endl;
+ << " (Write): " << dataset.get_rank() << std::endl;
auto data = initialize_container<Container, double>(dataset_dimensions);
assign_data(data);
dataset.write(data);
std::string dataset_name("dataset_3");
auto dataset =
group.create_dataset<Number>(dataset_name, dataset_dimensions);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
auto data = initialize_container<Container, float>(dataset_dimensions);
assign_data(data);
dataset.write(data);
<< " (Write): " << container_sum(data) << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.template io_mode<std::string>()
- << std::endl;
- std::cout << "Local no collective cause " + dataset_name << " "
- << container_name << "<" << type_name << ">"
- << " (Write): "
- << dataset.template local_no_collective_cause<std::string>()
- << std::endl;
- std::cout << "Global no collective cause " + dataset_name << " "
- << container_name << "<" << type_name << ">"
- << " (Write): "
- << dataset.template global_no_collective_cause<std::string>()
+ << " (Write): " << dataset.template get_io_mode<std::string>()
<< std::endl;
+ std::cout
+ << "Local no collective cause " + dataset_name << " "
+ << container_name << "<" << type_name << ">"
+ << " (Write): "
+ << dataset.template get_local_no_collective_cause<std::string>()
+ << std::endl;
+ std::cout
+ << "Global no collective cause " + dataset_name << " "
+ << container_name << "<" << type_name << ">"
+ << " (Write): "
+ << dataset.template get_global_no_collective_cause<std::string>()
+ << std::endl;
}
}
std::string dataset_name("dataset_4");
auto dataset =
group.create_dataset<Number>(dataset_name, dataset_dimensions);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.dimensions() << std::endl;
+ << " (Write): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.size() << std::endl;
+ << " (Write): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.rank() << std::endl;
+ << " (Write): " << dataset.get_rank() << std::endl;
const std::vector<hsize_t> hyperslab_dimensions_a = {2, 5};
const std::vector<hsize_t> hyperslab_offset_a = {0, 0};
auto hyperslab_data_a =
<< " (Write): " << container_sum(hyperslab_data_b) << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Write): " << dataset.template io_mode<std::string>()
+ << " (Write): " << dataset.template get_io_mode<std::string>()
<< std::endl;
std::cout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
std::cout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Write): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
{
std::string dataset_name("dataset_1");
auto dataset = group.dataset(dataset_name);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.dimensions() << std::endl;
+ << " (Read): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.size() << std::endl;
+ << " (Read): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.rank() << std::endl;
+ << " (Read): " << dataset.get_rank() << std::endl;
Container<Number> data = dataset.read<Container<Number>>();
deallog << "Sum " + dataset_name << " " << container_name << "<"
<< type_name << ">"
<< " (Read): " << container_sum(data) << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
std::cout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
std::cout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
{
std::string dataset_name("dataset_2");
auto dataset = group.dataset(dataset_name);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.dimensions() << std::endl;
+ << " (Read): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.size() << std::endl;
+ << " (Read): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.rank() << std::endl;
+ << " (Read): " << dataset.get_rank() << std::endl;
{
Container<Number> data = dataset.read<Container<Number>>();
deallog << "Sum " + dataset_name << " " << container_name << "<"
<< " (Read): " << container_sum(data) << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
std::cout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
- << std::endl;
- std::cout << "Global no collective cause " + dataset_name << " "
- << container_name << "<" << type_name << ">"
- << " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
+ std::cout
+ << "Global no collective cause " + dataset_name << " " << container_name
+ << "<" << type_name << ">"
+ << " (Read): "
+ << dataset.template get_global_no_collective_cause<std::string>()
+ << std::endl;
}
{
<< data_a[2] << ", " << data_a[3] << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
std::cout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
- << std::endl;
- std::cout << "Global no collective cause " + dataset_name << " "
- << container_name << "<" << type_name << ">"
- << " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
+ std::cout
+ << "Global no collective cause " + dataset_name << " " << container_name
+ << "<" << type_name << ">"
+ << " (Read): "
+ << dataset.template get_global_no_collective_cause<std::string>()
+ << std::endl;
}
}
{
std::string dataset_name("dataset_3");
auto dataset = group.dataset(dataset_name);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.dimensions() << std::endl;
+ << " (Read): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.size() << std::endl;
+ << " (Read): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.rank() << std::endl;
+ << " (Read): " << dataset.get_rank() << std::endl;
Container<Number> data = dataset.read<Container<Number>>();
deallog << "Sum " + dataset_name << " " << container_name << "<"
<< type_name << ">"
<< " (Read): " << container_sum(data) << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
- << std::endl;
- std::cout << "Local no collective cause " + dataset_name << " "
- << container_name << "<" << type_name << ">"
- << " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
- << std::endl;
- std::cout << "Global no collective cause " + dataset_name << " "
- << container_name << "<" << type_name << ">"
- << " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
+ std::cout
+ << "Local no collective cause " + dataset_name << " "
+ << container_name << "<" << type_name << ">"
+ << " (Read): "
+ << dataset.template get_local_no_collective_cause<std::string>()
+ << std::endl;
+ std::cout
+ << "Global no collective cause " + dataset_name << " "
+ << container_name << "<" << type_name << ">"
+ << " (Read): "
+ << dataset.template get_global_no_collective_cause<std::string>()
+ << std::endl;
}
}
{
std::string dataset_name("dataset_4");
auto dataset = group.dataset(dataset_name);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.dimensions() << std::endl;
+ << " (Read): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.size() << std::endl;
+ << " (Read): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.rank() << std::endl;
+ << " (Read): " << dataset.get_rank() << std::endl;
{
Container<Number> data = dataset.read<Container<Number>>();
deallog << "Sum " + dataset_name << " " << container_name << "<"
<< " (Read): " << container_sum(data) << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
std::cout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
- << std::endl;
- std::cout << "Global no collective cause " + dataset_name << " "
- << container_name << "<" << type_name << ">"
- << " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
+ std::cout
+ << "Global no collective cause " + dataset_name << " " << container_name
+ << "<" << type_name << ">"
+ << " (Read): "
+ << dataset.template get_global_no_collective_cause<std::string>()
+ << std::endl;
}
{
<< " (Read): " << container_sum(data_a) << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
std::cout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
- << std::endl;
- std::cout << "Global no collective cause " + dataset_name << " "
- << container_name << "<" << type_name << ">"
- << " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
+ std::cout
+ << "Global no collective cause " + dataset_name << " " << container_name
+ << "<" << type_name << ">"
+ << " (Read): "
+ << dataset.template get_global_no_collective_cause<std::string>()
+ << std::endl;
}
{
<< " (Read): " << container_sum(data_b) << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
std::cout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
- << std::endl;
- std::cout << "Global no collective cause " + dataset_name << " "
- << container_name << "<" << type_name << ">"
- << " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
+ std::cout
+ << "Global no collective cause " + dataset_name << " " << container_name
+ << "<" << type_name << ">"
+ << " (Read): "
+ << dataset.template get_global_no_collective_cause<std::string>()
+ << std::endl;
}
}
{
std::string dataset_name("dataset_5");
auto dataset = group.dataset(dataset_name);
- dataset.query_io_mode(true);
+ dataset.set_query_io_mode(true);
deallog << "Dimensions " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.dimensions() << std::endl;
+ << " (Read): " << dataset.get_dimensions() << std::endl;
deallog << "Size " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.size() << std::endl;
+ << " (Read): " << dataset.get_size() << std::endl;
deallog << "Rank " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.rank() << std::endl;
+ << " (Read): " << dataset.get_rank() << std::endl;
Container<Number> data = dataset.read<Container<Number>>();
deallog << "Sum " + dataset_name << " " << container_name << "<"
<< type_name << ">"
<< " (Read): " << container_sum(data) << std::endl;
std::cout << "IO mode " + dataset_name << " " << container_name << "<"
<< type_name << ">"
- << " (Read): " << dataset.template io_mode<std::string>()
+ << " (Read): " << dataset.template get_io_mode<std::string>()
<< std::endl;
std::cout << "Local no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template local_no_collective_cause<std::string>()
+ << dataset.template get_local_no_collective_cause<std::string>()
<< std::endl;
std::cout << "Global no collective cause " + dataset_name << " "
<< container_name << "<" << type_name << ">"
<< " (Read): "
- << dataset.template global_no_collective_cause<std::string>()
+ << dataset.template get_global_no_collective_cause<std::string>()
<< std::endl;
}
}