fixed: add missing HAVE_MPI ifs

This commit is contained in:
Arne Morten Kvarving 2023-02-28 09:49:01 +01:00
parent e9d1bbc355
commit 5f08897247

View File

@ -199,10 +199,14 @@ void HDF5File::writeSplit(hid_t grp,
std::vector<hsize_t> 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(),