]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check support for HDF5 and MPI
authorDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Fri, 3 Aug 2018 09:22:47 +0000 (11:22 +0200)
committerDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 9 Jan 2019 17:19:11 +0000 (18:19 +0100)
include/deal.II/base/hdf5.h
source/base/hdf5.cc

index 4d34cd66464d576677796b55966856e6c430d8d6..26d18844035bb2495f595eaeb95cba999e8905f0 100644 (file)
 
 #include <deal.II/base/config.h>
 
-#include <deal.II/lac/full_matrix.h>
+#ifdef DEAL_II_WITH_HDF5
 
-#include <hdf5.h>
+#  include <deal.II/lac/full_matrix.h>
 
-#include <vector>
+#  include <hdf5.h>
+
+#  include <vector>
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -391,4 +393,7 @@ namespace HDF5
 
 DEAL_II_NAMESPACE_CLOSE
 
-#endif
+
+#endif // DEAL_II_WITH_HDF5
+
+#endif // dealii_hdf5_h
index 80c28624d7d4b6dcba6a06b8089e9bc9b3b226d8..dfe415927c1cc3ed1ef6e5382b3112074db52c9e 100644 (file)
 //
 // ---------------------------------------------------------------------
 
-
 #include <deal.II/base/config.h>
 
-#include <deal.II/base/hdf5.h>
+#ifdef DEAL_II_WITH_HDF5
+
+#  include <deal.II/base/hdf5.h>
 
-#include <deal.II/lac/full_matrix.h>
+#  include <deal.II/lac/full_matrix.h>
 
-#include <hdf5.h>
+#  include <hdf5.h>
 
-#include <memory>
-#include <numeric>
-#include <vector>
+#  include <memory>
+#  include <numeric>
+#  include <vector>
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -627,6 +628,12 @@ namespace HDF5
 
     if (mpi)
       {
+#  ifndef DEAL_II_WITH_MPI
+        AssertThrow(false, ExcMessage("MPI support is disabled."));
+#  endif // DEAL_II_WITH_MPI
+#  ifndef H5_HAVE_PARALLEL
+        AssertThrow(false, ExcMessage("HDF5 parallel support is disabled."));
+#  endif // H5_HAVE_PARALLEL
         plist = H5Pcreate(H5P_FILE_ACCESS);
         H5Pset_fapl_mpio(plist, mpi_communicator, info);
       }
@@ -801,3 +808,5 @@ namespace HDF5
 } // namespace HDF5
 
 DEAL_II_NAMESPACE_CLOSE
+
+#endif // DEAL_II_WITH_HDF5

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.