]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Format code
authorDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Sun, 26 Aug 2018 15:25:50 +0000 (17:25 +0200)
committerDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 9 Jan 2019 18:08:27 +0000 (19:08 +0100)
tests/base/hdf5_03.cc
tests/base/hdf5_04.cc

index b4819e3de47d21fb31c5527d534753bf36dc311a..8ca34b45ef7dae9db6692b0d913e43160e0fc8eb 100644 (file)
@@ -502,61 +502,95 @@ read_test(HDF5::Group        root_group,
           MPI_Comm           mpi_communicator,
           ConditionalOStream pcout)
 {
-    std::string container_name;
-    std::string type_name;
+  std::string container_name;
+  std::string type_name;
 
-    if (std::is_same<Container<Number>, std::vector<Number>>::value)
-      {
-        container_name = std::string("std::vector");
-      }
-    else if (std::is_same<Container<Number>, FullMatrix<Number>>::value)
-      {
-        container_name = std::string("FullMatrix");
-      }
+  if (std::is_same<Container<Number>, std::vector<Number>>::value)
+    {
+      container_name = std::string("std::vector");
+    }
+  else if (std::is_same<Container<Number>, FullMatrix<Number>>::value)
+    {
+      container_name = std::string("FullMatrix");
+    }
 
-    if (std::is_same<Number, float>::value)
-      {
-        type_name = std::string("float");
-      }
-    else if (std::is_same<Number, double>::value)
-      {
-        type_name = std::string("double");
-      }
-    else if (std::is_same<Number, std::complex<float>>::value)
-      {
-        type_name = std::string("std::complex<float>");
-      }
-    else if (std::is_same<Number, std::complex<double>>::value)
-      {
-        type_name = std::string("std::complex<double>");
-      }
-    else if (std::is_same<Number, int>::value)
-      {
-        type_name = std::string("int");
-      }
-    else if (std::is_same<Number, unsigned int>::value)
-      {
-        type_name = std::string("unsigned int");
-      }
+  if (std::is_same<Number, float>::value)
+    {
+      type_name = std::string("float");
+    }
+  else if (std::is_same<Number, double>::value)
+    {
+      type_name = std::string("double");
+    }
+  else if (std::is_same<Number, std::complex<float>>::value)
+    {
+      type_name = std::string("std::complex<float>");
+    }
+  else if (std::is_same<Number, std::complex<double>>::value)
+    {
+      type_name = std::string("std::complex<double>");
+    }
+  else if (std::is_same<Number, int>::value)
+    {
+      type_name = std::string("int");
+    }
+  else if (std::is_same<Number, unsigned int>::value)
+    {
+      type_name = std::string("unsigned int");
+    }
+
+  deallog << "Read tests for " << container_name << "<" << type_name << ">"
+          << " datasets" << std::endl;
 
-    deallog << "Read tests for " << container_name << "<" << type_name << ">"
-            << " datasets" << std::endl;
+  auto group = root_group.group(container_name + "<" + type_name + ">");
 
-    auto group = root_group.group(container_name + "<" + type_name + ">");
+  {
+    std::string dataset_name("dataset_1");
+    auto        dataset = group.dataset(dataset_name);
+    dataset.check_io_mode(true);
+    deallog << "Dimensions " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.dimensions() << std::endl;
+    deallog << "Size " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.size() << std::endl;
+    deallog << "Rank " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.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>()
+          << std::endl;
+    pcout << "Local no collective cause " + dataset_name << " "
+          << container_name << "<" << type_name << ">"
+          << " (Read): "
+          << dataset.template 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>()
+          << std::endl;
+  }
 
+  {
+    std::string dataset_name("dataset_2");
+    auto        dataset = group.dataset(dataset_name);
+    dataset.check_io_mode(true);
+    deallog << "Dimensions " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.dimensions() << std::endl;
+    deallog << "Size " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.size() << std::endl;
+    deallog << "Rank " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.rank() << std::endl;
     {
-      std::string dataset_name("dataset_1");
-      auto        dataset = group.dataset(dataset_name);
-      dataset.check_io_mode(true);
-      deallog << "Dimensions " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.dimensions() << std::endl;
-      deallog << "Size " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.size() << std::endl;
-      deallog << "Rank " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.rank() << std::endl;
       Container<Number> data = dataset.read<Container, Number>();
       deallog << "Sum " + dataset_name << " " << container_name << "<"
               << type_name << ">"
@@ -578,19 +612,54 @@ read_test(HDF5::Group        root_group,
     }
 
     {
-      std::string dataset_name("dataset_2");
-      auto        dataset = group.dataset(dataset_name);
-      dataset.check_io_mode(true);
-      deallog << "Dimensions " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.dimensions() << std::endl;
-      deallog << "Size " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.size() << std::endl;
-      deallog << "Rank " + dataset_name << " " << container_name << "<"
+      std::vector<hsize_t> coordinates_a = {0,
+                                            0, // first point
+                                            0,
+                                            2, // second point
+                                            3,
+                                            4, // third point
+                                            25,
+                                            12}; // fourth point
+      auto data_a = dataset.template read_selection<Number>(coordinates_a);
+      deallog << "Selection " + dataset_name << " " << container_name << "<"
               << type_name << ">"
-              << " (Read): " << dataset.rank() << std::endl;
+              << " (Read): " << data_a[0] << ", " << data_a[1] << ", "
+              << data_a[2] << ", " << data_a[3] << std::endl;
+      pcout << "IO mode " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.template 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>()
+            << std::endl;
+      pcout << "Global no collective cause " + dataset_name << " "
+            << container_name << "<" << type_name << ">"
+            << " (Read): "
+            << dataset.template global_no_collective_cause<std::string>()
+            << std::endl;
+    }
+  }
+
+  {
+    // In this test data conversion is tested. The dataset only exists for
+    // float and double.
+    if (std::is_same<Number, float>::value ||
+        std::is_same<Number, double>::value)
       {
+        std::string dataset_name("dataset_3");
+        auto        dataset = group.dataset(dataset_name);
+        dataset.check_io_mode(true);
+        deallog << "Dimensions " + dataset_name << " " << container_name << "<"
+                << type_name << ">"
+                << " (Read): " << dataset.dimensions() << std::endl;
+        deallog << "Size " + dataset_name << " " << container_name << "<"
+                << type_name << ">"
+                << " (Read): " << dataset.size() << std::endl;
+        deallog << "Rank " + dataset_name << " " << container_name << "<"
+                << type_name << ">"
+                << " (Read): " << dataset.rank() << std::endl;
         Container<Number> data = dataset.read<Container, Number>();
         deallog << "Sum " + dataset_name << " " << container_name << "<"
                 << type_name << ">"
@@ -610,175 +679,107 @@ read_test(HDF5::Group        root_group,
               << dataset.template global_no_collective_cause<std::string>()
               << std::endl;
       }
+  }
 
-      {
-        std::vector<hsize_t> coordinates_a = {0,
-                                              0, // first point
-                                              0,
-                                              2, // second point
-                                              3,
-                                              4, // third point
-                                              25,
-                                              12}; // fourth point
-        auto data_a = dataset.template read_selection<Number>(coordinates_a);
-        deallog << "Selection " + dataset_name << " " << container_name << "<"
-                << type_name << ">"
-                << " (Read): " << data_a[0] << ", " << data_a[1] << ", "
-                << data_a[2] << ", " << data_a[3] << std::endl;
-        pcout << "IO mode " + dataset_name << " " << container_name << "<"
+  {
+    std::string dataset_name("dataset_4");
+    auto        dataset = group.dataset(dataset_name);
+    dataset.check_io_mode(true);
+    deallog << "Dimensions " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.dimensions() << std::endl;
+    deallog << "Size " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.size() << std::endl;
+    deallog << "Rank " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.rank() << std::endl;
+    {
+      Container<Number> data = dataset.read<Container, Number>();
+      deallog << "Sum " + dataset_name << " " << container_name << "<"
               << type_name << ">"
-              << " (Read): " << dataset.template 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>()
-              << std::endl;
-        pcout << "Global no collective cause " + dataset_name << " "
-              << container_name << "<" << type_name << ">"
-              << " (Read): "
-              << dataset.template global_no_collective_cause<std::string>()
-              << std::endl;
-      }
+              << " (Read): " << container_sum(data) << std::endl;
+      pcout << "IO mode " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.template 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>()
+            << std::endl;
+      pcout << "Global no collective cause " + dataset_name << " "
+            << container_name << "<" << type_name << ">"
+            << " (Read): "
+            << dataset.template global_no_collective_cause<std::string>()
+            << std::endl;
     }
 
     {
-      // In this test data conversion is tested. The dataset only exists for
-      // float and double.
-      if (std::is_same<Number, float>::value ||
-          std::is_same<Number, double>::value)
-        {
-          std::string dataset_name("dataset_3");
-          auto        dataset = group.dataset(dataset_name);
-          dataset.check_io_mode(true);
-          deallog << "Dimensions " + dataset_name << " " << container_name
-                  << "<" << type_name << ">"
-                  << " (Read): " << dataset.dimensions() << std::endl;
-          deallog << "Size " + dataset_name << " " << container_name << "<"
-                  << type_name << ">"
-                  << " (Read): " << dataset.size() << std::endl;
-          deallog << "Rank " + dataset_name << " " << container_name << "<"
-                  << type_name << ">"
-                  << " (Read): " << dataset.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>()
-                << std::endl;
-          pcout << "Local no collective cause " + dataset_name << " "
-                << container_name << "<" << type_name << ">"
-                << " (Read): "
-                << dataset.template 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>()
-                << std::endl;
-        }   
+      const std::vector<hsize_t> hyperslab_offset_a = {0, 0};
+      const std::vector<hsize_t> hyperslab_count_a  = {2, 5};
+      auto                       data_a =
+        dataset.read_hyperslab<Container, Number>(hyperslab_offset_a,
+                                                  hyperslab_count_a);
+      deallog << "Hyperslab_a sum " + dataset_name << " " << container_name
+              << "<" << type_name << ">"
+              << " (Read): " << container_sum(data_a) << std::endl;
+      pcout << "IO mode " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.template 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>()
+            << std::endl;
+      pcout << "Global no collective cause " + dataset_name << " "
+            << container_name << "<" << type_name << ">"
+            << " (Read): "
+            << dataset.template global_no_collective_cause<std::string>()
+            << std::endl;
     }
 
     {
-        std::string dataset_name("dataset_4");
-        auto        dataset = group.dataset(dataset_name);
-        dataset.check_io_mode(true);
-        deallog << "Dimensions " + dataset_name << " " << container_name << "<"
-                << type_name << ">"
-                << " (Read): " << dataset.dimensions() << std::endl;
-        deallog << "Size " + dataset_name << " " << container_name << "<"
-                << type_name << ">"
-                << " (Read): " << dataset.size() << std::endl;
-        deallog << "Rank " + dataset_name << " " << container_name << "<"
-                << type_name << ">"
-                << " (Read): " << dataset.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>()
-                << std::endl;
-          pcout << "Local no collective cause " + dataset_name << " "
-                << container_name << "<" << type_name << ">"
-                << " (Read): "
-                << dataset.template 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>()
-                << std::endl;
-        }
-
-        {
-          const std::vector<hsize_t> hyperslab_offset_a = {0, 0};
-          const std::vector<hsize_t> hyperslab_count_a  = {2, 5};
-          auto                       data_a =
-            dataset.read_hyperslab<Container, Number>(hyperslab_offset_a,
-                                                      hyperslab_count_a);
-          deallog << "Hyperslab_a sum " + dataset_name << " " << container_name
-                  << "<" << type_name << ">"
-                  << " (Read): " << container_sum(data_a) << std::endl;
-          pcout << "IO mode " + dataset_name << " " << container_name << "<"
-                << type_name << ">"
-                << " (Read): " << dataset.template 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>()
-                << std::endl;
-          pcout << "Global no collective cause " + dataset_name << " "
-                << container_name << "<" << type_name << ">"
-                << " (Read): "
-                << dataset.template global_no_collective_cause<std::string>()
-                << std::endl;
-        }
-
+      const std::vector<hsize_t> hyperslab_offset_b = {2, 0};
+      const std::vector<hsize_t> hyperslab_count_b  = {1, 4};
+      Container<Number>          data_b;
+      // This loop is used to test read_none(). At the end of the loop every
+      // MPI process will have read data_b
+      for (unsigned int mpi_idx = 0;
+           mpi_idx < Utilities::MPI::n_mpi_processes(mpi_communicator);
+           ++mpi_idx)
         {
-          const std::vector<hsize_t> hyperslab_offset_b = {2, 0};
-          const std::vector<hsize_t> hyperslab_count_b  = {1, 4};
-          Container<Number>          data_b;
-          // This loop is used to test read_none(). At the end of the loop every
-          // MPI process will have read data_b
-          for (unsigned int mpi_idx = 0;
-               mpi_idx < Utilities::MPI::n_mpi_processes(mpi_communicator);
-               ++mpi_idx)
+          if (Utilities::MPI::this_mpi_process(mpi_communicator) == mpi_idx)
             {
-              if (Utilities::MPI::this_mpi_process(mpi_communicator) == mpi_idx)
-                {
-                  data_b = dataset.read_hyperslab<Container, Number>(
-                    hyperslab_offset_b, hyperslab_count_b);
-                }
-              else
-                {
-                  dataset.read_none<Number>();
-                }
+              data_b =
+                dataset.read_hyperslab<Container, Number>(hyperslab_offset_b,
+                                                          hyperslab_count_b);
+            }
+          else
+            {
+              dataset.read_none<Number>();
             }
-          deallog << "Hyperslab_b sum " + dataset_name << " " << container_name
-                  << "<" << type_name << ">"
-                  << " (Read): " << container_sum(data_b) << std::endl;
-          pcout << "IO mode " + dataset_name << " " << container_name << "<"
-                << type_name << ">"
-                << " (Read): " << dataset.template 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>()
-                << std::endl;
-          pcout << "Global no collective cause " + dataset_name << " "
-                << container_name << "<" << type_name << ">"
-                << " (Read): "
-                << dataset.template global_no_collective_cause<std::string>()
-                << std::endl;
         }
-      }
+      deallog << "Hyperslab_b sum " + dataset_name << " " << container_name
+              << "<" << type_name << ">"
+              << " (Read): " << container_sum(data_b) << std::endl;
+      pcout << "IO mode " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.template 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>()
+            << std::endl;
+      pcout << "Global no collective cause " + dataset_name << " "
+            << container_name << "<" << type_name << ">"
+            << " (Read): "
+            << dataset.template global_no_collective_cause<std::string>()
+            << std::endl;
+    }
+  }
 }
 
 
