From: Daniel Garcia-Sanchez Date: Mon, 8 Oct 2018 13:22:35 +0000 (+0200) Subject: Rename functions X-Git-Tag: v9.1.0-rc1~453^2~35 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=498c5f7675667a12629bc76e4406abf53c92df8f;p=dealii.git Rename functions --- diff --git a/include/deal.II/base/hdf5.h b/include/deal.II/base/hdf5.h index d6b890c073..8bd2485b21 100644 --- a/include/deal.II/base/hdf5.h +++ b/include/deal.II/base/hdf5.h @@ -59,17 +59,17 @@ DEAL_II_NAMESPACE_OPEN * HDF5::File::Mode::open); * hdf5::Group data = data_file.group("data"); * - * auto nb_frequency_points = data.attr("nb_frequency_points"); - * auto rho = data.attr("rho"); - * auto save_vtk_files = data.attr("save_vtk_files"); - * auto simulation_type = data.attr("simulation_type"); + * auto nb_frequency_points = data.get_attribute("nb_frequency_points"); + * auto rho = data.get_attribute("rho"); + * auto save_vtk_files = data.get_attribute("save_vtk_files"); + * auto simulation_type = data.get_attribute("simulation_type"); * * std::vector> 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: @@ -94,10 +94,11 @@ DEAL_II_NAMESPACE_OPEN * 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`, `std::complex`, - * `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`, + * `std::complex`, `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 @@ -105,11 +106,12 @@ DEAL_II_NAMESPACE_OPEN * @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("dataset_name", dimensions); - * dataset.write_attr("complex_double_attribute", std::complex(2,2.3)); + * dataset.set_attribute("complex_double_attribute", + * std::complex(2,2.3)); * @endcode * * # MPI I/O @@ -223,8 +225,8 @@ DEAL_II_NAMESPACE_OPEN * [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 @@ -247,7 +249,8 @@ DEAL_II_NAMESPACE_OPEN * pcout << "Local no collective cause: " * << dataset.local_no_collective_cause() << std::endl; * pcout << "Global no collective cause: " - * << dataset.global_no_collective_cause() << std::endl; + * << dataset.get_global_no_collective_cause() << + * std::endl; * } * @endcode * @@ -258,7 +261,8 @@ DEAL_II_NAMESPACE_OPEN * 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 @@ -329,7 +333,7 @@ namespace HDF5 */ template 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`, @@ -345,7 +349,7 @@ namespace HDF5 */ template 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; @@ -675,7 +679,7 @@ namespace HDF5 */ template T - io_mode(); + get_io_mode(); /** * This funcion retrieves the local causes that broke collective I/O on the @@ -701,7 +705,7 @@ namespace HDF5 */ template T - local_no_collective_cause(); + get_local_no_collective_cause(); /** * This funcion retrieves the global causes that broke collective I/O on the @@ -727,60 +731,102 @@ namespace HDF5 */ template 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 - 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 _dimensions; - std::shared_ptr 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 dimensions; + + /** + * HDF5 dataspace identifier + */ + std::shared_ptr 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 H5Pget_mpio_no_collective_cause. + */ + uint32_t local_no_collective_cause; + + /** + * Global causes that broke collective I/O on the + * last parallel I/O call. See H5Pget_mpio_no_collective_cause. + */ + uint32_t global_no_collective_cause; }; /** diff --git a/source/base/hdf5.cc b/source/base/hdf5.cc index 3df8b0e8d3..f69c268581 100644 --- a/source/base/hdf5.cc +++ b/source/base/hdf5.cc @@ -405,7 +405,7 @@ namespace HDF5 template T - HDF5Object::attr(const std::string &attr_name) + HDF5Object::get_attribute(const std::string &attr_name) { std::shared_ptr t_type = internal::get_hdf5_datatype(); T value; @@ -425,7 +425,7 @@ namespace HDF5 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; @@ -445,7 +445,7 @@ namespace HDF5 template <> std::string - HDF5Object::attr(const std::string &attr_name) + HDF5Object::get_attribute(const std::string &attr_name) { // Reads a UTF8 variable string // @@ -493,7 +493,7 @@ namespace HDF5 template 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; @@ -529,7 +529,8 @@ namespace HDF5 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 // @@ -587,10 +588,10 @@ namespace HDF5 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(new hid_t, [](auto pointer) { // Relase the HDF5 resource @@ -604,7 +605,7 @@ namespace HDF5 }); // 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; @@ -615,17 +616,17 @@ namespace HDF5 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(_rank)); - _dimensions.assign(dims, dims + _rank); + AssertDimension(rank_ret, static_cast(rank)); + dimensions.assign(dims, dims + rank); free(dims); - _size = 1; - for (auto &&dimension : _dimensions) + size = 1; + for (auto &&dimension : dimensions) { - _size *= dimension; + size *= dimension; } } @@ -637,12 +638,12 @@ namespace HDF5 std::shared_ptr 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(new hid_t, [](auto pointer) { // Relase the HDF5 resource @@ -655,7 +656,7 @@ namespace HDF5 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, @@ -667,10 +668,10 @@ namespace HDF5 H5P_DEFAULT); Assert(*hdf5_reference >= 0, ExcMessage("Error at H5Dcreate2")); - _size = 1; + size = 1; for (auto &&dimension : dimensions) { - _size *= dimension; + size *= dimension; } } @@ -684,7 +685,7 @@ namespace HDF5 internal::get_hdf5_datatype(); hid_t plist; - Container data = internal::initialize_container(_dimensions); + Container data = internal::initialize_container(dimensions); if (mpi) { @@ -708,13 +709,13 @@ namespace HDF5 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); @@ -730,7 +731,7 @@ namespace HDF5 std::vector DataSet::read_selection(const std::vector &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 t_type = internal::get_hdf5_datatype(); @@ -738,10 +739,10 @@ namespace HDF5 hid_t memory_dataspace; std::vector data_dimensions{ - static_cast(coordinates.size() / _rank)}; + static_cast(coordinates.size() / rank)}; std::vector data( - static_cast(coordinates.size() / _rank)); + static_cast(coordinates.size() / rank)); memory_dataspace = H5Screate_simple(1, data_dimensions.data(), NULL); Assert(memory_dataspace >= 0, ExcMessage("Error at H5Screate_simple")); @@ -773,13 +774,13 @@ namespace HDF5 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")); } @@ -840,13 +841,13 @@ namespace HDF5 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")); } @@ -898,13 +899,13 @@ namespace HDF5 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")); } @@ -922,7 +923,7 @@ namespace HDF5 void DataSet::write(const Container &data) { - AssertDimension(_size, internal::get_container_size(data)); + AssertDimension(size, internal::get_container_size(data)); std::shared_ptr t_type = internal::get_hdf5_datatype(); hid_t plist; @@ -949,13 +950,13 @@ namespace HDF5 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); @@ -970,7 +971,7 @@ namespace HDF5 DataSet::write_selection(const std::vector & data, const std::vector &coordinates) { - AssertDimension(coordinates.size(), data.size() * _rank); + AssertDimension(coordinates.size(), data.size() * rank); std::shared_ptr t_type = internal::get_hdf5_datatype(); std::vector data_dimensions = {data.size()}; @@ -1008,13 +1009,13 @@ namespace HDF5 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")); } @@ -1075,13 +1076,13 @@ namespace HDF5 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")); } @@ -1141,13 +1142,13 @@ namespace HDF5 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")); } @@ -1194,13 +1195,13 @@ namespace HDF5 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); @@ -1214,24 +1215,23 @@ namespace HDF5 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"); @@ -1262,92 +1262,92 @@ namespace HDF5 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 - 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; } @@ -1522,17 +1522,17 @@ namespace HDF5 // std::complex and std::complex in hdf5.inst template int - HDF5Object::attr(const std::string &attr_name); + HDF5Object::get_attribute(const std::string &attr_name); template unsigned int - HDF5Object::attr(const std::string &attr_name); - // The specializations of HDF5Object::attr - // and HDF5Object::attr have been defined above + HDF5Object::get_attribute(const std::string &attr_name); + // The specializations of HDF5Object::get_attribute + // and HDF5Object::get_attribute have been defined above template void - HDF5Object::write_attr(const std::string &attr_name, int value); + HDF5Object::set_attribute(const std::string &attr_name, int value); template void - HDF5Object::write_attr(const std::string &attr_name, - unsigned int value); + HDF5Object::set_attribute(const std::string &attr_name, + unsigned int value); template std::vector DataSet::read>(); diff --git a/source/base/hdf5.inst.in b/source/base/hdf5.inst.in index bf2273ad93..d082f7562d 100644 --- a/source/base/hdf5.inst.in +++ b/source/base/hdf5.inst.in @@ -16,9 +16,10 @@ for (number : REAL_AND_COMPLEX_SCALARS) { - template number HDF5Object::attr(const std::string &attr_name); - template void HDF5Object::write_attr(const std::string &attr_name, - number value); + template number HDF5Object::get_attribute( + const std::string &attr_name); + template void HDF5Object::set_attribute( + const std::string &attr_name, number value); template std::vector DataSet::read>(); template Vector DataSet::read>(); diff --git a/tests/base/hdf5_01.cc b/tests/base/hdf5_01.cc index 27c480789a..c38d277e23 100644 --- a/tests/base/hdf5_01.cc +++ b/tests/base/hdf5_01.cc @@ -36,23 +36,24 @@ test() 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 group_complex_float = {2.45681934e5, 45e2}; const std::complex 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 dimensions = {50, 30}; @@ -60,46 +61,51 @@ test() auto test_dataset = test_group.create_dataset("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("root_float"); - auto root_double = data_file.attr("root_double"); - auto root_int = data_file.attr("root_int"); - auto root_unsigned_int = data_file.attr("root_unsigned_int"); + auto root_float = data_file.get_attribute("root_float"); + auto root_double = data_file.get_attribute("root_double"); + auto root_int = data_file.get_attribute("root_int"); + auto root_unsigned_int = + data_file.get_attribute("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("root_total") - << std::endl; + deallog << "root_total read:" + << data_file.get_attribute("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>("group_complex_float"); + test_group.get_attribute>("group_complex_float"); auto group_complex_double = - test_group.attr>("group_complex_double"); + test_group.get_attribute>("group_complex_double"); deallog << "group_complex_total calculated:" << (group_complex_float * group_complex_double) << std::endl; deallog << "group_complex_total read:" - << test_group.attr>("group_complex_total") + << test_group.get_attribute>( + "group_complex_total") << std::endl; deallog << "group_string read:" - << test_group.attr("group_string") << std::endl; + << test_group.get_attribute("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("dataset_double") << std::endl; + << test_dataset.get_attribute("dataset_double") + << std::endl; deallog << "dataset_string read:" - << test_dataset.attr("dataset_string") << std::endl; + << test_dataset.get_attribute("dataset_string") + << std::endl; } } diff --git a/tests/base/hdf5_02.cc b/tests/base/hdf5_02.cc index ac497bb355..abb98a524a 100644 --- a/tests/base/hdf5_02.cc +++ b/tests/base/hdf5_02.cc @@ -36,23 +36,24 @@ test() 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 group_complex_float = {2.45681934e5, 45e2}; const std::complex 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 dimensions = {50, 30}; @@ -60,46 +61,51 @@ test() auto test_dataset = test_group.create_dataset("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("root_float"); - auto root_double = data_file.attr("root_double"); - auto root_int = data_file.attr("root_int"); - auto root_unsigned_int = data_file.attr("root_unsigned_int"); + auto root_float = data_file.get_attribute("root_float"); + auto root_double = data_file.get_attribute("root_double"); + auto root_int = data_file.get_attribute("root_int"); + auto root_unsigned_int = + data_file.get_attribute("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("root_total") - << std::endl; + deallog << "root_total read:" + << data_file.get_attribute("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>("group_complex_float"); + test_group.get_attribute>("group_complex_float"); auto group_complex_double = - test_group.attr>("group_complex_double"); + test_group.get_attribute>("group_complex_double"); deallog << "group_complex_total calculated:" << (group_complex_float * group_complex_double) << std::endl; deallog << "group_complex_total read:" - << test_group.attr>("group_complex_total") + << test_group.get_attribute>( + "group_complex_total") << std::endl; deallog << "group_string read:" - << test_group.attr("group_string") << std::endl; + << test_group.get_attribute("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("dataset_double") << std::endl; + << test_dataset.get_attribute("dataset_double") + << std::endl; deallog << "dataset_string read:" - << test_dataset.attr("dataset_string") << std::endl; + << test_dataset.get_attribute("dataset_string") + << std::endl; } } diff --git a/tests/base/hdf5_03.cc b/tests/base/hdf5_03.cc index 995a02ab45..b15e4e48cb 100644 --- a/tests/base/hdf5_03.cc +++ b/tests/base/hdf5_03.cc @@ -206,16 +206,16 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_1"); auto dataset = group.create_dataset(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(dataset_dimensions); assign_data(data); if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0) @@ -231,17 +231,17 @@ write_test(HDF5::Group & root_group, << " (Write): " << container_sum(data) << std::endl; pcout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Write): " << dataset.template io_mode() + << " (Write): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } @@ -249,16 +249,16 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_2"); auto dataset = group.create_dataset(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 coordinates_a = {0, 0, // first point @@ -316,17 +316,17 @@ write_test(HDF5::Group & root_group, << std::endl; pcout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Write): " << dataset.template io_mode() + << " (Write): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } @@ -338,16 +338,16 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_3"); auto dataset = group.create_dataset(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(dataset_dimensions); assign_data(data); if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0) @@ -367,7 +367,7 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_3"); auto dataset = group.create_dataset(dataset_name, dataset_dimensions); - dataset.query_io_mode(true); + dataset.set_query_io_mode(true); auto data = initialize_container(dataset_dimensions); assign_data(data); if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0) @@ -383,17 +383,17 @@ write_test(HDF5::Group & root_group, << " (Write): " << container_sum(data) << std::endl; pcout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Write): " << dataset.template io_mode() + << " (Write): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } } @@ -402,16 +402,16 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_4"); auto dataset = group.create_dataset(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 hyperslab_dimensions_a = {2, 5}; const std::vector hyperslab_offset_a = {0, 0}; auto hyperslab_data_a = @@ -478,17 +478,17 @@ write_test(HDF5::Group & root_group, << " (Write): " << container_sum(hyperslab_data_b) << std::endl; pcout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Write): " << dataset.template io_mode() + << " (Write): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } } @@ -547,49 +547,49 @@ read_test(HDF5::Group root_group, { 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 data = dataset.read>(); 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() + << " (Read): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << 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 data = dataset.read>(); deallog << "Sum " + dataset_name << " " << container_name << "<" @@ -597,17 +597,17 @@ read_test(HDF5::Group root_group, << " (Read): " << container_sum(data) << std::endl; pcout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Read): " << dataset.template io_mode() + << " (Read): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } @@ -627,17 +627,17 @@ read_test(HDF5::Group root_group, << data_a[2] << ", " << data_a[3] << std::endl; pcout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Read): " << dataset.template io_mode() + << " (Read): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } } @@ -650,33 +650,33 @@ read_test(HDF5::Group root_group, { 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 data = dataset.read>(); 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() + << " (Read): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } } @@ -684,16 +684,16 @@ read_test(HDF5::Group root_group, { 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 data = dataset.read>(); deallog << "Sum " + dataset_name << " " << container_name << "<" @@ -701,17 +701,17 @@ read_test(HDF5::Group root_group, << " (Read): " << container_sum(data) << std::endl; pcout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Read): " << dataset.template io_mode() + << " (Read): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } @@ -726,17 +726,17 @@ read_test(HDF5::Group root_group, << " (Read): " << container_sum(data_a) << std::endl; pcout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Read): " << dataset.template io_mode() + << " (Read): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } @@ -766,17 +766,17 @@ read_test(HDF5::Group root_group, << " (Read): " << container_sum(data_b) << std::endl; pcout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Read): " << dataset.template io_mode() + << " (Read): " << dataset.template get_io_mode() << std::endl; pcout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; pcout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } } diff --git a/tests/base/hdf5_04.cc b/tests/base/hdf5_04.cc index 3315b45552..9b329d4217 100644 --- a/tests/base/hdf5_04.cc +++ b/tests/base/hdf5_04.cc @@ -203,16 +203,16 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_1"); auto dataset = group.create_dataset(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(dataset_dimensions); assign_data(data); dataset.write(data); @@ -221,17 +221,17 @@ write_test(HDF5::Group & root_group, << " (Write): " << container_sum(data) << std::endl; std::cout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Write): " << dataset.template io_mode() + << " (Write): " << dataset.template get_io_mode() << std::endl; std::cout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; std::cout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } @@ -239,16 +239,16 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_2"); auto dataset = group.create_dataset(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 coordinates_a = {0, 0, // first point @@ -293,17 +293,17 @@ write_test(HDF5::Group & root_group, << std::endl; std::cout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Write): " << dataset.template io_mode() + << " (Write): " << dataset.template get_io_mode() << std::endl; std::cout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; std::cout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } @@ -315,16 +315,16 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_3"); auto dataset = group.create_dataset(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(dataset_dimensions); assign_data(data); dataset.write(data); @@ -337,7 +337,7 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_3"); auto dataset = group.create_dataset(dataset_name, dataset_dimensions); - dataset.query_io_mode(true); + dataset.set_query_io_mode(true); auto data = initialize_container(dataset_dimensions); assign_data(data); dataset.write(data); @@ -346,18 +346,20 @@ write_test(HDF5::Group & root_group, << " (Write): " << container_sum(data) << std::endl; std::cout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Write): " << dataset.template io_mode() - << std::endl; - std::cout << "Local no collective cause " + dataset_name << " " - << container_name << "<" << type_name << ">" - << " (Write): " - << dataset.template local_no_collective_cause() - << std::endl; - std::cout << "Global no collective cause " + dataset_name << " " - << container_name << "<" << type_name << ">" - << " (Write): " - << dataset.template global_no_collective_cause() + << " (Write): " << dataset.template get_io_mode() << std::endl; + std::cout + << "Local no collective cause " + dataset_name << " " + << container_name << "<" << type_name << ">" + << " (Write): " + << dataset.template get_local_no_collective_cause() + << std::endl; + std::cout + << "Global no collective cause " + dataset_name << " " + << container_name << "<" << type_name << ">" + << " (Write): " + << dataset.template get_global_no_collective_cause() + << std::endl; } } @@ -365,16 +367,16 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_4"); auto dataset = group.create_dataset(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 hyperslab_dimensions_a = {2, 5}; const std::vector hyperslab_offset_a = {0, 0}; auto hyperslab_data_a = @@ -424,17 +426,17 @@ write_test(HDF5::Group & root_group, << " (Write): " << container_sum(hyperslab_data_b) << std::endl; std::cout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Write): " << dataset.template io_mode() + << " (Write): " << dataset.template get_io_mode() << std::endl; std::cout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; std::cout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } @@ -501,49 +503,49 @@ read_test(HDF5::Group root_group) { 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 data = dataset.read>(); 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() + << " (Read): " << dataset.template get_io_mode() << std::endl; std::cout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; std::cout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << 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 data = dataset.read>(); deallog << "Sum " + dataset_name << " " << container_name << "<" @@ -551,18 +553,19 @@ read_test(HDF5::Group root_group) << " (Read): " << container_sum(data) << std::endl; std::cout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Read): " << dataset.template io_mode() + << " (Read): " << dataset.template get_io_mode() << std::endl; std::cout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() - << std::endl; - std::cout << "Global no collective cause " + dataset_name << " " - << container_name << "<" << type_name << ">" - << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; + std::cout + << "Global no collective cause " + dataset_name << " " << container_name + << "<" << type_name << ">" + << " (Read): " + << dataset.template get_global_no_collective_cause() + << std::endl; } { @@ -581,18 +584,19 @@ read_test(HDF5::Group root_group) << data_a[2] << ", " << data_a[3] << std::endl; std::cout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Read): " << dataset.template io_mode() + << " (Read): " << dataset.template get_io_mode() << std::endl; std::cout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() - << std::endl; - std::cout << "Global no collective cause " + dataset_name << " " - << container_name << "<" << type_name << ">" - << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; + std::cout + << "Global no collective cause " + dataset_name << " " << container_name + << "<" << type_name << ">" + << " (Read): " + << dataset.template get_global_no_collective_cause() + << std::endl; } } @@ -604,50 +608,52 @@ read_test(HDF5::Group root_group) { 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 data = dataset.read>(); 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::endl; - std::cout << "Local no collective cause " + dataset_name << " " - << container_name << "<" << type_name << ">" - << " (Read): " - << dataset.template local_no_collective_cause() - << std::endl; - std::cout << "Global no collective cause " + dataset_name << " " - << container_name << "<" << type_name << ">" - << " (Read): " - << dataset.template global_no_collective_cause() + << " (Read): " << dataset.template get_io_mode() << std::endl; + std::cout + << "Local no collective cause " + dataset_name << " " + << container_name << "<" << type_name << ">" + << " (Read): " + << dataset.template get_local_no_collective_cause() + << std::endl; + std::cout + << "Global no collective cause " + dataset_name << " " + << container_name << "<" << type_name << ">" + << " (Read): " + << dataset.template get_global_no_collective_cause() + << 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 data = dataset.read>(); deallog << "Sum " + dataset_name << " " << container_name << "<" @@ -655,18 +661,19 @@ read_test(HDF5::Group root_group) << " (Read): " << container_sum(data) << std::endl; std::cout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Read): " << dataset.template io_mode() + << " (Read): " << dataset.template get_io_mode() << std::endl; std::cout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() - << std::endl; - std::cout << "Global no collective cause " + dataset_name << " " - << container_name << "<" << type_name << ">" - << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; + std::cout + << "Global no collective cause " + dataset_name << " " << container_name + << "<" << type_name << ">" + << " (Read): " + << dataset.template get_global_no_collective_cause() + << std::endl; } { @@ -680,18 +687,19 @@ read_test(HDF5::Group root_group) << " (Read): " << container_sum(data_a) << std::endl; std::cout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Read): " << dataset.template io_mode() + << " (Read): " << dataset.template get_io_mode() << std::endl; std::cout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() - << std::endl; - std::cout << "Global no collective cause " + dataset_name << " " - << container_name << "<" << type_name << ">" - << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; + std::cout + << "Global no collective cause " + dataset_name << " " << container_name + << "<" << type_name << ">" + << " (Read): " + << dataset.template get_global_no_collective_cause() + << std::endl; } { @@ -705,51 +713,52 @@ read_test(HDF5::Group root_group) << " (Read): " << container_sum(data_b) << std::endl; std::cout << "IO mode " + dataset_name << " " << container_name << "<" << type_name << ">" - << " (Read): " << dataset.template io_mode() + << " (Read): " << dataset.template get_io_mode() << std::endl; std::cout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() - << std::endl; - std::cout << "Global no collective cause " + dataset_name << " " - << container_name << "<" << type_name << ">" - << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; + std::cout + << "Global no collective cause " + dataset_name << " " << container_name + << "<" << type_name << ">" + << " (Read): " + << dataset.template get_global_no_collective_cause() + << 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 data = dataset.read>(); 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() + << " (Read): " << dataset.template get_io_mode() << std::endl; std::cout << "Local no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template local_no_collective_cause() + << dataset.template get_local_no_collective_cause() << std::endl; std::cout << "Global no collective cause " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " - << dataset.template global_no_collective_cause() + << dataset.template get_global_no_collective_cause() << std::endl; } }