From 855dd92b0e72771df86ec81f5334ffd2add1bfb7 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 26 Jan 2010 10:12:08 -0500 Subject: [svn-r18168] Description: Code cleanups for better alignment with trunk, along with style issues, etc. Also, get journal test files to work correctly when using a srcdir build. Tested on: Mac OS X/32 10.6.2 (amazon) w/debug, production & parallel (h5committest not required on this branch) --- configure | 26 ++-- configure.in | 20 ++- src/H5AC2.c | 375 +++++++++++++-------------------------------------- src/H5AC2private.h | 4 +- src/H5C2.c | 359 ++++++++++++------------------------------------ src/H5C2private.h | 16 +-- src/H5F.c | 2 +- test/cache2.c | 228 ++++++++++++++++--------------- test/cache2_api.c | 16 +-- test/cache2_common.c | 70 ++++------ 10 files changed, 365 insertions(+), 751 deletions(-) diff --git a/configure b/configure index 8fc02f4..186dc23 100755 --- a/configure +++ b/configure @@ -51557,15 +51557,16 @@ echo "$as_me: error: Removing old public API symbols not allowed when using them { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking for and unzipping large test files" >&5 -echo $ECHO_N "checking for and unzipping large test files... $ECHO_C" >&6; } -for f in $srcdir/test/testfiles/*.gz; do - if test -f $f; then - gunzip -f $f - fi -done -{ echo "$as_me:$LINENO: result: done" >&5 -echo "${ECHO_T}done" >&6; } +#{ echo "$as_me:$LINENO: checking for and unzipping large test files" >&5 +#echo $ECHO_N "checking for and unzipping large test files... $ECHO_C" >&6; } +#test -d ./test/testfiles || mkdir ./test/testfiles +#for f in $srcdir/test/testfiles/*.gz; do +# if test -f $f; then +# gunzip -c $f > ./test/testfiles/`basename -s .gz $f` +# fi +#done +#{ echo "$as_me:$LINENO: result: done" >&5 +#echo "${ECHO_T}done" >&6; } { echo "$as_me:$LINENO: checking Whether to perform strict file format checks" >&5 @@ -53631,6 +53632,13 @@ echo "$as_me: executing $ac_file commands" >&6;} sed '/^#/d' < src/libhdf5.settings > libhdf5.settings.TMP cp libhdf5.settings.TMP src/libhdf5.settings rm -f libhdf5.settings.TMP + echo "Unzip large test files" + test -d ./test/testfiles || mkdir ./test/testfiles + for f in $srcdir/test/testfiles/*.gz; do + if test -f $f; then + gunzip -c $f > ./test/testfiles/`basename -s .gz $f` + fi + done ;; "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. diff --git a/configure.in b/configure.in index 1843240..2388348 100644 --- a/configure.in +++ b/configure.in @@ -68,10 +68,19 @@ AC_OUTPUT_COMMANDS([ else /bin/mv -f pubconf src/H5pubconf.h fi + echo "Post process src/libhdf5.settings" sed '/^#/d' < src/libhdf5.settings > libhdf5.settings.TMP cp libhdf5.settings.TMP src/libhdf5.settings rm -f libhdf5.settings.TMP + + echo "Unzip large test files" + test -d ./test/testfiles || mkdir ./test/testfiles + for f in $srcdir/test/testfiles/*.gz; do + if test -f $f; then + gunzip -c $f > ./test/testfiles/`basename -s .gz $f` + fi + done ]) dnl It's possible to configure for a host other than the one on which @@ -3742,17 +3751,6 @@ if test "X${DEFAULT_API_VERSION}" != "Xv18" -a "X${DEPRECATED_SYMBOLS}" = "Xno" fi dnl ---------------------------------------------------------------------- -dnl Unzip large test files -dnl -AC_MSG_CHECKING([for and unzipping large test files]) -for f in $srcdir/test/testfiles/*.gz; do - if test -f $f; then - gunzip -f $f - fi -done -AC_MSG_RESULT([done]) - -dnl ---------------------------------------------------------------------- dnl Enable strict file format checks dnl AC_SUBST([STRICT_FORMAT_CHECKS]) diff --git a/src/H5AC2.c b/src/H5AC2.c index 5a12dea..25a3109 100644 --- a/src/H5AC2.c +++ b/src/H5AC2.c @@ -200,7 +200,7 @@ static herr_t H5AC2_log_renamed_entry(H5F_t * f, haddr_t new_addr); #endif /* H5_HAVE_PARALLEL */ -static herr_t H5AC2_set_cache_config(H5F_t * f, +static herr_t H5AC2_set_cache_config(H5AC2_t * cache_ptr, H5AC2_cache_config_t *config_ptr); @@ -702,7 +702,7 @@ H5AC2_create(H5F_t * f, } #endif /* H5_HAVE_PARALLEL */ - result = H5AC2_set_cache_config(f, config_ptr); + result = H5AC2_set_cache_config(f->shared->cache2, config_ptr); if ( result != SUCCEED ) { @@ -1838,15 +1838,6 @@ done: * Programmer: John Mainzer * 4/11/06 * - * Modifications: - * - * Added trace file support. JRM -- 6/6/06 - * - * Modified code in support of revised cache API needed - * to permit journaling. JRM -- 10/18/07 - * - * Removed file pointer parameter. QAK - 7/13/08 - * *------------------------------------------------------------------------- */ herr_t @@ -1858,10 +1849,6 @@ H5AC2_mark_pinned_entry_dirty(void * thing, char trace[128] = ""; FILE * trace_file_ptr = NULL; #endif /* H5AC2__TRACE_FILE_ENABLED */ -#ifdef H5_HAVE_PARALLEL - H5C2_t *cache_ptr; -#endif /* H5_HAVE_PARALLEL */ - herr_t result; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC2_mark_pinned_entry_dirty, FAIL) @@ -1874,78 +1861,45 @@ H5AC2_mark_pinned_entry_dirty(void * thing, * and new_size are really necessary in the trace file. Write the result * to catch occult errors. */ - if ( ( H5C2_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC2_mark_pinned_entry_dirty 0x%lx %d %d", + if((H5C2_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) + sprintf(trace, "%s 0x%lx %d %d", FUNC, (unsigned long)(((H5C2_cache_entry_t *)thing)->addr), (int)size_changed, (int)new_size); - } #endif /* H5AC2__TRACE_FILE_ENABLED */ #ifdef H5_HAVE_PARALLEL +{ + H5AC2_info_t *entry_ptr = (H5AC2_info_t *)thing; + H5C2_t *cache_ptr = entry_ptr->cache_ptr; - cache_ptr = ((H5AC2_info_t *)thing)->cache_ptr; - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - - if ( ( ((H5AC2_info_t *)thing)->is_dirty == FALSE ) && - ( NULL != cache_ptr->aux_ptr) ) { - - H5AC2_info_t * entry_ptr; - - HDassert( ( size_changed == TRUE ) || ( size_changed == FALSE ) ); - - entry_ptr = (H5AC2_info_t *)thing; - - if ( ! ( entry_ptr->is_pinned ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "Entry isn't pinned??") - } - - if ( entry_ptr->is_protected ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "Entry is protected??") - } - - result = H5AC2_log_dirtied_entry(entry_ptr, - entry_ptr->addr, - size_changed, - new_size); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C2__H5C2_T_MAGIC); - if ( result < 0 ) { + if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr)) { + /* Check for usage errors */ + if(!entry_ptr->is_pinned) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry isn't pinned??") + if(entry_ptr->is_protected) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry is protected??") - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "H5AC2_log_dirtied_entry() failed.") - } - } + if(H5AC2_log_dirtied_entry(entry_ptr, entry_ptr->addr, size_changed, new_size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") + } /* end if */ +} #endif /* H5_HAVE_PARALLEL */ - result = H5C2_mark_pinned_entry_dirty(thing, - size_changed, - new_size); - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "H5C2_mark_pinned_entry_dirty() failed.") - - } + if(H5C2_mark_pinned_entry_dirty(thing, size_changed, new_size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't mark pinned entry dirty") done: - #if H5AC2__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + if(trace_file_ptr) HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); - } #endif /* H5AC2__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC2_mark_pinned_entry_dirty() */ @@ -1963,30 +1917,16 @@ done: * Programmer: John Mainzer * 5/16/06 * - * Modifications: - * - * Added trace file support. JRM -- 6/6/06 - * - * Modified code in support of revised cache API needed - * to permit journaling. JRM -- 10/18/07 - * - * Removed file pointer parameter. QAK - 7/13/08 - * *------------------------------------------------------------------------- */ herr_t -H5AC2_mark_pinned_or_protected_entry_dirty(void * thing) +H5AC2_mark_pinned_or_protected_entry_dirty(void *thing) { -#ifdef H5_HAVE_PARALLEL - H5C2_t * cache_ptr; - H5AC2_info_t * info_ptr; -#endif /* H5_HAVE_PARALLEL */ - herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ #if H5AC2__TRACE_FILE_ENABLED char trace[128] = ""; FILE * trace_file_ptr = NULL; #endif /* H5AC2__TRACE_FILE_ENABLED */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC2_mark_pinned_or_protected_entry_dirty, FAIL) @@ -1998,61 +1938,38 @@ H5AC2_mark_pinned_or_protected_entry_dirty(void * thing) * is really necessary in the trace file. Write the result to catch * occult errors. */ - if ( ( H5C2_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC2_mark_pinned_or_protected_entry_dirty 0x%lx", + if((H5C2_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) + sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C2_cache_entry_t *)thing)->addr)); - } #endif /* H5AC2__TRACE_FILE_ENABLED */ #ifdef H5_HAVE_PARALLEL +{ + H5AC2_info_t *entry_ptr = (H5AC2_info_t *)thing; + H5C2_t *cache_ptr = entry_ptr->cache_ptr; - cache_ptr = ((H5AC2_info_t *)thing)->cache_ptr; - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( thing ); - - info_ptr = (H5AC2_info_t *)thing; - - if ( ( info_ptr->is_dirty == FALSE ) && ( ! ( info_ptr->is_protected ) ) && - ( info_ptr->is_pinned ) && - ( NULL != cache_ptr->aux_ptr) ) { - - result = H5AC2_log_dirtied_entry(info_ptr, - info_ptr->addr, - FALSE, - 0); - - if ( result < 0 ) { + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C2__H5C2_T_MAGIC); - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "H5AC2_log_dirtied_entry() failed.") - } - } + if((!entry_ptr->is_dirty) && (!entry_ptr->is_protected) && + (entry_ptr->is_pinned) && (NULL != cache_ptr->aux_ptr)) { + if(H5AC2_log_dirtied_entry(entry_ptr, entry_ptr->addr, FALSE, 0) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") + } /* end if */ +} #endif /* H5_HAVE_PARALLEL */ - result = H5C2_mark_pinned_or_protected_entry_dirty(thing); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "H5C2_mark_pinned_or_protected_entry_dirty() failed.") - - } + if(H5C2_mark_pinned_or_protected_entry_dirty(thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't mark pinned or protected entry dirty") done: - #if H5AC2__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + if(trace_file_ptr) HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); - } #endif /* H5AC2__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC2_mark_pinned_entry_dirty() */ @@ -2212,25 +2129,15 @@ done: * Programmer: John Mainzer * 4/27/06 * - * Modifications: - * - * Added trace file support. 6/6/06 - * - * Modified code in support of revised cache API needed - * to permit journaling. JRM - 10/18/07 - * - * Removed file pointer parameter. QAK - 7/13/08 - * *------------------------------------------------------------------------- */ herr_t -H5AC2_pin_protected_entry(void * thing) +H5AC2_pin_protected_entry(void *thing) { #if H5AC2__TRACE_FILE_ENABLED char trace[128] = ""; FILE * trace_file_ptr = NULL; #endif /* H5AC2__TRACE_FILE_ENABLED */ - herr_t result; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC2_pin_protected_entry, FAIL) @@ -2239,33 +2146,22 @@ H5AC2_pin_protected_entry(void * thing) /* For the pin protected entry call, only the addr is really necessary * in the trace file. Also write the result to catch occult errors. */ - if ( ( H5C2_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC2_pin_protected_entry 0x%lx", + if((H5C2_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) + sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C2_cache_entry_t *)thing)->addr)); - } #endif /* H5AC2__TRACE_FILE_ENABLED */ - result = H5C2_pin_protected_entry(thing); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, \ - "H5C2_pin_protected_entry() failed.") - } + if(H5C2_pin_protected_entry(thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "can't unpin entry") done: - #if H5AC2__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + if(trace_file_ptr) HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); - } #endif /* H5AC2__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC2_pin_protected_entry() */ @@ -2565,29 +2461,15 @@ done: * Programmer: John Mainzer * 7/5/06 * - * Modifications: - * - * JRM - 10/18/07 - * Modified code in support of revised cache API needed - * to permit journaling. - * - * Removed file pointer parameter. QAK - 7/13/08 - * *------------------------------------------------------------------------- */ - herr_t -H5AC2_resize_pinned_entry(void * thing, - size_t new_size) +H5AC2_resize_pinned_entry(void *thing, size_t new_size) { #if H5AC2__TRACE_FILE_ENABLED char trace[128] = ""; FILE * trace_file_ptr = NULL; #endif /* H5AC2__TRACE_FILE_ENABLED */ -#ifdef H5_HAVE_PARALLEL - H5C2_t *cache_ptr; -#endif /* H5_HAVE_PARALLEL */ - herr_t result; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC2_resize_pinned_entry, FAIL) @@ -2600,75 +2482,44 @@ H5AC2_resize_pinned_entry(void * thing, * really necessary in the trace file. Write the result to catch * occult errors. */ - if ( ( H5C2_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC2_resize_pinned_entry 0x%lx %d", + if((H5C2_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) + sprintf(trace, "%s 0x%lx %d", FUNC, (unsigned long)(((H5C2_cache_entry_t *)thing)->addr), (int)new_size); - } #endif /* H5AC2__TRACE_FILE_ENABLED */ #ifdef H5_HAVE_PARALLEL +{ + H5AC2_info_t * entry_ptr = (H5AC2_info_t *)thing; + H5C2_t *cache_ptr = entry_ptr->cache_ptr; - cache_ptr = ((H5AC2_info_t *)thing)->cache_ptr; - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( thing ); - - if ( ( ((H5AC2_info_t *)thing)->is_dirty == FALSE ) && - ( NULL != cache_ptr->aux_ptr) ) { - - H5AC2_info_t * entry_ptr; - - entry_ptr = (H5AC2_info_t *)thing; - - if ( ! ( entry_ptr->is_pinned ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "Entry isn't pinned??") - } - - if ( entry_ptr->is_protected ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "Entry is protected??") - } - - result = H5AC2_log_dirtied_entry(entry_ptr, - entry_ptr->addr, - TRUE, - new_size); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C2__H5C2_T_MAGIC); - if ( result < 0 ) { + if((!entry_ptr->is_dirty) && (NULL != cache_ptr->aux_ptr)) { + /* Check for usage errors */ + if(!entry_ptr->is_pinned) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry isn't pinned??") + if(entry_ptr->is_protected) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry is protected??") - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "H5AC2_log_dirtied_entry() failed.") - } - } + if(H5AC2_log_dirtied_entry(entry_ptr, entry_ptr->addr, TRUE, new_size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log entry") + } /* end if */ +} #endif /* H5_HAVE_PARALLEL */ - result = H5C2_resize_pinned_entry(thing, - new_size); - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "H5C2_resize_pinned_entry() failed.") - - } + if(H5C2_resize_pinned_entry(thing, new_size) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "can't resize entry") done: - #if H5AC2__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + if(trace_file_ptr) HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); - } #endif /* H5AC2__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC2_resize_pinned_entry() */ @@ -2683,19 +2534,10 @@ done: * Programmer: John Mainzer * 4/11/06 * - * Modifications: - * - * Added code supporting the trace file. JRM -- 6/7/06 - * - * Modified code in support of revised cache API needed - * to permit journaling. JRM - 10/18/07 - * - * Removed file pointer parameter. QAK - 6/9/08 - * *------------------------------------------------------------------------- */ herr_t -H5AC2_unpin_entry(void * thing) +H5AC2_unpin_entry(void *thing) { #if H5AC2__TRACE_FILE_ENABLED char trace[128] = ""; @@ -2712,30 +2554,22 @@ H5AC2_unpin_entry(void * thing) /* For the unpin entry call, only the addr is really necessary * in the trace file. Also write the result to catch occult errors. */ - if ( ( H5C2_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && - ( trace_file_ptr != NULL ) ) { - - sprintf(trace, "H5AC2_unpin_entry 0x%lx", + if((H5C2_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && + (NULL != trace_file_ptr)) + sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C2_cache_entry_t *)thing)->addr)); - } #endif /* H5AC2__TRACE_FILE_ENABLED */ - if ( H5C2_unpin_entry(thing) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "H5C2_unpin_entry() failed.") - } + if(H5C2_unpin_entry(thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "can't unpin entry") done: - #if H5AC2__TRACE_FILE_ENABLED - if ( trace_file_ptr != NULL ) { - + if(trace_file_ptr) HDfprintf(trace_file_ptr, "%s %d\n", trace, (int)ret_value); - } #endif /* H5AC2__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC2_unpin_entry() */ @@ -2898,16 +2732,8 @@ H5AC2_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC2_class_t *type, if ( ( dirtied ) && ( ((H5AC2_info_t *)thing)->is_dirty == FALSE ) && ( NULL != (aux_ptr = f->shared->cache2->aux_ptr) ) ) { - result = H5AC2_log_dirtied_entry(thing, - addr, - size_changed, - new_size); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ - "H5AC2_log_dirtied_entry() failed.") - } + if(H5AC2_log_dirtied_entry(thing, addr, size_changed, new_size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "can't log entry") } if ( ( (flags & H5C2__DELETED_FLAG) != 0 ) && @@ -3125,7 +2951,7 @@ done: */ herr_t -H5AC2_get_cache_auto_resize_config(H5AC2_t * cache_ptr, +H5AC2_get_cache_auto_resize_config(const H5AC2_t * cache_ptr, H5AC2_cache_config_t *config_ptr) { herr_t result; @@ -3157,7 +2983,7 @@ H5AC2_get_cache_auto_resize_config(H5AC2_t * cache_ptr, } - result = H5C2_get_cache_auto_resize_config((H5C2_t *)cache_ptr, + result = H5C2_get_cache_auto_resize_config((const H5C2_t *)cache_ptr, &internal_config); if ( result < 0 ) { @@ -3166,7 +2992,7 @@ H5AC2_get_cache_auto_resize_config(H5AC2_t * cache_ptr, "H5C2_get_cache_auto_resize_config() failed.") } - result = H5C2_get_evictions_enabled((H5C2_t *)cache_ptr, + result = H5C2_get_evictions_enabled((const H5C2_t *)cache_ptr, &evictions_enabled); if ( result < 0 ) { @@ -3517,11 +3343,9 @@ done: */ herr_t -H5AC2_set_cache_auto_resize_config(H5F_t * f, +H5AC2_set_cache_auto_resize_config(H5AC2_t * cache_ptr, H5AC2_cache_config_t *config_ptr) { - /* const char * fcn_name = "H5AC2_set_cache_auto_resize_config"; */ - H5AC2_t * cache_ptr; herr_t result; herr_t ret_value = SUCCEED; /* Return value */ #if H5AC2__TRACE_FILE_ENABLED @@ -3531,11 +3355,7 @@ H5AC2_set_cache_auto_resize_config(H5F_t * f, FUNC_ENTER_NOAPI(H5AC2_set_cache_auto_resize_config, FAIL) - HDassert( f ); - HDassert( f->shared ); - HDassert( f->shared->cache2 ); - - cache_ptr = (H5AC2_t *)f->shared->cache2; + HDassert( cache_ptr ); #if H5AC2__TRACE_FILE_ENABLED /* Make note of the new configuration. Don't look up the trace file @@ -3573,7 +3393,7 @@ H5AC2_set_cache_auto_resize_config(H5F_t * f, } - result = H5AC2_set_cache_config(f, config_ptr); + result = H5AC2_set_cache_config(cache_ptr, config_ptr); if ( result < 0 ) { @@ -3832,23 +3652,16 @@ done: */ herr_t -H5AC2_set_cache_config(H5F_t * f, +H5AC2_set_cache_config(H5AC2_t * cache_ptr, H5AC2_cache_config_t *config_ptr) { /* const char * fcn_name = "H5AC2_set_cache_config"; */ - H5AC2_t * cache_ptr; herr_t result; herr_t ret_value = SUCCEED; /* Return value */ H5C2_auto_size_ctl_t internal_config; FUNC_ENTER_NOAPI(H5AC2_set_cache_config, FAIL) - HDassert( f ); - HDassert( f->shared ); - HDassert( f->shared->cache2 ); - - cache_ptr = (H5AC2_t *)f->shared->cache2; - if ( ( cache_ptr == NULL ) #ifdef H5_HAVE_PARALLEL || @@ -3935,7 +3748,7 @@ H5AC2_set_cache_config(H5F_t * f, "H5AC2_ext_config_2_int_config() failed.") } - result = H5C2_set_cache_auto_resize_config(f, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &internal_config); if ( result < 0 ) { @@ -3944,7 +3757,7 @@ H5AC2_set_cache_config(H5F_t * f, } - result = H5C2_set_evictions_enabled(f, + result = H5C2_set_evictions_enabled(cache_ptr, config_ptr->evictions_enabled); if ( result < 0 ) { @@ -4955,8 +4768,6 @@ done: * * Programmer: John Mainzer, 6/29/05 * - * Modifications: - * *------------------------------------------------------------------------- */ @@ -4970,12 +4781,13 @@ H5AC2_log_dirtied_entry(const H5AC2_info_t * entry_ptr, size_t entry_size; H5AC2_t * cache_ptr; H5AC2_aux_t * aux_ptr; - H5AC2_slist_entry_t * slist_entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC2_log_dirtied_entry, FAIL) HDassert( entry_ptr ); + HDassert( entry_ptr->addr == addr ); + HDassert( entry_ptr->is_dirty == FALSE ); cache_ptr = entry_ptr->cache_ptr; @@ -4987,10 +4799,6 @@ H5AC2_log_dirtied_entry(const H5AC2_info_t * entry_ptr, HDassert( aux_ptr != NULL ); HDassert( aux_ptr->magic == H5AC2__H5AC2_AUX_T_MAGIC ); - HDassert( entry_ptr != NULL ); - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->is_dirty == FALSE ); - if ( size_changed ) { entry_size = new_size; @@ -5001,6 +4809,7 @@ H5AC2_log_dirtied_entry(const H5AC2_info_t * entry_ptr, } if ( aux_ptr->mpi_rank == 0 ) { + H5AC2_slist_entry_t * slist_entry_ptr; HDassert( aux_ptr->d_slist_ptr != NULL ); HDassert( aux_ptr->c_slist_ptr != NULL ); diff --git a/src/H5AC2private.h b/src/H5AC2private.h index 97283ab..1708295 100644 --- a/src/H5AC2private.h +++ b/src/H5AC2private.h @@ -345,7 +345,7 @@ H5_DLL herr_t H5AC2_set_write_done_callback(H5C2_t * cache_ptr, void (* write_done)(void)); H5_DLL herr_t H5AC2_stats(const H5F_t *f); -H5_DLL herr_t H5AC2_get_cache_auto_resize_config(H5AC2_t * cache_ptr, +H5_DLL herr_t H5AC2_get_cache_auto_resize_config(const H5AC2_t * cache_ptr, H5AC2_cache_config_t *config_ptr); H5_DLL herr_t H5AC2_get_cache_size(H5AC2_t * cache_ptr, @@ -368,7 +368,7 @@ H5_DLL herr_t H5AC2_register_mdjsc_callback(const H5F_t * file_ptr, H5_DLL herr_t H5AC2_reset_cache_hit_rate_stats(H5AC2_t * cache_ptr); -H5_DLL herr_t H5AC2_set_cache_auto_resize_config(H5F_t * f, +H5_DLL herr_t H5AC2_set_cache_auto_resize_config(H5C2_t * cache_ptr, H5AC2_cache_config_t *config_ptr); H5_DLL herr_t H5AC2_set_jnl_config(H5F_t * f, diff --git a/src/H5C2.c b/src/H5C2.c index 1e60a12..60447b2 100644 --- a/src/H5C2.c +++ b/src/H5C2.c @@ -1021,7 +1021,7 @@ H5C2_dest(H5F_t * f, cache_ptr->magic = 0; - H5FL_FREE(H5C2_t, cache_ptr); + cache_ptr = H5FL_FREE(H5C2_t, cache_ptr); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1987,7 +1987,7 @@ done: */ herr_t -H5C2_get_cache_auto_resize_config(H5C2_t * cache_ptr, +H5C2_get_cache_auto_resize_config(const H5C2_t * cache_ptr, H5C2_auto_size_ctl_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2169,7 +2169,7 @@ done: */ herr_t -H5C2_get_entry_status(H5F_t * f, +H5C2_get_entry_status(const H5F_t * f, haddr_t addr, size_t * size_ptr, hbool_t * in_cache_ptr, @@ -2262,7 +2262,7 @@ done: */ herr_t -H5C2_get_evictions_enabled(H5C2_t * cache_ptr, +H5C2_get_evictions_enabled(const H5C2_t * cache_ptr, hbool_t * evictions_enabled_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2304,25 +2304,20 @@ done: * Programmer: John Mainzer * 1/20/06 * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t -H5C2_get_trace_file_ptr(const H5C2_t * cache_ptr, - FILE ** trace_file_ptr_ptr) +H5C2_get_trace_file_ptr(const H5C2_t *cache_ptr, FILE **trace_file_ptr_ptr) { FUNC_ENTER_NOAPI_NOFUNC(H5C2_get_trace_file_ptr) - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( trace_file_ptr_ptr ); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C2__H5C2_T_MAGIC); + HDassert(trace_file_ptr_ptr); *trace_file_ptr_ptr = cache_ptr->trace_file_ptr; FUNC_LEAVE_NOAPI(SUCCEED) - } /* H5C2_get_trace_file_ptr() */ @@ -2340,29 +2335,21 @@ H5C2_get_trace_file_ptr(const H5C2_t * cache_ptr, * Programmer: Quincey Koziol * 6/9/08 * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5C2_get_trace_file_ptr_from_entry(const H5C2_cache_entry_t *entry_ptr, - FILE ** trace_file_ptr_ptr) + FILE ** trace_file_ptr_ptr) { - const H5C2_t *cache_ptr; /* Cache pointer, from entry */ - FUNC_ENTER_NOAPI_NOFUNC(H5C2_get_trace_file_ptr_from_entry) /* Sanity checks */ - HDassert( entry_ptr ); - HDassert( entry_ptr->cache_ptr ); + HDassert(entry_ptr); + HDassert(entry_ptr->cache_ptr); - cache_ptr = entry_ptr->cache_ptr; - - H5C2_get_trace_file_ptr(cache_ptr, trace_file_ptr_ptr); + H5C2_get_trace_file_ptr(entry_ptr->cache_ptr, trace_file_ptr_ptr); FUNC_LEAVE_NOAPI(SUCCEED) - } /* H5C2_get_trace_file_ptr_from_entry() */ @@ -3083,28 +3070,10 @@ done: * Programmer: John Mainzer * 3/22/06 * - * Modifications: - * - * Added code to do a flash cache size increase if - * appropriate. - * JRM -- 1/11/08 - * - * Added code to either insert the entry at the head of - * the transaction list (if it isn't in the list already), or - * move it to the head of the transaction list (if it is - * on the transaction list) if journaling is enabled. In this - * case, set the entry's last_trans field to the current - * transaction number if it isn't set to this value already. - * - * JRM -- 3/31/08 - * *------------------------------------------------------------------------- */ - herr_t -H5C2_mark_pinned_entry_dirty(void * thing, - hbool_t size_changed, - size_t new_size) +H5C2_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, size_t new_size) { H5C2_t * cache_ptr; H5C2_cache_entry_t * entry_ptr = (H5C2_cache_entry_t *)thing; @@ -3114,42 +3083,27 @@ H5C2_mark_pinned_entry_dirty(void * thing, FUNC_ENTER_NOAPI(H5C2_mark_pinned_entry_dirty, FAIL) - HDassert( entry_ptr ); - HDassert( H5F_addr_defined(entry_ptr->addr) ); - + /* Sanity checks */ + HDassert(entry_ptr); + HDassert(H5F_addr_defined(entry_ptr->addr)); cache_ptr = entry_ptr->cache_ptr; - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( ( ! ( cache_ptr->mdj_enabled ) ) || - ( cache_ptr->trans_in_progress ) ); - HDassert( thing ); - HDassert( ( size_changed == TRUE ) || ( size_changed == FALSE ) ); - - entry_ptr = (H5C2_cache_entry_t *)thing; - + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C2__H5C2_T_MAGIC); + HDassert((!cache_ptr->mdj_enabled) || cache_ptr->trans_in_progress); #if H5C2_PRINT_ENTRY_POINTS - if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) - { + if(H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id)) HDfprintf(stdout, "%s: addr = 0x%lX, size_changed = %d, new_size = %d.\n", FUNC, (unsigned long)(entry_ptr->addr), (int)size_changed, (int)new_size); - } #endif /* JRM */ - if ( ! ( entry_ptr->is_pinned ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "Entry isn't pinned??") - } - - if ( entry_ptr->is_protected ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "Entry is protected??") - } + /* Check for usage errors */ + if(!entry_ptr->is_pinned) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry isn't pinned??") + if(entry_ptr->is_protected) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "Entry is protected??") /* mark the entry as dirty if it isn't already */ entry_ptr->is_dirty = TRUE; @@ -3170,17 +3124,9 @@ H5C2_mark_pinned_entry_dirty(void * thing, size_increase = new_size - entry_ptr->size; if ( size_increase >= - cache_ptr->flash_size_increase_threshold ) { - - result = H5C2__flash_increase_cache_size(cache_ptr, - entry_ptr->size, - new_size); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ - "H5C2__flash_increase_cache_size failed.") - } + cache_ptr->flash_size_increase_threshold ) { + if(H5C2__flash_increase_cache_size(cache_ptr, entry_ptr->size, new_size) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "flash cache increase failed") } } } @@ -3229,16 +3175,12 @@ H5C2_mark_pinned_entry_dirty(void * thing, H5C2__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) done: - #if H5C2_PRINT_EXIT_POINTS - if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) { - HDfprintf(stdout, "%s: Exiting with result = %d.\n", - FUNC, (int)ret_value); - } + if(H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id)) + HDfprintf(stdout, "%s: Exiting with result = %d.\n", FUNC, (int)ret_value); #endif /* H5C2_PRINT_EXIT_POINTS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C2_mark_pinned_entry_dirty() */ @@ -3263,28 +3205,10 @@ done: * Programmer: John Mainzer * 5/15/06 * - * Modifications: - * - * JRM -- 3/29/07 - * Added sanity check to verify that the pinned entry - * is not protected read only. - * - * This sanity check is commented out for now -- uncomment - * it once we deal with the problem of entries being protected - * read only, and then dirtied. - * - * JRM -- 3/31/08 - * Updated function to maintain the transaction list when - * journaling is enabled. - * - * QAK -- 7/13/08 - * Dropped file pointer parameter and retrieve cache pointer from - * entry. - * *------------------------------------------------------------------------- */ herr_t -H5C2_mark_pinned_or_protected_entry_dirty(void * thing) +H5C2_mark_pinned_or_protected_entry_dirty(void *thing) { H5C2_t * cache_ptr; H5C2_cache_entry_t * entry_ptr = (H5C2_cache_entry_t *)thing; @@ -3292,23 +3216,17 @@ H5C2_mark_pinned_or_protected_entry_dirty(void * thing) FUNC_ENTER_NOAPI(H5C2_mark_pinned_or_protected_entry_dirty, FAIL) - HDassert( entry_ptr ); - HDassert( H5F_addr_defined(entry_ptr->addr) ); - + /* Sanity checks */ + HDassert(entry_ptr); + HDassert(H5F_addr_defined(entry_ptr->addr)); cache_ptr = entry_ptr->cache_ptr; - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( thing ); - - entry_ptr = (H5C2_cache_entry_t *)thing; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C2__H5C2_T_MAGIC); #if H5C2_PRINT_ENTRY_POINTS - if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) - { + if(H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id)) HDfprintf(stdout, "%s: addr = 0x%lX, type = %s.\n", FUNC, (unsigned long)(entry_ptr->addr), entry_ptr->type->name); - } #endif /* JRM */ if ( entry_ptr->is_protected ) { @@ -3348,16 +3266,12 @@ H5C2_mark_pinned_or_protected_entry_dirty(void * thing) } done: - #if H5C2_PRINT_EXIT_POINTS - if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) { - HDfprintf(stdout, "%s: Exiting with result = %d.\n", - FUNC, (int)ret_value); - } + if(H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id)) + HDfprintf(stdout, "%s: Exiting with result = %d.\n", FUNC, (int)ret_value); #endif /* H5C2_PRINT_EXIT_POINTS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C2_mark_pinned_or_protected_entry_dirty() */ @@ -3633,21 +3547,10 @@ done: * Programmer: John Mainzer * 7/5/06 * - * Modifications: - * - * Added code to apply a flash cache size increment if - * appropriate. - * JRM -- 1/11/08 - * - * QAK -- 7/13/08 - * Dropped file pointer parameter and retrieve cache pointer from - * entry. - * *------------------------------------------------------------------------- */ herr_t -H5C2_resize_pinned_entry(void * thing, - size_t new_size) +H5C2_resize_pinned_entry(void *thing, size_t new_size) { H5C2_t * cache_ptr; H5C2_cache_entry_t * entry_ptr = (H5C2_cache_entry_t *)thing; @@ -3657,43 +3560,27 @@ H5C2_resize_pinned_entry(void * thing, FUNC_ENTER_NOAPI(H5C2_resize_pinned_entry, FAIL) - HDassert( entry_ptr ); - HDassert( H5F_addr_defined(entry_ptr->addr) ); + /* Sanity checks */ + HDassert(entry_ptr); + HDassert(H5F_addr_defined(entry_ptr->addr)); + cache_ptr = entry_ptr->cache_ptr; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C2__H5C2_T_MAGIC); #if H5C2_PRINT_ENTRY_POINTS - if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) - { + if(H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id)) HDfprintf(stdout, "%s: type = %s, addr = 0x%lX, new_size = %d.\n", FUNC, entry_ptr->type->name, (unsigned long)(entry_ptr->addr), (int)new_size); - } #endif /* JRM */ - cache_ptr = entry_ptr->cache_ptr; - - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - HDassert( thing ); - - entry_ptr = (H5C2_cache_entry_t *)thing; - - if ( new_size <= 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "New size is non-positive.") - } - - if ( ! ( entry_ptr->is_pinned ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "Entry isn't pinned??") - } - - if ( entry_ptr->is_protected ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, \ - "Entry is protected??") - } + /* Check for usage errors */ + if(new_size <= 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "New size is non-positive.") + if(!entry_ptr->is_pinned) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry isn't pinned??") + if(entry_ptr->is_protected) + HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry is protected??") /* resizing dirties entries -- mark the entry as dirty if it * isn't already @@ -3776,16 +3663,12 @@ H5C2_resize_pinned_entry(void * thing, H5C2__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) done: - #if H5C2_PRINT_EXIT_POINTS - if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) { - HDfprintf(stdout, "%s: Exiting with result = %d.\n", - FUNC, (int)ret_value); - } + if(H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id)) + HDfprintf(stdout, "%s: Exiting with result = %d.\n", FUNC, (int)ret_value); #endif /* H5C2_PRINT_EXIT_POINTS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C2_resize_pinned_entry() */ @@ -3800,34 +3683,10 @@ done: * Programmer: John Mainzer * 4/26/06 * - * Modifications: - * - * JRM -- 4/26/06 - * Modified routine to allow it to operate on protected - * entries. - * - * JRM -- 2/16/07 - * Added conditional compile to avoid unused parameter - * warning in production compile. - * - * JRM -- 4/4/07 - * Fixed typo -- canged macro call to - * H5C2__UPDATE_STATS_FOR_UNPIN to call to - * H5C2__UPDATE_STATS_FOR_PIN. - * - * JRM -- 5/16/08 - * Undid change of 2/16/08, as we can use the f parameter - * in production mode. - * - * QAK -- 7/13/08 - * Dropped file pointer parameter and retrieve cache pointer from - * entry. - * *------------------------------------------------------------------------- */ - herr_t -H5C2_pin_protected_entry(void * thing) +H5C2_pin_protected_entry(void *thing) { H5C2_t * cache_ptr; H5C2_cache_entry_t * entry_ptr = (H5C2_cache_entry_t *)thing; @@ -3836,46 +3695,37 @@ H5C2_pin_protected_entry(void * thing) FUNC_ENTER_NOAPI(H5C2_pin_protected_entry, FAIL) #if H5C2_PRINT_ENTRY_POINTS - if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) - { + if(H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id)) HDfprintf(stdout, "%s: addr = 0x%lX, type = %s.\n", FUNC, (unsigned long)(entry_ptr->addr), entry_ptr->type->name); - } #endif /* JRM */ - HDassert( entry_ptr ); - HDassert( H5F_addr_defined(entry_ptr->addr) ); - + /* Sanity checks */ + HDassert(entry_ptr); + HDassert(H5F_addr_defined(entry_ptr->addr)); cache_ptr = entry_ptr->cache_ptr; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C2__H5C2_T_MAGIC); - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - - if ( ! ( entry_ptr->is_protected ) ) { - + /* Check for usage errors */ + if(!entry_ptr->is_protected) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Entry isn't protected") - } - - if ( entry_ptr->is_pinned ) { - + if(entry_ptr->is_pinned) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "Entry is already pinned") - } + /* Pin entry */ entry_ptr->is_pinned = TRUE; + /* Update statistics for entry */ H5C2__UPDATE_STATS_FOR_PIN(cache_ptr, entry_ptr) done: - #if H5C2_PRINT_EXIT_POINTS - if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) { - HDfprintf(stdout, "%s: Exiting with result = %d.\n", - FUNC, (int)ret_value); - } + if(H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id)) + HDfprintf(stdout, "%s: Exiting with result = %d.\n", FUNC, (int)ret_value); #endif /* H5C2_PRINT_EXIT_POINTS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C2_pin_protected_entry() */ @@ -4409,23 +4259,16 @@ done: */ herr_t -H5C2_set_cache_auto_resize_config(const H5F_t * f, +H5C2_set_cache_auto_resize_config(H5C2_t * cache_ptr, H5C2_auto_size_ctl_t *config_ptr) { - /* const char *fcn_name = "H5C2_set_cache_auto_resize_config()"; */ - H5C2_t * cache_ptr; - herr_t ret_value = SUCCEED; /* Return value */ herr_t result; size_t new_max_cache_size; size_t new_min_clean_size; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C2_set_cache_auto_resize_config, FAIL) - HDassert( f ); - HDassert( f->shared ); - - cache_ptr = f->shared->cache2; - if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C2__H5C2_T_MAGIC ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.") @@ -4699,19 +4542,13 @@ done: */ herr_t -H5C2_set_evictions_enabled(const H5F_t * f, +H5C2_set_evictions_enabled(H5C2_t * cache_ptr, hbool_t evictions_enabled) { - H5C2_t * cache_ptr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C2_set_evictions_enabled, FAIL) - HDassert( f ); - HDassert( f->shared ); - - cache_ptr = f->shared->cache2; - if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C2__H5C2_T_MAGIC ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.") @@ -5443,16 +5280,6 @@ H5C2_stats__reset(H5C2_t UNUSED * cache_ptr) * Programmer: John Mainzer * 3/22/06 * - * Modifications: - * - * JRM -- 4/26/06 - * Modified routine to allow it to operate on protected - * entries. - * - * QAK -- 6/9/08 - * Dropped file pointer parameter and retrieve cache pointer from - * entry. - * *------------------------------------------------------------------------- */ herr_t @@ -5464,46 +5291,38 @@ H5C2_unpin_entry(void *_entry_ptr) FUNC_ENTER_NOAPI(H5C2_unpin_entry, FAIL) -#if H5C2_PRINT_ENTRY_POINTS - if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) - { - HDfprintf(stdout, "%s: addr = 0x%lX, type = %s.\n", FUNC, - (unsigned long)(entry_ptr->addr), entry_ptr->type->name); - } -#endif /* JRM */ - - HDassert( entry_ptr ); - + /* Sanity check */ + HDassert(entry_ptr); cache_ptr = entry_ptr->cache_ptr; + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C2__H5C2_T_MAGIC); - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC ); - - if ( ! ( entry_ptr->is_pinned ) ) { +#if H5C2_PRINT_ENTRY_POINTS + if(H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id)) + HDfprintf(stdout, "%s: addr = 0x%lX, type = %s.\n", FUNC, (unsigned long)(entry_ptr->addr), entry_ptr->type->name); +#endif /* H5C2_PRINT_ENTRY_POINTS */ + /* Error checking */ + if(!entry_ptr->is_pinned) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Entry isn't pinned") - } - - if ( ! ( entry_ptr->is_protected ) ) { + /* Update unprotected entry */ + if(!entry_ptr->is_protected) H5C2__UPDATE_RP_FOR_UNPIN(cache_ptr, entry_ptr, FAIL) - } + /* Mark entry unpinned */ entry_ptr->is_pinned = FALSE; + /* Update statistics for unpin operation */ H5C2__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) done: - #if H5C2_PRINT_EXIT_POINTS - if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) { - HDfprintf(stdout, "%s: Exiting with result = %d.\n", - FUNC, (int)ret_value); - } + if(H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id)) + HDfprintf(stdout, "%s: Exiting with result = %d.\n", FUNC, (int)ret_value); #endif /* H5C2_PRINT_EXIT_POINTS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C2_unpin_entry() */ diff --git a/src/H5C2private.h b/src/H5C2private.h index 8c9075c..f7aec7e 100644 --- a/src/H5C2private.h +++ b/src/H5C2private.h @@ -1440,7 +1440,7 @@ H5_DLL herr_t H5C2_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags); H5_DLL herr_t H5C2_flush_to_min_clean(H5F_t * f, hid_t dxpl_id); -H5_DLL herr_t H5C2_get_cache_auto_resize_config(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_get_cache_auto_resize_config(const H5C2_t * cache_ptr, H5C2_auto_size_ctl_t *config_ptr); H5_DLL herr_t H5C2_get_cache_size(H5C2_t * cache_ptr, @@ -1452,7 +1452,7 @@ H5_DLL herr_t H5C2_get_cache_size(H5C2_t * cache_ptr, H5_DLL herr_t H5C2_get_cache_hit_rate(H5C2_t * cache_ptr, double * hit_rate_ptr); -H5_DLL herr_t H5C2_get_entry_status(H5F_t * f, +H5_DLL herr_t H5C2_get_entry_status(const H5F_t * f, haddr_t addr, size_t * size_ptr, hbool_t * in_cache_ptr, @@ -1460,13 +1460,13 @@ H5_DLL herr_t H5C2_get_entry_status(H5F_t * f, hbool_t * is_protected_ptr, hbool_t * is_pinned_ptr); -H5_DLL herr_t H5C2_get_evictions_enabled(H5C2_t * cache_ptr, +H5_DLL herr_t H5C2_get_evictions_enabled(const H5C2_t * cache_ptr, hbool_t * evictions_enabled_ptr); -H5_DLL herr_t H5C2_get_trace_file_ptr(const H5C2_t * cache_ptr, - FILE ** trace_file_ptr_ptr); +H5_DLL herr_t H5C2_get_trace_file_ptr(const H5C2_t *cache_ptr, + FILE **trace_file_ptr_ptr); H5_DLL herr_t H5C2_get_trace_file_ptr_from_entry(const H5C2_cache_entry_t *entry_ptr, - FILE ** trace_file_ptr_ptr); + FILE ** trace_file_ptr_ptr); H5_DLL herr_t H5C2_insert_entry(H5F_t * f, hid_t dxpl_id, @@ -1507,10 +1507,10 @@ H5_DLL herr_t H5C2_reset_cache_hit_rate_stats(H5C2_t * cache_ptr); H5_DLL herr_t H5C2_resize_pinned_entry(void * thing, size_t new_size); -H5_DLL herr_t H5C2_set_cache_auto_resize_config(const H5F_t * f, +H5_DLL herr_t H5C2_set_cache_auto_resize_config(H5C2_t * cache_ptr, H5C2_auto_size_ctl_t *config_ptr); -H5_DLL herr_t H5C2_set_evictions_enabled(const H5F_t * f, +H5_DLL herr_t H5C2_set_evictions_enabled(H5C2_t * cache_ptr, hbool_t evictions_enabled); H5_DLL herr_t H5C2_set_prefix(H5C2_t * cache_ptr, char * prefix); diff --git a/src/H5F.c b/src/H5F.c index 48eff8f..d728fca 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -3565,7 +3565,7 @@ H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "H5AC_set_cache_auto_resize_config() failed.") /* pass the resize configuration to the modified cache as well. */ - if(H5AC2_set_cache_auto_resize_config(file, (H5AC2_cache_config_t *)config_ptr) < 0) + if(H5AC2_set_cache_auto_resize_config(file->shared->cache2, (H5AC2_cache_config_t *)config_ptr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "H5AC2_set_cache_auto_resize_config() failed.") done: diff --git a/test/cache2.c b/test/cache2.c index 840865e..b3dd0b5 100644 --- a/test/cache2.c +++ b/test/cache2.c @@ -1045,6 +1045,7 @@ smoke_check_5(void) int32_t max_index = 1024; int mile_stone = 1; H5F_t * file_ptr = NULL; + H5C2_t * cache_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C2__CURR_AUTO_SIZE_CTL_VER, @@ -1133,10 +1134,11 @@ smoke_check_5(void) file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -1301,6 +1303,7 @@ smoke_check_6(void) int mile_stone = 1; int32_t max_index = 1024; H5F_t * file_ptr = NULL; + H5C2_t * cache_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C2__CURR_AUTO_SIZE_CTL_VER, @@ -1389,10 +1392,11 @@ smoke_check_6(void) file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -1557,6 +1561,7 @@ smoke_check_7(void) int mile_stone = 1; int32_t max_index = 1024; H5F_t * file_ptr = NULL; + H5C2_t * cache_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C2__CURR_AUTO_SIZE_CTL_VER, @@ -1646,10 +1651,11 @@ smoke_check_7(void) file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -1814,6 +1820,7 @@ smoke_check_8(void) int mile_stone = 1; int32_t max_index = 1024; H5F_t * file_ptr = NULL; + H5C2_t * cache_ptr = NULL; H5C2_auto_size_ctl_t auto_size_ctl = { /* int32_t version = */ H5C2__CURR_AUTO_SIZE_CTL_VER, @@ -1903,10 +1910,11 @@ smoke_check_8(void) file_ptr = setup_cache2((size_t)(2 * 1024), (size_t)(1 * 1024)); + cache_ptr = file_ptr->shared->cache2; if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -2075,6 +2083,7 @@ smoke_check_9(void) int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; + H5C2_t * cache_ptr = NULL; TESTING("smoke check #9 -- all clean, ins, dest, ren, 4/2 MB, corked"); @@ -2115,6 +2124,7 @@ smoke_check_9(void) file_ptr = setup_cache2((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); + cache_ptr = file_ptr->shared->cache2; /* disable evictions */ @@ -2124,7 +2134,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result < 0 ) { @@ -2161,7 +2171,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, TRUE); + result = H5C2_set_evictions_enabled(cache_ptr, TRUE); if ( result < 0 ) { @@ -2196,7 +2206,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result < 0 ) { @@ -2231,7 +2241,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, TRUE); + result = H5C2_set_evictions_enabled(cache_ptr, TRUE); if ( result < 0 ) { @@ -2257,7 +2267,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result < 0 ) { @@ -2298,7 +2308,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, TRUE); + result = H5C2_set_evictions_enabled(cache_ptr, TRUE); if ( result < 0 ) { @@ -2328,7 +2338,7 @@ smoke_check_9(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result < 0 ) { @@ -2409,6 +2419,7 @@ smoke_check_10(void) int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; + H5C2_t * cache_ptr = NULL; TESTING("smoke check #10 -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked"); @@ -2449,6 +2460,7 @@ smoke_check_10(void) file_ptr = setup_cache2((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); + cache_ptr = file_ptr->shared->cache2; if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d -- evictions enabled\n", @@ -2476,7 +2488,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result < 0 ) { @@ -2511,7 +2523,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, TRUE); + result = H5C2_set_evictions_enabled(cache_ptr, TRUE); if ( result < 0 ) { @@ -2546,7 +2558,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result < 0 ) { @@ -2572,7 +2584,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, TRUE); + result = H5C2_set_evictions_enabled(cache_ptr, TRUE); if ( result < 0 ) { @@ -2602,7 +2614,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result < 0 ) { @@ -2628,7 +2640,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, TRUE); + result = H5C2_set_evictions_enabled(cache_ptr, TRUE); if ( result < 0 ) { @@ -2658,7 +2670,7 @@ smoke_check_10(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result < 0 ) { @@ -2731,7 +2743,7 @@ write_permitted_check(void) int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; - H5C2_t * cache_ptr = NULL; + H5F_t * file_ptr = NULL; #endif /* H5C2_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ @@ -2774,14 +2786,14 @@ write_permitted_check(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - cache_ptr = setup_cache2((size_t)(1 * 1024 * 1024), + file_ptr = setup_cache2((size_t)(1 * 1024 * 1024), (size_t)(0)); if ( show_progress ) /* 3 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2803,7 +2815,7 @@ write_permitted_check(void) write_permitted2 = FALSE; - row_major_scan_backward2(/* cache_ptr */ cache_ptr, + row_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2825,7 +2837,7 @@ write_permitted_check(void) write_permitted2 = TRUE; - row_major_scan_forward2(/* cache_ptr */ cache_ptr, + row_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2847,7 +2859,7 @@ write_permitted_check(void) /* flush and destroy all entries in the cache: */ - flush_cache2(/* cache_ptr */ cache_ptr, + flush_cache2(/* file_ptr */ file_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); @@ -2856,7 +2868,7 @@ write_permitted_check(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - col_major_scan_forward2(/* cache_ptr */ cache_ptr, + col_major_scan_forward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2873,7 +2885,7 @@ write_permitted_check(void) write_permitted2 = FALSE; - col_major_scan_backward2(/* cache_ptr */ cache_ptr, + col_major_scan_backward2(/* file_ptr */ file_ptr, /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, @@ -2890,7 +2902,7 @@ write_permitted_check(void) HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", fcn_name, mile_stone++, (int)pass2); - takedown_cache2(cache_ptr, display_stats, TRUE); + takedown_cache2(file_ptr, display_stats, TRUE); if ( show_progress ) /* 10 */ HDfprintf(stdout, "%s() - %0d -- pass2 = %d\n", @@ -14060,8 +14072,6 @@ check_multiple_read_protect(void) core_file_driver_failed = FALSE; - core_file_driver_failed = FALSE; - pass2 = TRUE; /* allocate a cache. Should succeed. @@ -16096,7 +16106,7 @@ check_evictions_enabled(void) /* disable evictions */ if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result != SUCCEED ) { @@ -16189,7 +16199,7 @@ check_evictions_enabled(void) /* re-enable evictions */ if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, TRUE); + result = H5C2_set_evictions_enabled(cache_ptr, TRUE); if ( result != SUCCEED ) { @@ -16339,7 +16349,7 @@ check_evictions_enabled(void) /* disable evictions again */ if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result != SUCCEED ) { @@ -16388,7 +16398,7 @@ check_evictions_enabled(void) /* re-enable evictions again */ if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, TRUE); + result = H5C2_set_evictions_enabled(cache_ptr, TRUE); if ( result != SUCCEED ) { @@ -16468,7 +16478,7 @@ check_evictions_enabled(void) /* disable evictions one last time before we shut down */ if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, FALSE); + result = H5C2_set_evictions_enabled(cache_ptr, FALSE); if ( result != SUCCEED ) { @@ -18210,7 +18220,7 @@ check_check_evictions_enabled_err(void) if ( pass2 ) { - result = H5C2_set_evictions_enabled(file_ptr, TRUE); + result = H5C2_set_evictions_enabled(cache_ptr, TRUE); if ( result != SUCCEED ) { @@ -18397,7 +18407,7 @@ check_auto_cache_resize(void) if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -18768,7 +18778,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -19121,7 +19131,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -19313,7 +19323,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -19740,7 +19750,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -20284,7 +20294,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -20712,7 +20722,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -20982,7 +20992,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -21570,7 +21580,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -21708,7 +21718,7 @@ check_auto_cache_resize(void) if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -21867,7 +21877,7 @@ check_auto_cache_resize(void) if ( pass2 ) { auto_size_ctl.initial_size = 6 * 1024; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22041,7 +22051,7 @@ check_auto_cache_resize(void) if ( pass2 ) { auto_size_ctl.initial_size = 6 * 1024; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22199,7 +22209,7 @@ check_auto_cache_resize(void) if ( pass2 ) { auto_size_ctl.initial_size = 6 * 1024; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22404,7 +22414,7 @@ check_auto_cache_resize(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22724,7 +22734,7 @@ check_auto_cache_resize_disable(void) if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22797,7 +22807,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -22957,7 +22967,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23118,7 +23128,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23278,7 +23288,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23438,7 +23448,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23597,7 +23607,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23758,7 +23768,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -23986,7 +23996,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 1.0; /* disable decrement */ - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24221,7 +24231,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24460,7 +24470,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24589,7 +24599,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24718,7 +24728,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24847,7 +24857,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_empty_reserve = TRUE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -24977,7 +24987,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25107,7 +25117,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25265,7 +25275,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25480,7 +25490,7 @@ check_auto_cache_resize_epoch_markers(void) if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25549,7 +25559,7 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25726,7 +25736,7 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25848,7 +25858,7 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -25927,7 +25937,7 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -26041,7 +26051,7 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_empty_reserve = FALSE; auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, &auto_size_ctl); + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -26235,7 +26245,7 @@ check_auto_cache_resize_input_errs(void) if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &ref_auto_size_ctl); if ( result != SUCCEED ) { @@ -26317,20 +26327,14 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - /* Reset file's cache pointer */ - file_ptr->shared->cache2 = NULL; - - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(NULL, &invalid_auto_size_ctl); - /* Return file's cache pointer */ - file_ptr->shared->cache2 = cache_ptr; - if ( result != FAIL ) { pass2 = FALSE; failure_mssg2 = - "H5C2_set_cache_auto_resize_config accepted NULL file_ptr.\n"; + "H5C2_set_cache_auto_resize_config accepted NULL cache_ptr.\n"; } } @@ -26399,7 +26403,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26476,7 +26480,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26550,7 +26554,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26626,7 +26630,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26699,7 +26703,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26776,7 +26780,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26849,7 +26853,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26922,7 +26926,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -26998,7 +27002,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27071,7 +27075,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27148,7 +27152,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27222,7 +27226,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27298,7 +27302,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27371,7 +27375,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27444,7 +27448,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27521,7 +27525,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27597,7 +27601,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27673,7 +27677,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27747,7 +27751,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27823,7 +27827,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27897,7 +27901,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -27974,7 +27978,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28048,7 +28052,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28124,7 +28128,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28197,7 +28201,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28273,7 +28277,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28346,7 +28350,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28421,7 +28425,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = -0.0000001; /* INVALID */ - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28494,7 +28498,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -28541,7 +28545,7 @@ check_auto_cache_resize_input_errs(void) if ( pass2 ) { - result = H5C2_get_cache_auto_resize_config((H5C2_t *)&test_auto_size_ctl, + result = H5C2_get_cache_auto_resize_config((const H5C2_t *)&test_auto_size_ctl, &test_auto_size_ctl); if ( result != FAIL ) { @@ -28693,7 +28697,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass2 ) { - result = H5C2_set_cache_auto_resize_config(file_ptr, + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { diff --git a/test/cache2_api.c b/test/cache2_api.c index dc31619..450206d 100644 --- a/test/cache2_api.c +++ b/test/cache2_api.c @@ -28,11 +28,7 @@ /* global variable declarations: */ -const char *FILENAMES[] = { - "cache_test", - "cache_api_test", - NULL -}; +extern const char *FILENAME[]; /* macro definitions */ @@ -234,7 +230,7 @@ check_fapl_mdc_api_calls(void) /* setup the file name */ if ( pass2 ) { - if ( h5_fixname(FILENAMES[1], H5P_DEFAULT, filename, sizeof(filename)) + if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass2 = FALSE; @@ -403,7 +399,7 @@ check_fapl_mdc_api_calls(void) /* setup the file name */ if ( pass2 ) { - if ( h5_fixname(FILENAMES[1], H5P_DEFAULT, filename, sizeof(filename)) + if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass2 = FALSE; @@ -741,7 +737,7 @@ check_file_mdc_api_calls(void) /* setup the file name */ if ( pass2 ) { - if ( h5_fixname(FILENAMES[1], H5P_DEFAULT, filename, sizeof(filename)) + if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass2 = FALSE; @@ -1085,7 +1081,7 @@ mdc_api_call_smoke_check(void) if ( pass2 ) { - if ( h5_fixname(FILENAMES[1], H5P_DEFAULT, filename, sizeof(filename)) + if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass2 = FALSE; @@ -3293,7 +3289,7 @@ check_file_mdc_api_errs(void) HDfprintf(stdout, "%s: calling h5_fixname().\n", fcn_name); } - if ( h5_fixname(FILENAMES[1], H5P_DEFAULT, filename, sizeof(filename)) + if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass2 = FALSE; diff --git a/test/cache2_common.c b/test/cache2_common.c index c9c49f9..57149a5 100644 --- a/test/cache2_common.c +++ b/test/cache2_common.c @@ -33,9 +33,9 @@ /* global variable declarations: */ const char *FILENAME[] = { - "cache2_test", - "cache2_api_test", - NULL + "cache2_test", + "cache2_api_test", + NULL }; hid_t saved_fapl_id = H5P_DEFAULT; /* store the fapl id here between @@ -55,6 +55,10 @@ H5C2_t * saved_cache2 = NULL; /* store the pointer to the instance of * shutdown. */ +haddr_t saved_actual_base_addr = HADDR_UNDEF; /* Store the address of the + space allocated for cache items in the file between + cache setup & takedown */ + hbool_t write_permitted2 = TRUE; hbool_t pass2 = TRUE; /* set to false on error */ hbool_t skip_long_tests2 = TRUE; @@ -2279,7 +2283,7 @@ resize_pinned_entry2(H5F_t * file_ptr, HDassert( cache_ptr ); HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) ); - HDassert( type = VARIABLE_ENTRY_TYPE ) ; + HDassert( type == VARIABLE_ENTRY_TYPE ) ; HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes2[type] ) ); if ( ! entry_in_cache2(cache_ptr, type, idx) ) { @@ -2723,14 +2727,6 @@ verify_unprotected2(void) * * Programmer: JRM -- 9/13/07 * - * Modifications: - * - * Updated for changes in the parameter list of H5C2_create(). - * These changes are needed for journaling. We do nothing - * with these parameters here -- will write another version - * of this routine for journaling tests. - * JRM -- 3/27/08 - * *****************************************************************************/ H5F_t * @@ -2998,6 +2994,8 @@ setup_cache2(size_t max_cache_size, fcn_name); } } + + saved_actual_base_addr = actual_base_addr; } if ( show_progress ) /* 8 */ @@ -3062,6 +3060,13 @@ takedown_cache2(H5F_t * file_ptr, file_ptr->shared->cache2 = saved_cache2; saved_cache2 = NULL; } + + if ( H5F_addr_defined(saved_actual_base_addr) ) { + + H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, H5P_DEFAULT, saved_actual_base_addr, + (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); + saved_actual_base_addr = HADDR_UNDEF; + } } if ( saved_fapl_id != H5P_DEFAULT ) { @@ -3130,20 +3135,17 @@ expunge_entry2(H5F_t * file_ptr, int32_t idx) { /* const char * fcn_name = "expunge_entry2()"; */ -#ifndef NDEBUG - H5C2_t * cache_ptr; -#endif /* NDEBUG */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; if ( pass2 ) { - #ifndef NDEBUG - cache_ptr = file_ptr->shared->cache2; -#endif /* NDEBUG */ + H5C2_t * cache_ptr = file_ptr->shared->cache2; HDassert( cache_ptr ); +#endif /* NDEBUG */ + HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) ); @@ -3724,17 +3726,13 @@ pin_protected_entry2(H5F_t * file_ptr, int32_t idx) { /* const char * fcn_name = "pin_protected_entry2()"; */ -#ifndef NDEBUG - H5C2_t * cache_ptr; -#endif /* NDEBUG */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; if ( pass2 ) { - #ifndef NDEBUG - cache_ptr = file_ptr->shared->cache2; + H5C2_t * cache_ptr = file_ptr->shared->cache2; #endif /* NDEBUG */ HDassert( cache_ptr ); @@ -4476,7 +4474,6 @@ row_major_scan_forward2(H5F_t * file_ptr, local_max_index = MIN(max_index, max_indices2[type]); - /*while ( ( pass2 ) && ( idx <= (max_indices2[type] + lag) ) ) */ while ( ( pass2 ) && ( idx <= (local_max_index + lag) ) ) { if ( verbose ) { @@ -4485,7 +4482,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } if ( ( pass2 ) && ( do_inserts ) && ( (idx + lag) >= 0 ) && - /*( (idx + lag) <= max_indices2[type] ) && */ ( (idx + lag) <= local_max_index ) && ( ((idx + lag) % 2) == 0 ) && ( ! entry_in_cache2(cache_ptr, type, (idx + lag)) ) ) { @@ -4499,7 +4495,6 @@ row_major_scan_forward2(H5F_t * file_ptr, if ( ( pass2 ) && ( (idx + lag - 1) >= 0 ) && - /*( (idx + lag - 1) <= max_indices2[type] ) && */ ( (idx + lag - 1) <= local_max_index ) && ( ( (idx + lag - 1) % 3 ) == 0 ) ) { @@ -4510,7 +4505,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } if ( ( pass2 ) && ( (idx + lag - 2) >= 0 ) && - /*( (idx + lag - 2) <= max_indices2[type] ) && */ ( (idx + lag - 2) <= local_max_index ) && ( ( (idx + lag - 2) % 3 ) == 0 ) ) { @@ -4523,7 +4517,6 @@ row_major_scan_forward2(H5F_t * file_ptr, if ( ( pass2 ) && ( do_renames ) && ( (idx + lag - 2) >= 0 ) && - /*( (idx + lag - 2) <= max_indices2[type] ) && */ ( (idx + lag - 2) <= local_max_index ) && ( ( (idx + lag - 2) % 3 ) == 0 ) ) { @@ -4537,7 +4530,6 @@ row_major_scan_forward2(H5F_t * file_ptr, if ( ( pass2 ) && ( (idx + lag - 3) >= 0 ) && - /*( (idx + lag - 3) <= max_indices2[type] ) && */ ( (idx + lag - 3) <= local_max_index ) && ( ( (idx + lag - 3) % 5 ) == 0 ) ) { @@ -4548,7 +4540,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } if ( ( pass2 ) && ( (idx + lag - 5) >= 0 ) && - /*( (idx + lag - 5) <= max_indices2[type] ) && */ ( (idx + lag - 5) <= local_max_index ) && ( ( (idx + lag - 5) % 5 ) == 0 ) ) { @@ -4562,7 +4553,6 @@ row_major_scan_forward2(H5F_t * file_ptr, if ( do_mult_ro_protects ) { if ( ( pass2 ) && ( (idx + lag - 5) >= 0 ) && - /*( (idx + lag - 5) < max_indices2[type] ) && */ ( (idx + lag - 5) < local_max_index ) && ( (idx + lag - 5) % 9 == 0 ) ) { @@ -4574,7 +4564,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } if ( ( pass2 ) && ( (idx + lag - 6) >= 0 ) && - /*( (idx + lag - 6) < max_indices2[type] ) && */ ( (idx + lag - 6) < local_max_index ) && ( (idx + lag - 6) % 11 == 0 ) ) { @@ -4586,7 +4575,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } if ( ( pass2 ) && ( (idx + lag - 7) >= 0 ) && - /* ( (idx + lag - 7) < max_indices2[type] ) && */ ( (idx + lag - 7) < local_max_index ) && ( (idx + lag - 7) % 13 == 0 ) ) { @@ -4598,7 +4586,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } if ( ( pass2 ) && ( (idx + lag - 7) >= 0 ) && - /* ( (idx + lag - 7) < max_indices2[type] ) && */ ( (idx + lag - 7) < local_max_index ) && ( (idx + lag - 7) % 9 == 0 ) ) { @@ -4611,7 +4598,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } if ( ( pass2 ) && ( (idx + lag - 8) >= 0 ) && - /* ( (idx + lag - 8) < max_indices2[type] ) && */ ( (idx + lag - 8) < local_max_index ) && ( (idx + lag - 8) % 11 == 0 ) ) { @@ -4624,7 +4610,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } if ( ( pass2 ) && ( (idx + lag - 9) >= 0 ) && - /*( (idx + lag - 9) < max_indices2[type] ) && */ ( (idx + lag - 9) < local_max_index ) && ( (idx + lag - 9) % 13 == 0 ) ) { @@ -4637,7 +4622,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } } /* if ( do_mult_ro_protects ) */ - /*if ( ( pass2 ) && ( idx >= 0 ) && ( idx <= max_indices2[type] ) ) { */ if ( ( pass2 ) && ( idx >= 0 ) && ( idx <= local_max_index ) ) { if ( verbose ) @@ -4647,7 +4631,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } if ( ( pass2 ) && ( (idx - lag + 2) >= 0 ) && - /*( (idx - lag + 2) <= max_indices2[type] ) && */ ( (idx - lag + 2) <= local_max_index ) && ( ( (idx - lag + 2) % 7 ) == 0 ) ) { @@ -4659,7 +4642,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } if ( ( pass2 ) && ( (idx - lag + 1) >= 0 ) && - /*( (idx - lag + 1) <= max_indices2[type] ) && */ ( (idx - lag + 1) <= local_max_index ) && ( ( (idx - lag + 1) % 7 ) == 0 ) ) { @@ -4673,7 +4655,6 @@ row_major_scan_forward2(H5F_t * file_ptr, if ( do_destroys ) { if ( ( pass2 ) && ( (idx - lag) >= 0 ) && - /* ( ( idx - lag) <= max_indices2[type] ) ) { */ ( ( idx - lag) <= local_max_index ) ) { switch ( (idx - lag) %4 ) { @@ -4751,7 +4732,6 @@ row_major_scan_forward2(H5F_t * file_ptr, } else { if ( ( pass2 ) && ( (idx - lag) >= 0 ) && - /* ( ( idx - lag) <= max_indices2[type] ) ) { */ ( ( idx - lag) <= local_max_index ) ) { if ( verbose ) @@ -5509,7 +5489,7 @@ hl_col_major_scan_forward2(H5F_t * file_ptr, int dirty_unprotects) { const char * fcn_name = "hl_col_major_scan_forward2()"; - H5C2_t * cache_ptr = file_ptr->shared->cache2; + H5C2_t * cache_ptr; int32_t type = 0; int32_t idx; int32_t lag = 200; @@ -5636,7 +5616,7 @@ col_major_scan_backward2(H5F_t * file_ptr, int dirty_unprotects) { const char * fcn_name = "col_major_scan_backward2()"; - H5C2_t * cache_ptr = file_ptr->shared->cache2; + H5C2_t * cache_ptr; int i; int mile_stone = 1; int32_t type; @@ -5772,7 +5752,7 @@ hl_col_major_scan_backward2(H5F_t * file_ptr, int dirty_unprotects) { const char * fcn_name = "hl_col_major_scan_backward2()"; - H5C2_t * cache_ptr = file_ptr->shared->cache2; + H5C2_t * cache_ptr; int32_t type = 0; int32_t idx; int32_t lag = 50; @@ -5793,7 +5773,7 @@ hl_col_major_scan_backward2(H5F_t * file_ptr, local_max_index = MIN(max_index, MAX_ENTRIES); - if ( ( pass2 ) && ( reset_stats ) ) { + if ( reset_stats ) { H5C2_stats__reset(cache_ptr); } -- cgit v0.12