diff --git a/dune/fufem/hdf5/hdf5file.hh b/dune/fufem/hdf5/hdf5file.hh index 9344c2b8b815afb4217ef11425f17b6091bb573e..4936fe4001972afe7b595a3388682ab4b08df3ed 100644 --- a/dune/fufem/hdf5/hdf5file.hh +++ b/dune/fufem/hdf5/hdf5file.hh @@ -42,10 +42,15 @@ public: bool const fileExists = stat(filename.c_str(), &buffer) == 0; unsigned int flags = fileExists ? H5F_ACC_RDWR : H5F_ACC_EXCL; + if (swmr) { #if H5_VERSION_GE(1, 10, 0) - if (swmr) flags |= H5F_ACC_SWMR_WRITE; +#else + std::cerr + << "WARNING: SWMR requested but not supported by this version of HDF5" + << std::endl; #endif + } file_ = fileExists ? H5Fopen(filename.c_str(), flags, fapl) : H5Fcreate(filename.c_str(), flags, H5P_DEFAULT, fapl); @@ -69,6 +74,10 @@ public: #if H5_VERSION_GE(1, 10, 0) swmrEnabled_ = true; H5Fstart_swmr_write(file_); +#else + std::cerr + << "WARNING: SWMR requested but not supported by this version of HDF5" + << std::endl; #endif }