From c2e60909e35d988e86d78b7c8bfc0d2d51c4e75f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 Nov 2016 15:04:26 -0600 Subject: Add test to memcheck ignore and increase cache test timeout --- config/cmake/CTestCustom.cmake | 1 + test/CMakeTests.cmake | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 481873e..f9431e7 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -211,6 +211,7 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5REPACK_VERIFY_LAYOUT_ALL-layout_long_switches #uses grepTest.cmake H5REPACK_VERIFY_LAYOUT_ALL-layout_short_switches #uses grepTest.cmake H5REPACK-plugin + H5REPACK_CMP-plugin_zero ######### tools/h5stat ######### H5STAT-clearall-objects ######### tools/misc ######### diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index f4b37f3..5cca2d2 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -581,7 +581,7 @@ endforeach (test ${H5TEST_TESTS}) set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1) set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800) -set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800) +set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 3600) set_tests_properties (H5TEST-btree2 PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT 2400) @@ -612,7 +612,7 @@ if (BUILD_SHARED_LIBS) set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1) set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800) - set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800) + set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 3600) set_tests_properties (H5TEST-shared-btree2 PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT 2400) endif (BUILD_SHARED_LIBS) @@ -638,7 +638,7 @@ if (NOT CYGWIN) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) - set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 2400) + set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 3600) endif (NOT CYGWIN) #-- Adding test for err_compat @@ -745,7 +745,7 @@ if (BUILD_SHARED_LIBS) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) - set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 2400) + set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 3600) endif (NOT CYGWIN) #-- Adding test for err_compat @@ -1072,7 +1072,7 @@ if (HDF5_TEST_VFD) set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1800) if (NOT CYGWIN) - set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800) + set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 3600) endif (NOT CYGWIN) if (BUILD_SHARED_LIBS) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) @@ -1080,7 +1080,7 @@ if (HDF5_TEST_VFD) set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1800) if (NOT CYGWIN) - set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800) + set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 3600) endif (NOT CYGWIN) endif (BUILD_SHARED_LIBS) if (HDF5_TEST_FHEAP_VFD) -- cgit v0.12 From e2863ca880a6983558d3ba3e5219164a57287f04 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 22 Nov 2016 20:55:03 -0500 Subject: Fixed a few memory problems in test/cache_logging.c and test/h5test.c (which show up in test/vfd.c). --- test/cache_logging.c | 1 + test/h5test.c | 33 ++++++++++++++++++++++----------- test/vfd.c | 2 +- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/test/cache_logging.c b/test/cache_logging.c index a5e399c..9190a8a 100644 --- a/test/cache_logging.c +++ b/test/cache_logging.c @@ -132,6 +132,7 @@ test_logging_api(void) TEST_ERROR; /* Clean up */ + HDfree(location); if(H5Fclose(fid) < 0) TEST_ERROR; diff --git a/test/h5test.c b/test/h5test.c index c126da8..f85e96c 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1584,32 +1584,43 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ ssize_t nread; /* Number of bytes read in */ - void *buf; /* Buffer for copying data */ - const char *filename = H5_get_srcdir_filename(origfilename);; /* Get the test file name to copy */ + void *buf = NULL; /* Buffer for copying data */ + const char *filename = H5_get_srcdir_filename(origfilename); /* Get the test file name to copy */ /* Allocate copy buffer */ - if(NULL == (buf = HDmalloc(READ_BUF_SIZE))) - return -1; + if(NULL == (buf = HDcalloc((size_t)1, (size_t)READ_BUF_SIZE))) + goto error; /* Copy old file into temporary file */ if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) - return -1; + goto error; if((fd_new = HDopen(local_copy_name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) - return -1; + goto error; /* Copy data */ while((nread = HDread(fd_old, buf, (size_t)READ_BUF_SIZE)) > 0) if(HDwrite(fd_new, buf, (size_t)nread) < 0) - return -1; + goto error; + /* Close files */ + if(HDclose(fd_old) < 0) + goto error; + if(HDclose(fd_new) < 0) + goto error; + /* Release memory */ HDfree(buf); - /* Close files */ - if(HDclose(fd_old) < 0) return -1; - if(HDclose(fd_new) < 0) return -1; - return 0; + +error: + /* ignore return values since we're already noted the problem */ + if(fd_old > 0) + HDclose(fd_old); + if(fd_new > 0) + HDclose(fd_new); + HDfree(buf); + return -1; } /* end h5_make_local_copy() */ diff --git a/test/vfd.c b/test/vfd.c index c19e0d0..a215264 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -997,7 +997,7 @@ test_family_compat(void) counter++; HDsnprintf(newname_individual, sizeof(newname_individual), newname, counter); HDsnprintf(pathname_individual, sizeof(pathname_individual), pathname, counter); - } + } /* end while */ /* Make sure we can open the file. Use the read and write mode to flush the * superblock. */ -- cgit v0.12 From 191cc19ae0a2feb72d2171a0808fdc71a3b862dd Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 23 Nov 2016 16:45:47 -0500 Subject: Added vlen reclaim functions to a test in tfile.c that leaks memory. --- test/tfile.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/tfile.c b/test/tfile.c index 833d2d9..d6cb427 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -2268,12 +2268,11 @@ test_file_double_file_dataset_open(hbool_t new_format) CHECK(ret, FAIL, "H5Dwrite"); /* Closing */ + /* (Leave sid1 open for later use) */ ret = H5Dclose(did1); CHECK(ret, FAIL, "H5Dclose"); ret = H5Tclose(tid1); CHECK(ret, FAIL, "H5Tclose"); - ret = H5Sclose(sid1); - CHECK(ret, FAIL, "H5Sclose"); ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Dclose"); @@ -2392,6 +2391,8 @@ test_file_double_file_dataset_open(hbool_t new_format) HDmemset(buffer, 0, sizeof(char*) * 5); ret = H5Dread(did2, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); CHECK(ret, FAIL, "H5Dread"); + ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, buffer); + CHECK(ret, FAIL, "H5Dvlen_reclaim"); /* Second file's dataset close */ ret = H5Dclose(did2); @@ -2404,6 +2405,9 @@ test_file_double_file_dataset_open(hbool_t new_format) /* First file's dataset read */ HDmemset(buffer, 0, sizeof(char*) * 5); ret = H5Dread(did1, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); + CHECK(ret, FAIL, "H5Dread"); + ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, buffer); + CHECK(ret, FAIL, "H5Dvlen_reclaim"); /* First file's dataset close */ ret = H5Dclose(did1); @@ -2416,6 +2420,8 @@ test_file_double_file_dataset_open(hbool_t new_format) /* Closing */ ret = H5Tclose(tid1); CHECK(ret, FAIL, "H5Tclose"); + ret = H5Sclose(sid1); + CHECK(ret, FAIL, "H5Sclose"); ret = H5Tclose(tid2); CHECK(ret, FAIL, "H5Tclose"); -- cgit v0.12 From 1071d8bf73bc9f069b9d939d882aa27e2334f94a Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 25 Nov 2016 16:07:23 -0600 Subject: Add a flag for H5C__flush_single_entry() to allow the parallel code to request that images for entries be generated, even when not writing the entry from an MPI rank. --- src/H5C.c | 58 ++++++++++++++++++++++++++++++-------------------------- src/H5Cmpio.c | 42 ++++++++++++++++++++++++++++++---------- src/H5Cprivate.h | 2 ++ 3 files changed, 65 insertions(+), 37 deletions(-) diff --git a/src/H5C.c b/src/H5C.c index 147489b..31f887d 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -5739,6 +5739,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ hbool_t during_flush; /* external flag */ hbool_t write_entry; /* internal flag */ hbool_t destroy_entry; /* internal flag */ + hbool_t generate_image; /* internal flag */ hbool_t was_dirty; haddr_t entry_addr = HADDR_UNDEF; herr_t ret_value = SUCCEED; /* Return value */ @@ -5759,6 +5760,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ take_ownership = ((flags & H5C__TAKE_OWNERSHIP_FLAG) != 0); del_from_slist_on_destroy = ((flags & H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) != 0); during_flush = ((flags & H5C__DURING_FLUSH_FLAG) != 0); + generate_image = ((flags & H5C__GENERATE_IMAGE_FLAG) != 0); /* Set the flag for destroying the entry, based on the 'take ownership' * and 'destroy' flags @@ -5818,29 +5820,13 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ entry_ptr->flush_in_progress = TRUE; entry_ptr->flush_marker = FALSE; - /* serialize the entry if necessary, and then write it to disk. */ - if(write_entry) { - - /* The entry is dirty, and we are doing either a flush, - * or a flush destroy. In either case, serialize the - * entry and write it to disk. - * - * Note that this may cause the entry to be re-sized and/or - * moved in the cache. - * - * As we will not update the metadata cache's data structures - * until we we finish the write, we must touch up these - * data structures for size and location changes even if we - * are about to delete the entry from the cache (i.e. on a - * flush destroy). - */ + /* The entry is dirty, and we are doing a flush, a flush destroy or have + * been requested to generate an image. In those cases, serialize the + * entry. + */ + if(write_entry || generate_image) { HDassert(entry_ptr->is_dirty); -#if H5C_DO_SANITY_CHECKS - if(cache_ptr->check_write_permitted && !(cache_ptr->write_permitted)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Write when writes are always forbidden!?!?!") -#endif /* H5C_DO_SANITY_CHECKS */ - if(NULL == entry_ptr->image_ptr) { if(NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer") @@ -5854,13 +5840,22 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't generate entry's image") } /* end if ( ! (entry_ptr->image_up_to_date) ) */ + } /* end if */ + + /* Finally, write the image to disk. + * + * Note that if the H5AC__CLASS_SKIP_WRITES flag is set in the + * in the entry's type, we silently skip the write. This + * flag should only be used in test code. + */ + if(write_entry) { + HDassert(entry_ptr->is_dirty); + +#if H5C_DO_SANITY_CHECKS + if(cache_ptr->check_write_permitted && !(cache_ptr->write_permitted)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Write when writes are always forbidden!?!?!") +#endif /* H5C_DO_SANITY_CHECKS */ - /* Finally, write the image to disk. - * - * Note that if the H5AC__CLASS_SKIP_WRITES flag is set in the - * in the entry's type, we silently skip the write. This - * flag should only be used in test code. - */ if(((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0) { #ifdef H5_HAVE_PARALLEL if(collective_write_list) { @@ -7600,6 +7595,15 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, * * Purpose: Serialize an entry and generate its image. * + * Note: This may cause the entry to be re-sized and/or moved in + * the cache. + * + * As we will not update the metadata cache's data structures + * until we we finish the write, we must touch up these + * data structures for size and location changes even if we + * are about to delete the entry from the cache (i.e. on a + * flush destroy). + * * Return: Non-negative on success/Negative on failure * * Programmer: Mohamad Chaarawi diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 8a28f88..72de4d0 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -454,13 +454,37 @@ H5C_apply_candidate_list(H5F_t * f, (long long)clear_ptr->addr); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - /* No need to check for the next entry in the scan being - * removed from the cache, as this call to H5C__flush_single_entry() - * will not call either the pre_serialize or serialize callbacks. + /* reset entries_removed_counter and + * last_entry_removed_ptr prior to the call to + * H5C__flush_single_entry() so that we can spot + * unexpected removals of entries from the cache, + * and set the restart_scan flag if proceeding + * would be likely to cause us to scan an entry + * that is no longer in the cache. + * + * Note that as of this writing (April 2015) this + * case cannot occur in the parallel case. However + * Quincey is making noises about changing this, hence + * the insertion of this test. + * + * Note also that there is no test code to verify + * that this code actually works (although similar code + * in the serial version exists and is tested). + * + * Implementing a test will likely require implementing + * flush op like facilities in the parallel tests. At + * a guess this will not be terribly painful, but it + * will take a bit of time. */ + cache_ptr->entries_removed_counter = 0; + cache_ptr->last_entry_removed_ptr = NULL; - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") + + if((cache_ptr->entries_removed_counter > 1) || + (cache_ptr->last_entry_removed_ptr == entry_ptr)) + restart_scan = TRUE; } /* end if */ /* Else, if this process needs to flush this entry. */ @@ -508,11 +532,9 @@ H5C_apply_candidate_list(H5F_t * f, if(H5C__flush_single_entry(f, dxpl_id, flush_ptr, H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, collective_write_list) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry.") - if ( ( cache_ptr->entries_removed_counter > 1 ) || - ( cache_ptr->last_entry_removed_ptr == entry_ptr ) ) - + if((cache_ptr->entries_removed_counter > 1) || + (cache_ptr->last_entry_removed_ptr == entry_ptr)) restart_scan = TRUE; - } /* end else-if */ /* Otherwise, no action to be taken on this entry. Grab the next. */ @@ -663,7 +685,7 @@ H5C_apply_candidate_list(H5F_t * f, (long long)clear_ptr->addr); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") } /* end else-if */ @@ -714,7 +736,7 @@ H5C_apply_candidate_list(H5F_t * f, if (delayed_ptr) { if (delayed_ptr->clear_on_unprotect) { - if(H5C__flush_single_entry(f, dxpl_id, delayed_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, delayed_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG, NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry.") entry_ptr->clear_on_unprotect = FALSE; diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index c03e2e7..923083f 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -183,6 +183,7 @@ * H5C__FLUSH_MARKED_ENTRIES_FLAG * H5C__TAKE_OWNERSHIP_FLAG * H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG + * H5C__GENERATE_IMAGE_FLAG */ #define H5C__NO_FLAGS_SET 0x00000 #define H5C__SET_FLUSH_MARKER_FLAG 0x00001 @@ -202,6 +203,7 @@ #define H5C__EVICT_ALLOW_LAST_PINS_FLAG 0x04000 #define H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG 0x08000 #define H5C__DURING_FLUSH_FLAG 0x10000 /* Set when the entire cache is being flushed */ +#define H5C__GENERATE_IMAGE_FLAG 0x20000 /* Set during parallel I/O */ /* Debugging/sanity checking/statistics settings */ #ifndef NDEBUG -- cgit v0.12 From ea4d18c3d9c3b6c77030abdf2f0509bc68224559 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 25 Nov 2016 17:18:52 -0600 Subject: Remove unnecessary assert. --- testpar/t_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 066dd77..0fa0096 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -2522,7 +2522,7 @@ datum_serialize(const H5F_t *f, HDassert( aux_ptr ); HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); - HDassert( entry_ptr->aux_ptr == NULL ); +// HDassert( entry_ptr->aux_ptr == NULL ); entry_ptr->aux_ptr = aux_ptr; -- cgit v0.12 From c9bbc2f1ccd0cb6403bf4221de46ef1e831d779c Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 25 Nov 2016 21:09:45 -0500 Subject: Added src/H5config.h.in~ to .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 49b76e1..40c6a69 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,7 @@ src/H5Einit.h src/H5Epubgen.h src/H5Eterm.h src/H5config.h.in +src/H5config.h.in~ src/H5overflow.h src/H5version.h src/Makefile.in -- cgit v0.12 From 1aa2373b2e1a651bec507dcb14a89b51815a972c Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 27 Nov 2016 16:05:03 -0500 Subject: Simplified .gitignore by using patterns. --- .gitignore | 113 ++++++++++--------------------------------------------------- 1 file changed, 18 insertions(+), 95 deletions(-) diff --git a/.gitignore b/.gitignore index 40c6a69..7424325 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,22 @@ -/Makefile.in +# .gitignore file for HDF5 + +# Makefile.in files +**/Makefile.in + +# Java .classes files +**/java/.classes + +# Backup files +# Editor-specific extensions should go in your ~/.gitconfig, but we +# include the standard Unix backup '~' extension since autoheader +# backs up H5config.h.in when it creates a new one and the +# extension is always '~'. +**/*~ + +# Other files, most of which are created by the Autotools though +# some are created by scripts in bin/ /aclocal.m4 /autom4te.cache -bin/Makefile.in bin/compile bin/config.guess bin/config.sub @@ -11,109 +26,17 @@ bin/ltmain.sh bin/missing bin/test-driver /build* -c++/Makefile.in -c++/examples/Makefile.in -c++/src/Makefile.in -c++/src/header_files/Makefile.in -c++/test/Makefile.in -config/Makefile.in -config/cmake/Makefile.in -config/cmake/UserMacros/Makefile.in -config/cmake/scripts/Makefile.in -config/cmake_ext_mod/Makefile.in -config/site-specific/Makefile.in /configure -examples/Makefile.in -fortran/Makefile.in -fortran/examples/Makefile.in -fortran/src/Makefile.in -fortran/test/Makefile.in -fortran/testpar/Makefile.in -hl/Makefile.in -hl/c++/Makefile.in -hl/c++/examples/Makefile.in -hl/c++/src/Makefile.in -hl/c++/test/Makefile.in -hl/examples/Makefile.in -hl/fortran/Makefile.in -hl/fortran/examples/Makefile.in -hl/fortran/src/Makefile.in -hl/fortran/test/Makefile.in -hl/src/Makefile.in -hl/test/Makefile.in -hl/tools/Makefile.in -hl/tools/gif2h5/Makefile.in -hl/tools/gif2h5/testfiles/Makefile.in -java/Makefile.in -java/examples/Makefile.in -java/examples/datasets/.classes -java/examples/datasets/Makefile.in -java/examples/datatypes/.classes -java/examples/datatypes/Makefile.in -java/examples/groups/.classes -java/examples/groups/Makefile.in -java/examples/intro/.classes -java/examples/intro/Makefile.in -java/src/.classes -java/src/Makefile.in -java/src/jni/Makefile.in -java/test/.classes -java/test/Makefile.in -m4/Makefile.in m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4 -release_docs/Makefile.in src/H5Edefin.h src/H5Einit.h src/H5Epubgen.h src/H5Eterm.h src/H5config.h.in -src/H5config.h.in~ src/H5overflow.h src/H5version.h -src/Makefile.in -test/Makefile.in -test/testfiles/Makefile.in -test/testfiles/plist_files/Makefile.in -testpar/Makefile.in -tools/Makefile.in -tools/lib/Makefile.in -tools/src/Makefile.in -tools/test/Makefile.in -tools/testfiles/Makefile.in -tools/testfiles/pbits/Makefile.in -tools/testfiles/vds/Makefile.in -tools/src/h5copy/Makefile.in -tools/src/h5diff/Makefile.in -tools/src/h5dump/Makefile.in -tools/src/h5format_convert/Makefile.in -tools/src/h5import/Makefile.in -tools/src/h5jam/Makefile.in -tools/src/h5ls/Makefile.in -tools/src/h5repack/Makefile.in -tools/src/h5stat/Makefile.in -tools/src/misc/Makefile.in -tools/src/misc/vds/Makefile.in -tools/test/h5copy/Makefile.in -tools/test/h5copy/testfiles/Makefile.in -tools/test/h5diff/Makefile.in -tools/test/h5diff/testfiles/Makefile.in -tools/test/h5dump/Makefile.in -tools/test/h5dump/errfiles/Makefile.in -tools/test/h5format_convert/Makefile.in -tools/test/h5import/Makefile.in -tools/test/h5import/testfiles/Makefile.in -tools/test/h5jam/Makefile.in -tools/test/h5jam/testfiles/Makefile.in -tools/test/h5ls/Makefile.in -tools/test/h5repack/Makefile.in -tools/test/h5repack/testfiles/Makefile.in -tools/test/h5stat/Makefile.in -tools/test/h5stat/testfiles/Makefile.in -tools/test/misc/Makefile.in -tools/test/misc/testfiles/Makefile.in -tools/test/misc/vds/Makefile.in -tools/test/perform/Makefile.in + -- cgit v0.12 From 460b573a73e1cfa73ad16dc7fff286fd561ff735 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 27 Nov 2016 19:00:12 -0600 Subject: Eliminate unnecessary data structure for parallel collective metadata cache I/O --- src/H5C.c | 17 +---------------- src/H5Cmpio.c | 55 ++++++++++--------------------------------------------- src/H5Cpkg.h | 9 --------- testpar/t_cache.c | 1 - 4 files changed, 11 insertions(+), 71 deletions(-) diff --git a/src/H5C.c b/src/H5C.c index 31f887d..af2440c 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -216,9 +216,6 @@ H5FL_DEFINE_STATIC(H5C_t); /* Declare a free list to manage flush dependency arrays */ H5FL_BLK_DEFINE_STATIC(parent); -/* Declare extern free list to manage the H5C_collective_write_t struct */ -H5FL_EXTERN(H5C_collective_write_t); - /*------------------------------------------------------------------------- @@ -5859,20 +5856,8 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ if(((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0) { #ifdef H5_HAVE_PARALLEL if(collective_write_list) { - H5C_collective_write_t *item; - - if(NULL == (item = (H5C_collective_write_t *)H5FL_MALLOC(H5C_collective_write_t))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "unable to allocate skip list item") - - item->length = entry_ptr->size; - item->free_buf = FALSE; - item->buf = entry_ptr->image_ptr; - item->offset = entry_ptr->addr; - - if(H5SL_insert(collective_write_list, item, &item->offset) < 0) { - H5MM_free(item); + if(H5SL_insert(collective_write_list, entry_ptr, &entry_ptr->addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "unable to insert skip list item") - } /* end if */ } /* end if */ else #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 72de4d0..0d666de 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -66,7 +66,6 @@ /********************/ static herr_t H5C__collective_write(H5F_t *f, hid_t dxpl_id, H5SL_t *collective_write_list); -static herr_t H5C__collective_write_free(void *_item, void *key, void *op_data); /*********************/ @@ -83,9 +82,6 @@ static herr_t H5C__collective_write_free(void *_item, void *key, void *op_data); /* Local Variables */ /*******************/ -/* Declare a free list to manage the H5C_collective_write_t struct */ -H5FL_DEFINE(H5C_collective_write_t); - /*------------------------------------------------------------------------- @@ -783,7 +779,7 @@ done: candidate_assignment_table = (int *)H5MM_xfree((void *)candidate_assignment_table); if(collective_write_list) - if(H5SL_destroy(collective_write_list, H5C__collective_write_free, NULL) < 0) + if(H5SL_close(collective_write_list) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "failed to destroy skip list") FUNC_LEAVE_NOAPI(ret_value) @@ -1382,7 +1378,7 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id, H5SL_t *collective_write_list) if(count > 0) { H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_COLLECTIVE; H5SL_node_t *node; - H5C_collective_write_t *item; + H5C_cache_entry_t *entry_ptr; void *base_buf; int i; @@ -1400,25 +1396,25 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id, H5SL_t *collective_write_list) /* Fill arrays */ node = H5SL_first(collective_write_list); HDassert(node); - if(NULL == (item = (H5C_collective_write_t *)H5SL_item(node))) + if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") /* Set up initial array position & buffer base address */ - length_array[0] = (int)item->length; - base_buf = item->buf; + length_array[0] = (int)entry_ptr->size; + base_buf = entry_ptr->image_ptr; buf_array[0] = (MPI_Aint)0; - offset_array[0] = (MPI_Aint)item->offset; + offset_array[0] = (MPI_Aint)entry_ptr->addr; node = H5SL_next(node); i = 1; while(node) { - if(NULL == (item = (H5C_collective_write_t *)H5SL_item(node))) + if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") /* Set up array position */ - length_array[i] = (int)item->length; - buf_array[i] = (MPI_Aint)item->buf - (MPI_Aint)base_buf; - offset_array[i] = (MPI_Aint)item->offset; + length_array[i] = (int)entry_ptr->size; + buf_array[i] = (MPI_Aint)entry_ptr->image_ptr - (MPI_Aint)base_buf; + offset_array[i] = (MPI_Aint)entry_ptr->addr; /* Advance to next node & array location */ node = H5SL_next(node); @@ -1491,36 +1487,5 @@ done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5C__collective_write() */ - - -/*------------------------------------------------------------------------- - * - * Function: H5C__collective_write_free - * - * Purpose: Release node on collective write skiplist - * - * Return: FAIL if error is detected, SUCCEED otherwise. - * - * Programmer: Mohamad Chaarawi - * February, 2016 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5C__collective_write_free(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED *op_data) -{ - H5C_collective_write_t *item = (H5C_collective_write_t *)_item; - - FUNC_ENTER_STATIC_NOERR - - /* Sanity check */ - HDassert(item); - - if(item->free_buf) - item->buf = H5MM_xfree(item->buf); - H5FL_FREE(H5C_collective_write_t, item); - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5C__collective_write_free() */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 78ae930..63c2c8b 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -4310,15 +4310,6 @@ struct H5C_t { char prefix[H5C__PREFIX_LEN]; }; -#ifdef H5_HAVE_PARALLEL -typedef struct H5C_collective_write_t { - size_t length; - hbool_t free_buf; - void *buf; - haddr_t offset; -} H5C_collective_write_t; -#endif /* H5_HAVE_PARALLEL */ - /* Define typedef for tagged cache entry iteration callbacks */ typedef int (*H5C_tag_iter_cb_t)(H5C_cache_entry_t *entry, void *ctx); diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 0fa0096..ef89c8d 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -2522,7 +2522,6 @@ datum_serialize(const H5F_t *f, HDassert( aux_ptr ); HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); -// HDassert( entry_ptr->aux_ptr == NULL ); entry_ptr->aux_ptr = aux_ptr; -- cgit v0.12 From 2cb2d5a533c2de7503014da3250c3088e1ba089d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 28 Nov 2016 01:26:33 -0600 Subject: Remove "collective write list" parameter from H5C__flush_single_entry() as it is only used in a couple of places. The collective write list has been moved to be internal to the cache data structure instead. --- src/H5C.c | 39 +++++++++++++++++---------------------- src/H5Cmpio.c | 53 ++++++++++++++++++++++++++++++++--------------------- src/H5Cpkg.h | 16 ++++++++++------ src/H5Ctag.c | 2 +- 4 files changed, 60 insertions(+), 50 deletions(-) diff --git a/src/H5C.c b/src/H5C.c index af2440c..e57dc81 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -366,6 +366,7 @@ H5C_create(size_t max_cache_size, cache_ptr->coll_list_size = (size_t)0; cache_ptr->coll_head_ptr = NULL; cache_ptr->coll_tail_ptr = NULL; + cache_ptr->coll_write_list = NULL; #endif /* H5_HAVE_PARALLEL */ cache_ptr->cLRU_list_len = 0; @@ -811,7 +812,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, /* Delete the entry from the skip list on destroy */ flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flush_flags, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flush_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "can't flush entry") done: @@ -3111,7 +3112,7 @@ H5C_unprotect(H5F_t * f, /* Delete the entry from the skip list on destroy */ flush_flags |= H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flush_flags, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, flush_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush entry") } @@ -3125,7 +3126,7 @@ H5C_unprotect(H5F_t * f, else if(test_entry_ptr != entry_ptr) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "hash table contains multiple entries for addr?!?.") - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't clear entry") } #endif /* H5_HAVE_PARALLEL */ @@ -4318,7 +4319,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, cache_ptr->entries_removed_counter = 0; cache_ptr->last_entry_removed_ptr = NULL; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__NO_FLAGS_SET, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") if(cache_ptr->entries_removed_counter > 1 || cache_ptr->last_entry_removed_ptr == prev_ptr) @@ -4329,7 +4330,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, bytes_evicted += entry_ptr->size; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0 ) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } @@ -4412,7 +4413,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, prev_ptr = entry_ptr->prev; if ( ! (entry_ptr->is_dirty) ) { - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush clean entry") } /* just skip the entry if it is dirty, as we can't do @@ -5209,7 +5210,7 @@ H5C_flush_invalidate_ring(const H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, */ protected_entries++; } else if(entry_ptr->is_pinned) { - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__DURING_FLUSH_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__DURING_FLUSH_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty pinned entry flush failed.") if(cache_ptr->slist_changed) { @@ -5226,8 +5227,7 @@ H5C_flush_invalidate_ring(const H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, } /* end if */ } /* end if */ else { - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, - (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG), NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry flush destroy failed.") if(cache_ptr->slist_changed) { @@ -5324,8 +5324,7 @@ H5C_flush_invalidate_ring(const H5F_t * f, hid_t dxpl_id, H5C_ring_t ring, * or three entries. */ cache_ptr->entry_watched_for_removal = next_entry_ptr; - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, - (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG), NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (cooked_flags | H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Entry flush destroy failed.") /* Check for the next entry getting removed */ @@ -5613,7 +5612,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags) protected_entries++; } /* end if */ else { - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG), NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG)) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry.") if(cache_ptr->slist_changed) { @@ -5721,11 +5720,7 @@ done: */ herr_t H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ptr, - unsigned flags, H5SL_t -#ifndef H5_HAVE_PARALLEL - H5_ATTR_UNUSED -#endif /* NDEBUG */ - *collective_write_list) + unsigned flags) { H5C_t * cache_ptr; /* Cache for file */ hbool_t destroy; /* external flag */ @@ -5855,8 +5850,8 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_ if(((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0) { #ifdef H5_HAVE_PARALLEL - if(collective_write_list) { - if(H5SL_insert(collective_write_list, entry_ptr, &entry_ptr->addr) < 0) + if(cache_ptr->coll_write_list) { + if(H5SL_insert(cache_ptr->coll_write_list, entry_ptr, &entry_ptr->addr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, "unable to insert skip list item") } /* end if */ else @@ -6679,7 +6674,7 @@ H5C_make_space_in_cache(H5F_t * f, } /* end if */ #endif - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__NO_FLAGS_SET, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") if ( ( cache_ptr->entries_removed_counter > 1 ) || @@ -6696,7 +6691,7 @@ H5C_make_space_in_cache(H5F_t * f, cache_ptr->entries_scanned_to_make_space++; #endif /* H5C_COLLECT_CACHE_STATS */ - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") } else { /* We have enough space so don't flush clean entry. */ @@ -6837,7 +6832,7 @@ H5C_make_space_in_cache(H5F_t * f, #ifdef H5_HAVE_PARALLEL if(!(entry_ptr->coll_access)) { #endif /* H5_HAVE_PARALLEL */ - if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") #ifdef H5_HAVE_PARALLEL } /* end if */ diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 0d666de..ab94879 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -64,8 +64,7 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5C__collective_write(H5F_t *f, hid_t dxpl_id, - H5SL_t *collective_write_list); +static herr_t H5C__collective_write(H5F_t *f, hid_t dxpl_id); /*********************/ @@ -226,7 +225,6 @@ H5C_apply_candidate_list(H5F_t * f, H5C_cache_entry_t * entry_ptr = NULL; H5C_cache_entry_t * flush_ptr = NULL; H5C_cache_entry_t * delayed_ptr = NULL; - H5SL_t * collective_write_list = NULL; #if H5C_DO_SANITY_CHECKS haddr_t last_addr; #endif /* H5C_DO_SANITY_CHECKS */ @@ -260,8 +258,11 @@ H5C_apply_candidate_list(H5F_t * f, #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ if(f->coll_md_write) { + /* Sanity check */ + HDassert(NULL == cache_ptr->coll_write_list); + /* Create skip list of entries for collective write */ - if(NULL == (collective_write_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) + if(NULL == (cache_ptr->coll_write_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create skip list for entries") } /* end if */ @@ -475,7 +476,7 @@ H5C_apply_candidate_list(H5F_t * f, cache_ptr->entries_removed_counter = 0; cache_ptr->last_entry_removed_ptr = NULL; - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") if((cache_ptr->entries_removed_counter > 1) || @@ -525,7 +526,7 @@ H5C_apply_candidate_list(H5F_t * f, cache_ptr->last_entry_removed_ptr = NULL; /* Add this entry to the list of entries to collectively write */ - if(H5C__flush_single_entry(f, dxpl_id, flush_ptr, H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, collective_write_list) < 0) + if(H5C__flush_single_entry(f, dxpl_id, flush_ptr, H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry.") if((cache_ptr->entries_removed_counter > 1) || @@ -681,7 +682,7 @@ H5C_apply_candidate_list(H5F_t * f, (long long)clear_ptr->addr); #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") } /* end else-if */ @@ -698,7 +699,7 @@ H5C_apply_candidate_list(H5F_t * f, #endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */ /* Add this entry to the list of entries to collectively write */ - if(H5C__flush_single_entry(f, dxpl_id, flush_ptr, H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, collective_write_list) < 0) + if(H5C__flush_single_entry(f, dxpl_id, flush_ptr, H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") } /* end else-if */ } /* end if */ @@ -732,14 +733,14 @@ H5C_apply_candidate_list(H5F_t * f, if (delayed_ptr) { if (delayed_ptr->clear_on_unprotect) { - if(H5C__flush_single_entry(f, dxpl_id, delayed_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, delayed_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__GENERATE_IMAGE_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry.") entry_ptr->clear_on_unprotect = FALSE; entries_cleared++; } else if (delayed_ptr->flush_immediately) { /* Add this entry to the list of entries to collectively write */ - if(H5C__flush_single_entry(f, dxpl_id, delayed_ptr, H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, collective_write_list) < 0) + if(H5C__flush_single_entry(f, dxpl_id, delayed_ptr, H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush entry collectively.") entry_ptr->flush_immediately = FALSE; @@ -752,10 +753,11 @@ H5C_apply_candidate_list(H5F_t * f, /* If we've deferred writing to do it collectively, take care of that now */ if(f->coll_md_write) { - HDassert(collective_write_list); + /* Sanity check */ + HDassert(cache_ptr->coll_write_list); /* Write collective list */ - if(H5C__collective_write(f, dxpl_id, collective_write_list) < 0) + if(H5C__collective_write(f, dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "Can't write metadata collectively") } /* end if */ @@ -778,9 +780,11 @@ done: if(candidate_assignment_table != NULL) candidate_assignment_table = (int *)H5MM_xfree((void *)candidate_assignment_table); - if(collective_write_list) - if(H5SL_close(collective_write_list) < 0) + if(cache_ptr->coll_write_list) { + if(H5SL_close(cache_ptr->coll_write_list) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "failed to destroy skip list") + cache_ptr->coll_write_list = NULL; + } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* H5C_apply_candidate_list() */ @@ -1019,7 +1023,7 @@ done: * * Note that unlike H5C_apply_candidate_list(), * H5C_mark_entries_as_clean() makes all its calls to - * H6C_flush_single_entry() with the + * H5C__flush_single_entry() with the * H5C__FLUSH_CLEAR_ONLY_FLAG set. As a result, * the pre_serialize() and serialize calls are not made. * @@ -1178,7 +1182,7 @@ H5C_mark_entries_as_clean(H5F_t * f, * * Note that unlike H5C_apply_candidate_list(), * H5C_mark_entries_as_clean() makes all its calls to - * H6C_flush_single_entry() with the H5C__FLUSH_CLEAR_ONLY_FLAG + * H5C__flush_single_entry() with the H5C__FLUSH_CLEAR_ONLY_FLAG * set. As a result, the pre_serialize() and serialize calls are * not made. * @@ -1213,7 +1217,7 @@ H5C_mark_entries_as_clean(H5F_t * f, entry_ptr = entry_ptr->prev; entries_cleared++; - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") } else { @@ -1241,7 +1245,7 @@ H5C_mark_entries_as_clean(H5F_t * f, entry_ptr = entry_ptr->next; entries_cleared++; - if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0 ) + if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.") } else { @@ -1349,8 +1353,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__collective_write(H5F_t *f, hid_t dxpl_id, H5SL_t *collective_write_list) +H5C__collective_write(H5F_t *f, hid_t dxpl_id) { + H5AC_t *cache_ptr; H5P_genplist_t *plist = NULL; H5FD_mpio_xfer_t orig_xfer_mode = H5FD_MPIO_COLLECTIVE; int count; @@ -1366,6 +1371,12 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id, H5SL_t *collective_write_list) FUNC_ENTER_STATIC + /* Sanity checks */ + HDassert(f != NULL); + cache_ptr = f->shared->cache; + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->coll_write_list != NULL); + /* Get original transfer mode */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") @@ -1373,7 +1384,7 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id, H5SL_t *collective_write_list) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") /* Get number of entries in collective write list */ - count = (int)H5SL_count(collective_write_list); + count = (int)H5SL_count(cache_ptr->coll_write_list); if(count > 0) { H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_COLLECTIVE; @@ -1394,7 +1405,7 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id, H5SL_t *collective_write_list) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective offset table length array") /* Fill arrays */ - node = H5SL_first(collective_write_list); + node = H5SL_first(cache_ptr->coll_write_list); HDassert(node); if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 63c2c8b..16efb5c 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -3430,7 +3430,7 @@ typedef struct H5C_tag_info_t { * entry is removed from the cache by any means (eviction, * expungement, or take ownership at this point in time). * Functions that perform scans on lists may set this field - * to zero prior to calling H5C_flush_single_entry(). + * to zero prior to calling H5C__flush_single_entry(). * Unexpected changes to the counter indicate that an entry * was removed from the cache as a side effect of the flush. * @@ -3438,7 +3438,7 @@ typedef struct H5C_tag_info_t { * which contained the last entry to be removed from the cache, * or NULL if there either is no such entry, or if a function * performing a scan of a list has set this field to NULL prior - * to calling H5C_flush_single_entry(). + * to calling H5C__flush_single_entry(). * * WARNING!!! This field must NEVER be dereferenced. It is * maintained to allow functions that perform scans of lists @@ -4069,17 +4069,17 @@ typedef struct H5C_tag_info_t { * obtain estimates of how frequently these restarts occur. * * slist_scan_restarts: Number of times a scan of the slist (that contains - * calls to H5C_flush_single_entry()) has been restarted to + * calls to H5C__flush_single_entry()) has been restarted to * avoid potential issues with change of status of the next * entry in the scan. * * LRU_scan_restarts: Number of times a scan of the LRU list (that contains - * calls to H5C_flush_single_entry()) has been restarted to + * calls to H5C__flush_single_entry()) has been restarted to * avoid potential issues with change of status of the next * entry in the scan. * * hash_bucket_scan_restarts: Number of times a scan of a hash bucket list - * (that contains calls to H5C_flush_single_entry()) has been + * (that contains calls to H5C__flush_single_entry()) has been * restarted to avoid potential issues with change of status * of the next entry in the scan. * @@ -4205,10 +4205,14 @@ struct H5C_t { H5C_cache_entry_t * dLRU_tail_ptr; #ifdef H5_HAVE_PARALLEL + /* Fields for collective metadata reads */ int32_t coll_list_len; size_t coll_list_size; H5C_cache_entry_t * coll_head_ptr; H5C_cache_entry_t * coll_tail_ptr; + + /* Fields for collective metadata writes */ + H5SL_t * coll_write_list; #endif /* H5_HAVE_PARALLEL */ /* Fields for automatic cache size adjustment */ @@ -4328,7 +4332,7 @@ H5_DLLVAR const H5C_class_t H5C__epoch_marker_class; /* General routines */ H5_DLL herr_t H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, - H5C_cache_entry_t *entry_ptr, unsigned flags, H5SL_t *collective_write_list); + H5C_cache_entry_t *entry_ptr, unsigned flags); H5_DLL herr_t H5C__flush_marked_entries(H5F_t * f, hid_t dxpl_id); H5_DLL herr_t H5C__iter_tagged_entries(H5C_t *cache, haddr_t tag, hbool_t match_global, H5C_tag_iter_cb_t cb, void *cb_ctx); diff --git a/src/H5Ctag.c b/src/H5Ctag.c index 33f7c22..6d5b454 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -467,7 +467,7 @@ H5C__evict_tagged_entries_cb(H5C_cache_entry_t *entry, void *_ctx) ctx->pinned_entries_need_evicted = TRUE; else { /* Evict the Entry */ - if(H5C__flush_single_entry(ctx->f, ctx->dxpl_id, entry, H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG, NULL) < 0) + if(H5C__flush_single_entry(ctx->f, ctx->dxpl_id, entry, H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, H5_ITER_ERROR, "Entry eviction failed.") ctx->evicted_entries_last_pass = TRUE; } /* end else */ -- cgit v0.12