From 5f0889724721c0c1d99de6f59ede2baf01ecb46b Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 28 Feb 2023 09:49:01 +0100 Subject: [PATCH] fixed: add missing HAVE_MPI ifs --- opm/simulators/utils/HDF5File.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/opm/simulators/utils/HDF5File.cpp b/opm/simulators/utils/HDF5File.cpp index 4eaa53423..d92399727 100644 --- a/opm/simulators/utils/HDF5File.cpp +++ b/opm/simulators/utils/HDF5File.cpp @@ -199,10 +199,14 @@ void HDF5File::writeSplit(hid_t grp, std::vector proc_sizes(comm_.size()); hid_t dxpl = H5P_DEFAULT; if (comm_.size() > 1) { +#if HAVE_MPI hsize_t lsize = buffer.size(); comm_.allgather(&lsize, 1, proc_sizes.data()); dxpl = H5Pcreate(H5P_DATASET_XFER); H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); +#else + assert(false); // should be unreachable +#endif } else { proc_sizes[0] = buffer.size(); } @@ -246,8 +250,12 @@ void HDF5File::writeRootOnly(hid_t grp, hid_t dcpl = this->getCompression(size); hid_t dxpl = H5P_DEFAULT; if (comm_.size() > 1) { +#if HAVE_MPI dxpl = H5Pcreate(H5P_DATASET_XFER); H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE); +#else + assert(false); // should be unreachable +#endif } hid_t dataset_id = H5Dcreate2(grp, dset.c_str(),