diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2024-03-05 14:52:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-05 14:52:09 (GMT) |
commit | 7741170bdd225da130f3ab98c454c118b5511b14 (patch) | |
tree | 35e631c884f16cf1251523c703b25df5cb178541 /src/H5C.c | |
parent | c44e0e35ed584d4efe67bdf1dafe25a793085e0f (diff) | |
download | hdf5-7741170bdd225da130f3ab98c454c118b5511b14.zip hdf5-7741170bdd225da130f3ab98c454c118b5511b14.tar.gz hdf5-7741170bdd225da130f3ab98c454c118b5511b14.tar.bz2 |
Sync develop branch changes since 2/16 to hdf5_1_14 branch (#4058)
* Remove oneapi return value warning. (#4028)
* Replaced last sprintf with snprintf (#4007)
* Replaced last sprintf with snprintf
To have the size of the buffer, it was required to change a function signature, and change all users of it.
In most cases, determining the buffer size wasn't trivial and so SIZE_MAX is passed. But at least this improves the infrastructure. Someone can later figure out the correct sizes.
* Test vlen sequence IO in API tests (#4027)
* Check argument for CMake REGEX FCMangle.h. (#4029)
* Replace deprecated Fortran 'include mpif.h' with 'USE mpi' (#4031)
With MPI 4.1 the use of the mpif.h include file has been deprecated. Codes
should transition to USE mpi or USE mpi_f08.
Signed-off-by: Christoph Niethammer <niethammer@hlrs.de>
* Fix H5F_get_access_plist to copy file locking settings (#4030)
H5F_get_access_plist previously did not copy over the file locking settings
from a file into the new File Access Property List that it creates. This would
make it difficult to match the file locking settings between an external file
and its parent file.
* Fix missing NOT from if check in HL folder (#4036)
* Fix the datatype passed to H5*exists_async APIs in tests. (#4033)
Add a new testing function to verify C_BOOL values.
* Add deb and rpm binaries to snapshots (#4035)
* Update and Add general INSTALL (#4016)
* Improve performance of flushing single objects (#4017)
Improve performance of flushing a single object, and remove metadata
cache flush markers
* Fix memory leak in H5LTopen_file_image when H5LT_FILE_IMAGE_DONT_COPY flag is used (#4021)
When the H5LT_FILE_IMAGE_DONT_COPY flag is passed to H5LTopen_file_image, the internally-allocated
udata structure gets leaked as the core file driver doesn't have a way to determine when or if it
needs to call the 'udata_free' callback. This has been fixed by freeing the udata structure when
the 'image_free' callback gets made during file close, where the file is holding the last reference
to the udata structure.
* Fix allocating too much memory in dset API test (#4041)
* Don't try to load general-19 warnings file for icc (#4042)
The Autools Classic Intel compiler configuration attempts to load a file
named `general-19` from the intel-warnings/classic directory, which does
not exist.
This removes the attempted load of the file.
* Remove unused AIX cross-compile cache overrides (#4043)
The ibm-aix Autotools config file had some unmaintained and unnecessary
Autoconf cache overrides. These have been removed.
* Consolidate Autotools linux files (#4044)
There are many architecture-specific linux files in the config
directory, all of which simply redirect to linux-gnulibc1.
This change renames linux-gnulibc1 to linux-gnu and deletes the more
specific files.
* Remove check for gettimeofday + tz in CMake (#4045)
This is not used in the library
* Remove limitations on preset generators (#4051)
* Fix issue with FAPL file locking setting inheriting test (#4053)
Fixes an issue where the HDF5_USE_FILE_LOCKING environment variable being
set can interfere with the file locking setting that the test expects to
be returned.
* Bump the github-actions group with 2 updates (#4054)
Bumps the github-actions group with 2 updates: [actions/download-artifact](https://github.com/actions/download-artifact) and [github/codeql-action](https://github.com/github/codeql-action).
* Fix VOL-compatibility issues in External Link API test (#4039)
Fix link API tests with incorrect filename
* Add upddated cmake tools from source location (#4040)
* Add options to allow tools type selection and naming (#4046)
* Improve error messages when tools attempt to use non-enabled S3 and HDFS VFDs. (#4047)
* Correct several 1.15/1.15.0 references to 1.14/1.14.4.
* Ignore HDF5Examples/CMakeUserPresets.json
Diffstat (limited to 'src/H5C.c')
-rw-r--r-- | src/H5C.c | 79 |
1 files changed, 30 insertions, 49 deletions
@@ -493,7 +493,7 @@ H5C_dest(H5F_t *f) #endif /* H5AC_DUMP_IMAGE_STATS_ON_CLOSE */ /* Enable the slist, as it is needed in the flush */ - if (H5C_set_slist_enabled(f->shared->cache, true, false) < 0) + if (H5C_set_slist_enabled(f->shared->cache, true, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed"); /* Flush and invalidate all cache entries */ @@ -567,7 +567,7 @@ H5C_evict(H5F_t *f) assert(f); /* Enable the slist, as it is needed in the flush */ - if (H5C_set_slist_enabled(f->shared->cache, true, false) < 0) + if (H5C_set_slist_enabled(f->shared->cache, true, true) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed"); /* Flush and invalidate all cache entries except the pinned entries */ @@ -575,7 +575,7 @@ H5C_evict(H5F_t *f) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict entries in the cache"); /* Disable the slist */ - if (H5C_set_slist_enabled(f->shared->cache, false, true) < 0) + if (H5C_set_slist_enabled(f->shared->cache, false, false) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist disabled failed"); done: @@ -1042,41 +1042,32 @@ done: * * 1) Verifies that the slist is empty. * - * 2) Scans the index list, and inserts all dirty entries - * into the slist. + * 2) If the populate_slist parameter is true, scans the + * index list, and inserts all dirty entries into the + * slist. * * 3) Sets cache_ptr->slist_enabled = true. * - * Note that the clear_slist parameter is ignored if - * the slist_enabed parameter is true. - * * * If the slist_enabled_parameter is false, the function - * shuts down the slist. - * - * Normally the slist will be empty at this point, however - * that need not be the case if H5C_flush_cache() has been - * called with the H5C__FLUSH_MARKED_ENTRIES_FLAG. - * - * Thus shutdown proceeds as follows: + * shuts down the slist: * * 1) Test to see if the slist is empty. If it is, proceed * to step 3. * - * 2) Test to see if the clear_slist parameter is true. - * - * If it is, remove all entries from the slist. - * - * If it isn't, throw an error. + * 2) Remove all entries from the slist. * * 3) set cache_ptr->slist_enabled = false. * + * Note that the populate_slist parameter is ignored if + * the slist_enabed parameter is false. + * * Return: SUCCEED on success, and FAIL on failure. * *------------------------------------------------------------------------- */ herr_t -H5C_set_slist_enabled(H5C_t *cache_ptr, bool slist_enabled, bool clear_slist) +H5C_set_slist_enabled(H5C_t *cache_ptr, bool slist_enabled, bool populate_slist) { H5C_cache_entry_t *entry_ptr; herr_t ret_value = SUCCEED; /* Return value */ @@ -1097,40 +1088,30 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, bool slist_enabled, bool clear_slist) */ cache_ptr->slist_enabled = true; - /* scan the index list and insert all dirty entries in the slist */ - entry_ptr = cache_ptr->il_head; - while (entry_ptr != NULL) { - if (entry_ptr->is_dirty) - H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL); - entry_ptr = entry_ptr->il_next; - } + if (populate_slist) { + /* scan the index list and insert all dirty entries in the slist */ + entry_ptr = cache_ptr->il_head; + while (entry_ptr != NULL) { + if (entry_ptr->is_dirty) + H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL); + entry_ptr = entry_ptr->il_next; + } - /* we don't maintain a dirty index len, so we can't do a cross - * check against it. Note that there is no point in cross checking - * against the dirty LRU size, as the dirty LRU may not be maintained, - * and in any case, there is no requirement that all dirty entries - * will reside on the dirty LRU. - */ - assert(cache_ptr->dirty_index_size == cache_ptr->slist_size); + /* we don't maintain a dirty index len, so we can't do a cross + * check against it. Note that there is no point in cross checking + * against the dirty LRU size, as the dirty LRU may not be maintained, + * and in any case, there is no requirement that all dirty entries + * will reside on the dirty LRU. + */ + assert(cache_ptr->dirty_index_size == cache_ptr->slist_size); + } } else { /* take down the skip list */ if (!cache_ptr->slist_enabled) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist already disabled?"); - if ((cache_ptr->slist_len != 0) || (cache_ptr->slist_size != 0)) { - if (clear_slist) { - H5SL_node_t *node_ptr; - - node_ptr = H5SL_first(cache_ptr->slist_ptr); - while (node_ptr != NULL) { - entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, false, FAIL); - node_ptr = H5SL_first(cache_ptr->slist_ptr); - } - } - else - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty?"); - } + if ((cache_ptr->slist_len != 0) || (cache_ptr->slist_size != 0)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty?"); cache_ptr->slist_enabled = false; |