From: Daniel Garcia-Sanchez Date: Fri, 3 Aug 2018 09:22:47 +0000 (+0200) Subject: Check support for HDF5 and MPI X-Git-Tag: v9.1.0-rc1~453^2~74 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b03546c2bf0e81aee541bdcbb859dec3ae13e9da;p=dealii.git Check support for HDF5 and MPI --- diff --git a/include/deal.II/base/hdf5.h b/include/deal.II/base/hdf5.h index 4d34cd6646..26d1884403 100644 --- a/include/deal.II/base/hdf5.h +++ b/include/deal.II/base/hdf5.h @@ -18,11 +18,13 @@ #include -#include +#ifdef DEAL_II_WITH_HDF5 -#include +# include -#include +# include + +# include DEAL_II_NAMESPACE_OPEN @@ -391,4 +393,7 @@ namespace HDF5 DEAL_II_NAMESPACE_CLOSE -#endif + +#endif // DEAL_II_WITH_HDF5 + +#endif // dealii_hdf5_h diff --git a/source/base/hdf5.cc b/source/base/hdf5.cc index 80c28624d7..dfe415927c 100644 --- a/source/base/hdf5.cc +++ b/source/base/hdf5.cc @@ -13,18 +13,19 @@ // // --------------------------------------------------------------------- - #include -#include +#ifdef DEAL_II_WITH_HDF5 + +# include -#include +# include -#include +# include -#include -#include -#include +# include +# include +# include 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