summaryrefslogtreecommitdiffstats
path: root/src/H5Fint.c
diff options
context:
space:
mode:
authorGlenn Song <43005495+glennsong09@users.noreply.github.com>2023-10-24 17:51:55 (GMT)
committerGitHub <noreply@github.com>2023-10-24 17:51:55 (GMT)
commitea1714b3035b9de6cac885508c9f4d882c817b3f (patch)
tree9a34f4118e3850cbe138c5e01046eb5bbe0a0d60 /src/H5Fint.c
parent1900cc63eb14a240ce988a0cd99d1e6babd528f1 (diff)
downloadhdf5-ea1714b3035b9de6cac885508c9f4d882c817b3f.zip
hdf5-ea1714b3035b9de6cac885508c9f4d882c817b3f.tar.gz
hdf5-ea1714b3035b9de6cac885508c9f4d882c817b3f.tar.bz2
Fix H5Pset_evict_on_close failing regardless of actual parallel use (#3761)
Allow H5Pset_evict_on_close to be called regardless of whether a parallel build of HDF5 is being used Fail during file opens if H5Pset_evict_on_close has been set to true on the given File Access Property List and the size of the MPI communicator being used is greater than 1
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r--src/H5Fint.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index 014f619..4093b4b 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -1968,6 +1968,22 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "can't get minimum raw data fraction of page buffer");
} /* end if */
+ /* Get the evict on close setting */
+ if (H5P_get(a_plist, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, &evict_on_close) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get evict on close value");
+
+#ifdef H5_HAVE_PARALLEL
+ /* Check for evict on close in parallel (currently unsupported) */
+ assert(file->shared);
+ if (H5F_SHARED_HAS_FEATURE(file->shared, H5FD_FEAT_HAS_MPI)) {
+ int mpi_size = H5F_shared_mpi_get_size(file->shared);
+
+ if ((mpi_size > 1) && evict_on_close)
+ HGOTO_ERROR(H5E_FILE, H5E_UNSUPPORTED, NULL,
+ "evict on close is currently not supported in parallel HDF5");
+ }
+#endif
+
/*
* Read or write the file superblock, depending on whether the file is
* empty or not.
@@ -2046,8 +2062,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
* or later, verify that the access property list value matches the value
* in shared file structure.
*/
- if (H5P_get(a_plist, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, &evict_on_close) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get evict on close value");
if (shared->nrefs == 1)
shared->evict_on_close = evict_on_close;
else if (shared->nrefs > 1) {