{"action":"created","comment":{"url":"https://api.github.com/repos/dealii/dealii/pulls/comments/223820398","pull_request_review_id":163042080,"id":223820398,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzgyMDM5OA==","diff_hunk":"@@ -0,0 +1,712 @@\n+// ---------------------------------------------------------------------\n+//\n+// Copyright (C) 1998 - 2018 by the deal.II authors\n+//\n+// This file is part of the deal.II library.\n+//\n+// The deal.II library is free software; you can use it, redistribute\n+// it, and/or modify it under the terms of the GNU Lesser General\n+// Public License as published by the Free Software Foundation; either\n+// version 2.1 of the License, or (at your option) any later version.\n+// The full text of the license can be found in the file LICENSE.md at\n+// the top level directory of deal.II.\n+//\n+// ---------------------------------------------------------------------\n+\n+#ifndef dealii_hdf5_h\n+#define dealii_hdf5_h\n+\n+#include <deal.II/base/config.h>\n+\n+#ifdef DEAL_II_WITH_HDF5\n+\n+#  include <deal.II/lac/full_matrix.h>\n+\n+#  include <hdf5.h>\n+\n+#  include <vector>\n+\n+DEAL_II_NAMESPACE_OPEN\n+\n+/**\n+ * Namespace containing the HDF5 interface.\n+ *\n+ * The [Hierarchical Data Format (HDF)](https://www.hdfgroup.org/) is a cross\n+ * platform and high I/O performance format designed to store large amounts of\n+ * data. It supports serial and MPI I/O access. This set of classes provide an\n+ * interface to the [C HDF5 library](https://www.hdfgroup.org/downloads/hdf5/).\n+ *\n+ * # Data exchange with python scripts\n+ * The HDF5 format can be used to exchange data with python scripts. The strings\n+ * are stored as HDF5 variable-length UTF-8 strings and the complex numbers are\n+ * stored as HDF5 compound datatypes compatible with\n+ * [h5py](https://www.h5py.org/) and [numpy](http://www.numpy.org/).\n+ */\n+// clang-format off\n+/**\n+ *\n+ * This python script writes the parameters for a deal.ii simulation:\n+ * @code\n+ * h5_file = h5py.File('simulation.hdf5','w')\n+ * data = h5_file.create_group('data')\n+ * data.attrs['nb_frequency_points'] = 50 # int\n+ * data.attrs['rho'] = 2300.5 # double\n+ * data.attrs['save_vtk_files'] = True # bool\n+ * data.attrs['simulation_type'] = 'elastic_equation' # utf8 string\n+ * @endcode\n+ *\n+ * C++ deal.ii simulation with MPI HDF5:\n+ * @code\n+ * hdf5::File data_file(\"simulation.hdf5\", MPI_COMM_WORLD, HDF5::File::Mode::open);\n+ * hdf5::Group data = data_file.group(\"data\");\n+ *\n+ * auto nb_frequency_points = data.attr<int>(\"nb_frequency_points\");\n+ * auto rho = data.attr<double>(\"rho\");\n+ * auto save_vtk_files = data.attr<bool>(\"save_vtk_files\");\n+ * auto simulation_type = data.attr<std::string>(\"simulation_type\");\n+ *\n+ * std::vector<std::complex<double>> displacement = {...};\n+ *\n+ * auto some_data = data.write_dataset<double>(\"displacement\", displacement);\n+ *\n+ * // Write the simulation metadata\n+ * data.write_attr(\"active_cells\", triangulation.n_active_cells());\n+ * @endcode\n+ *\n+ * Read the simulation results with python:\n+ * @code\n+ * h5_file = h5py.File('simulation.hdf5','r+')\n+ * data = h5_file['data']\n+ * displacement = data['displacement'] # complex128 dtype\n+ * active_cells = data.attrs['degrees_of_freedom'])\n+ * @endcode\n+ */\n+// clang-format on\n+/**\n+ *\n+ * # Groups, Datasets and attributes\n+ * The HDF5 file is organized in\n+ * [groups](https://bitbucket.hdfgroup.org/pages/HDFFV/hdf5doc/master/browse/html/UG/HDF5_Users_Guide-Responsive%20HTML5/HDF5_Users_Guide/Groups/HDF5_Groups.htm)\n+ * and\n+ * [datasets](https://bitbucket.hdfgroup.org/pages/HDFFV/hdf5doc/master/browse/html/UG/HDF5_Users_Guide-Responsive%20HTML5/HDF5_Users_Guide/Datasets/HDF5_Datasets.htm).\n+ * In the most comon case the file structure is a tree. Groups can contain\n+ * datasets and others groups. Datasets are objects composed by a collection of\n+ * data elements which can be seen as tensors or a matrices. The methods of the\n+ * DataSet class have been instantiated for the types: `float`, `double`,\n+ * `std::complex<float>`, `std::complex<double>`, `int` and `unsigned int`.\n+ *\n+ * In addtition attributes can be attached to the root file, a group or a\n+ * dataset. An [HDF5\n+ * attribute](https://bitbucket.hdfgroup.org/pages/HDFFV/hdf5doc/master/browse/html/UG/HDF5_Users_Guide-Responsive%20HTML5/HDF5_Users_Guide/Attributes/HDF5_Attributes.htm)\n+ * is a small meta data. The methods HDF5Object::attr(const std::string) and\n+ * HDF5Object::write_attr(const std::string, const T) have been instantiated for\n+ * the types: `float`, `double`, `std::complex<float>`, `std::complex<double>`,\n+ * `int`, `unsigned int`, `bool`, and `std::string`.\n+ *\n+ * Below an example code can be found. Note that, if the group already exists\n+ * the method Group::group(std::string) should be used instead of\n+ * Group::create_group(std::string).\n+ * @code\n+ * HDF5::File data_file(filename, HDF5::File::Mode::create);\n+ * double double_attribute = 2.2;\n+ * data_file.write_attr(\"double_attribute\", double attribute);\n+ * auto group = data_file.create_group(\"group\");\n+ * group.write_attr(\"simulation_type\", std::string(\"elastic_equation\"));\n+ * auto dataset = group.create_dataset<double>(\"dataset_name\", dimensions);\n+ * dataset.write_attr(\"complex_double_attribute\", std::complex<double>(2,2.3));\n+ * @endcode\n+ *\n+ * # MPI I/O\n+ * The HDF5 calls that modify the structure of the file are\n+ * always collective, whereas writing and reading raw data in a dataset can be\n+ * done independently or collectively. [Collective access is usually\n+ * faster](https://www.hdfgroup.org/2015/08/parallel-io-with-hdf5/) since it\n+ * allows MPI to do optimizations. In these set of classes all the calls are set\n+ * to collective in order to maximize the performance. This means that all the\n+ * MPI processes have to contribute to every single call, even if they don't\n+ * have data to write.\n+ *\n+ * ## Write a hyperslab in parallel\n+ * The example below shows how to write a hyperslab.\n+ * @code\n+ * std::vector<hsize_t> dataset_dimensions = {50, 30};\n+ * auto dataset = group.create_dataset<double>(\"name\", dataset_dimensions);\n+ *  if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)\n+ *    {\n+ *      // data can be std::vector, FullMatrix or Vector\n+ *      FullMatrix<double> data = {...};\n+ *      std::vector<hsize_t> hyperslab_dimensions = {2, 5};\n+ *      std::vector<hsize_t> hyperslab_offset     = {0, 0};\n+ *      dataset.write_hyperslab(hyperslab_data,\n+ *                              hyperslab_offset,\n+ *                              hyperslab_dimensions);\n+ *    }\n+ *  else\n+ *    {\n+ *      dataset.write_none<double>();\n+ *    }\n+ * @endcode\n+ *\n+ * ## Write unordered data in parallel\n+ * The example below shows how to write a selection of data.\n+ * @code\n+ * std::vector<hsize_t> dataset_dimensions = {50, 30};\n+ * auto dataset = group.create_dataset<double>(\"name\", dataset_dimensions);\n+ * std::vector<hsize_t> coordinates_a = {0,\n+ *                                       0, // first point\n+ *                                       0,\n+ *                                       2, // second point\n+ *                                       3,\n+ *                                       4, // third point\n+ *                                       25,\n+ *                                       12}; // fourth point\n+ *  std::vector<double>  data_a        = {2, 3, 5, 6};\n+ *\n+ *  std::vector<hsize_t> coordinates_b = {5,\n+ *                                        0, // first point\n+ *                                        0,\n+ *                                        4, // second point\n+ *                                        5,\n+ *                                        4, // third point\n+ *                                        26,\n+ *                                        12}; // fourth point\n+ *  std::vector<double>  data_b        = {9, 4, 7, 6};\n+ *  if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)\n+ *    {\n+ *      dataset.write_selection(data_a, coordinates_a);\n+ *    }\n+ *  else if (Utilities::MPI::this_mpi_process(mpi_communicator) == 1)\n+ *    {\n+ *      dataset.write_selection(data_b, coordinates_b);\n+ *    }\n+ *  else\n+ *    {\n+ *      dataset.write_none<double>();\n+ *    }\n+ * @endcode\n+ *\n+ * ## Query the type of I/O that HDF5 performed on the last parallel I/O call\n+ * In some cases such as when there is type conversion the HDF5 library can\n+ * decide to do independent I/O instead of collective I/O. The following code\n+ * can be used to query the I/O method.\n+ * @code\n+ * auto dataset = group.create_dataset<double>(\"name\", dimensions);\n+ * #ifdef DEBUG\n+ * dataset.check_io_mode(true);\n+ * #endif\n+ *\n+ * if (Utilities::MPI::this_mpi_process(mpi_communicator) == 0)\n+ *     {\n+ *       dataset.write(data);\n+ *     }\n+ * else\n+ *     {\n+ *       dataset.write_none<double>();\n+ *     }\n+ *\n+ * #ifdef DEBUG\n+ * pcout << \"IO mode :\" << dataset.io_mode<std::string>() << std::endl;\n+ * pcout << \"Local no collective cause :\"\n+ *       << dataset.local_no_collective_cause<std::string>() << std::endl;\n+ * pcout << \"Global no collective cause :\"\n+ *       << dataset.global_no_collective_cause<std::string>() << std::endl;\n+ * #endif\n+ * @endcode\n+ *\n+ * @author Daniel Garcia-Sanchez, 2018\n+ */\n+namespace HDF5\n+\n+{\n+  /**\n+   * Base class for the HDF5 objects.\n+   *\n+   * @author Daniel Garcia-Sanchez, 2018\n+   */\n+  class HDF5Object\n+  {\n+  protected:\n+    HDF5Object(const std::string name, bool mpi);\n+\n+  public:\n+    enum class Mode\n+    {\n+      create,\n+      open\n+    };\n+\n+    /**\n+     * Reads an attribute. T can be float, double, std::complex<float>,\n+     * std::complex<double>, int, unsigned int, bool or std::string. Note that\n+     * the encoding of std::string is UTF8 in order to be compatible with\n+     * python3.\n+     *\n+     * Datatype conversion takes place at the time of a read or write and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <typename T>\n+    T\n+    attr(const std::string attr_name);\n+\n+    /**\n+     * Writes an attribute. T can be float, double, std::complex<float>,\n+     * std::complex<double>, int, unsigned int, bool or std::string. Note that\n+     * the encoding of std::string is UTF8 in order to be compatible with\n+     * python3.\n+     *\n+     * Datatype conversion takes place at the time of a read or write and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <typename T>\n+    void\n+    write_attr(const std::string attr_name, const T value);\n+\n+\n+    const std::string name;\n+\n+  protected:\n+    /**\n+     * HDF5 identifier for the objects File, Group and DataSet\n+     */\n+    std::shared_ptr<hid_t> hdf5_reference;\n+\n+    /**\n+     * If true use parallel HDF5, if false use serial HDF5.\n+     */\n+    const bool mpi;\n+\n+    /**\n+     * Returned value of the last HDF5 C library call.\n+     *\n+     * The HDF5 calls return a non-negative value if successful; otherwise they\n+     * return a negative value.\n+     *\n+     * Calls such as\n+     * [H5DWrite](https://support.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Write)\n+     * use this variable to store the returned value. Other calls such as\n+     * [H5Pcreate](https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-Create)\n+     * don't use this variable to store the returned value.\n+     */\n+    herr_t ret;\n+  };\n+\n+  /**\n+   * This class implements a HDF5 DataSet.\n+   *\n+   * @author Daniel Garcia-Sanchez, 2018\n+   */\n+  class DataSet : public HDF5Object\n+  {\n+    friend class Group;\n+\n+  protected:\n+    // Open dataset\n+    DataSet(const std::string name, const hid_t &parent_group_id, bool mpi);\n+\n+    // Create dataset\n+    DataSet(const std::string      name,\n+            const hid_t &          parent_group_id,\n+            std::vector<hsize_t>   dimensions,\n+            std::shared_ptr<hid_t> t_type,\n+            bool                   mpi);\n+\n+  public:\n+    /**\n+     * Reads data of the dataset. Number can be float, double,\n+     * std::complex<float>, std::complex<double>, int or unsigned int.\n+     *\n+     * Datatype conversion takes place at the time of a read or write and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <template <class...> class Container, typename number>\n+    Container<number>\n+    read();\n+\n+    /**\n+     * Reads data of a subset of the dataset. Number can be float, double,\n+     * std::complex<float>, std::complex<double>, int or unsigned int.\n+     *\n+     * The selected elements can be scattered and take any shape in the dataset.\n+     * For example, in the case of a dataset with rank 4 a selection of 3 points\n+     * will be described by a 3-by-4 array. To select the points (1,1,1,1),\n+     * (14,6,12,18), and (8,22,30,22), the point selection array would be as\n+     * follows:\n+     *\n+     *    0  0  0  0\n+     *\n+     *   13  5 11 17\n+     *\n+     *    7 21 29 21\n+     *\n+     * <a\n+     * href=\"https://support.hdfgroup.org/newsletters/newsletter140.html\">Parallel\n+     * HDF5 supports collective I/O on point selections.</a>\n+     *\n+     * Datatype conversion takes place at the time of a read or write and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <typename number>\n+    std::vector<number>\n+    read_selection(const std::vector<hsize_t> coordinates);\n+\n+    /**\n+     * Reads a hyperslab from the dataset. The parameters are summarized\n+     * below:\n+     *  - Offset: The starting location for the hyperslab.\n+     *  - Count: The number of elements to select along each dimension.\n+     *\n+     * Stride and block are set to NULL.\n+     *\n+     * See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/HDF5_Users_Guide/Dataspaces/HDF5_Dataspaces_and_Partial_I_O.htm?rhtocid=7.2#TOC_7_4_Dataspaces_and_Databc-6\">Dataspaces\n+     * and Data Transfer</a>  section in the HDF5 User's Guide. See as well the\n+     * <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc1.8/RM/RM_H5S.html#Dataspace-SelectHyperslab\">H5Sselect_hyperslab\n+     * definition</a>.\n+     *\n+     * Datatype conversion takes place at the time of a read or read and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <template <class...> class Container, typename number>\n+    Container<number>\n+    read_hyperslab(const std::vector<hsize_t> &offset,\n+                   const std::vector<hsize_t> &count);\n+\n+    /**\n+     * This function does not read any data, but it can contribute to a\n+     * collective read call. Number can be float, double, std::complex<float>,\n+     * std::complex<double>, int or unsigned int.\n+     *\n+     * Datatype conversion takes place at the time of a read or write and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <typename number>\n+    void\n+    read_none();\n+\n+    /**\n+     * Writes data in the dataset. Number can be float, double,\n+     * std::complex<float>, std::complex<double>, int or unsigned int.\n+     *\n+     * Datatype conversion takes place at the time of a read or write and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <template <class...> class Container, typename number>\n+    void\n+    write(const Container<number> &data);\n+\n+    /**\n+     * Writes data to a subset of the dataset. Number can be float, double,\n+     * std::complex<float>, std::complex<double>, int or unsigned int.\n+     *\n+     * The selected elements can be scattered and take any shape in the dataset.\n+     * For example, in the case of a dataset with rank 4 a selection of 3 points\n+     * will be described by a 3-by-4 array. To select the points (1,1,1,1),\n+     * (14,6,12,18), and (8,22,30,22), the point selection array would be as\n+     * follows:\n+     *\n+     *    0  0  0  0\n+     *\n+     *   13  5 11 17\n+     *\n+     *    7 21 29 21\n+     *\n+     * <a\n+     * href=\"https://support.hdfgroup.org/newsletters/newsletter140.html\">Parallel\n+     * HDF5 supports collective I/O on point selections.</a>\n+     *\n+     * Datatype conversion takes place at the time of a read or write and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <typename number>\n+    void\n+    write_selection(const std::vector<number> &data,\n+                    const std::vector<hsize_t> coordinates);\n+\n+    /**\n+     * Writes a data hyperslab to the dataset. The parameters are summarized\n+     * below:\n+     *  - Offset: The starting location for the hyperslab.\n+     *  - Count: The number of elements to select along each dimension.\n+     */\n+    // clang-format off\n+    /**\n+     *\n+     * Stride and block are set to NULL. For more complex hyperslabs see\n+     * write_hyperslab(const Container<number> &data, const std::vector<hsize_t> &data_dimensions, const std::vector<hsize_t> &offset, const std::vector<hsize_t> &stride, const std::vector<hsize_t> &count, const std::vector<hsize_t> &block).\n+     */\n+    // clang-format on\n+    /**\n+     *\n+     * See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/HDF5_Users_Guide/Dataspaces/HDF5_Dataspaces_and_Partial_I_O.htm?rhtocid=7.2#TOC_7_4_Dataspaces_and_Databc-6\">Dataspaces\n+     * and Data Transfer</a>  section in the HDF5 User's Guide. See as well the\n+     * <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc1.8/RM/RM_H5S.html#Dataspace-SelectHyperslab\">H5Sselect_hyperslab\n+     * definition</a>.\n+     *\n+     * Datatype conversion takes place at the time of a read or write and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <template <class...> class Container, typename number>\n+    void\n+    write_hyperslab(const Container<number> &   data,\n+                    const std::vector<hsize_t> &offset,\n+                    const std::vector<hsize_t> &count);\n+\n+    /**\n+     * Writes a data hyperslab to the dataset. The parameters are summarized\n+     * below:\n+     *  - Dataset_dimensions: the dimensions of the data memory block.\n+     *  - Offset: The starting location for the hyperslab.\n+     *  - Stride: The number of elements to separate each element or block to be\n+     * selected.\n+     *  - Count: The number of elements or blocks to select along each\n+     * dimension.\n+     *  - Block: The size of the block selected from the dataspace.\n+     *\n+     * See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/HDF5_Users_Guide/Dataspaces/HDF5_Dataspaces_and_Partial_I_O.htm?rhtocid=7.2#TOC_7_4_Dataspaces_and_Databc-6\">Dataspaces\n+     * and Data Transfer</a>  section in the HDF5 User's Guide. See as well the\n+     * <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc1.8/RM/RM_H5S.html#Dataspace-SelectHyperslab\">H5Sselect_hyperslab\n+     * definition</a>.\n+     *\n+     * Datatype conversion takes place at the time of a read or write and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <template <class...> class Container, typename number>\n+    void\n+    write_hyperslab(const Container<number> &   data,\n+                    const std::vector<hsize_t> &data_dimensions,\n+                    const std::vector<hsize_t> &offset,\n+                    const std::vector<hsize_t> &stride,\n+                    const std::vector<hsize_t> &count,\n+                    const std::vector<hsize_t> &block);\n+\n+    /**\n+     * This function does not write any data, but it can contribute to a\n+     * collective write call. Number can be `float`, `double`,\n+     * `std::complex<float>`, `std::complex<double>`, `int` or `unsigned int`.\n+     *\n+     * Datatype conversion takes place at the time of a read or write and is\n+     * automatic. See the <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/UG/HDF5_Users_Guide-Responsive%20HTML5/index.html#t=HDF5_Users_Guide%2FDatatypes%2FHDF5_Datatypes.htm%23TOC_6_10_Data_Transferbc-26&rhtocid=6.5_2\">Data\n+     * Transfer: Datatype Conversion and Selection</a>  section in the HDF5\n+     * User's Guide.\n+     */\n+    template <typename number>\n+    void\n+    write_none();\n+\n+    /**\n+     * This funcion retrieves the type of I/O that was performed on the last\n+     * parallel I/O call. See <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMpioActualIoMode\">H5Pget_mpio_actual_io_mode</a>.\n+     * The return type T can be H5D_mpio_actual_io_mode_t or std::string. The\n+     * type H5D_mpio_actual_io_mode_t corresponds to the value returned by\n+     * H5Pget_mpio_actual_io_mode and std::string is a human readable\n+     * conversion.\n+     */\n+    template <typename T>\n+    T\n+    io_mode();\n+\n+    /**\n+     * This funcion retrieves the local causes that broke collective I/O on the\n+     * last parallel I/O call. See <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMpioNoCollectiveCause\">H5Pget_mpio_no_collective_cause</a>.\n+     * The return type T can be uint32_t or std::string. The type uint32_t\n+     * corresponds to the value returned by H5Pget_mpio_no_collective_cause and\n+     * std::string is a human readable conversion.\n+     */\n+    template <typename T>\n+    T\n+    local_no_collective_cause();\n+\n+    /**\n+     * This funcion retrieves the global causes that broke collective I/O on the\n+     * last parallel I/O call. See <a\n+     * href=\"https://support.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMpioNoCollectiveCause\">H5Pget_mpio_no_collective_cause</a>.\n+     * The return type T can be uint32_t or std::string. The type uint32_t\n+     * corresponds to the value returned by H5Pget_mpio_no_collective_cause and\n+     * std::string is a human readable conversion.\n+     */\n+    template <typename T>\n+    T\n+    global_no_collective_cause();\n+\n+    /**\n+     * This function retrieves the IO mode checking. If check_io_mode is true,\n+     * then after every read and write operation in the dataset, it will be\n+     * retrieved the type of I/O that was performed on the last parallel I/O\n+     * call If check_io_mode is false then no checking will be performed.\n+     */\n+    bool\n+    check_io_mode() const;\n+\n+    /**\n+     * This funcion sets the IO mode checking. If check_io_mode is true, then\n+     * after every read and write operation in the dataset, it will be retrieved\n+     * the type of I/O that was performed on the last parallel I/O call If\n+     * check_io_mode is false then no checking will be performed.\n+     */\n+    void\n+    check_io_mode(bool check_io_mode);\n+\n+    /**\n+     * This funcion returns the dimensions of the dataset.\n+     */\n+    std::vector<hsize_t>\n+    dimensions() const;\n+\n+    /**\n+     * This funcion returns the total size of the dataset.\n+     */\n+    unsigned int\n+    size() const;\n+\n+    /**\n+     * This funcion returns the rank of the dataset.\n+     */\n+    unsigned int\n+    rank() const;\n+\n+  private:\n+    unsigned int              _rank;","path":"include/deal.II/base/hdf5.h","position":null,"original_position":606,"commit_id":"23775d5bf3fa8003e41dba7e7a1ee19d4fbc06bc","original_commit_id":"91cfff81e66d51aab4cb1dee557b0b3def3c1b09","user":{"login":"dangars","id":25910642,"node_id":"MDQ6VXNlcjI1OTEwNjQy","avatar_url":"https://avatars0.githubusercontent.com/u/25910642?v=4","gravatar_id":"","url":"https://api.github.com/users/dangars","html_url":"https://github.com/dangars","followers_url":"https://api.github.com/users/dangars/followers","following_url":"https://api.github.com/users/dangars/following{/other_user}","gists_url":"https://api.github.com/users/dangars/gists{/gist_id}","starred_url":"https://api.github.com/users/dangars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangars/subscriptions","organizations_url":"https://api.github.com/users/dangars/orgs","repos_url":"https://api.github.com/users/dangars/repos","events_url":"https://api.github.com/users/dangars/events{/privacy}","received_events_url":"https://api.github.com/users/dangars/received_events","type":"User","site_admin":false},"body":"I renamed all these variables and removed the underscores. I added a description.\r\nI used gets and sets for the functions.","created_at":"2018-10-09T18:48:20Z","updated_at":"2018-10-09T18:48:20Z","html_url":"https://github.com/dealii/dealii/pull/7020#discussion_r223820398","pull_request_url":"https://api.github.com/repos/dealii/dealii/pulls/7020","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dealii/dealii/pulls/comments/223820398"},"html":{"href":"https://github.com/dealii/dealii/pull/7020#discussion_r223820398"},"pull_request":{"href":"https://api.github.com/repos/dealii/dealii/pulls/7020"}},"in_reply_to_id":222135188},"pull_request":{"url":"https://api.github.com/repos/dealii/dealii/pulls/7020","id":205705938,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1NzA1OTM4","html_url":"https://github.com/dealii/dealii/pull/7020","diff_url":"https://github.com/dealii/dealii/pull/7020.diff","patch_url":"https://github.com/dealii/dealii/pull/7020.patch","issue_url":"https://api.github.com/repos/dealii/dealii/issues/7020","number":7020,"state":"open","locked":false,"title":"Add HDF5 classes","user":{"login":"dangars","id":25910642,"node_id":"MDQ6VXNlcjI1OTEwNjQy","avatar_url":"https://avatars0.githubusercontent.com/u/25910642?v=4","gravatar_id":"","url":"https://api.github.com/users/dangars","html_url":"https://github.com/dangars","followers_url":"https://api.github.com/users/dangars/followers","following_url":"https://api.github.com/users/dangars/following{/other_user}","gists_url":"https://api.github.com/users/dangars/gists{/gist_id}","starred_url":"https://api.github.com/users/dangars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangars/subscriptions","organizations_url":"https://api.github.com/users/dangars/orgs","repos_url":"https://api.github.com/users/dangars/repos","events_url":"https://api.github.com/users/dangars/events{/privacy}","received_events_url":"https://api.github.com/users/dangars/received_events","type":"User","site_admin":false},"body":"Todo list:\r\n\r\n- [x] Serial support\r\n- [x] MPI support\r\n- [x] Support for float, double and long double\r\n- [x] Support for std::complex_float, std::complex_double and std::complex_long_double\r\n- [x] Support for int and unsigned int, \r\n- [x] Support for Unicode python3 strings (h5py UTF8) and python complex numbers\r\n- [x] Support std::vector, Vector and FullMatrix\r\n- [x] Add io_mode(), local_no_collective_cause() and global_no_collective_cause()\r\n- [x] Write tests\r\n- [x] Check with valgrind","created_at":"2018-08-02T11:42:01Z","updated_at":"2018-10-09T18:48:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"adf3b435edd20619ad06a65e3bcd58e1a707d5e7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":680368525,"node_id":"MDU6TGFiZWw2ODAzNjg1MjU=","url":"https://api.github.com/repos/dealii/dealii/labels/Post-processing","name":"Post-processing","color":"5319e7","default":false},{"id":689420049,"node_id":"MDU6TGFiZWw2ODk0MjAwNDk=","url":"https://api.github.com/repos/dealii/dealii/labels/Python","name":"Python","color":"c5def5","default":false},{"id":252577276,"node_id":"MDU6TGFiZWwyNTI1NzcyNzY=","url":"https://api.github.com/repos/dealii/dealii/labels/RFC","name":"RFC","color":"829ce0","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dealii/dealii/pulls/7020/commits","review_comments_url":"https://api.github.com/repos/dealii/dealii/pulls/7020/comments","review_comment_url":"https://api.github.com/repos/dealii/dealii/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dealii/dealii/issues/7020/comments","statuses_url":"https://api.github.com/repos/dealii/dealii/statuses/23775d5bf3fa8003e41dba7e7a1ee19d4fbc06bc","head":{"label":"dangars:hdf5","ref":"hdf5","sha":"23775d5bf3fa8003e41dba7e7a1ee19d4fbc06bc","user":{"login":"dangars","id":25910642,"node_id":"MDQ6VXNlcjI1OTEwNjQy","avatar_url":"https://avatars0.githubusercontent.com/u/25910642?v=4","gravatar_id":"","url":"https://api.github.com/users/dangars","html_url":"https://github.com/dangars","followers_url":"https://api.github.com/users/dangars/followers","following_url":"https://api.github.com/users/dangars/following{/other_user}","gists_url":"https://api.github.com/users/dangars/gists{/gist_id}","starred_url":"https://api.github.com/users/dangars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangars/subscriptions","organizations_url":"https://api.github.com/users/dangars/orgs","repos_url":"https://api.github.com/users/dangars/repos","events_url":"https://api.github.com/users/dangars/events{/privacy}","received_events_url":"https://api.github.com/users/dangars/received_events","type":"User","site_admin":false},"repo":{"id":118017521,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgwMTc1MjE=","name":"dealii","full_name":"dangars/dealii","private":false,"owner":{"login":"dangars","id":25910642,"node_id":"MDQ6VXNlcjI1OTEwNjQy","avatar_url":"https://avatars0.githubusercontent.com/u/25910642?v=4","gravatar_id":"","url":"https://api.github.com/users/dangars","html_url":"https://github.com/dangars","followers_url":"https://api.github.com/users/dangars/followers","following_url":"https://api.github.com/users/dangars/following{/other_user}","gists_url":"https://api.github.com/users/dangars/gists{/gist_id}","starred_url":"https://api.github.com/users/dangars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangars/subscriptions","organizations_url":"https://api.github.com/users/dangars/orgs","repos_url":"https://api.github.com/users/dangars/repos","events_url":"https://api.github.com/users/dangars/events{/privacy}","received_events_url":"https://api.github.com/users/dangars/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dangars/dealii","description":"The development repository for the deal.II finite element library.","fork":true,"url":"https://api.github.com/repos/dangars/dealii","forks_url":"https://api.github.com/repos/dangars/dealii/forks","keys_url":"https://api.github.com/repos/dangars/dealii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dangars/dealii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dangars/dealii/teams","hooks_url":"https://api.github.com/repos/dangars/dealii/hooks","issue_events_url":"https://api.github.com/repos/dangars/dealii/issues/events{/number}","events_url":"https://api.github.com/repos/dangars/dealii/events","assignees_url":"https://api.github.com/repos/dangars/dealii/assignees{/user}","branches_url":"https://api.github.com/repos/dangars/dealii/branches{/branch}","tags_url":"https://api.github.com/repos/dangars/dealii/tags","blobs_url":"https://api.github.com/repos/dangars/dealii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dangars/dealii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dangars/dealii/git/refs{/sha}","trees_url":"https://api.github.com/repos/dangars/dealii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dangars/dealii/statuses/{sha}","languages_url":"https://api.github.com/repos/dangars/dealii/languages","stargazers_url":"https://api.github.com/repos/dangars/dealii/stargazers","contributors_url":"https://api.github.com/repos/dangars/dealii/contributors","subscribers_url":"https://api.github.com/repos/dangars/dealii/subscribers","subscription_url":"https://api.github.com/repos/dangars/dealii/subscription","commits_url":"https://api.github.com/repos/dangars/dealii/commits{/sha}","git_commits_url":"https://api.github.com/repos/dangars/dealii/git/commits{/sha}","comments_url":"https://api.github.com/repos/dangars/dealii/comments{/number}","issue_comment_url":"https://api.github.com/repos/dangars/dealii/issues/comments{/number}","contents_url":"https://api.github.com/repos/dangars/dealii/contents/{+path}","compare_url":"https://api.github.com/repos/dangars/dealii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dangars/dealii/merges","archive_url":"https://api.github.com/repos/dangars/dealii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dangars/dealii/downloads","issues_url":"https://api.github.com/repos/dangars/dealii/issues{/number}","pulls_url":"https://api.github.com/repos/dangars/dealii/pulls{/number}","milestones_url":"https://api.github.com/repos/dangars/dealii/milestones{/number}","notifications_url":"https://api.github.com/repos/dangars/dealii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dangars/dealii/labels{/name}","releases_url":"https://api.github.com/repos/dangars/dealii/releases{/id}","deployments_url":"https://api.github.com/repos/dangars/dealii/deployments","created_at":"2018-01-18T17:50:35Z","updated_at":"2018-10-04T17:18:13Z","pushed_at":"2018-10-09T17:12:35Z","git_url":"git://github.com/dangars/dealii.git","ssh_url":"git@github.com:dangars/dealii.git","clone_url":"https://github.com/dangars/dealii.git","svn_url":"https://github.com/dangars/dealii","homepage":"http://www.dealii.org/","size":225249,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dealii:master","ref":"master","sha":"a790880f04e2dfea1cff32cbc0ea7f5fced64371","user":{"login":"dealii","id":7506070,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1MDYwNzA=","avatar_url":"https://avatars3.githubusercontent.com/u/7506070?v=4","gravatar_id":"","url":"https://api.github.com/users/dealii","html_url":"https://github.com/dealii","followers_url":"https://api.github.com/users/dealii/followers","following_url":"https://api.github.com/users/dealii/following{/other_user}","gists_url":"https://api.github.com/users/dealii/gists{/gist_id}","starred_url":"https://api.github.com/users/dealii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dealii/subscriptions","organizations_url":"https://api.github.com/users/dealii/orgs","repos_url":"https://api.github.com/users/dealii/repos","events_url":"https://api.github.com/users/dealii/events{/privacy}","received_events_url":"https://api.github.com/users/dealii/received_events","type":"Organization","site_admin":false},"repo":{"id":21943980,"node_id":"MDEwOlJlcG9zaXRvcnkyMTk0Mzk4MA==","name":"dealii","full_name":"dealii/dealii","private":false,"owner":{"login":"dealii","id":7506070,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1MDYwNzA=","avatar_url":"https://avatars3.githubusercontent.com/u/7506070?v=4","gravatar_id":"","url":"https://api.github.com/users/dealii","html_url":"https://github.com/dealii","followers_url":"https://api.github.com/users/dealii/followers","following_url":"https://api.github.com/users/dealii/following{/other_user}","gists_url":"https://api.github.com/users/dealii/gists{/gist_id}","starred_url":"https://api.github.com/users/dealii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dealii/subscriptions","organizations_url":"https://api.github.com/users/dealii/orgs","repos_url":"https://api.github.com/users/dealii/repos","events_url":"https://api.github.com/users/dealii/events{/privacy}","received_events_url":"https://api.github.com/users/dealii/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dealii/dealii","description":"The development repository for the deal.II finite element library.","fork":false,"url":"https://api.github.com/repos/dealii/dealii","forks_url":"https://api.github.com/repos/dealii/dealii/forks","keys_url":"https://api.github.com/repos/dealii/dealii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dealii/dealii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dealii/dealii/teams","hooks_url":"https://api.github.com/repos/dealii/dealii/hooks","issue_events_url":"https://api.github.com/repos/dealii/dealii/issues/events{/number}","events_url":"https://api.github.com/repos/dealii/dealii/events","assignees_url":"https://api.github.com/repos/dealii/dealii/assignees{/user}","branches_url":"https://api.github.com/repos/dealii/dealii/branches{/branch}","tags_url":"https://api.github.com/repos/dealii/dealii/tags","blobs_url":"https://api.github.com/repos/dealii/dealii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dealii/dealii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dealii/dealii/git/refs{/sha}","trees_url":"https://api.github.com/repos/dealii/dealii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dealii/dealii/statuses/{sha}","languages_url":"https://api.github.com/repos/dealii/dealii/languages","stargazers_url":"https://api.github.com/repos/dealii/dealii/stargazers","contributors_url":"https://api.github.com/repos/dealii/dealii/contributors","subscribers_url":"https://api.github.com/repos/dealii/dealii/subscribers","subscription_url":"https://api.github.com/repos/dealii/dealii/subscription","commits_url":"https://api.github.com/repos/dealii/dealii/commits{/sha}","git_commits_url":"https://api.github.com/repos/dealii/dealii/git/commits{/sha}","comments_url":"https://api.github.com/repos/dealii/dealii/comments{/number}","issue_comment_url":"https://api.github.com/repos/dealii/dealii/issues/comments{/number}","contents_url":"https://api.github.com/repos/dealii/dealii/contents/{+path}","compare_url":"https://api.github.com/repos/dealii/dealii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dealii/dealii/merges","archive_url":"https://api.github.com/repos/dealii/dealii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dealii/dealii/downloads","issues_url":"https://api.github.com/repos/dealii/dealii/issues{/number}","pulls_url":"https://api.github.com/repos/dealii/dealii/pulls{/number}","milestones_url":"https://api.github.com/repos/dealii/dealii/milestones{/number}","notifications_url":"https://api.github.com/repos/dealii/dealii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dealii/dealii/labels{/name}","releases_url":"https://api.github.com/repos/dealii/dealii/releases{/id}","deployments_url":"https://api.github.com/repos/dealii/dealii/deployments","created_at":"2014-07-17T14:00:26Z","updated_at":"2018-10-09T14:28:08Z","pushed_at":"2018-10-09T18:08:50Z","git_url":"git://github.com/dealii/dealii.git","ssh_url":"git@github.com:dealii/dealii.git","clone_url":"https://github.com/dealii/dealii.git","svn_url":"https://github.com/dealii/dealii","homepage":"https://www.dealii.org/","size":205073,"stargazers_count":373,"watchers_count":373,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":323,"mirror_url":null,"archived":false,"open_issues_count":317,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":323,"open_issues":317,"watchers":373,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dealii/dealii/pulls/7020"},"html":{"href":"https://github.com/dealii/dealii/pull/7020"},"issue":{"href":"https://api.github.com/repos/dealii/dealii/issues/7020"},"comments":{"href":"https://api.github.com/repos/dealii/dealii/issues/7020/comments"},"review_comments":{"href":"https://api.github.com/repos/dealii/dealii/pulls/7020/comments"},"review_comment":{"href":"https://api.github.com/repos/dealii/dealii/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dealii/dealii/pulls/7020/commits"},"statuses":{"href":"https://api.github.com/repos/dealii/dealii/statuses/23775d5bf3fa8003e41dba7e7a1ee19d4fbc06bc"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dangars"}}