From 76657b3fa7f8bce9fa3598d197db729577c6851c Mon Sep 17 00:00:00 2001 From: Daniel Garcia-Sanchez Date: Thu, 4 Oct 2018 11:41:03 +0200 Subject: [PATCH] Rename check_io_mode() to query_io_mode() --- include/deal.II/base/hdf5.h | 18 ++++++------- source/base/hdf5.cc | 54 ++++++++++++++++++------------------- tests/base/hdf5_03.cc | 18 ++++++------- tests/base/hdf5_04.cc | 20 +++++++------- 4 files changed, 55 insertions(+), 55 deletions(-) diff --git a/include/deal.II/base/hdf5.h b/include/deal.II/base/hdf5.h index 3dc8bcc231..11381a0fd4 100644 --- a/include/deal.II/base/hdf5.h +++ b/include/deal.II/base/hdf5.h @@ -205,7 +205,7 @@ DEAL_II_NAMESPACE_OPEN * 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 DataSet::check_io_mode() is set to True, then after + * query the I/O mode. If DataSet::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 @@ -219,7 +219,7 @@ DEAL_II_NAMESPACE_OPEN * @code * auto dataset = group.create_dataset("name", dimensions); * #ifdef DEBUG - * dataset.check_io_mode(true); + * dataset.query_io_mode(true); * #endif * * if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0) @@ -231,7 +231,7 @@ DEAL_II_NAMESPACE_OPEN * dataset.write_none(); * } * - * if(dataset.check_io_mode()){ + * if(dataset.query_io_mode()){ * pcout << "IO mode: " << dataset.io_mode() << std::endl; * pcout << "Local no collective cause: " * << dataset.local_no_collective_cause() << std::endl; @@ -639,12 +639,12 @@ namespace HDF5 global_no_collective_cause(); /** - * This function retrieves the boolean check_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 check_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) @@ -655,13 +655,13 @@ namespace HDF5 * Debug mode because it requires calling additional HDF5 routines. */ bool - check_io_mode() const; + query_io_mode() const; /** - * This function sets the boolean check_io_mode(). + * This function sets the boolean query_io_mode(). */ void - check_io_mode(bool check_io_mode); + query_io_mode(bool query_io_mode); /** * This funcion returns the dimensions of the dataset. @@ -686,7 +686,7 @@ namespace HDF5 std::vector _dimensions; std::shared_ptr dataspace; unsigned int _size; - bool _check_io_mode; + bool _query_io_mode; H5D_mpio_actual_io_mode_t _io_mode; uint32_t _local_no_collective_cause; uint32_t _global_no_collective_cause; diff --git a/source/base/hdf5.cc b/source/base/hdf5.cc index 94a9904f34..5ff0b366e5 100644 --- a/source/base/hdf5.cc +++ b/source/base/hdf5.cc @@ -522,7 +522,7 @@ namespace HDF5 const hid_t & parent_group_id, const bool mpi) : HDF5Object(name, mpi) - , _check_io_mode(false) + , _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) @@ -572,7 +572,7 @@ namespace HDF5 : HDF5Object(name, mpi) , _rank(dimensions.size()) , _dimensions(dimensions) - , _check_io_mode(false) + , _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) @@ -639,7 +639,7 @@ namespace HDF5 if (mpi) { - if (_check_io_mode) + if (_query_io_mode) { ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode); Assert(ret >= 0, ExcInternalError()); @@ -702,7 +702,7 @@ namespace HDF5 if (mpi) { - if (_check_io_mode) + if (_query_io_mode) { ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode); Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode")); @@ -767,7 +767,7 @@ namespace HDF5 if (mpi) { - if (_check_io_mode) + if (_query_io_mode) { ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode); Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode")); @@ -823,7 +823,7 @@ namespace HDF5 if (mpi) { - if (_check_io_mode) + if (_query_io_mode) { ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode); Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode")); @@ -872,7 +872,7 @@ namespace HDF5 if (mpi) { - if (_check_io_mode) + if (_query_io_mode) { ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode); Assert(ret >= 0, ExcInternalError()); @@ -929,7 +929,7 @@ namespace HDF5 if (mpi) { - if (_check_io_mode) + if (_query_io_mode) { ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode); Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode")); @@ -994,7 +994,7 @@ namespace HDF5 if (mpi) { - if (_check_io_mode) + if (_query_io_mode) { ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode); Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode")); @@ -1058,7 +1058,7 @@ namespace HDF5 if (mpi) { - if (_check_io_mode) + if (_query_io_mode) { ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode); Assert(ret >= 0, ExcMessage("Error at H5Pget_mpio_actual_io_mode")); @@ -1109,7 +1109,7 @@ namespace HDF5 if (mpi) { - if (_check_io_mode) + if (_query_io_mode) { ret = H5Pget_mpio_actual_io_mode(plist, &_io_mode); Assert(ret >= 0, ExcInternalError()); @@ -1129,9 +1129,9 @@ namespace HDF5 H5D_mpio_actual_io_mode_t DataSet::io_mode() { - Assert(_check_io_mode, + Assert(_query_io_mode, ExcMessage( - "check_io_mode() should be true in order to use io_mode()")); + "query_io_mode() should be true in order to use io_mode()")); return _io_mode; } @@ -1141,9 +1141,9 @@ namespace HDF5 std::string DataSet::io_mode() { - Assert(_check_io_mode, + Assert(_query_io_mode, ExcMessage( - "check_io_mode() should be true in order to use io_mode()")); + "query_io_mode() should be true in order to use io_mode()")); switch (_io_mode) { case (H5D_MPIO_NO_COLLECTIVE): @@ -1176,9 +1176,9 @@ namespace HDF5 DataSet::local_no_collective_cause() { Assert( - _check_io_mode, + _query_io_mode, ExcMessage( - "check_io_mode() should be true in order to use local_no_collective_cause()")); + "query_io_mode() should be true in order to use local_no_collective_cause()")); return _local_no_collective_cause; } @@ -1189,9 +1189,9 @@ namespace HDF5 DataSet::local_no_collective_cause() { Assert( - _check_io_mode, + _query_io_mode, ExcMessage( - "check_io_mode() should be true in order to use local_no_collective_cause()")); + "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); } @@ -1200,9 +1200,9 @@ namespace HDF5 DataSet::global_no_collective_cause() { Assert( - _check_io_mode, + _query_io_mode, ExcMessage( - "check_io_mode() should be true in order to use global_no_collective_cause()")); + "query_io_mode() should be true in order to use global_no_collective_cause()")); return _global_no_collective_cause; } @@ -1213,22 +1213,22 @@ namespace HDF5 DataSet::global_no_collective_cause() { Assert( - _check_io_mode, + _query_io_mode, ExcMessage( - "check_io_mode() should be true in order to use global_no_collective_cause()")); + "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); } bool - DataSet::check_io_mode() const + DataSet::query_io_mode() const { - return _check_io_mode; + return _query_io_mode; } void - DataSet::check_io_mode(bool check_io_mode) + DataSet::query_io_mode(bool query_io_mode) { - _check_io_mode = check_io_mode; + _query_io_mode = query_io_mode; } std::vector diff --git a/tests/base/hdf5_03.cc b/tests/base/hdf5_03.cc index 8ca34b45ef..6d8ee1e544 100644 --- a/tests/base/hdf5_03.cc +++ b/tests/base/hdf5_03.cc @@ -206,7 +206,7 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_1"); auto dataset = group.create_dataset(dataset_name, dataset_dimensions); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " << dataset.dimensions() << std::endl; @@ -249,7 +249,7 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_2"); auto dataset = group.create_dataset(dataset_name, dataset_dimensions); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " << dataset.dimensions() << std::endl; @@ -338,7 +338,7 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_3"); auto dataset = group.create_dataset(dataset_name, dataset_dimensions); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " << dataset.dimensions() << std::endl; @@ -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.check_io_mode(true); + dataset.query_io_mode(true); auto data = initialize_container(dataset_dimensions); assign_data(data); if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0) @@ -402,7 +402,7 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_4"); auto dataset = group.create_dataset(dataset_name, dataset_dimensions); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " << dataset.dimensions() << std::endl; @@ -547,7 +547,7 @@ read_test(HDF5::Group root_group, { std::string dataset_name("dataset_1"); auto dataset = group.dataset(dataset_name); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " << dataset.dimensions() << std::endl; @@ -580,7 +580,7 @@ read_test(HDF5::Group root_group, { std::string dataset_name("dataset_2"); auto dataset = group.dataset(dataset_name); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " << dataset.dimensions() << std::endl; @@ -650,7 +650,7 @@ read_test(HDF5::Group root_group, { std::string dataset_name("dataset_3"); auto dataset = group.dataset(dataset_name); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " << dataset.dimensions() << std::endl; @@ -684,7 +684,7 @@ read_test(HDF5::Group root_group, { std::string dataset_name("dataset_4"); auto dataset = group.dataset(dataset_name); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " << dataset.dimensions() << std::endl; diff --git a/tests/base/hdf5_04.cc b/tests/base/hdf5_04.cc index bdb11b2525..4c56c94e2f 100644 --- a/tests/base/hdf5_04.cc +++ b/tests/base/hdf5_04.cc @@ -203,7 +203,7 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_1"); auto dataset = group.create_dataset(dataset_name, dataset_dimensions); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " << dataset.dimensions() << std::endl; @@ -239,7 +239,7 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_2"); auto dataset = group.create_dataset(dataset_name, dataset_dimensions); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " << dataset.dimensions() << std::endl; @@ -315,7 +315,7 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_3"); auto dataset = group.create_dataset(dataset_name, dataset_dimensions); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " << dataset.dimensions() << std::endl; @@ -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.check_io_mode(true); + dataset.query_io_mode(true); auto data = initialize_container(dataset_dimensions); assign_data(data); dataset.write(data); @@ -365,7 +365,7 @@ write_test(HDF5::Group & root_group, std::string dataset_name("dataset_4"); auto dataset = group.create_dataset(dataset_name, dataset_dimensions); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Write): " << dataset.dimensions() << std::endl; @@ -501,7 +501,7 @@ read_test(HDF5::Group root_group) { std::string dataset_name("dataset_1"); auto dataset = group.dataset(dataset_name); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " << dataset.dimensions() << std::endl; @@ -534,7 +534,7 @@ read_test(HDF5::Group root_group) { std::string dataset_name("dataset_2"); auto dataset = group.dataset(dataset_name); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " << dataset.dimensions() << std::endl; @@ -604,7 +604,7 @@ read_test(HDF5::Group root_group) { std::string dataset_name("dataset_3"); auto dataset = group.dataset(dataset_name); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " << dataset.dimensions() << std::endl; @@ -638,7 +638,7 @@ read_test(HDF5::Group root_group) { std::string dataset_name("dataset_4"); auto dataset = group.dataset(dataset_name); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " << dataset.dimensions() << std::endl; @@ -723,7 +723,7 @@ read_test(HDF5::Group root_group) { std::string dataset_name("dataset_5"); auto dataset = group.dataset(dataset_name); - dataset.check_io_mode(true); + dataset.query_io_mode(true); deallog << "Dimensions " + dataset_name << " " << container_name << "<" << type_name << ">" << " (Read): " << dataset.dimensions() << std::endl; -- 2.39.5