summaryrefslogtreecommitdiffstats
path: root/test
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 /test
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 'test')
-rw-r--r--test/evict_on_close.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/test/evict_on_close.c b/test/evict_on_close.c
index 9ca7f9f..db2a962 100644
--- a/test/evict_on_close.c
+++ b/test/evict_on_close.c
@@ -32,12 +32,6 @@
#include "H5Ipkg.h"
#include "H5VLprivate.h" /* Virtual Object Layer */
-/* Evict on close is not supported under parallel at this time.
- * In the meantime, we just run a simple check that EoC can't be
- * enabled in parallel HDF5.
- */
-#ifndef H5_HAVE_PARALLEL
-
/* Uncomment to manually inspect cache states */
/* (Requires debug build of the library) */
/* #define EOC_MANUAL_INSPECTION */
@@ -974,89 +968,3 @@ error:
exit(EXIT_FAILURE);
} /* end main() */
-
-#else
-
-/*-------------------------------------------------------------------------
- * Function: check_evict_on_close_parallel_fail()
- *
- * Purpose: Verify that the H5Pset_evict_on_close() call fails in
- * parallel HDF5.
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-check_evict_on_close_parallel_fail(void)
-{
- hid_t fapl_id = H5I_INVALID_HID;
- bool evict_on_close;
- herr_t status;
-
- TESTING("evict on close fails in parallel");
-
- /* Create a fapl */
- if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- TEST_ERROR;
-
- /* Set the evict on close property (should fail)*/
- evict_on_close = true;
- H5E_BEGIN_TRY
- {
- status = H5Pset_evict_on_close(fapl_id, evict_on_close);
- }
- H5E_END_TRY
- if (status >= 0)
- FAIL_PUTS_ERROR("H5Pset_evict_on_close() did not fail in parallel HDF5.");
-
- /* close fapl */
- if (H5Pclose(fapl_id) < 0)
- TEST_ERROR;
-
- PASSED();
- return SUCCEED;
-
-error:
- H5_FAILED();
- return FAIL;
-
-} /* check_evict_on_close_parallel_fail() */
-
-/*-------------------------------------------------------------------------
- * Function: main (parallel version)
- *
- * Return: EXIT_FAILURE/EXIT_SUCCESS
- *
- *-------------------------------------------------------------------------
- */
-int
-main(void)
-{
- unsigned nerrors = 0; /* number of test errors */
-
- printf("Testing evict-on-close cache behavior\n");
-
- /* Initialize */
- h5_reset();
-
- /* Test that EoC fails in parallel HDF5 */
- nerrors += check_evict_on_close_parallel_fail() < 0 ? 1 : 0;
-
- if (nerrors)
- goto error;
-
- printf("All evict-on-close tests passed.\n");
- printf("Note that EoC is not supported under parallel so most tests are skipped.\n");
-
- exit(EXIT_SUCCESS);
-
-error:
-
- printf("***** %u evict-on-close test%s FAILED! *****\n", nerrors, nerrors > 1 ? "S" : "");
-
- exit(EXIT_FAILURE);
-
-} /* main() - parallel */
-
-#endif /* H5_HAVE_PARALLEL */