From fa991ca566c5aa6651abf0f48559fbb08efd97af Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Mon, 30 May 2016 12:09:49 +0200 Subject: [PATCH] HDF5: Warn if SWMR is requested but unavailable --- dune/fufem/hdf5/hdf5file.hh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dune/fufem/hdf5/hdf5file.hh b/dune/fufem/hdf5/hdf5file.hh index 9344c2b8..4936fe40 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 } -- GitLab