]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove long double and std::complex<long double> instantiations
authorDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Mon, 20 Aug 2018 22:06:20 +0000 (00:06 +0200)
committerDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 9 Jan 2019 18:08:10 +0000 (19:08 +0100)
The std::complex<long double> instantiation creates errors with valgrind.

Although long double does not create errors with valgrind, it is not a widely used.

include/deal.II/base/hdf5.h
source/base/hdf5.cc
tests/base/hdf5_01.cc
tests/base/hdf5_01.output
tests/base/hdf5_02.cc
tests/base/hdf5_02.with_hdf5=true.mpirun=1.output
tests/base/hdf5_02.with_hdf5=true.mpirun=4.output

index 950f8f04c2f65cfca37ce83a06c5cc8641750522..0163db464efcbd9a14b6181eecc410b09da3a9d3 100644 (file)
@@ -128,10 +128,10 @@ namespace HDF5
     };
 
     /**
-     * Reads an attribute. T can be float, double, long double,
-     * std::complex<float>, std::complex<double>, std::complex<long double>,
-     * int, unsigned int, bool or std::string. Note that the encoding of
-     * std::string is UTF8 in order to be compatible with python3.
+     * Reads an attribute. T can be float, double, std::complex<float>,
+     * std::complex<double>, int, unsigned int, bool or std::string. Note that
+     * the encoding of std::string is UTF8 in order to be compatible with
+     * python3.
      *
      * Datatype conversion takes place at the time of a read or write and is
      * automatic. See the <a
@@ -144,10 +144,10 @@ namespace HDF5
     attr(const std::string attr_name) const;
 
     /**
-     * Reads an attribute. T can be float, double, long double,
-     * std::complex<float>, std::complex<double>, std::complex<long double>,
-     * int, unsigned int, bool or std::string. Note that the encoding of
-     * std::string is UTF8 in order to be compatible with python3.
+     * Reads an attribute. T can be float, double, std::complex<float>,
+     * std::complex<double>, int, unsigned int, bool or std::string. Note that
+     * the encoding of std::string is UTF8 in order to be compatible with
+     * python3.
      *
      * Datatype conversion takes place at the time of a read or write and is
      * automatic. See the <a
@@ -190,9 +190,8 @@ namespace HDF5
 
   public:
     /**
-     * Reads data of the dataset. Number can be float, double, long double,
-     * std::complex<float>, std::complex<double>, std::complex<long double>, int
-     * or unsigned int.
+     * Reads data of the dataset. Number can be float, double,
+     * std::complex<float>, std::complex<double>, int or unsigned int.
      *
      * Datatype conversion takes place at the time of a read or write and is
      * automatic. See the <a
@@ -205,9 +204,8 @@ namespace HDF5
     read();
 
     /**
-     * Reads data of a subset of the dataset. Number can be float, double, long
-     * double, std::complex<float>, std::complex<double>,
-     * std::complex<long double>, int or unsigned int.
+     * Reads data of a subset of the dataset. Number can be float, double,
+     * std::complex<float>, std::complex<double>, int or unsigned int.
      *
      * The selected elements can be scattered and take any shape in the dataset.
      * For examples, in the 4D case, we will be selecting three points and a 4D
@@ -263,8 +261,8 @@ namespace HDF5
 
     /**
      * This function does not read any data, but can contribute to a collective
-     * read call. Number can be float, double, long double, std::complex<float>,
-     * std::complex<double>, std::complex<long double>, int or unsigned int.
+     * read call. Number can be float, double, std::complex<float>,
+     * std::complex<double>, int or unsigned int.
      *
      * Datatype conversion takes place at the time of a read or write and is
      * automatic. See the <a
@@ -277,9 +275,8 @@ namespace HDF5
     read_none();
 
     /**
-     * Writes data in the dataset. Number can be float, double, long double,
-     * std::complex<float>, std::complex<double>, std::complex<long double>, int
-     * or unsigned int.
+     * Writes data in the dataset. Number can be float, double,
+     * std::complex<float>, std::complex<double>, int or unsigned int.
      *
      * Datatype conversion takes place at the time of a read or write and is
      * automatic. See the <a
@@ -292,9 +289,8 @@ namespace HDF5
     write(const Container<number> &data);
 
     /**
-     * Writes data to a subset of the dataset. Number can be float, double, long
-     * double, std::complex<float>, std::complex<double>,
-     * std::complex<long double>, int or unsigned int.
+     * Writes data to a subset of the dataset. Number can be float, double,
+     * std::complex<float>, std::complex<double>, int or unsigned int.
      *
      * The selected elements can be scattered and take any shape in the dataset.
      * For examples, in the 4D case, we will be selecting three points and a 4D
@@ -392,9 +388,8 @@ namespace HDF5
 
     /**
      * This function does not write any data, but can contribute to a collective
-     * write call. Number can be float, double, long double,
-     * std::complex<float>, std::complex<double>, std::complex<long double>, int
-     * or unsigned int.
+     * write call. Number can be float, double, std::complex<float>,
+     * std::complex<double>, int or unsigned int.
      *
      * Datatype conversion takes place at the time of a read or write and is
      * automatic. See the <a
@@ -524,9 +519,8 @@ namespace HDF5
     dataset(const std::string name);
 
     /**
-     * Creates a dataset. Number can be float, double, long
-     * double, std::complex<float>, std::complex<double>,
-     * std::complex<long double>, int or unsigned int.
+     * Creates a dataset. Number can be float, double, std::complex<float>,
+     * std::complex<double>, int or unsigned int.
      *
      * Datatype conversion takes place at the time of a read or write and is
      * automatic. See the <a
@@ -540,9 +534,8 @@ namespace HDF5
                    const std::vector<hsize_t> dimensions) const;
 
     /**
-     * Creates and writes data to a dataset. Number can be float, double, long
-     * double, std::complex<float>, std::complex<double>,
-     * std::complex<long double>, int or unsigned int.
+     * Creates and writes data to a dataset. Number can be float, double,
+     * std::complex<float>, std::complex<double>, int or unsigned int.
      *
      * Datatype conversion takes place at the time of a read or write and is
      * automatic. See the <a
index 581f17eee7f7dd80320ee1a965a6022eba2c72f0..b78ada717796bdf9224bba663e7a5fbd3620552f 100644 (file)
@@ -52,11 +52,6 @@ namespace HDF5
           t_type  = std::shared_ptr<hid_t>(new hid_t);
           *t_type = H5T_NATIVE_DOUBLE;
         }
-      else if (std::is_same<number, long double>::value)
-        {
-          t_type  = std::shared_ptr<hid_t>(new hid_t);
-          *t_type = H5T_NATIVE_LDOUBLE;
-        }
       else if (std::is_same<number, int>::value)
         {
           t_type  = std::shared_ptr<hid_t>(new hid_t);
@@ -97,21 +92,6 @@ namespace HDF5
           H5Tinsert(*t_type, "r", 0, H5T_NATIVE_DOUBLE);
           H5Tinsert(*t_type, "i", sizeof(double), H5T_NATIVE_DOUBLE);
         }
-      else if (std::is_same<number, std::complex<long double>>::value)
-        {
-          t_type  = std::shared_ptr<hid_t>(new hid_t, [](auto pointer) {
-            // Relase the HDF5 resource
-            H5Tclose(*pointer);
-            delete pointer;
-          });
-          *t_type = H5Tcreate(H5T_COMPOUND, sizeof(std::complex<long double>));
-          //  The C++ standards committee agreed to mandate that the storage
-          //  format used for the std::complex type be binary-compatible with
-          //  the C99 type, i.e. an array T[2] with consecutive real [0] and
-          //  imaginary [1] parts.
-          H5Tinsert(*t_type, "r", 0, H5T_NATIVE_LDOUBLE);
-          H5Tinsert(*t_type, "i", sizeof(long double), H5T_NATIVE_LDOUBLE);
-        }
       else
         {
           Assert(false, ExcInternalError());
@@ -1364,15 +1344,10 @@ namespace HDF5
   HDF5Object::attr<float>(const std::string attr_name) const;
   template double
   HDF5Object::attr<double>(const std::string attr_name) const;
-  template long double
-  HDF5Object::attr<long double>(const std::string attr_name) const;
   template std::complex<float>
   HDF5Object::attr<std::complex<float>>(const std::string attr_name) const;
   template std::complex<double>
   HDF5Object::attr<std::complex<double>>(const std::string attr_name) const;
-  template std::complex<long double>
-  HDF5Object::attr<std::complex<long double>>(
-    const std::string attr_name) const;
   template int
   HDF5Object::attr<int>(const std::string attr_name) const;
   template unsigned int
@@ -1385,9 +1360,6 @@ namespace HDF5
   HDF5Object::write_attr<double>(const std::string attr_name,
                                  double            value) const;
   template void
-  HDF5Object::write_attr<long double>(const std::string attr_name,
-                                      long double       value) const;
-  template void
   HDF5Object::write_attr<std::complex<float>>(const std::string   attr_name,
                                               std::complex<float> value) const;
   template void
@@ -1395,10 +1367,6 @@ namespace HDF5
     const std::string    attr_name,
     std::complex<double> value) const;
   template void
-  HDF5Object::write_attr<std::complex<long double>>(
-    const std::string         attr_name,
-    std::complex<long double> value) const;
-  template void
   HDF5Object::write_attr<int>(const std::string attr_name, int value) const;
   template void
   HDF5Object::write_attr<unsigned int>(const std::string attr_name,
@@ -1408,14 +1376,10 @@ namespace HDF5
   DataSet::read<std::vector, float>();
   template std::vector<double>
   DataSet::read<std::vector, double>();
-  template std::vector<long double>
-  DataSet::read<std::vector, long double>();
   template std::vector<std::complex<float>>
   DataSet::read<std::vector, std::complex<float>>();
   template std::vector<std::complex<double>>
   DataSet::read<std::vector, std::complex<double>>();
-  template std::vector<std::complex<long double>>
-  DataSet::read<std::vector, std::complex<long double>>();
   template std::vector<int>
   DataSet::read<std::vector, int>();
   template std::vector<unsigned int>
@@ -1424,8 +1388,6 @@ namespace HDF5
   DataSet::read<FullMatrix, float>();
   template FullMatrix<double>
   DataSet::read<FullMatrix, double>();
-  template FullMatrix<long double>
-  DataSet::read<FullMatrix, long double>();
   template FullMatrix<std::complex<float>>
   DataSet::read<FullMatrix, std::complex<float>>();
   template FullMatrix<std::complex<double>>
@@ -1435,17 +1397,12 @@ namespace HDF5
   DataSet::read_selection<float>(const std::vector<hsize_t> coordinates);
   template std::vector<double>
   DataSet::read_selection<double>(const std::vector<hsize_t> coordinates);
-  template std::vector<long double>
-  DataSet::read_selection<long double>(const std::vector<hsize_t> coordinates);
   template std::vector<std::complex<float>>
   DataSet::read_selection<std::complex<float>>(
     const std::vector<hsize_t> coordinates);
   template std::vector<std::complex<double>>
   DataSet::read_selection<std::complex<double>>(
     const std::vector<hsize_t> coordinates);
-  template std::vector<std::complex<long double>>
-  DataSet::read_selection<std::complex<long double>>(
-    const std::vector<hsize_t> coordinates);
   template std::vector<int>
   DataSet::read_selection<int>(const std::vector<hsize_t> coordinates);
   template std::vector<unsigned int>
@@ -1459,10 +1416,6 @@ namespace HDF5
   DataSet::read_hyperslab<std::vector, double>(
     const std::vector<hsize_t> &offset,
     const std::vector<hsize_t> &count);
-  template std::vector<long double>
-  DataSet::read_hyperslab<std::vector, long double>(
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
   template std::vector<std::complex<float>>
   DataSet::read_hyperslab<std::vector, std::complex<float>>(
     const std::vector<hsize_t> &offset,
@@ -1471,10 +1424,6 @@ namespace HDF5
   DataSet::read_hyperslab<std::vector, std::complex<double>>(
     const std::vector<hsize_t> &offset,
     const std::vector<hsize_t> &count);
-  template std::vector<std::complex<long double>>
-  DataSet::read_hyperslab<std::vector, std::complex<long double>>(
-    const std::vector<hsize_t> &offset,
-    const std::vector<hsize_t> &count);
   template std::vector<int>
   DataSet::read_hyperslab<std::vector, int>(const std::vector<hsize_t> &offset,
                                             const std::vector<hsize_t> &count);
@@ -1503,14 +1452,10 @@ namespace HDF5
   template void
   DataSet::read_none<double>();
   template void
-  DataSet::read_none<long double>();
-  template void
   DataSet::read_none<std::complex<float>>();
   template void
   DataSet::read_none<std::complex<double>>();
   template void
-  DataSet::read_none<std::complex<long double>>();
-  template void
   DataSet::read_none<int>();
   template void
   DataSet::read_none<unsigned int>();
@@ -1520,18 +1465,12 @@ namespace HDF5
   template void
   DataSet::write<std::vector, double>(const std::vector<double> &data);
   template void
-  DataSet::write<std::vector, long double>(
-    const std::vector<long double> &data);
-  template void
   DataSet::write<std::vector, std::complex<float>>(
     const std::vector<std::complex<float>> &data);
   template void
   DataSet::write<std::vector, std::complex<double>>(
     const std::vector<std::complex<double>> &data);
   template void
-  DataSet::write<std::vector, std::complex<long double>>(
-    const std::vector<std::complex<long double>> &data);
-  template void
   DataSet::write<std::vector, int>(const std::vector<int> &data);
   template void
   DataSet::write<std::vector, unsigned int>(
@@ -1554,9 +1493,6 @@ namespace HDF5
   DataSet::write_selection<double>(const std::vector<double> &data,
                                    const std::vector<hsize_t> coordinates);
   template void
-  DataSet::write_selection<long double>(const std::vector<long double> &data,
-                                        const std::vector<hsize_t> coordinates);
-  template void
   DataSet::write_selection<std::complex<float>>(
     const std::vector<std::complex<float>> &data,
     const std::vector<hsize_t>              coordinates);
@@ -1565,10 +1501,6 @@ namespace HDF5
     const std::vector<std::complex<double>> &data,
     const std::vector<hsize_t>               coordinates);
   template void
-  DataSet::write_selection<std::complex<long double>>(
-    const std::vector<std::complex<long double>> &data,
-    const std::vector<hsize_t>                    coordinates);
-  template void
   DataSet::write_selection<int>(const std::vector<int> &   data,
                                 const std::vector<hsize_t> coordinates);
   template void
@@ -1587,11 +1519,6 @@ namespace HDF5
     const std::vector<hsize_t> &offset,
     const std::vector<hsize_t> &count);
   template void
-  DataSet::write_hyperslab<std::vector, long double>(
-    const std::vector<long double> &data,
-    const std::vector<hsize_t> &    offset,
-    const std::vector<hsize_t> &    count);
-  template void
   DataSet::write_hyperslab<std::vector, std::complex<float>>(
     const std::vector<std::complex<float>> &data,
     const std::vector<hsize_t> &            offset,
@@ -1602,11 +1529,6 @@ namespace HDF5
     const std::vector<hsize_t> &             offset,
     const std::vector<hsize_t> &             count);
   template void
-  DataSet::write_hyperslab<std::vector, std::complex<long double>>(
-    const std::vector<std::complex<long double>> &data,
-    const std::vector<hsize_t> &                  offset,
-    const std::vector<hsize_t> &                  count);
-  template void
   DataSet::write_hyperslab<std::vector, int>(const std::vector<int> &    data,
                                              const std::vector<hsize_t> &offset,
                                              const std::vector<hsize_t> &count);
@@ -1653,14 +1575,6 @@ namespace HDF5
     const std::vector<hsize_t> &count,
     const std::vector<hsize_t> &block);
   template void
-  DataSet::write_hyperslab<std::vector, long double>(
-    const std::vector<long double> &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);
-  template void
   DataSet::write_hyperslab<std::vector, std::complex<float>>(
     const std::vector<std::complex<float>> &data,
     const std::vector<hsize_t> &            data_dimensions,
@@ -1677,14 +1591,6 @@ namespace HDF5
     const std::vector<hsize_t> &             count,
     const std::vector<hsize_t> &             block);
   template void
-  DataSet::write_hyperslab<std::vector, std::complex<long double>>(
-    const std::vector<std::complex<long double>> &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);
-  template void
   DataSet::write_hyperslab<std::vector, int>(
     const std::vector<int> &    data,
     const std::vector<hsize_t> &data_dimensions,
@@ -1738,14 +1644,10 @@ namespace HDF5
   template void
   DataSet::write_none<double>();
   template void
-  DataSet::write_none<long double>();
-  template void
   DataSet::write_none<std::complex<float>>();
   template void
   DataSet::write_none<std::complex<double>>();
   template void
-  DataSet::write_none<std::complex<long double>>();
-  template void
   DataSet::write_none<int>();
   template void
   DataSet::write_none<unsigned int>();
@@ -1757,10 +1659,6 @@ namespace HDF5
   Group::create_dataset<double>(const std::string          name,
                                 const std::vector<hsize_t> dimensions) const;
   template DataSet
-  Group::create_dataset<long double>(
-    const std::string          name,
-    const std::vector<hsize_t> dimensions) const;
-  template DataSet
   Group::create_dataset<std::complex<float>>(
     const std::string          name,
     const std::vector<hsize_t> dimensions) const;
@@ -1769,10 +1667,6 @@ namespace HDF5
     const std::string          name,
     const std::vector<hsize_t> dimensions) const;
   template DataSet
-  Group::create_dataset<std::complex<long double>>(
-    const std::string          name,
-    const std::vector<hsize_t> dimensions) const;
-  template DataSet
   Group::create_dataset<int>(const std::string          name,
                              const std::vector<hsize_t> dimensions) const;
   template DataSet
@@ -1787,19 +1681,12 @@ namespace HDF5
   Group::write_dataset(const std::string          name,
                        const std::vector<double> &data) const;
   template void
-  Group::write_dataset(const std::string               name,
-                       const std::vector<long double> &data) const;
-  template void
   Group::write_dataset(const std::string                       name,
                        const std::vector<std::complex<float>> &data) const;
   template void
   Group::write_dataset(const std::string                        name,
                        const std::vector<std::complex<double>> &data) const;
   template void
-  Group::write_dataset(
-    const std::string                             name,
-    const std::vector<std::complex<long double>> &data) const;
-  template void
   Group::write_dataset(const std::string       name,
                        const std::vector<int> &data) const;
   template void
index 7dd9c0d329e820bcda194c812abfc2e36f49b1fa..d093b1b964627b5ef718c6c280148133a57b70cb 100644 (file)
@@ -34,31 +34,24 @@ test()
     // Create attributes attached to the root
     const float        root_float        = 2.45681934e5;
     const double       root_double       = 6.234542e3;
-    const long double  root_long_double  = 4.321432e6;
     const int          root_int          = -56;
     const unsigned int root_unsigned_int = 22;
     data_file.write_attr("root_float", root_float);
     data_file.write_attr("root_double", root_double);
-    data_file.write_attr("root_long_double", root_long_double);
     data_file.write_attr("root_int", root_int);
     data_file.write_attr("root_unsigned_int", root_unsigned_int);
     data_file.write_attr("root_total",
-                         (root_float + root_double + root_long_double) *
-                           root_int * root_unsigned_int);
+                         (root_float + root_double) * root_int *
+                           root_unsigned_int);
 
     // Create attributes attached to a group
     auto                      test_group = data_file.create_group("test_group");
-    const std::complex<float> group_complex_float        = {2.45681934e5, 45e2};
-    const std::complex<double>      group_complex_double = {6.234542e3, 2};
-    const std::complex<long double> group_complex_long_double = {4.321432e6,
-                                                                 23};
+    const std::complex<float> group_complex_float   = {2.45681934e5, 45e2};
+    const std::complex<double> group_complex_double = {6.234542e3, 2};
     test_group.write_attr("group_complex_float", group_complex_float);
     test_group.write_attr("group_complex_double", group_complex_double);
-    test_group.write_attr("group_complex_long_double",
-                          group_complex_long_double);
     test_group.write_attr("group_complex_total",
-                          group_complex_float * group_complex_double *
-                            group_complex_long_double);
+                          group_complex_float * group_complex_double);
     test_group.write_attr("group_string", std::string("test_string_attribute"));
 
     // Create attributes attached to a dataset
@@ -78,15 +71,13 @@ test()
     HDF5::File data_file(filename, HDF5::File::Mode::open);
     auto       root_float  = data_file.attr<float>("root_float");
     auto       root_double = data_file.attr<double>("root_double");
-    auto root_long_double  = data_file.attr<long double>("root_long_double");
-    auto root_int          = data_file.attr<int>("root_int");
+    auto       root_int    = data_file.attr<int>("root_int");
     auto root_unsigned_int = data_file.attr<unsigned int>("root_unsigned_int");
     // calculated and read should be the same
     deallog << "root_total calculated:"
-            << (root_float + root_double + root_long_double) * root_int *
-                 root_unsigned_int
+            << (root_float + root_double) * root_int * root_unsigned_int
             << std::endl;
-    deallog << "root_total read:" << data_file.attr<long double>("root_total")
+    deallog << "root_total read:" << data_file.attr<double>("root_total")
             << std::endl;
 
     // Read attributes attached to a group
@@ -95,14 +86,10 @@ test()
       test_group.attr<std::complex<float>>("group_complex_float");
     auto group_complex_double =
       test_group.attr<std::complex<double>>("group_complex_double");
-    auto group_complex_long_double =
-      test_group.attr<std::complex<long double>>("group_complex_long_double");
     deallog << "group_complex_total calculated:"
-            << (group_complex_float * group_complex_double *
-                group_complex_long_double)
-            << std::endl;
+            << (group_complex_float * group_complex_double) << std::endl;
     deallog << "group_complex_total read:"
-            << test_group.attr<std::complex<long double>>("group_complex_total")
+            << test_group.attr<std::complex<double>>("group_complex_total")
             << std::endl;
     deallog << "group_string read:"
             << test_group.attr<std::string>("group_string") << std::endl;
index 90484a04eb05f3ac1c3267303bd58aaee6aae0c2..2885b923d3823811c34711400acba853da6ff3f1 100644 (file)
@@ -1,8 +1,8 @@
 
-DEAL::root_total calculated:-5.63437e+09
-DEAL::root_total read:-5.63437e+09
-DEAL::group_complex_total calculated:(6.61916e+15,1.23398e+14)
-DEAL::group_complex_total read:(6.61916e+15,1.23398e+14)
+DEAL::root_total calculated:-3.10361e+08
+DEAL::root_total read:-3.10361e+08
+DEAL::group_complex_total calculated:(1.53171e+09,2.85468e+07)
+DEAL::group_complex_total read:(1.53171e+09,2.85468e+07)
 DEAL::group_string read:test_string_attribute
 DEAL::dataset_double read:20.2000
 DEAL::dataset_string read:test_dataset_attribute
index ba7716dae8c7b1043a52b3a10c0692f30e049bd6..40544037855ceffe50ef1ddbab355264d2d1950b 100644 (file)
@@ -34,31 +34,24 @@ test()
     // Create attributes attached to the root
     const float        root_float        = 2.45681934e5;
     const double       root_double       = 6.234542e3;
-    const long double  root_long_double  = 4.321432e6;
     const int          root_int          = -56;
     const unsigned int root_unsigned_int = 22;
     data_file.write_attr("root_float", root_float);
     data_file.write_attr("root_double", root_double);
-    data_file.write_attr("root_long_double", root_long_double);
     data_file.write_attr("root_int", root_int);
     data_file.write_attr("root_unsigned_int", root_unsigned_int);
     data_file.write_attr("root_total",
-                         (root_float + root_double + root_long_double) *
-                           root_int * root_unsigned_int);
+                         (root_float + root_double) * root_int *
+                           root_unsigned_int);
 
     // Create attributes attached to a group
     auto                      test_group = data_file.create_group("test_group");
-    const std::complex<float> group_complex_float        = {2.45681934e5, 45e2};
-    const std::complex<double>      group_complex_double = {6.234542e3, 2};
-    const std::complex<long double> group_complex_long_double = {4.321432e6,
-                                                                 23};
+    const std::complex<float> group_complex_float   = {2.45681934e5, 45e2};
+    const std::complex<double> group_complex_double = {6.234542e3, 2};
     test_group.write_attr("group_complex_float", group_complex_float);
     test_group.write_attr("group_complex_double", group_complex_double);
-    test_group.write_attr("group_complex_long_double",
-                          group_complex_long_double);
     test_group.write_attr("group_complex_total",
-                          group_complex_float * group_complex_double *
-                            group_complex_long_double);
+                          group_complex_float * group_complex_double);
     test_group.write_attr("group_string", std::string("test_string_attribute"));
 
     // Create attributes attached to a dataset
@@ -78,15 +71,13 @@ test()
     HDF5::File data_file(filename, MPI_COMM_WORLD, HDF5::File::Mode::open);
     auto       root_float  = data_file.attr<float>("root_float");
     auto       root_double = data_file.attr<double>("root_double");
-    auto root_long_double  = data_file.attr<long double>("root_long_double");
-    auto root_int          = data_file.attr<int>("root_int");
+    auto       root_int    = data_file.attr<int>("root_int");
     auto root_unsigned_int = data_file.attr<unsigned int>("root_unsigned_int");
     // calculated and read should be the same
     deallog << "root_total calculated:"
-            << (root_float + root_double + root_long_double) * root_int *
-                 root_unsigned_int
+            << (root_float + root_double) * root_int * root_unsigned_int
             << std::endl;
-    deallog << "root_total read:" << data_file.attr<long double>("root_total")
+    deallog << "root_total read:" << data_file.attr<double>("root_total")
             << std::endl;
 
     // Read attributes attached to a group
@@ -95,14 +86,10 @@ test()
       test_group.attr<std::complex<float>>("group_complex_float");
     auto group_complex_double =
       test_group.attr<std::complex<double>>("group_complex_double");
-    auto group_complex_long_double =
-      test_group.attr<std::complex<long double>>("group_complex_long_double");
     deallog << "group_complex_total calculated:"
-            << (group_complex_float * group_complex_double *
-                group_complex_long_double)
-            << std::endl;
+            << (group_complex_float * group_complex_double) << std::endl;
     deallog << "group_complex_total read:"
-            << test_group.attr<std::complex<long double>>("group_complex_total")
+            << test_group.attr<std::complex<double>>("group_complex_total")
             << std::endl;
     deallog << "group_string read:"
             << test_group.attr<std::string>("group_string") << std::endl;
index 90484a04eb05f3ac1c3267303bd58aaee6aae0c2..2885b923d3823811c34711400acba853da6ff3f1 100644 (file)
@@ -1,8 +1,8 @@
 
-DEAL::root_total calculated:-5.63437e+09
-DEAL::root_total read:-5.63437e+09
-DEAL::group_complex_total calculated:(6.61916e+15,1.23398e+14)
-DEAL::group_complex_total read:(6.61916e+15,1.23398e+14)
+DEAL::root_total calculated:-3.10361e+08
+DEAL::root_total read:-3.10361e+08
+DEAL::group_complex_total calculated:(1.53171e+09,2.85468e+07)
+DEAL::group_complex_total read:(1.53171e+09,2.85468e+07)
 DEAL::group_string read:test_string_attribute
 DEAL::dataset_double read:20.2000
 DEAL::dataset_string read:test_dataset_attribute
index 90484a04eb05f3ac1c3267303bd58aaee6aae0c2..2885b923d3823811c34711400acba853da6ff3f1 100644 (file)
@@ -1,8 +1,8 @@
 
-DEAL::root_total calculated:-5.63437e+09
-DEAL::root_total read:-5.63437e+09
-DEAL::group_complex_total calculated:(6.61916e+15,1.23398e+14)
-DEAL::group_complex_total read:(6.61916e+15,1.23398e+14)
+DEAL::root_total calculated:-3.10361e+08
+DEAL::root_total read:-3.10361e+08
+DEAL::group_complex_total calculated:(1.53171e+09,2.85468e+07)
+DEAL::group_complex_total read:(1.53171e+09,2.85468e+07)
 DEAL::group_string read:test_string_attribute
 DEAL::dataset_double read:20.2000
 DEAL::dataset_string read:test_dataset_attribute

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

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.