diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-04-22 06:25:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-22 06:25:12 (GMT) |
commit | 7707859279a60b32d2b6c915442a7c04d44445b4 (patch) | |
tree | 890d16aa2408b270368b36ea4f05ca20fe2f16f6 /src/H5AC.c | |
parent | a4371b6fce577852691dfdeac642dec1dd4b9453 (diff) | |
download | hdf5-7707859279a60b32d2b6c915442a7c04d44445b4.zip hdf5-7707859279a60b32d2b6c915442a7c04d44445b4.tar.gz hdf5-7707859279a60b32d2b6c915442a7c04d44445b4.tar.bz2 |
Merge with develop (#2790)
Diffstat (limited to 'src/H5AC.c')
-rw-r--r-- | src/H5AC.c | 107 |
1 files changed, 22 insertions, 85 deletions
@@ -312,7 +312,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list") } /* end if */ - /* construct the candidate slist for all processes. + /* construct the candidate skip list for all processes. * when the distributed strategy is selected as all processes * will use it in the case of a flush. */ @@ -413,14 +413,6 @@ done: * Programmer: Robb Matzke * Jul 9 1997 * - * Changes: - * - * In the parallel case, added code to setup the MDC slist - * before the call to H5AC__flush_entries() and take it down - * afterwards. - * - * JRM -- 7/29/20 - * *------------------------------------------------------------------------- */ herr_t @@ -447,34 +439,25 @@ H5AC_dest(H5F_t *f) /* Check if log messages are being emitted */ if (H5C_get_logging_status(f->shared->cache, &log_enabled, &curr_logging) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to get logging status") - if (log_enabled && curr_logging) { - - if (H5C_log_write_destroy_cache_msg(f->shared->cache) < 0) - - HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") - } /* Tear down logging */ if (log_enabled) { + if (curr_logging) + if (H5C_log_write_destroy_cache_msg(f->shared->cache) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") if (H5C_log_tear_down(f->shared->cache) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "mdc logging tear-down failed") - } + HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "metadata cache logging tear-down failed") + } /* end if */ #ifdef H5_HAVE_PARALLEL - /* destroying the cache, so clear all collective entries */ if (H5C_clear_coll_entries(f->shared->cache, FALSE) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "can't clear collective entries") aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache); - if (aux_ptr) { - /* Sanity check */ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); @@ -488,7 +471,7 @@ H5AC_dest(H5F_t *f) * H5AC__flush_entries() and disable it afterwards, as the * skip list will be disabled after the previous flush. * - * Note that H5C_dest() does slist setup and take down as well. + * Note that H5C_dest() does skip list setup and take down as well. * Unfortunately, we can't do the setup and take down just once, * as H5C_dest() is called directly in the test code. * @@ -496,59 +479,45 @@ H5AC_dest(H5F_t *f) * point, so the overhead should be minimal. */ if (H5F_ACC_RDWR & H5F_INTENT(f)) { - - /* enable and load the slist */ + /* enable and load the skip list */ if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "set slist enabled failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't enable skip list") if (H5AC__flush_entries(f) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush") - /* disable the slist -- should be empty */ + /* disable the skip list -- should be empty */ if (H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "disable slist failed") - } - } -#endif /* H5_HAVE_PARALLEL */ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't disable skip list") + } /* end if */ + } /* end if */ +#endif /* H5_HAVE_PARALLEL */ /* Destroy the cache */ if (H5C_dest(f) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache") f->shared->cache = NULL; #ifdef H5_HAVE_PARALLEL - if (aux_ptr != NULL) { - if (aux_ptr->d_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->d_slist_ptr) == 0); H5SL_close(aux_ptr->d_slist_ptr); - } /* end if */ if (aux_ptr->c_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0); H5SL_close(aux_ptr->c_slist_ptr); - } /* end if */ if (aux_ptr->candidate_slist_ptr != NULL) { - HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0); H5SL_close(aux_ptr->candidate_slist_ptr); - } /* end if */ aux_ptr->magic = 0; aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr); - } /* end if */ #endif /* H5_HAVE_PARALLEL */ @@ -1191,13 +1160,12 @@ done: * * Function: H5AC_prep_for_file_flush * - * Purpose: This function should be called just prior to the first - * call to H5AC_flush() during a file flush. + * Purpose: Handle any setup required prior to metadata cache flush. * - * Its purpose is to handly any setup required prior to - * metadata cache flush. + * This function should be called just prior to the first + * call to H5AC_flush() during a file flush. * - * Initially, this means setting up the slist prior to the + * Initially, this means setting up the skip list prior to the * flush. We do this in a separate call because * H5F__flush_phase2() make repeated calls to H5AC_flush(). * Handling this detail in separate calls allows us to avoid @@ -1209,8 +1177,6 @@ done: * Programmer: John Mainzer * 5/5/20 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t @@ -1226,13 +1192,10 @@ H5AC_prep_for_file_flush(H5F_t *f) HDassert(f->shared->cache); if (H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist enabled failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't enable skip list") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_prep_for_file_flush() */ /*------------------------------------------------------------------------- @@ -1242,14 +1205,11 @@ done: * Purpose: This function should be called just after the last * call to H5AC_flush() during a file flush. * - * Its purpose is to perform any necessary cleanup after the - * metadata cache flush. - * * The objective of the call is to allow the metadata cache * to do any necessary necessary cleanup work after a cache * flush. * - * Initially, this means taking down the slist after the + * Initially, this means taking down the skip list after the * flush. We do this in a separate call because * H5F__flush_phase2() make repeated calls to H5AC_flush(). * Handling this detail in separate calls allows us to avoid @@ -1261,8 +1221,6 @@ done: * Programmer: John Mainzer * 5/5/20 * - * Changes: None. - * *------------------------------------------------------------------------- */ herr_t @@ -1278,13 +1236,10 @@ H5AC_secure_from_file_flush(H5F_t *f) HDassert(f->shared->cache); if (H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0) - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist enabled failed") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't disable skip list") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_secure_from_file_flush() */ /*------------------------------------------------------------------------- @@ -1474,24 +1429,6 @@ H5AC_resize_entry(void *thing, size_t new_size) * amounts of dirty metadata creation in other areas -- which will * cause aux_ptr->dirty_bytes to be incremented. * - * The bottom line is that this code is probably OK, but the above - * points should be kept in mind. - * - * One final observation: This comment is occasioned by a bug caused - * by moving the call to H5AC__log_dirtied_entry() after the call to - * H5C_resize_entry(), and then only calling H5AC__log_dirtied_entry() - * if entry_ptr->is_dirty was false. - * - * Since H5C_resize_entry() marks the target entry dirty unless there - * is not change in size, this had the effect of not calling - * H5AC__log_dirtied_entry() when it should be, and corrupting - * the cleaned and dirtied lists used by rank 0 in the parallel - * version of the metadata cache. - * - * The point here is that you should be very careful when working with - * this code, and not modify it unless you fully understand it. - * - * JRM -- 2/28/22 */ if ((!entry_ptr->is_dirty) && (entry_ptr->size != new_size)) { |