--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2015 - 2018 by the deal.II Authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// Read/write tests with serial HDF5. This tests different hyperslab shapes with
+// different ranks.
+
+#include <deal.II/base/conditional_ostream.h>
+#include <deal.II/base/hdf5.h>
+
+#include <deal.II/lac/full_matrix.h>
+#include <deal.II/lac/vector.h>
+
+#include <boost/lexical_cast.hpp>
+#include <boost/type_traits.hpp>
+
+#include <numeric>
+
+#include "../tests.h"
+
+// This function initializes a container of Number type
+template <template <class...> class Container, typename Number>
+typename std::enable_if<
+ std::is_same<Container<Number>, std::vector<Number>>::value,
+ Container<Number>>::type
+initialize_container(std::vector<hsize_t> dimensions)
+{
+ return Container<Number>(std::accumulate(
+ dimensions.begin(), dimensions.end(), 1, std::multiplies<int>()));
+}
+
+
+
+template <template <class...> class Container, typename Number>
+typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
+ Container<Number>>::type
+initialize_container(std::vector<hsize_t> dimensions)
+{
+ return Container<Number>(std::accumulate(
+ dimensions.begin(), dimensions.end(), 1, std::multiplies<int>()));
+}
+
+
+
+template <template <class...> class Container, typename Number>
+typename std::enable_if<
+ std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ Container<Number>>::type
+initialize_container(std::vector<hsize_t> dimensions)
+{
+ return FullMatrix<Number>(dimensions[0], dimensions[1]);
+}
+
+
+
+// This function assignes data to the elements of the container
+template <template <class...> class Container, typename Number>
+typename std::enable_if<
+ std::is_same<Container<Number>, std::vector<Number>>::value,
+ void>::type
+assign_data(Container<Number> &data)
+{
+ for (unsigned int idx = 0; idx < data.size(); ++idx)
+ {
+ data[idx] = idx;
+ }
+}
+
+
+
+template <template <class...> class Container, typename Number>
+typename std::enable_if<std::is_same<Container<Number>, Vector<Number>>::value,
+ void>::type
+assign_data(Container<Number> &data)
+{
+ for (unsigned int idx = 0; idx < data.size(); ++idx)
+ {
+ data[idx] = idx;
+ }
+}
+
+
+
+template <template <class...> class Container, typename Number>
+typename std::enable_if<
+ std::is_same<Container<Number>, FullMatrix<Number>>::value,
+ void>::type
+assign_data(Container<Number> &data)
+{
+ for (unsigned int row_idx = 0; row_idx < data.m(); ++row_idx)
+ {
+ for (unsigned int col_idx = 0; col_idx < data.n(); ++col_idx)
+ {
+ data[row_idx][col_idx] = (row_idx * data.n() + col_idx);
+ }
+ }
+}
+
+
+// This function converts the data to a string
+template <typename Number>
+std::string
+container_to_string(std::vector<Number> &data)
+{
+ std::string data_string;
+
+ auto append_to_data_string = [&data_string](const std::string p) {
+ if (data_string.length() > 0)
+ data_string += ", ";
+ data_string += p;
+ };
+
+ for (unsigned int idx = 0; idx < data.size(); ++idx)
+ {
+ append_to_data_string(boost::lexical_cast<std::string>(data[idx]));
+ }
+
+ return "[" + data_string + "]";
+}
+
+template <typename Number>
+std::string
+container_to_string(Vector<Number> &data)
+{
+ std::string data_string;
+
+ auto append_to_data_string = [&data_string](const std::string p) {
+ if (data_string.length() > 0)
+ data_string += ", ";
+ data_string += p;
+ };
+
+ for (unsigned int idx = 0; idx < data.size(); ++idx)
+ {
+ append_to_data_string(boost::lexical_cast<std::string>(data[idx]));
+ }
+
+ return "[" + data_string + "]";
+}
+
+template <typename Number>
+std::string
+container_to_string(FullMatrix<Number> &data)
+{
+ std::string data_string;
+
+ for (unsigned int row_idx = 0; row_idx < data.m(); ++row_idx)
+ {
+ if (row_idx > 0)
+ data_string += ", ";
+ data_string += "[";
+ for (unsigned int col_idx = 0; col_idx < data.n(); ++col_idx)
+ {
+ if (col_idx > 0)
+ data_string += ", ";
+ data_string +=
+ boost::lexical_cast<std::string>(data[row_idx][col_idx]);
+ }
+ data_string += "]";
+ }
+
+ return "[" + data_string + "]";
+}
+
+// This constexpr function converts a type to a std::string
+template <typename Number>
+std::string
+type_to_string()
+{
+ std::string type_name;
+
+ 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");
+ }
+
+ return type_name;
+}
+
+
+
+// This function tests parallel write and gets the group by reference
+template <typename Number>
+void
+write_test(HDF5::Group &root_group)
+{
+ const std::string type_name = type_to_string<Number>();
+
+ deallog << "Write tests for " << type_name << " datasets" << std::endl;
+
+ auto group = root_group.create_group(type_name);
+
+
+ {
+ std::string dataset_name("dataset_1");
+
+ // This dataset is a 5x3 matrix
+ // Output generated by h5dump
+ // (0,0): 0, 1, 2,
+ // (1,0): 3, 4, 5,
+ // (2,0): 6, 7, 8,
+ // (3,0): 9, 10, 11,
+ // (4,0): 12, 13, 14
+
+ const std::vector<hsize_t> dataset_dimensions = {5, 3};
+ auto dataset =
+ group.create_dataset<Number>(dataset_name, dataset_dimensions);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_size() << std::endl;
+ deallog << "Rank " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_rank() << std::endl;
+ auto data = initialize_container<std::vector, Number>(dataset_dimensions);
+ assign_data(data);
+
+ dataset.write(data);
+
+ deallog << "Data " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << container_to_string(data) << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<" << type_name
+ << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+
+ {
+ std::string dataset_name("dataset_2");
+
+ // This dataset is a 2x5x3 tensor
+ // Output generated by h5dump
+ // (0,0,0): 0, 1, 2, (1,0,0): 15, 16, 17,
+ // (0,1,0): 3, 4, 5, (1,1,0): 18, 19, 20,
+ // (0,2,0): 6, 7, 8, (1,2,0): 21, 22, 23,
+ // (0,3,0): 9, 10, 11, (1,3,0): 24, 25, 26,
+ // (0,4,0): 12, 13, 14, (1,4,0): 27, 28, 29
+
+ const std::vector<hsize_t> dataset_dimensions = {2, 5, 3};
+ auto dataset =
+ group.create_dataset<Number>(dataset_name, dataset_dimensions);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_size() << std::endl;
+ deallog << "Rank " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_rank() << std::endl;
+ auto data = initialize_container<std::vector, Number>(dataset_dimensions);
+ assign_data(data);
+
+ dataset.write(data);
+
+ deallog << "Data " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << container_to_string(data) << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<" << type_name
+ << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+
+ {
+ std::string dataset_name("dataset_3");
+
+ // This dataset is a 2x5x3 tensor
+ // Output generated by h5dump
+ // (0,0,0): 0, 1, 2, (1,0,0): 0, 2, 4,
+ // (0,1,0): 3, 4, 5, (1,1,0): 6, 8, 10,
+ // (0,2,0): 6, 7, 8, (1,2,0): 12, 14, 16,
+ // (0,3,0): 9, 10, 11, (1,3,0): 18, 20, 22,
+ // (0,4,0): 12, 13, 14, (1,4,0): 24, 26, 28
+
+ const std::vector<hsize_t> dataset_dimensions = {2, 5, 3};
+ auto dataset =
+ group.create_dataset<Number>(dataset_name, dataset_dimensions);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_size() << std::endl;
+ deallog << "Rank " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_rank() << std::endl;
+
+ {
+ const std::vector<hsize_t> data_dimensions = {5, 3};
+ auto data = initialize_container<std::vector, Number>(data_dimensions);
+ assign_data(data);
+ const std::vector<hsize_t> hyperslab_offset = {0, 0, 0};
+ const std::vector<hsize_t> hyperslab_count = {1, 5, 3};
+ dataset.write_hyperslab(data, hyperslab_offset, hyperslab_count);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+
+ {
+ const std::vector<hsize_t> data_dimensions = {5, 3};
+ auto data = initialize_container<FullMatrix, Number>(data_dimensions);
+ assign_data(data);
+ // Modify the data in order to have different data than in mpi_comm = 0
+ data *= 2;
+ const std::vector<hsize_t> hyperslab_offset = {1, 0, 0};
+ const std::vector<hsize_t> hyperslab_count = {1, 5, 3};
+ dataset.write_hyperslab(data, hyperslab_offset, hyperslab_count);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+ }
+
+ {
+ std::string dataset_name("dataset_4");
+
+ // This dataset is a 3x2x4 tensor
+ // Output generated by h5dump
+ // (0,0,0): 0, 1, 2, 3,
+ // (0,1,0): 0, 2, 4, 6,
+ // (1,0,0): 4, 5, 6, 7,
+ // (1,1,0): 8, 10, 12, 14,
+ // (2,0,0): 8, 9, 10, 11,
+ // (2,1,0): 16, 18, 20, 22
+
+ const std::vector<hsize_t> dataset_dimensions = {3, 2, 4};
+ auto dataset =
+ group.create_dataset<Number>(dataset_name, dataset_dimensions);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_size() << std::endl;
+ deallog << "Rank " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_rank() << std::endl;
+
+ {
+ const std::vector<hsize_t> data_dimensions = {3, 4};
+ auto data = initialize_container<std::vector, Number>(data_dimensions);
+ assign_data(data);
+ const std::vector<hsize_t> hyperslab_offset = {0, 0, 0};
+ const std::vector<hsize_t> hyperslab_count = {3, 1, 4};
+ dataset.write_hyperslab(data, hyperslab_offset, hyperslab_count);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+
+ {
+ const std::vector<hsize_t> data_dimensions = {3, 4};
+ auto data = initialize_container<FullMatrix, Number>(data_dimensions);
+ assign_data(data);
+ // Modify the data in order to have different data than in mpi_comm = 0
+ data *= 2;
+ const std::vector<hsize_t> hyperslab_offset = {0, 1, 0};
+ const std::vector<hsize_t> hyperslab_count = {3, 1, 4};
+ dataset.write_hyperslab(data, hyperslab_offset, hyperslab_count);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+ }
+
+ {
+ std::string dataset_name("dataset_5");
+
+ // This dataset is a 3x2x4 tensor
+ // Output generated by h5dump
+ // (0,0,0): 2, 0, 0, 38,
+ // (0,1,0): 6, 5, 0, 3,
+ // (1,0,0): 12, 0, 0, 0,
+ // (1,1,0): 16, 15, 0, 13,
+ // (2,0,0): 32, 0, 0, 0,
+ // (2,1,0): 36, 35, 0, 33
+
+
+ const std::vector<hsize_t> dataset_dimensions = {3, 2, 4};
+ auto dataset =
+ group.create_dataset<Number>(dataset_name, dataset_dimensions);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_size() << std::endl;
+ deallog << "Rank " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_rank() << std::endl;
+
+ {
+ std::vector<hsize_t> coordinates = {0,
+ 0,
+ 0, // first point
+ 0,
+ 1,
+ 3, // second point
+ 0,
+ 1,
+ 1, // third point
+ 0,
+ 1,
+ 0}; // fourth point
+ std::vector<Number> data = {2, 3, 5, 6};
+
+ dataset.write_selection(data, coordinates);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+
+ {
+ std::vector<hsize_t> coordinates = {1,
+ 0,
+ 0, // first point
+ 1,
+ 1,
+ 3, // second point
+ 1,
+ 1,
+ 1, // third point
+ 1,
+ 1,
+ 0}; // fourth point
+ std::vector<Number> data = {12, 13, 15, 16};
+
+ dataset.write_selection(data, coordinates);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+
+ {
+ std::vector<hsize_t> coordinates = {2,
+ 0,
+ 0, // first point
+ 2,
+ 1,
+ 3, // second point
+ 2,
+ 1,
+ 1, // third point
+ 2,
+ 1,
+ 0, // fourth point
+ 0,
+ 0,
+ 3}; // fith point
+ std::vector<Number> data = {32, 33, 35, 36, 38};
+
+ dataset.write_selection(data, coordinates);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+ }
+
+ {
+ std::string dataset_name("dataset_6");
+
+ // This dataset is a 7x12 matrix
+ // Output generated by h5dump
+ // (0,0): -0, 0, 1, -1, 2, 3, -2, 4, 5, -3, 6, 7,
+ // (1,0): -4, 8, 9, -5, 10, 11, -6, 12, 13, -7, 14, 15,
+ // (2,0): -8, 16, 17, -9, 18, 19, -10, 20, 21, -11, 22, 23,
+ // (3,0): -12, 0, 0, -13, 0, 0, -14, 0, 0, -15, 0, 0,
+ // (4,0): -16, 24, 25, -17, 26, 27, -18, 28, 29, -19, 30, 31,
+ // (5,0): -20, 32, 33, -21, 34, 35, -22, 36, 37, -23, 38, 39,
+ // (6,0): -24, 40, 41, -25, 42, 43, -26, 44, 45, -27, 46, 47
+
+ const std::vector<hsize_t> dataset_dimensions = {7, 12};
+ auto dataset =
+ group.create_dataset<Number>(dataset_name, dataset_dimensions);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_size() << std::endl;
+ deallog << "Rank " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_rank() << std::endl;
+
+ {
+ const std::vector<hsize_t> data_dimensions = {6, 8};
+ auto data = initialize_container<FullMatrix, Number>(data_dimensions);
+ assign_data(data);
+ const std::vector<hsize_t> offset = {0, 1};
+ const std::vector<hsize_t> stride = {4, 3};
+ const std::vector<hsize_t> count = {2, 4};
+ const std::vector<hsize_t> block = {3, 2};
+
+ dataset.write_hyperslab(
+ data, data_dimensions, offset, stride, count, block);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+
+ {
+ const std::vector<hsize_t> data_dimensions = {7, 4};
+ auto data = initialize_container<FullMatrix, Number>(data_dimensions);
+ assign_data(data);
+ data *= -1;
+ const std::vector<hsize_t> offset = {0, 0};
+ const std::vector<hsize_t> stride = {7, 3};
+ const std::vector<hsize_t> count = {1, 4};
+ const std::vector<hsize_t> block = {7, 1};
+
+ dataset.write_hyperslab(
+ data, data_dimensions, offset, stride, count, block);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+ }
+
+ {
+ std::string dataset_name("dataset_7");
+
+ // This dataset is a 3x2x4 tensor
+ // Output generated by h5dump
+ // (0,0,0): 2, 0, 0, 38,
+ // (0,1,0): 6, 5, 0, 3,
+ // (1,0,0): 12, 0, 0, 0,
+ // (1,1,0): 16, 15, 0, 13,
+ // (2,0,0): 32, 0, 0, 0,
+ // (2,1,0): 36, 35, 0, 33
+
+
+ const std::vector<hsize_t> dataset_dimensions = {3, 2, 4};
+ auto dataset =
+ group.create_dataset<Number>(dataset_name, dataset_dimensions);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_size() << std::endl;
+ deallog << "Rank " << dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_rank() << std::endl;
+
+ {
+ std::vector<hsize_t> coordinates = {0,
+ 0,
+ 0, // first point
+ 0,
+ 1,
+ 3, // second point
+ 0,
+ 1,
+ 1, // third point
+ 0,
+ 1,
+ 0}; // fourth point
+ Vector<Number> data(4);
+ data[0] = 2;
+ data[1] = 3;
+ data[2] = 5;
+ data[3] = 6;
+
+ dataset.write_selection(data, coordinates);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+
+ {
+ std::vector<hsize_t> coordinates = {1,
+ 0,
+ 0, // first point
+ 1,
+ 1,
+ 3, // second point
+ 1,
+ 1,
+ 1, // third point
+ 1,
+ 1,
+ 0}; // fourth point
+ Vector<Number> data(4);
+ data[0] = 12;
+ data[1] = 13;
+ data[2] = 15;
+ data[3] = 16;
+
+ dataset.write_selection(data, coordinates);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+
+ {
+ std::vector<hsize_t> coordinates = {2,
+ 0,
+ 0, // first point
+ 2,
+ 1,
+ 3, // second point
+ 2,
+ 1,
+ 1, // third point
+ 2,
+ 1,
+ 0, // fourth point
+ 0,
+ 0,
+ 3}; // fith point
+ Vector<Number> data(5);
+ data[0] = 32;
+ data[1] = 33;
+ data[2] = 35;
+ data[3] = 36;
+ data[4] = 38;
+
+ dataset.write_selection(data, coordinates);
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Write): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " + dataset_name << "<"
+ << type_name << ">"
+ << " (Write): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+ }
+ }
+}
+
+
+// This function tests parallel read. Unlike write_test, this functions gets a
+// copy of the group
+template <typename Number>
+void
+read_test(HDF5::Group root_group)
+{
+ const std::string type_name = type_to_string<Number>();
+
+ deallog << "Read tests for " << type_name << " datasets" << std::endl;
+
+ auto group = root_group.group(type_name);
+
+ {
+ std::string dataset_name("dataset_1");
+
+ // This dataset is a 5x3 matrix
+ // Output generated by h5dump
+ // (0,0): 0, 1, 2,
+ // (1,0): 3, 4, 5,
+ // (2,0): 6, 7, 8,
+ // (3,0): 9, 10, 11,
+ // (4,0): 12, 13, 14
+
+ auto dataset = group.open_dataset(dataset_name);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_size() << std::endl;
+ deallog << "Rank " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_rank() << std::endl;
+ {
+ auto data = dataset.read<FullMatrix<Number>>();
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Data " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+
+ {
+ // The output should be the column vector [7, 10, 13]
+ const std::vector<hsize_t> hyperslab_offset = {2, 1};
+ const std::vector<hsize_t> hyperslab_count = {3, 1};
+ auto data = dataset.read_hyperslab<std::vector<Number>>(hyperslab_offset,
+ hyperslab_count);
+
+ std::cout << "Column vector" << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Column vector " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+
+ {
+ // The output should be the row vector [9, 10, 11]
+ const std::vector<hsize_t> hyperslab_offset = {3, 0};
+ const std::vector<hsize_t> hyperslab_count = {1, 3};
+ auto data = dataset.read_hyperslab<std::vector<Number>>(hyperslab_offset,
+ hyperslab_count);
+
+ std::cout << "Row vector" << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Row vector " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+
+ {
+ // The output should be the matrix [[3, 4, 5], [6, 7, 8]]
+ const std::vector<hsize_t> hyperslab_offset = {1, 0};
+ const std::vector<hsize_t> hyperslab_count = {2, 3};
+ auto data = dataset.read_hyperslab<FullMatrix<Number>>(hyperslab_offset,
+ hyperslab_count);
+
+ std::cout << "Sub-matrix" << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Sub-matrix " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+ }
+
+ {
+ std::string dataset_name("dataset_2");
+
+ // This dataset is a 2x5x3 tensor
+ // Output generated by h5dump
+ // (0,0,0): 0, 1, 2, (1,0,0): 15, 16, 17,
+ // (0,1,0): 3, 4, 5, (1,1,0): 18, 19, 20,
+ // (0,2,0): 6, 7, 8, (1,2,0): 21, 22, 23,
+ // (0,3,0): 9, 10, 11, (1,3,0): 24, 25, 26,
+ // (0,4,0): 12, 13, 14, (1,4,0): 27, 28, 29
+
+ auto dataset = group.open_dataset(dataset_name);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_size() << std::endl;
+ deallog << "Rank " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_rank() << std::endl;
+ {
+ auto data = dataset.read<std::vector<Number>>();
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Data " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+
+ {
+ // The output should be the column vector [16, 19, 22, 25]
+ const std::vector<hsize_t> hyperslab_offset = {1, 0, 1};
+ const std::vector<hsize_t> hyperslab_count = {1, 4, 1};
+ auto data = dataset.read_hyperslab<std::vector<Number>>(hyperslab_offset,
+ hyperslab_count);
+
+ std::cout << "Column vector" << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Column vector " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+
+ {
+ // The output should be the row vector [1, 16]
+ const std::vector<hsize_t> hyperslab_offset = {0, 0, 1};
+ const std::vector<hsize_t> hyperslab_count = {2, 1, 1};
+ auto data = dataset.read_hyperslab<std::vector<Number>>(hyperslab_offset,
+ hyperslab_count);
+
+ std::cout << "Row vector" << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Row vector " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+
+ {
+ // The output should be the matrix [[18, 19], [21, 22], [24, 25]]
+ const std::vector<hsize_t> hyperslab_offset = {1, 1, 0};
+ const std::vector<hsize_t> hyperslab_count = {1, 3, 2};
+ auto data = dataset.read_hyperslab<FullMatrix<Number>>(hyperslab_offset,
+ hyperslab_count);
+
+ std::cout << "Sub-matrix" << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Sub-matrix " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+
+ {
+ // The output should be the matrix [[3, 4, 5], [18, 19, 20]]
+ const std::vector<hsize_t> hyperslab_offset = {0, 1, 0};
+ const std::vector<hsize_t> hyperslab_count = {2, 1, 3};
+ auto data = dataset.read_hyperslab<FullMatrix<Number>>(hyperslab_offset,
+ hyperslab_count);
+
+ std::cout << "Sub-matrix" << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Sub-matrix " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+
+ {
+ // The output should be the matrix [[0, 2], [6, 8], [12, 14]]
+
+ const std::vector<hsize_t> data_dimensions = {1, 3, 2};
+ const std::vector<hsize_t> offset = {0, 0, 0};
+ const std::vector<hsize_t> stride = {1, 2, 2};
+ const std::vector<hsize_t> count = {1, 3, 2};
+ const std::vector<hsize_t> block = {1, 1, 1};
+
+ auto data = dataset.read_hyperslab<FullMatrix<Number>>(
+ data_dimensions, offset, stride, count, block);
+
+ std::cout << "Sub-matrix" << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Sub-matrix " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+
+ {
+ // The output should be the matrix [0, 20, 22, 13, 11]
+ std::vector<hsize_t> coordinates = {0,
+ 0,
+ 0, // first point
+ 1,
+ 1,
+ 2, // second point
+ 1,
+ 2,
+ 1, // third point
+ 0,
+ 4,
+ 1, // fourth point
+ 0,
+ 3,
+ 2}; // fith point
+
+ auto data = dataset.read_selection<std::vector<Number>>(coordinates);
+
+ std::cout << "Sub-matrix" << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Selection std::vector " + dataset_name << "<" << type_name
+ << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+
+ {
+ // The output should be the matrix [0, 20, 22, 13, 11]
+ std::vector<hsize_t> coordinates = {0,
+ 0,
+ 0, // first point
+ 1,
+ 1,
+ 2, // second point
+ 1,
+ 2,
+ 1, // third point
+ 0,
+ 4,
+ 1, // fourth point
+ 0,
+ 3,
+ 2}; // fith point
+
+ auto data = dataset.read_selection<Vector<Number>>(coordinates);
+
+ std::cout << "Sub-matrix" << std::endl;
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Selection Vector " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+ }
+
+ {
+ std::string dataset_name("dataset_3");
+
+ // This dataset is a 2x5x3 tensor
+ // Output generated by h5dump
+ // (0,0,0): 0, 1, 2, (1,0,0): 0, 2, 4,
+ // (0,1,0): 3, 4, 5, (1,1,0): 6, 8, 10,
+ // (0,2,0): 6, 7, 8, (1,2,0): 12, 14, 16,
+ // (0,3,0): 9, 10, 11, (1,3,0): 18, 20, 22,
+ // (0,4,0): 12, 13, 14, (1,4,0): 24, 26, 28
+
+ auto dataset = group.open_dataset(dataset_name);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_size() << std::endl;
+ deallog << "Rank " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_rank() << std::endl;
+ {
+ auto data = dataset.read<std::vector<Number>>();
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Data " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+ }
+
+ {
+ std::string dataset_name("dataset_4");
+
+ // This dataset is a 3x2x4 tensor
+ // Output generated by h5dump
+ // (0,0,0): 0, 1, 2, 3,
+ // (0,1,0): 0, 2, 4, 6,
+ // (1,0,0): 4, 5, 6, 7,
+ // (1,1,0): 8, 10, 12, 14,
+ // (2,0,0): 8, 9, 10, 11,
+ // (2,1,0): 16, 18, 20, 22
+
+ auto dataset = group.open_dataset(dataset_name);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_size() << std::endl;
+ deallog << "Rank " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_rank() << std::endl;
+ {
+ auto data = dataset.read<std::vector<Number>>();
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Data " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+ }
+
+ {
+ std::string dataset_name("dataset_5");
+
+ // This dataset is a 3x2x4 tensor
+ // Output generated by h5dump
+ // (0,0,0): 2, 0, 0, 38,
+ // (0,1,0): 6, 5, 0, 3,
+ // (1,0,0): 12, 0, 0, 0,
+ // (1,1,0): 16, 15, 0, 13,
+ // (2,0,0): 32, 0, 0, 0,
+ // (2,1,0): 36, 35, 0, 33
+
+
+ auto dataset = group.open_dataset(dataset_name);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_size() << std::endl;
+ deallog << "Rank " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_rank() << std::endl;
+ {
+ auto data = dataset.read<std::vector<Number>>();
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Data " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+ }
+
+ {
+ std::string dataset_name("dataset_6");
+
+ // This dataset is a 7x12 matrix
+ // Output generated by h5dump
+ // (0,0): -0, 0, 1, -1, 2, 3, -2, 4, 5, -3, 6, 7,
+ // (1,0): -4, 8, 9, -5, 10, 11, -6, 12, 13, -7, 14, 15,
+ // (2,0): -8, 16, 17, -9, 18, 19, -10, 20, 21, -11, 22, 23,
+ // (3,0): -12, 0, 0, -13, 0, 0, -14, 0, 0, -15, 0, 0,
+ // (4,0): -16, 24, 25, -17, 26, 27, -18, 28, 29, -19, 30, 31,
+ // (5,0): -20, 32, 33, -21, 34, 35, -22, 36, 37, -23, 38, 39,
+ // (6,0): -24, 40, 41, -25, 42, 43, -26, 44, 45, -27, 46, 47
+
+
+ auto dataset = group.open_dataset(dataset_name);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_size() << std::endl;
+ deallog << "Rank " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_rank() << std::endl;
+ {
+ auto data = dataset.read<FullMatrix<Number>>();
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Data " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+ }
+
+ {
+ std::string dataset_name("dataset_7");
+
+ // This dataset is a 3x2x4 tensor
+ // Output generated by h5dump
+ // (0,0,0): 2, 0, 0, 38,
+ // (0,1,0): 6, 5, 0, 3,
+ // (1,0,0): 12, 0, 0, 0,
+ // (1,1,0): 16, 15, 0, 13,
+ // (2,0,0): 32, 0, 0, 0,
+ // (2,1,0): 36, 35, 0, 33
+
+
+ auto dataset = group.open_dataset(dataset_name);
+ dataset.set_query_io_mode(true);
+ deallog << "Dimensions " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_dimensions() << std::endl;
+ deallog << "Size " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_size() << std::endl;
+ deallog << "Rank " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_rank() << std::endl;
+ {
+ auto data = dataset.read<std::vector<Number>>();
+
+ std::cout << "IO mode " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << dataset.get_io_mode() << std::endl;
+ std::cout << "Local no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_local_no_collective_cause()
+ << std::endl;
+ std::cout << "Global no collective cause " << dataset_name << "<"
+ << type_name << ">"
+ << " (Read): " << dataset.get_global_no_collective_cause()
+ << std::endl;
+
+ deallog << "Data " + dataset_name << "<" << type_name << ">"
+ << " (Read): " << container_to_string(data) << std::endl;
+ }
+ }
+}
+
+
+int
+main(int argc, char **argv)
+{
+ initlog();
+
+ try
+ {
+ std::string filename = "test.h5";
+
+ {
+ HDF5::File data_file(filename, HDF5::File::FileAccessMode::create);
+
+ write_test<float>(data_file);
+ write_test<double>(data_file);
+
+#ifdef DEAL_II_WITH_COMPLEX_VALUES
+ write_test<std::complex<float>>(data_file);
+ write_test<std::complex<double>>(data_file);
+#endif
+ }
+
+ {
+ HDF5::File data_file(filename, HDF5::File::FileAccessMode::open);
+ read_test<float>(data_file);
+ read_test<double>(data_file);
+
+#ifdef DEAL_II_WITH_COMPLEX_VALUES
+ read_test<std::complex<float>>(data_file);
+ read_test<std::complex<double>>(data_file);
+#endif
+ }
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl
+ << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl
+ << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+
+DEAL::Write tests for float datasets
+DEAL::Dimensions dataset_1<float> (Write): 5 3
+DEAL::Size dataset_1<float> (Write): 15
+DEAL::Rank dataset_1<float> (Write): 2
+DEAL::Data dataset_1<float> (Write): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
+DEAL::Dimensions dataset_2<float> (Write): 2 5 3
+DEAL::Size dataset_2<float> (Write): 30
+DEAL::Rank dataset_2<float> (Write): 3
+DEAL::Data dataset_2<float> (Write): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
+DEAL::Dimensions dataset_3<float> (Write): 2 5 3
+DEAL::Size dataset_3<float> (Write): 30
+DEAL::Rank dataset_3<float> (Write): 3
+DEAL::Dimensions dataset_4<float> (Write): 3 2 4
+DEAL::Size dataset_4<float> (Write): 24
+DEAL::Rank dataset_4<float> (Write): 3
+DEAL::Dimensions dataset_5<float> (Write): 3 2 4
+DEAL::Size dataset_5<float> (Write): 24
+DEAL::Rank dataset_5<float> (Write): 3
+DEAL::Dimensions dataset_6<float> (Write): 7 12
+DEAL::Size dataset_6<float> (Write): 84
+DEAL::Rank dataset_6<float> (Write): 2
+DEAL::Dimensions dataset_7<float> (Write): 3 2 4
+DEAL::Size dataset_7<float> (Write): 24
+DEAL::Rank dataset_7<float> (Write): 3
+DEAL::Write tests for double datasets
+DEAL::Dimensions dataset_1<double> (Write): 5 3
+DEAL::Size dataset_1<double> (Write): 15
+DEAL::Rank dataset_1<double> (Write): 2
+DEAL::Data dataset_1<double> (Write): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
+DEAL::Dimensions dataset_2<double> (Write): 2 5 3
+DEAL::Size dataset_2<double> (Write): 30
+DEAL::Rank dataset_2<double> (Write): 3
+DEAL::Data dataset_2<double> (Write): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
+DEAL::Dimensions dataset_3<double> (Write): 2 5 3
+DEAL::Size dataset_3<double> (Write): 30
+DEAL::Rank dataset_3<double> (Write): 3
+DEAL::Dimensions dataset_4<double> (Write): 3 2 4
+DEAL::Size dataset_4<double> (Write): 24
+DEAL::Rank dataset_4<double> (Write): 3
+DEAL::Dimensions dataset_5<double> (Write): 3 2 4
+DEAL::Size dataset_5<double> (Write): 24
+DEAL::Rank dataset_5<double> (Write): 3
+DEAL::Dimensions dataset_6<double> (Write): 7 12
+DEAL::Size dataset_6<double> (Write): 84
+DEAL::Rank dataset_6<double> (Write): 2
+DEAL::Dimensions dataset_7<double> (Write): 3 2 4
+DEAL::Size dataset_7<double> (Write): 24
+DEAL::Rank dataset_7<double> (Write): 3
+DEAL::Read tests for float datasets
+DEAL::Dimensions dataset_1<float> (Read): 5 3
+DEAL::Size dataset_1<float> (Read): 15
+DEAL::Rank dataset_1<float> (Read): 2
+DEAL::Data dataset_1<float> (Read): [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
+DEAL::Column vector dataset_1<float> (Read): [7, 10, 13]
+DEAL::Row vector dataset_1<float> (Read): [9, 10, 11]
+DEAL::Sub-matrix dataset_1<float> (Read): [[3, 4, 5], [6, 7, 8]]
+DEAL::Dimensions dataset_2<float> (Read): 2 5 3
+DEAL::Size dataset_2<float> (Read): 30
+DEAL::Rank dataset_2<float> (Read): 3
+DEAL::Data dataset_2<float> (Read): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
+DEAL::Column vector dataset_2<float> (Read): [16, 19, 22, 25]
+DEAL::Row vector dataset_2<float> (Read): [1, 16]
+DEAL::Sub-matrix dataset_2<float> (Read): [[18, 19], [21, 22], [24, 25]]
+DEAL::Sub-matrix dataset_2<float> (Read): [[3, 4, 5], [18, 19, 20]]
+DEAL::Sub-matrix dataset_2<float> (Read): [[0, 2], [6, 8], [12, 14]]
+DEAL::Selection std::vector dataset_2<float> (Read): [0, 20, 22, 13, 11]
+DEAL::Selection Vector dataset_2<float> (Read): [0, 20, 22, 13, 11]
+DEAL::Dimensions dataset_3<float> (Read): 2 5 3
+DEAL::Size dataset_3<float> (Read): 30
+DEAL::Rank dataset_3<float> (Read): 3
+DEAL::Data dataset_3<float> (Read): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28]
+DEAL::Dimensions dataset_4<float> (Read): 3 2 4
+DEAL::Size dataset_4<float> (Read): 24
+DEAL::Rank dataset_4<float> (Read): 3
+DEAL::Data dataset_4<float> (Read): [0, 1, 2, 3, 0, 2, 4, 6, 4, 5, 6, 7, 8, 10, 12, 14, 8, 9, 10, 11, 16, 18, 20, 22]
+DEAL::Dimensions dataset_5<float> (Read): 3 2 4
+DEAL::Size dataset_5<float> (Read): 24
+DEAL::Rank dataset_5<float> (Read): 3
+DEAL::Data dataset_5<float> (Read): [2, 0, 0, 38, 6, 5, 0, 3, 12, 0, 0, 0, 16, 15, 0, 13, 32, 0, 0, 0, 36, 35, 0, 33]
+DEAL::Dimensions dataset_6<float> (Read): 7 12
+DEAL::Size dataset_6<float> (Read): 84
+DEAL::Rank dataset_6<float> (Read): 2
+DEAL::Data dataset_6<float> (Read): [[-0, 0, 1, -1, 2, 3, -2, 4, 5, -3, 6, 7], [-4, 8, 9, -5, 10, 11, -6, 12, 13, -7, 14, 15], [-8, 16, 17, -9, 18, 19, -10, 20, 21, -11, 22, 23], [-12, 0, 0, -13, 0, 0, -14, 0, 0, -15, 0, 0], [-16, 24, 25, -17, 26, 27, -18, 28, 29, -19, 30, 31], [-20, 32, 33, -21, 34, 35, -22, 36, 37, -23, 38, 39], [-24, 40, 41, -25, 42, 43, -26, 44, 45, -27, 46, 47]]
+DEAL::Dimensions dataset_7<float> (Read): 3 2 4
+DEAL::Size dataset_7<float> (Read): 24
+DEAL::Rank dataset_7<float> (Read): 3
+DEAL::Data dataset_7<float> (Read): [2, 0, 0, 38, 6, 5, 0, 3, 12, 0, 0, 0, 16, 15, 0, 13, 32, 0, 0, 0, 36, 35, 0, 33]
+DEAL::Read tests for double datasets
+DEAL::Dimensions dataset_1<double> (Read): 5 3
+DEAL::Size dataset_1<double> (Read): 15
+DEAL::Rank dataset_1<double> (Read): 2
+DEAL::Data dataset_1<double> (Read): [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
+DEAL::Column vector dataset_1<double> (Read): [7, 10, 13]
+DEAL::Row vector dataset_1<double> (Read): [9, 10, 11]
+DEAL::Sub-matrix dataset_1<double> (Read): [[3, 4, 5], [6, 7, 8]]
+DEAL::Dimensions dataset_2<double> (Read): 2 5 3
+DEAL::Size dataset_2<double> (Read): 30
+DEAL::Rank dataset_2<double> (Read): 3
+DEAL::Data dataset_2<double> (Read): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
+DEAL::Column vector dataset_2<double> (Read): [16, 19, 22, 25]
+DEAL::Row vector dataset_2<double> (Read): [1, 16]
+DEAL::Sub-matrix dataset_2<double> (Read): [[18, 19], [21, 22], [24, 25]]
+DEAL::Sub-matrix dataset_2<double> (Read): [[3, 4, 5], [18, 19, 20]]
+DEAL::Sub-matrix dataset_2<double> (Read): [[0, 2], [6, 8], [12, 14]]
+DEAL::Selection std::vector dataset_2<double> (Read): [0, 20, 22, 13, 11]
+DEAL::Selection Vector dataset_2<double> (Read): [0, 20, 22, 13, 11]
+DEAL::Dimensions dataset_3<double> (Read): 2 5 3
+DEAL::Size dataset_3<double> (Read): 30
+DEAL::Rank dataset_3<double> (Read): 3
+DEAL::Data dataset_3<double> (Read): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28]
+DEAL::Dimensions dataset_4<double> (Read): 3 2 4
+DEAL::Size dataset_4<double> (Read): 24
+DEAL::Rank dataset_4<double> (Read): 3
+DEAL::Data dataset_4<double> (Read): [0, 1, 2, 3, 0, 2, 4, 6, 4, 5, 6, 7, 8, 10, 12, 14, 8, 9, 10, 11, 16, 18, 20, 22]
+DEAL::Dimensions dataset_5<double> (Read): 3 2 4
+DEAL::Size dataset_5<double> (Read): 24
+DEAL::Rank dataset_5<double> (Read): 3
+DEAL::Data dataset_5<double> (Read): [2, 0, 0, 38, 6, 5, 0, 3, 12, 0, 0, 0, 16, 15, 0, 13, 32, 0, 0, 0, 36, 35, 0, 33]
+DEAL::Dimensions dataset_6<double> (Read): 7 12
+DEAL::Size dataset_6<double> (Read): 84
+DEAL::Rank dataset_6<double> (Read): 2
+DEAL::Data dataset_6<double> (Read): [[-0, 0, 1, -1, 2, 3, -2, 4, 5, -3, 6, 7], [-4, 8, 9, -5, 10, 11, -6, 12, 13, -7, 14, 15], [-8, 16, 17, -9, 18, 19, -10, 20, 21, -11, 22, 23], [-12, 0, 0, -13, 0, 0, -14, 0, 0, -15, 0, 0], [-16, 24, 25, -17, 26, 27, -18, 28, 29, -19, 30, 31], [-20, 32, 33, -21, 34, 35, -22, 36, 37, -23, 38, 39], [-24, 40, 41, -25, 42, 43, -26, 44, 45, -27, 46, 47]]
+DEAL::Dimensions dataset_7<double> (Read): 3 2 4
+DEAL::Size dataset_7<double> (Read): 24
+DEAL::Rank dataset_7<double> (Read): 3
+DEAL::Data dataset_7<double> (Read): [2, 0, 0, 38, 6, 5, 0, 3, 12, 0, 0, 0, 16, 15, 0, 13, 32, 0, 0, 0, 36, 35, 0, 33]
--- /dev/null
+
+DEAL::Write tests for float datasets
+DEAL::Dimensions dataset_1<float> (Write): 5 3
+DEAL::Size dataset_1<float> (Write): 15
+DEAL::Rank dataset_1<float> (Write): 2
+DEAL::Data dataset_1<float> (Write): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
+DEAL::Dimensions dataset_2<float> (Write): 2 5 3
+DEAL::Size dataset_2<float> (Write): 30
+DEAL::Rank dataset_2<float> (Write): 3
+DEAL::Data dataset_2<float> (Write): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
+DEAL::Dimensions dataset_3<float> (Write): 2 5 3
+DEAL::Size dataset_3<float> (Write): 30
+DEAL::Rank dataset_3<float> (Write): 3
+DEAL::Dimensions dataset_4<float> (Write): 3 2 4
+DEAL::Size dataset_4<float> (Write): 24
+DEAL::Rank dataset_4<float> (Write): 3
+DEAL::Dimensions dataset_5<float> (Write): 3 2 4
+DEAL::Size dataset_5<float> (Write): 24
+DEAL::Rank dataset_5<float> (Write): 3
+DEAL::Dimensions dataset_6<float> (Write): 7 12
+DEAL::Size dataset_6<float> (Write): 84
+DEAL::Rank dataset_6<float> (Write): 2
+DEAL::Dimensions dataset_7<float> (Write): 3 2 4
+DEAL::Size dataset_7<float> (Write): 24
+DEAL::Rank dataset_7<float> (Write): 3
+DEAL::Write tests for double datasets
+DEAL::Dimensions dataset_1<double> (Write): 5 3
+DEAL::Size dataset_1<double> (Write): 15
+DEAL::Rank dataset_1<double> (Write): 2
+DEAL::Data dataset_1<double> (Write): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
+DEAL::Dimensions dataset_2<double> (Write): 2 5 3
+DEAL::Size dataset_2<double> (Write): 30
+DEAL::Rank dataset_2<double> (Write): 3
+DEAL::Data dataset_2<double> (Write): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
+DEAL::Dimensions dataset_3<double> (Write): 2 5 3
+DEAL::Size dataset_3<double> (Write): 30
+DEAL::Rank dataset_3<double> (Write): 3
+DEAL::Dimensions dataset_4<double> (Write): 3 2 4
+DEAL::Size dataset_4<double> (Write): 24
+DEAL::Rank dataset_4<double> (Write): 3
+DEAL::Dimensions dataset_5<double> (Write): 3 2 4
+DEAL::Size dataset_5<double> (Write): 24
+DEAL::Rank dataset_5<double> (Write): 3
+DEAL::Dimensions dataset_6<double> (Write): 7 12
+DEAL::Size dataset_6<double> (Write): 84
+DEAL::Rank dataset_6<double> (Write): 2
+DEAL::Dimensions dataset_7<double> (Write): 3 2 4
+DEAL::Size dataset_7<double> (Write): 24
+DEAL::Rank dataset_7<double> (Write): 3
+DEAL::Write tests for std::complex<float> datasets
+DEAL::Dimensions dataset_1<std::complex<float>> (Write): 5 3
+DEAL::Size dataset_1<std::complex<float>> (Write): 15
+DEAL::Rank dataset_1<std::complex<float>> (Write): 2
+DEAL::Data dataset_1<std::complex<float>> (Write): [(0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (8,0), (9,0), (10,0), (11,0), (12,0), (13,0), (14,0)]
+DEAL::Dimensions dataset_2<std::complex<float>> (Write): 2 5 3
+DEAL::Size dataset_2<std::complex<float>> (Write): 30
+DEAL::Rank dataset_2<std::complex<float>> (Write): 3
+DEAL::Data dataset_2<std::complex<float>> (Write): [(0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (8,0), (9,0), (10,0), (11,0), (12,0), (13,0), (14,0), (15,0), (16,0), (17,0), (18,0), (19,0), (20,0), (21,0), (22,0), (23,0), (24,0), (25,0), (26,0), (27,0), (28,0), (29,0)]
+DEAL::Dimensions dataset_3<std::complex<float>> (Write): 2 5 3
+DEAL::Size dataset_3<std::complex<float>> (Write): 30
+DEAL::Rank dataset_3<std::complex<float>> (Write): 3
+DEAL::Dimensions dataset_4<std::complex<float>> (Write): 3 2 4
+DEAL::Size dataset_4<std::complex<float>> (Write): 24
+DEAL::Rank dataset_4<std::complex<float>> (Write): 3
+DEAL::Dimensions dataset_5<std::complex<float>> (Write): 3 2 4
+DEAL::Size dataset_5<std::complex<float>> (Write): 24
+DEAL::Rank dataset_5<std::complex<float>> (Write): 3
+DEAL::Dimensions dataset_6<std::complex<float>> (Write): 7 12
+DEAL::Size dataset_6<std::complex<float>> (Write): 84
+DEAL::Rank dataset_6<std::complex<float>> (Write): 2
+DEAL::Dimensions dataset_7<std::complex<float>> (Write): 3 2 4
+DEAL::Size dataset_7<std::complex<float>> (Write): 24
+DEAL::Rank dataset_7<std::complex<float>> (Write): 3
+DEAL::Write tests for std::complex<double> datasets
+DEAL::Dimensions dataset_1<std::complex<double>> (Write): 5 3
+DEAL::Size dataset_1<std::complex<double>> (Write): 15
+DEAL::Rank dataset_1<std::complex<double>> (Write): 2
+DEAL::Data dataset_1<std::complex<double>> (Write): [(0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (8,0), (9,0), (10,0), (11,0), (12,0), (13,0), (14,0)]
+DEAL::Dimensions dataset_2<std::complex<double>> (Write): 2 5 3
+DEAL::Size dataset_2<std::complex<double>> (Write): 30
+DEAL::Rank dataset_2<std::complex<double>> (Write): 3
+DEAL::Data dataset_2<std::complex<double>> (Write): [(0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (8,0), (9,0), (10,0), (11,0), (12,0), (13,0), (14,0), (15,0), (16,0), (17,0), (18,0), (19,0), (20,0), (21,0), (22,0), (23,0), (24,0), (25,0), (26,0), (27,0), (28,0), (29,0)]
+DEAL::Dimensions dataset_3<std::complex<double>> (Write): 2 5 3
+DEAL::Size dataset_3<std::complex<double>> (Write): 30
+DEAL::Rank dataset_3<std::complex<double>> (Write): 3
+DEAL::Dimensions dataset_4<std::complex<double>> (Write): 3 2 4
+DEAL::Size dataset_4<std::complex<double>> (Write): 24
+DEAL::Rank dataset_4<std::complex<double>> (Write): 3
+DEAL::Dimensions dataset_5<std::complex<double>> (Write): 3 2 4
+DEAL::Size dataset_5<std::complex<double>> (Write): 24
+DEAL::Rank dataset_5<std::complex<double>> (Write): 3
+DEAL::Dimensions dataset_6<std::complex<double>> (Write): 7 12
+DEAL::Size dataset_6<std::complex<double>> (Write): 84
+DEAL::Rank dataset_6<std::complex<double>> (Write): 2
+DEAL::Dimensions dataset_7<std::complex<double>> (Write): 3 2 4
+DEAL::Size dataset_7<std::complex<double>> (Write): 24
+DEAL::Rank dataset_7<std::complex<double>> (Write): 3
+DEAL::Read tests for float datasets
+DEAL::Dimensions dataset_1<float> (Read): 5 3
+DEAL::Size dataset_1<float> (Read): 15
+DEAL::Rank dataset_1<float> (Read): 2
+DEAL::Data dataset_1<float> (Read): [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
+DEAL::Column vector dataset_1<float> (Read): [7, 10, 13]
+DEAL::Row vector dataset_1<float> (Read): [9, 10, 11]
+DEAL::Sub-matrix dataset_1<float> (Read): [[3, 4, 5], [6, 7, 8]]
+DEAL::Dimensions dataset_2<float> (Read): 2 5 3
+DEAL::Size dataset_2<float> (Read): 30
+DEAL::Rank dataset_2<float> (Read): 3
+DEAL::Data dataset_2<float> (Read): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
+DEAL::Column vector dataset_2<float> (Read): [16, 19, 22, 25]
+DEAL::Row vector dataset_2<float> (Read): [1, 16]
+DEAL::Sub-matrix dataset_2<float> (Read): [[18, 19], [21, 22], [24, 25]]
+DEAL::Sub-matrix dataset_2<float> (Read): [[3, 4, 5], [18, 19, 20]]
+DEAL::Sub-matrix dataset_2<float> (Read): [[0, 2], [6, 8], [12, 14]]
+DEAL::Selection std::vector dataset_2<float> (Read): [0, 20, 22, 13, 11]
+DEAL::Selection Vector dataset_2<float> (Read): [0, 20, 22, 13, 11]
+DEAL::Dimensions dataset_3<float> (Read): 2 5 3
+DEAL::Size dataset_3<float> (Read): 30
+DEAL::Rank dataset_3<float> (Read): 3
+DEAL::Data dataset_3<float> (Read): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28]
+DEAL::Dimensions dataset_4<float> (Read): 3 2 4
+DEAL::Size dataset_4<float> (Read): 24
+DEAL::Rank dataset_4<float> (Read): 3
+DEAL::Data dataset_4<float> (Read): [0, 1, 2, 3, 0, 2, 4, 6, 4, 5, 6, 7, 8, 10, 12, 14, 8, 9, 10, 11, 16, 18, 20, 22]
+DEAL::Dimensions dataset_5<float> (Read): 3 2 4
+DEAL::Size dataset_5<float> (Read): 24
+DEAL::Rank dataset_5<float> (Read): 3
+DEAL::Data dataset_5<float> (Read): [2, 0, 0, 38, 6, 5, 0, 3, 12, 0, 0, 0, 16, 15, 0, 13, 32, 0, 0, 0, 36, 35, 0, 33]
+DEAL::Dimensions dataset_6<float> (Read): 7 12
+DEAL::Size dataset_6<float> (Read): 84
+DEAL::Rank dataset_6<float> (Read): 2
+DEAL::Data dataset_6<float> (Read): [[-0, 0, 1, -1, 2, 3, -2, 4, 5, -3, 6, 7], [-4, 8, 9, -5, 10, 11, -6, 12, 13, -7, 14, 15], [-8, 16, 17, -9, 18, 19, -10, 20, 21, -11, 22, 23], [-12, 0, 0, -13, 0, 0, -14, 0, 0, -15, 0, 0], [-16, 24, 25, -17, 26, 27, -18, 28, 29, -19, 30, 31], [-20, 32, 33, -21, 34, 35, -22, 36, 37, -23, 38, 39], [-24, 40, 41, -25, 42, 43, -26, 44, 45, -27, 46, 47]]
+DEAL::Dimensions dataset_7<float> (Read): 3 2 4
+DEAL::Size dataset_7<float> (Read): 24
+DEAL::Rank dataset_7<float> (Read): 3
+DEAL::Data dataset_7<float> (Read): [2, 0, 0, 38, 6, 5, 0, 3, 12, 0, 0, 0, 16, 15, 0, 13, 32, 0, 0, 0, 36, 35, 0, 33]
+DEAL::Read tests for double datasets
+DEAL::Dimensions dataset_1<double> (Read): 5 3
+DEAL::Size dataset_1<double> (Read): 15
+DEAL::Rank dataset_1<double> (Read): 2
+DEAL::Data dataset_1<double> (Read): [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
+DEAL::Column vector dataset_1<double> (Read): [7, 10, 13]
+DEAL::Row vector dataset_1<double> (Read): [9, 10, 11]
+DEAL::Sub-matrix dataset_1<double> (Read): [[3, 4, 5], [6, 7, 8]]
+DEAL::Dimensions dataset_2<double> (Read): 2 5 3
+DEAL::Size dataset_2<double> (Read): 30
+DEAL::Rank dataset_2<double> (Read): 3
+DEAL::Data dataset_2<double> (Read): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
+DEAL::Column vector dataset_2<double> (Read): [16, 19, 22, 25]
+DEAL::Row vector dataset_2<double> (Read): [1, 16]
+DEAL::Sub-matrix dataset_2<double> (Read): [[18, 19], [21, 22], [24, 25]]
+DEAL::Sub-matrix dataset_2<double> (Read): [[3, 4, 5], [18, 19, 20]]
+DEAL::Sub-matrix dataset_2<double> (Read): [[0, 2], [6, 8], [12, 14]]
+DEAL::Selection std::vector dataset_2<double> (Read): [0, 20, 22, 13, 11]
+DEAL::Selection Vector dataset_2<double> (Read): [0, 20, 22, 13, 11]
+DEAL::Dimensions dataset_3<double> (Read): 2 5 3
+DEAL::Size dataset_3<double> (Read): 30
+DEAL::Rank dataset_3<double> (Read): 3
+DEAL::Data dataset_3<double> (Read): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28]
+DEAL::Dimensions dataset_4<double> (Read): 3 2 4
+DEAL::Size dataset_4<double> (Read): 24
+DEAL::Rank dataset_4<double> (Read): 3
+DEAL::Data dataset_4<double> (Read): [0, 1, 2, 3, 0, 2, 4, 6, 4, 5, 6, 7, 8, 10, 12, 14, 8, 9, 10, 11, 16, 18, 20, 22]
+DEAL::Dimensions dataset_5<double> (Read): 3 2 4
+DEAL::Size dataset_5<double> (Read): 24
+DEAL::Rank dataset_5<double> (Read): 3
+DEAL::Data dataset_5<double> (Read): [2, 0, 0, 38, 6, 5, 0, 3, 12, 0, 0, 0, 16, 15, 0, 13, 32, 0, 0, 0, 36, 35, 0, 33]
+DEAL::Dimensions dataset_6<double> (Read): 7 12
+DEAL::Size dataset_6<double> (Read): 84
+DEAL::Rank dataset_6<double> (Read): 2
+DEAL::Data dataset_6<double> (Read): [[-0, 0, 1, -1, 2, 3, -2, 4, 5, -3, 6, 7], [-4, 8, 9, -5, 10, 11, -6, 12, 13, -7, 14, 15], [-8, 16, 17, -9, 18, 19, -10, 20, 21, -11, 22, 23], [-12, 0, 0, -13, 0, 0, -14, 0, 0, -15, 0, 0], [-16, 24, 25, -17, 26, 27, -18, 28, 29, -19, 30, 31], [-20, 32, 33, -21, 34, 35, -22, 36, 37, -23, 38, 39], [-24, 40, 41, -25, 42, 43, -26, 44, 45, -27, 46, 47]]
+DEAL::Dimensions dataset_7<double> (Read): 3 2 4
+DEAL::Size dataset_7<double> (Read): 24
+DEAL::Rank dataset_7<double> (Read): 3
+DEAL::Data dataset_7<double> (Read): [2, 0, 0, 38, 6, 5, 0, 3, 12, 0, 0, 0, 16, 15, 0, 13, 32, 0, 0, 0, 36, 35, 0, 33]
+DEAL::Read tests for std::complex<float> datasets
+DEAL::Dimensions dataset_1<std::complex<float>> (Read): 5 3
+DEAL::Size dataset_1<std::complex<float>> (Read): 15
+DEAL::Rank dataset_1<std::complex<float>> (Read): 2
+DEAL::Data dataset_1<std::complex<float>> (Read): [[(0,0), (1,0), (2,0)], [(3,0), (4,0), (5,0)], [(6,0), (7,0), (8,0)], [(9,0), (10,0), (11,0)], [(12,0), (13,0), (14,0)]]
+DEAL::Column vector dataset_1<std::complex<float>> (Read): [(7,0), (10,0), (13,0)]
+DEAL::Row vector dataset_1<std::complex<float>> (Read): [(9,0), (10,0), (11,0)]
+DEAL::Sub-matrix dataset_1<std::complex<float>> (Read): [[(3,0), (4,0), (5,0)], [(6,0), (7,0), (8,0)]]
+DEAL::Dimensions dataset_2<std::complex<float>> (Read): 2 5 3
+DEAL::Size dataset_2<std::complex<float>> (Read): 30
+DEAL::Rank dataset_2<std::complex<float>> (Read): 3
+DEAL::Data dataset_2<std::complex<float>> (Read): [(0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (8,0), (9,0), (10,0), (11,0), (12,0), (13,0), (14,0), (15,0), (16,0), (17,0), (18,0), (19,0), (20,0), (21,0), (22,0), (23,0), (24,0), (25,0), (26,0), (27,0), (28,0), (29,0)]
+DEAL::Column vector dataset_2<std::complex<float>> (Read): [(16,0), (19,0), (22,0), (25,0)]
+DEAL::Row vector dataset_2<std::complex<float>> (Read): [(1,0), (16,0)]
+DEAL::Sub-matrix dataset_2<std::complex<float>> (Read): [[(18,0), (19,0)], [(21,0), (22,0)], [(24,0), (25,0)]]
+DEAL::Sub-matrix dataset_2<std::complex<float>> (Read): [[(3,0), (4,0), (5,0)], [(18,0), (19,0), (20,0)]]
+DEAL::Sub-matrix dataset_2<std::complex<float>> (Read): [[(0,0), (2,0)], [(6,0), (8,0)], [(12,0), (14,0)]]
+DEAL::Selection std::vector dataset_2<std::complex<float>> (Read): [(0,0), (20,0), (22,0), (13,0), (11,0)]
+DEAL::Selection Vector dataset_2<std::complex<float>> (Read): [(0,0), (20,0), (22,0), (13,0), (11,0)]
+DEAL::Dimensions dataset_3<std::complex<float>> (Read): 2 5 3
+DEAL::Size dataset_3<std::complex<float>> (Read): 30
+DEAL::Rank dataset_3<std::complex<float>> (Read): 3
+DEAL::Data dataset_3<std::complex<float>> (Read): [(0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (8,0), (9,0), (10,0), (11,0), (12,0), (13,0), (14,0), (0,0), (2,0), (4,0), (6,0), (8,0), (10,0), (12,0), (14,0), (16,0), (18,0), (20,0), (22,0), (24,0), (26,0), (28,0)]
+DEAL::Dimensions dataset_4<std::complex<float>> (Read): 3 2 4
+DEAL::Size dataset_4<std::complex<float>> (Read): 24
+DEAL::Rank dataset_4<std::complex<float>> (Read): 3
+DEAL::Data dataset_4<std::complex<float>> (Read): [(0,0), (1,0), (2,0), (3,0), (0,0), (2,0), (4,0), (6,0), (4,0), (5,0), (6,0), (7,0), (8,0), (10,0), (12,0), (14,0), (8,0), (9,0), (10,0), (11,0), (16,0), (18,0), (20,0), (22,0)]
+DEAL::Dimensions dataset_5<std::complex<float>> (Read): 3 2 4
+DEAL::Size dataset_5<std::complex<float>> (Read): 24
+DEAL::Rank dataset_5<std::complex<float>> (Read): 3
+DEAL::Data dataset_5<std::complex<float>> (Read): [(2,0), (0,0), (0,0), (38,0), (6,0), (5,0), (0,0), (3,0), (12,0), (0,0), (0,0), (0,0), (16,0), (15,0), (0,0), (13,0), (32,0), (0,0), (0,0), (0,0), (36,0), (35,0), (0,0), (33,0)]
+DEAL::Dimensions dataset_6<std::complex<float>> (Read): 7 12
+DEAL::Size dataset_6<std::complex<float>> (Read): 84
+DEAL::Rank dataset_6<std::complex<float>> (Read): 2
+DEAL::Data dataset_6<std::complex<float>> (Read): [[(-0,0), (0,0), (1,0), (-1,0), (2,0), (3,0), (-2,0), (4,0), (5,0), (-3,0), (6,0), (7,0)], [(-4,0), (8,0), (9,0), (-5,0), (10,0), (11,0), (-6,0), (12,0), (13,0), (-7,0), (14,0), (15,0)], [(-8,0), (16,0), (17,0), (-9,0), (18,0), (19,0), (-10,0), (20,0), (21,0), (-11,0), (22,0), (23,0)], [(-12,0), (0,0), (0,0), (-13,0), (0,0), (0,0), (-14,0), (0,0), (0,0), (-15,0), (0,0), (0,0)], [(-16,0), (24,0), (25,0), (-17,0), (26,0), (27,0), (-18,0), (28,0), (29,0), (-19,0), (30,0), (31,0)], [(-20,0), (32,0), (33,0), (-21,0), (34,0), (35,0), (-22,0), (36,0), (37,0), (-23,0), (38,0), (39,0)], [(-24,0), (40,0), (41,0), (-25,0), (42,0), (43,0), (-26,0), (44,0), (45,0), (-27,0), (46,0), (47,0)]]
+DEAL::Dimensions dataset_7<std::complex<float>> (Read): 3 2 4
+DEAL::Size dataset_7<std::complex<float>> (Read): 24
+DEAL::Rank dataset_7<std::complex<float>> (Read): 3
+DEAL::Data dataset_7<std::complex<float>> (Read): [(2,0), (0,0), (0,0), (38,0), (6,0), (5,0), (0,0), (3,0), (12,0), (0,0), (0,0), (0,0), (16,0), (15,0), (0,0), (13,0), (32,0), (0,0), (0,0), (0,0), (36,0), (35,0), (0,0), (33,0)]
+DEAL::Read tests for std::complex<double> datasets
+DEAL::Dimensions dataset_1<std::complex<double>> (Read): 5 3
+DEAL::Size dataset_1<std::complex<double>> (Read): 15
+DEAL::Rank dataset_1<std::complex<double>> (Read): 2
+DEAL::Data dataset_1<std::complex<double>> (Read): [[(0,0), (1,0), (2,0)], [(3,0), (4,0), (5,0)], [(6,0), (7,0), (8,0)], [(9,0), (10,0), (11,0)], [(12,0), (13,0), (14,0)]]
+DEAL::Column vector dataset_1<std::complex<double>> (Read): [(7,0), (10,0), (13,0)]
+DEAL::Row vector dataset_1<std::complex<double>> (Read): [(9,0), (10,0), (11,0)]
+DEAL::Sub-matrix dataset_1<std::complex<double>> (Read): [[(3,0), (4,0), (5,0)], [(6,0), (7,0), (8,0)]]
+DEAL::Dimensions dataset_2<std::complex<double>> (Read): 2 5 3
+DEAL::Size dataset_2<std::complex<double>> (Read): 30
+DEAL::Rank dataset_2<std::complex<double>> (Read): 3
+DEAL::Data dataset_2<std::complex<double>> (Read): [(0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (8,0), (9,0), (10,0), (11,0), (12,0), (13,0), (14,0), (15,0), (16,0), (17,0), (18,0), (19,0), (20,0), (21,0), (22,0), (23,0), (24,0), (25,0), (26,0), (27,0), (28,0), (29,0)]
+DEAL::Column vector dataset_2<std::complex<double>> (Read): [(16,0), (19,0), (22,0), (25,0)]
+DEAL::Row vector dataset_2<std::complex<double>> (Read): [(1,0), (16,0)]
+DEAL::Sub-matrix dataset_2<std::complex<double>> (Read): [[(18,0), (19,0)], [(21,0), (22,0)], [(24,0), (25,0)]]
+DEAL::Sub-matrix dataset_2<std::complex<double>> (Read): [[(3,0), (4,0), (5,0)], [(18,0), (19,0), (20,0)]]
+DEAL::Sub-matrix dataset_2<std::complex<double>> (Read): [[(0,0), (2,0)], [(6,0), (8,0)], [(12,0), (14,0)]]
+DEAL::Selection std::vector dataset_2<std::complex<double>> (Read): [(0,0), (20,0), (22,0), (13,0), (11,0)]
+DEAL::Selection Vector dataset_2<std::complex<double>> (Read): [(0,0), (20,0), (22,0), (13,0), (11,0)]
+DEAL::Dimensions dataset_3<std::complex<double>> (Read): 2 5 3
+DEAL::Size dataset_3<std::complex<double>> (Read): 30
+DEAL::Rank dataset_3<std::complex<double>> (Read): 3
+DEAL::Data dataset_3<std::complex<double>> (Read): [(0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (8,0), (9,0), (10,0), (11,0), (12,0), (13,0), (14,0), (0,0), (2,0), (4,0), (6,0), (8,0), (10,0), (12,0), (14,0), (16,0), (18,0), (20,0), (22,0), (24,0), (26,0), (28,0)]
+DEAL::Dimensions dataset_4<std::complex<double>> (Read): 3 2 4
+DEAL::Size dataset_4<std::complex<double>> (Read): 24
+DEAL::Rank dataset_4<std::complex<double>> (Read): 3
+DEAL::Data dataset_4<std::complex<double>> (Read): [(0,0), (1,0), (2,0), (3,0), (0,0), (2,0), (4,0), (6,0), (4,0), (5,0), (6,0), (7,0), (8,0), (10,0), (12,0), (14,0), (8,0), (9,0), (10,0), (11,0), (16,0), (18,0), (20,0), (22,0)]
+DEAL::Dimensions dataset_5<std::complex<double>> (Read): 3 2 4
+DEAL::Size dataset_5<std::complex<double>> (Read): 24
+DEAL::Rank dataset_5<std::complex<double>> (Read): 3
+DEAL::Data dataset_5<std::complex<double>> (Read): [(2,0), (0,0), (0,0), (38,0), (6,0), (5,0), (0,0), (3,0), (12,0), (0,0), (0,0), (0,0), (16,0), (15,0), (0,0), (13,0), (32,0), (0,0), (0,0), (0,0), (36,0), (35,0), (0,0), (33,0)]
+DEAL::Dimensions dataset_6<std::complex<double>> (Read): 7 12
+DEAL::Size dataset_6<std::complex<double>> (Read): 84
+DEAL::Rank dataset_6<std::complex<double>> (Read): 2
+DEAL::Data dataset_6<std::complex<double>> (Read): [[(-0,0), (0,0), (1,0), (-1,0), (2,0), (3,0), (-2,0), (4,0), (5,0), (-3,0), (6,0), (7,0)], [(-4,0), (8,0), (9,0), (-5,0), (10,0), (11,0), (-6,0), (12,0), (13,0), (-7,0), (14,0), (15,0)], [(-8,0), (16,0), (17,0), (-9,0), (18,0), (19,0), (-10,0), (20,0), (21,0), (-11,0), (22,0), (23,0)], [(-12,0), (0,0), (0,0), (-13,0), (0,0), (0,0), (-14,0), (0,0), (0,0), (-15,0), (0,0), (0,0)], [(-16,0), (24,0), (25,0), (-17,0), (26,0), (27,0), (-18,0), (28,0), (29,0), (-19,0), (30,0), (31,0)], [(-20,0), (32,0), (33,0), (-21,0), (34,0), (35,0), (-22,0), (36,0), (37,0), (-23,0), (38,0), (39,0)], [(-24,0), (40,0), (41,0), (-25,0), (42,0), (43,0), (-26,0), (44,0), (45,0), (-27,0), (46,0), (47,0)]]
+DEAL::Dimensions dataset_7<std::complex<double>> (Read): 3 2 4
+DEAL::Size dataset_7<std::complex<double>> (Read): 24
+DEAL::Rank dataset_7<std::complex<double>> (Read): 3
+DEAL::Data dataset_7<std::complex<double>> (Read): [(2,0), (0,0), (0,0), (38,0), (6,0), (5,0), (0,0), (3,0), (12,0), (0,0), (0,0), (0,0), (16,0), (15,0), (0,0), (13,0), (32,0), (0,0), (0,0), (0,0), (36,0), (35,0), (0,0), (33,0)]