index a3f5e601059cb8ffbea98c667e49781c915b123e..bdb11b25250f124ef167f1cb6ade0b8238e91b5d 100644 (file)
@@ -456,61 +456,95 @@ template <template <class...> class Container, typename Number>
 void
 read_test(HDF5::Group root_group)
 {
-    std::string container_name;
-    std::string type_name;
+  std::string container_name;
+  std::string type_name;
 
-    if (std::is_same<Container<Number>, std::vector<Number>>::value)
-      {
-        container_name = std::string("std::vector");
-      }
-    else if (std::is_same<Container<Number>, FullMatrix<Number>>::value)
-      {
-        container_name = std::string("FullMatrix");
-      }
+  if (std::is_same<Container<Number>, std::vector<Number>>::value)
+    {
+      container_name = std::string("std::vector");
+    }
+  else if (std::is_same<Container<Number>, FullMatrix<Number>>::value)
+    {
+      container_name = std::string("FullMatrix");
+    }
 
-    if (std::is_same<Number, float>::value)
-      {
-        type_name = std::string("float");
-      }
-    else if (std::is_same<Number, double>::value)
-      {
-        type_name = std::string("double");
-      }
-    else if (std::is_same<Number, std::complex<float>>::value)
-      {
-        type_name = std::string("std::complex<float>");
-      }
-    else if (std::is_same<Number, std::complex<double>>::value)
-      {
-        type_name = std::string("std::complex<double>");
-      }
-    else if (std::is_same<Number, int>::value)
-      {
-        type_name = std::string("int");
-      }
-    else if (std::is_same<Number, unsigned int>::value)
-      {
-        type_name = std::string("unsigned int");
-      }
+  if (std::is_same<Number, float>::value)
+    {
+      type_name = std::string("float");
+    }
+  else if (std::is_same<Number, double>::value)
+    {
+      type_name = std::string("double");
+    }
+  else if (std::is_same<Number, std::complex<float>>::value)
+    {
+      type_name = std::string("std::complex<float>");
+    }
+  else if (std::is_same<Number, std::complex<double>>::value)
+    {
+      type_name = std::string("std::complex<double>");
+    }
+  else if (std::is_same<Number, int>::value)
+    {
+      type_name = std::string("int");
+    }
+  else if (std::is_same<Number, unsigned int>::value)
+    {
+      type_name = std::string("unsigned int");
+    }
 
-    deallog << "Read tests for " << container_name << "<" << type_name << ">"
-            << " datasets" << std::endl;
+  deallog << "Read tests for " << container_name << "<" << type_name << ">"
+          << " datasets" << std::endl;
 
-    auto group = root_group.group(container_name + "<" + type_name + ">");
+  auto group = root_group.group(container_name + "<" + type_name + ">");
 
-    {
-      std::string dataset_name("dataset_1");
-      auto        dataset = group.dataset(dataset_name);
-      dataset.check_io_mode(true);
-      deallog << "Dimensions " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.dimensions() << std::endl;
-      deallog << "Size " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.size() << std::endl;
-      deallog << "Rank " + dataset_name << " " << container_name << "<"
+  {
+    std::string dataset_name("dataset_1");
+    auto        dataset = group.dataset(dataset_name);
+    dataset.check_io_mode(true);
+    deallog << "Dimensions " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.dimensions() << std::endl;
+    deallog << "Size " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.size() << std::endl;
+    deallog << "Rank " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.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.rank() << std::endl;
+              << " (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>()
+              << std::endl;
+  }
+
+  {
+    std::string dataset_name("dataset_2");
+    auto        dataset = group.dataset(dataset_name);
+    dataset.check_io_mode(true);
+    deallog << "Dimensions " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.dimensions() << std::endl;
+    deallog << "Size " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.size() << std::endl;
+    deallog << "Rank " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.rank() << std::endl;
+    {
       Container<Number> data = dataset.read<Container, Number>();
       deallog << "Sum " + dataset_name << " " << container_name << "<"
               << type_name << ">"
@@ -532,19 +566,54 @@ read_test(HDF5::Group root_group)
     }
 
     {
-      std::string dataset_name("dataset_2");
-      auto        dataset = group.dataset(dataset_name);
-      dataset.check_io_mode(true);
-      deallog << "Dimensions " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.dimensions() << std::endl;
-      deallog << "Size " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.size() << std::endl;
-      deallog << "Rank " + dataset_name << " " << container_name << "<"
+      std::vector<hsize_t> coordinates_a = {0,
+                                            0, // first point
+                                            0,
+                                            2, // second point
+                                            3,
+                                            4, // third point
+                                            25,
+                                            12}; // fourth point
+      auto data_a = dataset.template read_selection<Number>(coordinates_a);
+      deallog << "Selection " + dataset_name << " " << container_name << "<"
               << type_name << ">"
-              << " (Read): " << dataset.rank() << std::endl;
+              << " (Read): " << data_a[0] << ", " << data_a[1] << ", "
+              << 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>()
+                << 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>()
+                << std::endl;
+    }
+  }
+
+  {
+    // In this test data conversion is tested. The dataset only exists for
+    // float and double.
+    if (std::is_same<Number, float>::value ||
+        std::is_same<Number, double>::value)
       {
+        std::string dataset_name("dataset_3");
+        auto        dataset = group.dataset(dataset_name);
+        dataset.check_io_mode(true);
+        deallog << "Dimensions " + dataset_name << " " << container_name << "<"
+                << type_name << ">"
+                << " (Read): " << dataset.dimensions() << std::endl;
+        deallog << "Size " + dataset_name << " " << container_name << "<"
+                << type_name << ">"
+                << " (Read): " << dataset.size() << std::endl;
+        deallog << "Rank " + dataset_name << " " << container_name << "<"
+                << type_name << ">"
+                << " (Read): " << dataset.rank() << std::endl;
         Container<Number> data = dataset.read<Container, Number>();
         deallog << "Sum " + dataset_name << " " << container_name << "<"
                 << type_name << ">"
@@ -564,183 +633,76 @@ read_test(HDF5::Group root_group)
                   << dataset.template global_no_collective_cause<std::string>()
                   << std::endl;
       }
+  }
 
-      {
-        std::vector<hsize_t> coordinates_a = {0,
-                                              0, // first point
-                                              0,
-                                              2, // second point
-                                              3,
-                                              4, // third point
-                                              25,
-                                              12}; // fourth point
-        auto data_a = dataset.template read_selection<Number>(coordinates_a);
-        deallog << "Selection " + dataset_name << " " << container_name << "<"
-                << type_name << ">"
-                << " (Read): " << data_a[0] << ", " << data_a[1] << ", "
-                << 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>()
-                  << 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>()
-                  << std::endl;
-      }
-    }
-
+  {
+    std::string dataset_name("dataset_4");
+    auto        dataset = group.dataset(dataset_name);
+    dataset.check_io_mode(true);
+    deallog << "Dimensions " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.dimensions() << std::endl;
+    deallog << "Size " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.size() << std::endl;
+    deallog << "Rank " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.rank() << std::endl;
     {
-      // In this test data conversion is tested. The dataset only exists for
-      // float and double.
-      if (std::is_same<Number, float>::value ||
-          std::is_same<Number, double>::value)
-        {
-          std::string dataset_name("dataset_3");
-          auto        dataset = group.dataset(dataset_name);
-          dataset.check_io_mode(true);
-          deallog << "Dimensions " + dataset_name << " " << container_name
-                  << "<" << type_name << ">"
-                  << " (Read): " << dataset.dimensions() << std::endl;
-          deallog << "Size " + dataset_name << " " << container_name << "<"
-                  << type_name << ">"
-                  << " (Read): " << dataset.size() << std::endl;
-          deallog << "Rank " + dataset_name << " " << container_name << "<"
-                  << type_name << ">"
-                  << " (Read): " << dataset.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>()
-            << 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>()
+                << std::endl;
     }
 
     {
-        std::string dataset_name("dataset_4");
-        auto        dataset = group.dataset(dataset_name);
-        dataset.check_io_mode(true);
-        deallog << "Dimensions " + dataset_name << " " << container_name << "<"
-                << type_name << ">"
-                << " (Read): " << dataset.dimensions() << std::endl;
-        deallog << "Size " + dataset_name << " " << container_name << "<"
-                << type_name << ">"
-                << " (Read): " << dataset.size() << std::endl;
-        deallog << "Rank " + dataset_name << " " << container_name << "<"
+      const std::vector<hsize_t> hyperslab_offset_a = {0, 0};
+      const std::vector<hsize_t> hyperslab_count_a  = {2, 5};
+      auto                       data_a =
+        dataset.read_hyperslab<Container, Number>(hyperslab_offset_a,
+                                                  hyperslab_count_a);
+      deallog << "Hyperslab_a sum " + dataset_name << " " << container_name
+              << "<" << type_name << ">"
+              << " (Read): " << container_sum(data_a) << std::endl;
+      std::cout << "IO mode " + dataset_name << " " << container_name << "<"
                 << type_name << ">"
-                << " (Read): " << dataset.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>()
-            << std::endl;
-        }
-
-        {
-          const std::vector<hsize_t> hyperslab_offset_a = {0, 0};
-          const std::vector<hsize_t> hyperslab_count_a  = {2, 5};
-          auto                       data_a =
-            dataset.read_hyperslab<Container, Number>(hyperslab_offset_a,
-                                                      hyperslab_count_a);
-          deallog << "Hyperslab_a sum " + dataset_name << " " << container_name
-                  << "<" << type_name << ">"
-                  << " (Read): " << container_sum(data_a) << 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>()
-            << std::endl;
-        }
-
-        {
-          const std::vector<hsize_t> hyperslab_offset_b = {2, 0};
-          const std::vector<hsize_t> hyperslab_count_b  = {1, 4};
-          Container<Number>          data_b;
-          data_b = dataset.read_hyperslab<Container, Number>(hyperslab_offset_b,
-                                                             hyperslab_count_b);
-          deallog << "Hyperslab_b sum " + dataset_name << " " << container_name
-                  << "<" << type_name << ">"
-                  << " (Read): " << container_sum(data_b) << 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>()
-            << std::endl;
-        }
-      }
+                << " (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>()
+                << std::endl;
+    }
 
     {
-      std::string dataset_name("dataset_5");
-      auto        dataset = group.dataset(dataset_name);
-      dataset.check_io_mode(true);
-      deallog << "Dimensions " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.dimensions() << std::endl;
-      deallog << "Size " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.size() << std::endl;
-      deallog << "Rank " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << dataset.rank() << std::endl;
-      Container<Number> data = dataset.read<Container, Number>();
-      deallog << "Sum " + dataset_name << " " << container_name << "<"
-              << type_name << ">"
-              << " (Read): " << container_sum(data) << std::endl;
+      const std::vector<hsize_t> hyperslab_offset_b = {2, 0};
+      const std::vector<hsize_t> hyperslab_count_b  = {1, 4};
+      Container<Number>          data_b;
+      data_b = dataset.read_hyperslab<Container, Number>(hyperslab_offset_b,
+                                                         hyperslab_count_b);
+      deallog << "Hyperslab_b sum " + dataset_name << " " << container_name
+              << "<" << type_name << ">"
+              << " (Read): " << container_sum(data_b) << std::endl;
       std::cout << "IO mode " + dataset_name << " " << container_name << "<"
                 << type_name << ">"
                 << " (Read): " << dataset.template io_mode<std::string>()
@@ -756,6 +718,40 @@ read_test(HDF5::Group root_group)
                 << dataset.template global_no_collective_cause<std::string>()
                 << std::endl;
     }
+  }
+
+  {
+    std::string dataset_name("dataset_5");
+    auto        dataset = group.dataset(dataset_name);
+    dataset.check_io_mode(true);
+    deallog << "Dimensions " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.dimensions() << std::endl;
+    deallog << "Size " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.size() << std::endl;
+    deallog << "Rank " + dataset_name << " " << container_name << "<"
+            << type_name << ">"
+            << " (Read): " << dataset.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>()
+              << std::endl;
+  }
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.