summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-04-20 20:33:09 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-04-20 20:33:09 (GMT)
commit5fefc12bd84843c295096330d5884dc0a1e043b0 (patch)
tree27aa293f46eefbad7c00a0f7738075cdbc401068 /test
parent05628b46873fa594ee769af0196728970c705082 (diff)
parent5ed622b9ca432f1b440e8903680695ac83e28301 (diff)
downloadhdf5-5fefc12bd84843c295096330d5884dc0a1e043b0.zip
hdf5-5fefc12bd84843c295096330d5884dc0a1e043b0.tar.gz
hdf5-5fefc12bd84843c295096330d5884dc0a1e043b0.tar.bz2
Merge pull request #443 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:eoc_parallel_prevent to develop
* commit '5ed622b9ca432f1b440e8903680695ac83e28301': The cache_image test shows a skipped message about EoC in parallel. Added code to disable the evict-on-close feature in the parallel library.
Diffstat (limited to 'test')
-rw-r--r--test/cache_image.c10
-rw-r--r--test/evict_on_close.c99
2 files changed, 108 insertions, 1 deletions
diff --git a/test/cache_image.c b/test/cache_image.c
index dfbd02e..378c21e 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -7714,6 +7714,7 @@ get_free_sections_test(void)
static unsigned
evict_on_close_test(void)
{
+#ifndef H5_HAVE_PARALLEL
const char * fcn_name = "evict_on_close_test()";
char filename[512];
hbool_t show_progress = FALSE;
@@ -7722,9 +7723,16 @@ evict_on_close_test(void)
H5F_t *file_ptr = NULL;
H5C_t *cache_ptr = NULL;
int cp = 0;
+#endif /* H5_HAVE_PARALLEL */
TESTING("Cache image / evict on close interaction");
+#ifdef H5_HAVE_PARALLEL
+ SKIPPED();
+ HDputs(" EoC not supported in the parallel library.");
+ return 0;
+#else
+
pass = TRUE;
if ( show_progress )
@@ -8013,6 +8021,7 @@ evict_on_close_test(void)
FUNC, failure_mssg);
return !pass;
+#endif /* H5_HAVE_PARALLEL */
} /* evict_on_close_test() */
@@ -8072,4 +8081,3 @@ main(void)
} /* main() */
-
diff --git a/test/evict_on_close.c b/test/evict_on_close.c
index b00c1e4..147976b 100644
--- a/test/evict_on_close.c
+++ b/test/evict_on_close.c
@@ -39,6 +39,12 @@
#include "H5Gpkg.h"
#include "H5Ipkg.h"
+/* 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 */
@@ -992,3 +998,96 @@ error:
} /* 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
+ *
+ * Programmer: Dana Robinson
+ * Spring 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+check_evict_on_close_parallel_fail(void)
+{
+ hid_t fapl_id = -1;
+ hbool_t 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
+ *
+ * Programmer: Dana Robinson
+ * Spring 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ unsigned nerrors = 0; /* number of test errors */
+
+ HDprintf("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;
+
+ HDprintf("All evict-on-close tests passed.\n");
+ HDprintf("Note that EoC is not supported under parallel so most tests are skipped.\n");
+
+ return EXIT_SUCCESS;
+
+error:
+
+ HDprintf("***** %u evict-on-close test%s FAILED! *****\n",
+ nerrors, nerrors > 1 ? "S" : "");
+
+ return EXIT_FAILURE;
+
+} /* main() - parallel */
+
+#endif /* H5_HAVE_PARALLEL */
+