summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-04-24 21:57:07 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-04-24 21:57:07 (GMT)
commit86dacce61f4e2465b1044d3ef7509d0201261fbd (patch)
treea7199d3f730720d06caa054fa054c52b2073397a
parentb4f7874311c6d516e19530c2003f902d67738dba (diff)
parent435214cb555725d3690826caeb7c255057b9f09a (diff)
downloadhdf5-86dacce61f4e2465b1044d3ef7509d0201261fbd.zip
hdf5-86dacce61f4e2465b1044d3ef7509d0201261fbd.tar.gz
hdf5-86dacce61f4e2465b1044d3ef7509d0201261fbd.tar.bz2
Merge pull request #458 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:hdf5_1_10_1 to hdf5_1_10_1
* commit '435214cb555725d3690826caeb7c255057b9f09a': Fixed problems that prevent bin/trace from marking up some functions. 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.
-rw-r--r--src/H5.c6
-rw-r--r--src/H5PL.c10
-rw-r--r--src/H5Pfapl.c6
-rw-r--r--test/cache_image.c10
-rw-r--r--test/evict_on_close.c99
5 files changed, 124 insertions, 7 deletions
diff --git a/src/H5.c b/src/H5.c
index 5875906..1068fc6 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -942,7 +942,7 @@ H5allocate_memory(size_t size, hbool_t clear)
{
void *ret_value = NULL;
- FUNC_ENTER_API_NOINIT;
+ FUNC_ENTER_API_NOINIT
H5TRACE2("*x", "zb", size, clear);
if(clear)
@@ -983,7 +983,7 @@ H5resize_memory(void *mem, size_t size)
{
void *ret_value = NULL;
- FUNC_ENTER_API_NOINIT;
+ FUNC_ENTER_API_NOINIT
H5TRACE2("*x", "*xz", mem, size);
ret_value = H5MM_realloc(mem, size);
@@ -1007,7 +1007,7 @@ H5resize_memory(void *mem, size_t size)
herr_t
H5free_memory(void *mem)
{
- FUNC_ENTER_API_NOINIT;
+ FUNC_ENTER_API_NOINIT
H5TRACE1("e", "*x", mem);
/* At this time, it is impossible for this to fail. */
diff --git a/src/H5PL.c b/src/H5PL.c
index bf69d3d..02c8f00 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -638,14 +638,20 @@ done:
*
* Purpose: Query the size of the current list of plugin paths.
*
- * Return: Non-negative or success.
+ * Return: Plugin path size (can't indicate failure due to unsigned type)
*
*-------------------------------------------------------------------------
*/
unsigned int
H5PLsize(void)
{
- return (unsigned int)H5PL_num_paths_g;
+ unsigned int ret_value = (unsigned int)H5PL_num_paths_g;
+
+ FUNC_ENTER_API(0)
+ H5TRACE0("Iu","");
+
+done:
+ FUNC_LEAVE_API(ret_value)
} /* end H5PLsize() */
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 0dab539..1b0a4b9 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -4395,9 +4395,13 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close)
if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
- /* Set values */
+#ifndef H5_HAVE_PARALLEL
+ /* Set value */
if(H5P_set(plist, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, &evict_on_close) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set evict on close property")
+#else
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "evict on close is currently not supported in parallel HDF5")
+#endif /* H5_HAVE_PARALLEL */
done:
FUNC_LEAVE_API(ret_value)
diff --git a/test/cache_image.c b/test/cache_image.c
index c3adf5c..58b0b8f 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -7712,6 +7712,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;
@@ -7720,9 +7721,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 )
@@ -8011,6 +8019,7 @@ evict_on_close_test(void)
FUNC, failure_mssg);
return !pass;
+#endif /* H5_HAVE_PARALLEL */
} /* evict_on_close_test() */
@@ -8070,4 +8079,3 @@ main(void)
} /* main() */
-
diff --git a/test/evict_on_close.c b/test/evict_on_close.c
index b4ef246..6536837 100644
--- a/test/evict_on_close.c
+++ b/test/evict_on_close.c
@@ -37,6 +37,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 */
@@ -990,3 +996,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 */
+