From b4c2be19afc2095b73a3c3f1fc37932cc08335db Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 18 Aug 2011 17:56:54 -0500 Subject: [svn-r21261] Description: Synchronize metadata journaling branch with changes from trunk. Tested on: Mac OS X/32 10.6.8 (amazon) (h5committest not required on this branch) --- config/apple | 3 + configure | 3 +- configure.in | 3 +- src/H5AC.c | 293 +++------- src/H5B2cache.c | 6 +- src/H5B2int.c | 8 +- src/H5Bcache.c | 5 +- src/H5C.c | 388 ++++--------- src/H5Cprivate.h | 22 +- src/H5F.c | 8 +- src/H5FScache.c | 6 +- src/H5Gnode.c | 6 +- src/H5HFcache.c | 74 +-- src/H5HFdbg.c | 2 +- src/H5HFdblock.c | 1 + src/H5HFhdr.c | 7 +- src/H5HFman.c | 5 +- src/H5HFpkg.h | 84 +-- src/H5HGcache.c | 4 +- src/H5HLcache.c | 41 +- src/H5L.c | 2 +- src/H5Ocache.c | 74 +-- src/H5Pfapl.c | 8 +- src/H5SMcache.c | 8 +- test/cache.c | 496 ++++++++-------- test/cache_api.c | 46 +- test/cache_common.c | 1563 +++++++++++++++++++++------------------------------ test/cache_common.h | 6 +- test/fheap.c | 13 +- testpar/t_cache.c | 142 +---- 30 files changed, 1317 insertions(+), 2010 deletions(-) diff --git a/config/apple b/config/apple index 14504bb..b39a224 100644 --- a/config/apple +++ b/config/apple @@ -29,6 +29,9 @@ fi # Figure out compiler flags . $srcdir/config/gnu-flags +H5_CFLAGS="$H5_CFLAGS -D_DARWIN_C_SOURCE" + + # The default Fortran 90 compiler if test "X-" = "X-$FC"; then # Assume Absoft compiler diff --git a/configure b/configure index 0160833..2ef8c32 100755 --- a/configure +++ b/configure @@ -25186,7 +25186,8 @@ if test "X-$DEBUG_PKG" = X- ; then fi -all_packages="ac,b,b2,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v,z" +#all_packages="ac,b,b2,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v,z" +all_packages="ac,b,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v,z" case "X-$DEBUG_PKG" in X-yes) DEBUG_PKG="d,e,f,g,hg,i,mm,o,p,s,t,v,z" diff --git a/configure.in b/configure.in index 1ba7f7c..9e6cefe 100644 --- a/configure.in +++ b/configure.in @@ -2167,7 +2167,8 @@ if test "X-$DEBUG_PKG" = X- ; then fi AC_SUBST([DEBUG_PKG]) -all_packages="ac,b,b2,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v,z" +#all_packages="ac,b,b2,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v,z" +all_packages="ac,b,d,e,f,g,hg,hl,i,mf,mm,o,p,s,t,v,z" case "X-$DEBUG_PKG" in X-yes) DEBUG_PKG="d,e,f,g,hg,i,mm,o,p,s,t,v,z" diff --git a/src/H5AC.c b/src/H5AC.c index a173d8d..7980749 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -166,9 +166,9 @@ static herr_t H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, H5AC_t * cache_ptr, hbool_t do_barrier); -static herr_t H5AC_receive_and_apply_clean_list(H5F_t * f, - hid_t dxpl_id, - H5AC_t * cache_ptr); +static herr_t H5AC_receive_and_apply_clean_list(H5F_t * f, + hid_t dxpl_id, + H5AC_t * cache_ptr); static herr_t H5AC_log_moved_entry(const H5F_t * f, haddr_t old_addr, @@ -425,8 +425,6 @@ herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ - herr_t result; #ifdef H5_HAVE_PARALLEL char prefix[H5C__PREFIX_LEN] = ""; MPI_Comm mpi_comm = MPI_COMM_NULL; @@ -434,6 +432,7 @@ H5AC_create(const H5F_t *f, int mpi_size = -1; H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_create, FAIL) @@ -443,13 +442,6 @@ H5AC_create(const H5F_t *f, HDcompile_assert(NELMTS(H5AC_entry_type_names) == H5AC_NTYPES); HDcompile_assert(H5C__MAX_NUM_TYPE_IDS == H5AC_NTYPES); - result = H5AC_validate_config(config_ptr); - - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration"); - } - #ifdef H5_HAVE_PARALLEL if ( IS_H5FD_MPI(f) ) { @@ -595,24 +587,13 @@ H5AC_create(const H5F_t *f, } #ifdef H5_HAVE_PARALLEL else if ( aux_ptr != NULL ) { - - result = H5C_set_prefix(f->shared->cache, prefix); - - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \ - "H5C_set_prefix() failed") - } + if(H5C_set_prefix(f->shared->cache, prefix) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "H5C_set_prefix() failed") } #endif /* H5_HAVE_PARALLEL */ - result = H5AC_set_cache_config(f->shared->cache, config_ptr); - - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, \ - "auto resize configuration failed") - } + if(H5AC_set_cache_config(f->shared->cache, config_ptr) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "auto resize configuration failed") done: @@ -1564,7 +1545,6 @@ herr_t H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags) { - herr_t result; #ifdef H5_HAVE_PARALLEL H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ @@ -2678,75 +2658,48 @@ herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr) { - herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ #if H5AC__TRACE_FILE_ENABLED H5AC_cache_config_t trace_config = H5AC__DEFAULT_CACHE_CONFIG; FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_set_cache_auto_resize_config, FAIL) - HDassert( cache_ptr ); + HDassert(cache_ptr); #if H5AC__TRACE_FILE_ENABLED /* Make note of the new configuration. Don't look up the trace file * pointer, as that may change before we use it. */ - if ( config_ptr != NULL ) { - + if(config_ptr != NULL) trace_config = *config_ptr; - - } #endif /* H5AC__TRACE_FILE_ENABLED */ - if ( ( cache_ptr == NULL ) + if((cache_ptr == NULL) #ifdef H5_HAVE_PARALLEL || - ( ( cache_ptr->aux_ptr != NULL ) - && - ( - ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic - != - H5AC__H5AC_AUX_T_MAGIC - ) - ) + ((cache_ptr->aux_ptr != NULL) && + (((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != H5AC__H5AC_AUX_T_MAGIC)) #endif /* H5_HAVE_PARALLEL */ - ) { - + ) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry.") - } - - result = H5AC_validate_config(config_ptr); - - if ( result != SUCCEED ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration"); - } - - - result = H5AC_set_cache_config(cache_ptr, config_ptr); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5AC_set_cache_config() failed.") - } + if(H5AC_set_cache_config(cache_ptr, config_ptr) < 0 ) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't set cache configuration") done: - #if H5AC__TRACE_FILE_ENABLED /* For the set cache auto resize config call, only the contents * of the config is necessary in the trace file. Write the return * value to catch occult errors. */ - if ( ( cache_ptr != NULL ) && - ( H5C_get_trace_file_ptr(cache_ptr, &trace_file_ptr) >= 0 ) && - ( trace_file_ptr != NULL ) ) { - + if((cache_ptr != NULL) && + (H5C_get_trace_file_ptr(cache_ptr, &trace_file_ptr) >= 0) && + (trace_file_ptr != NULL)) HDfprintf(trace_file_ptr, "%s %d %d %d %d \"%s\" %d %d %d %f %d %d %ld %d %f %f %d %d %d %f %f %d %f %f %d %d %d %d %f %d %d\n", - "H5AC_set_cache_auto_resize_config", + FUNC, trace_config.version, (int)(trace_config.rpt_fcn_enabled), (int)(trace_config.open_trace_file), @@ -2777,11 +2730,9 @@ done: trace_config.empty_reserve, trace_config.dirty_bytes_threshold, (int)ret_value); - } #endif /* H5AC__TRACE_FILE_ENABLED */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_set_cache_auto_resize_config() */ @@ -2961,94 +2912,47 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5AC_set_cache_config(H5AC_t * cache_ptr, H5AC_cache_config_t *config_ptr) { - herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ H5C_auto_size_ctl_t internal_config; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5AC_set_cache_config, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5AC_set_cache_config) - if ( ( cache_ptr == NULL ) + if((cache_ptr == NULL) #ifdef H5_HAVE_PARALLEL || - ( ( cache_ptr->aux_ptr != NULL ) + ((cache_ptr->aux_ptr != NULL) && - ( - ((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic - != - H5AC__H5AC_AUX_T_MAGIC - ) - ) + (((H5AC_aux_t *)(cache_ptr->aux_ptr))->magic != H5AC__H5AC_AUX_T_MAGIC)) #endif /* H5_HAVE_PARALLEL */ - ) { - + ) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry.") - } - result = H5AC_validate_config(config_ptr); - - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration"); - } - - if ( config_ptr->open_trace_file ) { + if(H5AC_validate_config(config_ptr) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration") + if(config_ptr->open_trace_file) { FILE * file_ptr = NULL; - if ( H5C_get_trace_file_ptr(cache_ptr, &file_ptr) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_get_trace_file_ptr() failed.") - } - - if ( ( ! ( config_ptr->close_trace_file ) ) && - ( file_ptr != NULL ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "Trace file already open.") - } - } - - if ( - ( - config_ptr->dirty_bytes_threshold - < - H5AC__MIN_DIRTY_BYTES_THRESHOLD - ) - || - ( - config_ptr->dirty_bytes_threshold - > - H5AC__MAX_DIRTY_BYTES_THRESHOLD - ) - ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "config_ptr->dirty_bytes_threshold out of range.") - } - - if ( config_ptr->close_trace_file ) { - - if ( H5AC_close_trace_file(cache_ptr) < 0 ) { + if(H5C_get_trace_file_ptr(cache_ptr, &file_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't get trace file pointer") - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5AC_close_trace_file() failed.") - } - } + if((!(config_ptr->close_trace_file)) && (file_ptr != NULL)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Trace file already open.") + } /* end if */ - if ( config_ptr->open_trace_file ) { + if((config_ptr->dirty_bytes_threshold < H5AC__MIN_DIRTY_BYTES_THRESHOLD) + || ( config_ptr->dirty_bytes_threshold > H5AC__MAX_DIRTY_BYTES_THRESHOLD)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->dirty_bytes_threshold out of range.") - if ( H5AC_open_trace_file(cache_ptr, config_ptr->trace_file_name) < 0 ) - { + if(config_ptr->close_trace_file && H5AC_close_trace_file(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't close trace file") - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "H5AC_open_trace_file() failed.") - } - } + if(config_ptr->open_trace_file && H5AC_open_trace_file(cache_ptr, config_ptr->trace_file_name) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't open trace file") if(H5AC_ext_config_2_int_config(config_ptr, &internal_config) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_ext_config_2_int_config() failed.") @@ -3060,17 +2964,13 @@ H5AC_set_cache_config(H5AC_t * cache_ptr, HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed.") #ifdef H5_HAVE_PARALLEL - if ( cache_ptr->aux_ptr != NULL ) { - + if(cache_ptr->aux_ptr != NULL) ((H5AC_aux_t *)(cache_ptr->aux_ptr))->dirty_bytes_threshold = config_ptr->dirty_bytes_threshold; - } #endif /* H5_HAVE_PARALLEL */ done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_set_cache_config() */ @@ -3099,45 +2999,28 @@ done: herr_t H5AC_validate_config(H5AC_cache_config_t * config_ptr) { - herr_t result; H5C_auto_size_ctl_t internal_config; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_validate_config, FAIL) - if ( config_ptr == NULL ) { - + if(config_ptr == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.") - } - - if ( config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION ) { + if(config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown config version.") - } - if ( ( config_ptr->rpt_fcn_enabled != TRUE ) && - ( config_ptr->rpt_fcn_enabled != FALSE ) ) { + if((config_ptr->rpt_fcn_enabled != TRUE) && (config_ptr->rpt_fcn_enabled != FALSE)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->rpt_fcn_enabled must be either TRUE or FALSE.") - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "config_ptr->rpt_fcn_enabled must be either TRUE or FALSE.") - } + if((config_ptr->open_trace_file != TRUE) && (config_ptr->open_trace_file != FALSE)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->open_trace_file must be either TRUE or FALSE.") - if ( ( config_ptr->open_trace_file != TRUE ) && - ( config_ptr->open_trace_file != FALSE ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "config_ptr->open_trace_file must be either TRUE or FALSE.") - } - - if ( ( config_ptr->close_trace_file != TRUE ) && - ( config_ptr->close_trace_file != FALSE ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "config_ptr->close_trace_file must be either TRUE or FALSE.") - } + if((config_ptr->close_trace_file != TRUE) && (config_ptr->close_trace_file != FALSE)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->close_trace_file must be either TRUE or FALSE.") /* don't bother to test trace_file_name unless open_trace_file is TRUE */ - if ( config_ptr->open_trace_file ) { + if(config_ptr->open_trace_file) { size_t name_len; /* Can't really test the trace_file_name field without trying to @@ -3145,65 +3028,35 @@ H5AC_validate_config(H5AC_cache_config_t * config_ptr) * sanity checks on the length of the file name. */ name_len = HDstrlen(config_ptr->trace_file_name); + if(name_len == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty.") + else if(name_len > H5AC__MAX_TRACE_FILE_NAME_LEN) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long.") + } /* end if */ - if ( name_len == 0 ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "config_ptr->trace_file_name is empty.") - - } else if ( name_len > H5AC__MAX_TRACE_FILE_NAME_LEN ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "config_ptr->trace_file_name too long.") - } - } - - if ( ( config_ptr->evictions_enabled != TRUE ) && - ( config_ptr->evictions_enabled != FALSE ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "config_ptr->evictions_enabled must be either TRUE or FALSE.") - } - - if ( ( config_ptr->evictions_enabled == FALSE ) && - ( ( config_ptr->incr_mode != H5C_incr__off ) || - ( config_ptr->flash_incr_mode != H5C_flash_incr__off ) || - ( config_ptr->decr_mode != H5C_decr__off ) ) ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "Can't disable evictions while auto-resize is enabled.") - } - - if ( config_ptr->dirty_bytes_threshold < H5AC__MIN_DIRTY_BYTES_THRESHOLD ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "dirty_bytes_threshold too small.") - } else - if ( config_ptr->dirty_bytes_threshold > H5AC__MAX_DIRTY_BYTES_THRESHOLD ) { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, - "dirty_bytes_threshold too big.") - } - - if ( H5AC_ext_config_2_int_config(config_ptr, &internal_config) != - SUCCEED ) { + if((config_ptr->evictions_enabled != TRUE) && (config_ptr->evictions_enabled != FALSE)) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->evictions_enabled must be either TRUE or FALSE.") - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5AC_ext_config_2_int_config() failed.") - } + if((config_ptr->evictions_enabled == FALSE) && + ((config_ptr->incr_mode != H5C_incr__off) || + (config_ptr->flash_incr_mode != H5C_flash_incr__off) || + (config_ptr->decr_mode != H5C_decr__off))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Can't disable evictions while auto-resize is enabled.") - result = H5C_validate_resize_config(&internal_config, - H5C_RESIZE_CFG__VALIDATE_ALL); + if(config_ptr->dirty_bytes_threshold < H5AC__MIN_DIRTY_BYTES_THRESHOLD) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small.") + else + if(config_ptr->dirty_bytes_threshold > H5AC__MAX_DIRTY_BYTES_THRESHOLD) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big.") - if ( result != SUCCEED ) { + if(H5AC_ext_config_2_int_config(config_ptr, &internal_config) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_ext_config_2_int_config() failed.") + if(H5C_validate_resize_config(&internal_config, H5C_RESIZE_CFG__VALIDATE_ALL) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error(s) in new config.") - } done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_validate_config() */ diff --git a/src/H5B2cache.c b/src/H5B2cache.c index f8247aa..4cbb817 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -298,7 +298,7 @@ done: static herr_t H5B2_cache_hdr_image_len(const void *_thing, size_t *image_len) { - H5B2_t *bt2 = (H5B2_t *)_thing; /* Pointer to the B-tree header */ + const H5B2_t *bt2 = (const H5B2_t *)_thing; /* Pointer to the B-tree header */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_hdr_image_len) @@ -610,7 +610,7 @@ done: static herr_t H5B2_cache_int_image_len(const void *_thing, size_t *image_len) { - H5B2_internal_t *internal = (H5B2_internal_t *)_thing; /* Pointer to the B-tree internal node */ + const H5B2_internal_t *internal = (const H5B2_internal_t *)_thing; /* Pointer to the B-tree internal node */ H5B2_shared_t *shared; /* Shared B-tree information */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_int_image_len) @@ -918,7 +918,7 @@ done: static herr_t H5B2_cache_leaf_image_len(const void *_thing, size_t *image_len) { - H5B2_leaf_t *leaf = (H5B2_leaf_t *)_thing; /* Pointer to the B-tree leaf node */ + const H5B2_leaf_t *leaf = (const H5B2_leaf_t *)_thing; /* Pointer to the B-tree leaf node */ H5B2_shared_t *shared; /* Shared B-tree information */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_leaf_image_len) diff --git a/src/H5B2int.c b/src/H5B2int.c index 9384056..fbf8b55 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -3429,7 +3429,7 @@ H5B2_assert_leaf(H5B2_shared_t *shared, H5B2_leaf_t *leaf) unsigned u,v; /* Local index variables */ /* General sanity checking on node */ - HDassert(leaf->nrec<=shared->split_leaf_nrec); + HDassert(leaf->nrec <= hdr->node_info->split_nrec); /* Sanity checking on records */ for(u=0; unrec; u++) @@ -3459,7 +3459,7 @@ H5B2_assert_leaf2(H5B2_shared_t *shared, H5B2_leaf_t *leaf, H5B2_leaf_t *leaf2) unsigned u,v; /* Local index variables */ /* General sanity checking on node */ - HDassert(leaf->nrec<=shared->split_leaf_nrec); + HDassert(leaf->nrec <= hdr->node_info->split_nrec); /* Sanity checking on records */ for(u=0; unrec; u++) { @@ -3492,7 +3492,7 @@ H5B2_assert_internal(hsize_t parent_all_nrec, H5B2_shared_t *shared, H5B2_intern unsigned u,v; /* Local index variables */ /* General sanity checking on node */ - HDassert(internal->nrec<=shared->split_int_nrec); + HDassert(internal->nrec <= hdr->node_info->split_nrec); /* Sanity checking on records */ for(u=0; unrec; u++) @@ -3538,7 +3538,7 @@ H5B2_assert_internal2(hsize_t parent_all_nrec, H5B2_shared_t *shared, H5B2_inter unsigned u,v; /* Local index variables */ /* General sanity checking on node */ - HDassert(internal->nrec<=shared->split_int_nrec); + HDassert(internal->nrec <= hdr->node_info->split_nrec); /* Sanity checking on records */ for(u=0; unrec; u++) diff --git a/src/H5Bcache.c b/src/H5Bcache.c index f95fb69..a3ee75e 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -128,7 +128,8 @@ H5B_get_load_size(const void *_udata, size_t *image_len) * * Purpose: Deserialize the data structure from disk. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Pointer to a new B-tree node. + * Failure: NULL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -244,7 +245,7 @@ done: static herr_t H5B_image_len(const void *_thing, size_t *image_len) { - H5B_t *bt = (H5B_t *)_thing; /* Pointer to the B-tree node */ + const H5B_t *bt = (const H5B_t *)_thing; /* Pointer to the B-tree node */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_image_len) diff --git a/src/H5C.c b/src/H5C.c index d9a6f08..dd27ec2 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -210,14 +210,15 @@ const H5C_class_t epoch_marker_class = /* name = */ "epoch marker", /* mem_type = */ H5FD_MEM_DEFAULT, /* value doesn't matter */ /* flags = */ H5AC__CLASS_NO_FLAGS_SET, - /* get_load_size = */ &H5C_epoch_marker_get_load_size, - /* deserialize = */ &H5C_epoch_marker_deserialize, - /* image_len = */ &H5C_epoch_marker_image_len, - /* serialize = */ &H5C_epoch_marker_serialize, - /* free_icr = */ &H5C_epoch_marker_free_icr, + /* get_load_size = */ H5C_epoch_marker_get_load_size, + /* deserialize = */ H5C_epoch_marker_deserialize, + /* image_len = */ H5C_epoch_marker_image_len, + /* serialize = */ H5C_epoch_marker_serialize, + /* free_icr = */ H5C_epoch_marker_free_icr, }; + /*************************************************************************** * Class functions for H5C__EPOCH_MAKER_TYPE: * @@ -226,85 +227,66 @@ const H5C_class_t epoch_marker_class = * JRM - 11/16/04 * ***************************************************************************/ - static herr_t H5C_epoch_marker_get_load_size(const void UNUSED *udata_ptr, - size_t UNUSED *image_len_ptr) + size_t UNUSED *image_len_ptr) { - herr_t ret_value = FAIL; /* Return value */ - - FUNC_ENTER_NOAPI(H5C_epoch_marker_get_load_size, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5C_epoch_marker_get_load_size) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn.") -done: - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C_epoch_marker_get_load_size() */ + static void * -H5C_epoch_marker_deserialize(const void UNUSED * image_ptr, - size_t UNUSED len, - void UNUSED * udata, - hbool_t UNUSED * dirty_ptr) +H5C_epoch_marker_deserialize(const void UNUSED * image_ptr, size_t UNUSED len, + void UNUSED * udata, hbool_t UNUSED * dirty_ptr) { - void * ret_value = NULL; /* Return value */ - - FUNC_ENTER_NOAPI(H5C_epoch_marker_deserialize, NULL) + FUNC_ENTER_NOAPI_NOINIT(H5C_epoch_marker_deserialize) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "called unreachable fcn.") + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn.") -done: - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(NULL) +} /* end H5C_epoch_marker_deserialize() */ + static herr_t H5C_epoch_marker_image_len(const void UNUSED *thing, - size_t UNUSED *image_len_ptr) + size_t UNUSED *image_len_ptr) { - herr_t ret_value = FAIL; /* Return value */ + FUNC_ENTER_NOAPI_NOINIT(H5C_epoch_marker_image_len) - FUNC_ENTER_NOAPI(H5C_epoch_marker_image_len, FAIL) + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn.") - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C_epoch_marker_image_len() */ + static herr_t -H5C_epoch_marker_serialize(const H5F_t UNUSED *f, - hid_t UNUSED dxpl_id, - haddr_t UNUSED addr, - size_t UNUSED len, - void UNUSED * image_ptr, - void UNUSED * thing, - unsigned UNUSED * flags_ptr, - haddr_t UNUSED * new_addr_ptr, - size_t UNUSED * new_len_ptr, - void UNUSED ** new_image_ptr_ptr) +H5C_epoch_marker_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, + haddr_t UNUSED addr, size_t UNUSED len, void UNUSED * image_ptr, + void UNUSED * thing, unsigned UNUSED * flags_ptr, + haddr_t UNUSED * new_addr_ptr, size_t UNUSED * new_len_ptr, + void UNUSED ** new_image_ptr_ptr) { - herr_t ret_value = FAIL; /* Return value */ + FUNC_ENTER_NOAPI_NOINIT(H5C_epoch_marker_serialize) - FUNC_ENTER_NOAPI(H5C_epoch_marker_serialize, FAIL) + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn.") - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C_epoch_marker_serialize() */ + static herr_t H5C_epoch_marker_free_icr(void UNUSED * thing) { - herr_t ret_value = FAIL; /* Return value */ + FUNC_ENTER_NOAPI_NOINIT(H5C_epoch_marker_free_icr) - FUNC_ENTER_NOAPI(H5C_epoch_marker_free_icr, FAIL) + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn.") - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "called unreachable fcn.") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C_epoch_marker_free_icr() */ /*------------------------------------------------------------------------- @@ -815,61 +797,40 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, *------------------------------------------------------------------------- */ herr_t -H5C_dest(H5F_t * f, - hid_t dxpl_id) +H5C_dest(H5F_t * f, hid_t dxpl_id) { H5C_t * cache_ptr = f->shared->cache; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_dest, FAIL) - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); /* All metadata journaling status change callbacks should have * de-registered at this point. */ - HDassert( cache_ptr->num_mdjsc_cbs == 0 ); + HDassert(cache_ptr->num_mdjsc_cbs == 0); - if ( cache_ptr->mdj_enabled ) { - - if ( H5C_end_journaling(f, dxpl_id, cache_ptr) != SUCCEED ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "H5C_end_journaling() failed.") - } - } - - if ( H5C_flush_cache(f, dxpl_id, - H5C__FLUSH_INVALIDATE_FLAG) < 0 ) { + if(cache_ptr->mdj_enabled && H5C_end_journaling(f, dxpl_id, cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't shut down journaling") + if(H5C_flush_cache(f, dxpl_id, H5C__FLUSH_INVALIDATE_FLAG) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") - } - - if ( cache_ptr->slist_ptr != NULL ) { + if(cache_ptr->slist_ptr != NULL) { H5SL_close(cache_ptr->slist_ptr); cache_ptr->slist_ptr = NULL; - } - - if ( cache_ptr->mdjsc_cb_tbl != NULL ) { + } /* end if */ + if(cache_ptr->mdjsc_cb_tbl != NULL) cache_ptr->mdjsc_cb_tbl = (H5C_mdjsc_record_t *)H5MM_xfree(cache_ptr->mdjsc_cb_tbl); - if ( cache_ptr->mdjsc_cb_tbl != NULL ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, \ - "free of mdjsc_cb_tbl failed."); - } - } - cache_ptr->magic = 0; - cache_ptr = H5FL_FREE(H5C_t, cache_ptr); done: FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_dest() */ @@ -940,111 +901,78 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_expunge_entry(H5F_t * f, - hid_t dxpl_id, - const H5C_class_t * type, - haddr_t addr) +H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type, + haddr_t addr) { H5C_t * cache_ptr; - herr_t result; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_expunge_entry, FAIL) - HDassert( f ); - HDassert( f->shared ); + HDassert(f); + HDassert(f->shared); cache_ptr = f->shared->cache; - HDassert( cache_ptr ); - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( type ); - HDassert( H5F_addr_defined(addr) ); + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(type); + HDassert(H5F_addr_defined(addr)); #if H5C_DO_EXTREME_SANITY_CHECKS - if ( H5C_validate_lru_list(cache_ptr) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "LRU sanity check failed.\n"); - } + if(H5C_validate_lru_list(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU sanity check failed.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ + /* Look for entry in cache */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) - - if ( ( entry_ptr == NULL ) || ( entry_ptr->type != type ) ) { - + if((entry_ptr == NULL) || (entry_ptr->type != type)) /* the target doesn't exist in the cache, so we are done. */ HGOTO_DONE(SUCCEED) - } - - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->type == type ); - if ( entry_ptr->is_protected ) { + HDassert(entry_ptr->addr == addr); + HDassert(entry_ptr->type == type); - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \ - "Target entry is protected.") - } - - if ( entry_ptr->is_pinned ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \ - "Target entry is pinned.") - } + /* Check for entry being pinned or protected */ + if(entry_ptr->is_protected) + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is protected.") + if(entry_ptr->is_pinned) + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "Target entry is pinned.") /* H5C_flush_single_entry() will choke if the last_trans field * of the entry isn't zero, or if the entry is on the transaction * list, or on the transaction write in progress list. Must tend * to this before we we make the call. */ - if ( cache_ptr->mdj_enabled ) { - - if ( cache_ptr->trans_num > 0 ) { + if(cache_ptr->mdj_enabled) { + if(cache_ptr->trans_num > 0) { /* remove the entry from the transaction list if it is there */ H5C__TRANS_DLL_REMOVE(entry_ptr, cache_ptr->tl_head_ptr, \ - cache_ptr->tl_tail_ptr, cache_ptr->tl_len, \ - cache_ptr->tl_size, FAIL); + cache_ptr->tl_tail_ptr, cache_ptr->tl_len, \ + cache_ptr->tl_size, FAIL); entry_ptr->last_trans = (uint64_t)0; - - H5C__UPDATE_RP_FOR_JOURNAL_WRITE_COMPLETE(cache_ptr, \ - entry_ptr, \ - FAIL) - } - } + H5C__UPDATE_RP_FOR_JOURNAL_WRITE_COMPLETE(cache_ptr, entry_ptr, FAIL) + } /* end if */ + } /* end if */ /* If we get this far, call H5C_flush_single_entry() with the * H5C__FLUSH_INVALIDATE_FLAG and the H5C__FLUSH_CLEAR_ONLY_FLAG. * This will clear the entry, and then delete it from the cache. */ - - result = H5C_flush_single_entry(f, - dxpl_id, - entry_ptr->type, - entry_ptr->addr, - H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, - TRUE); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, \ - "H5C_flush_single_entry() failed.") - } + if(H5C_flush_single_entry(f, dxpl_id, entry_ptr->type, entry_ptr->addr, + H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_flush_single_entry() failed.") done: - #if H5C_DO_EXTREME_SANITY_CHECKS - if ( H5C_validate_lru_list(cache_ptr) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "LRU sanity check failed.\n"); - } + if(H5C_validate_lru_list(cache_ptr) < 0) + HDONE_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU sanity check failed.\n") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_expunge_entry() */ @@ -1117,16 +1045,8 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) HDassert( ! ( cache_ptr->flush_in_progress ) ); - if ( cache_ptr->mdj_enabled ) { - - status = H5C_journal_pre_flush(cache_ptr); - - if ( status != SUCCEED ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "H5C_journal_pre_flush() failed.") - } - } + if(cache_ptr->mdj_enabled && H5C_journal_pre_flush(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "H5C_journal_pre_flush() failed.") cache_ptr->flush_in_progress = TRUE; @@ -1412,17 +1332,9 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) } - if ( cache_ptr->mdj_enabled ) { - - status = H5C_journal_post_flush(f, dxpl_id, cache_ptr, - (hbool_t)(flush_marked_entries == FALSE)); - - if ( status != SUCCEED ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "H5C_journal_post_flush() failed.") - } - } + if(cache_ptr->mdj_enabled && H5C_journal_post_flush(f, dxpl_id, cache_ptr, + (hbool_t)(flush_marked_entries == FALSE)) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "H5C_journal_post_flush() failed.") done: @@ -2036,8 +1948,7 @@ H5C_insert_entry(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( ( ! ( cache_ptr->mdj_enabled ) ) || - ( cache_ptr->trans_in_progress ) ); + HDassert( !(cache_ptr->mdj_enabled) || cache_ptr->trans_in_progress ); HDassert( type ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); @@ -2204,7 +2115,7 @@ H5C_insert_entry(H5F_t * f, } else { HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, \ - "duplicate entry in cache.") + "duplicate entry in cache, addr = %llu", (unsigned long long)addr) } } @@ -2690,19 +2601,10 @@ H5C_move_entry(H5C_t * cache_ptr, "Target entry is protected.") } - if ( ( entry_ptr->destroy_in_progress ) && - ( cache_ptr->mdj_enabled ) ) - { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "move on destroy when journaling is enabled.\n"); - } - - if ( ( entry_ptr->flush_in_progress ) && - ( cache_ptr->mdj_enabled ) ) - { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "move on flush when journaling is enabled.\n"); - } + if(entry_ptr->destroy_in_progress && cache_ptr->mdj_enabled) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "move on destroy when journaling is enabled.\n") + if(entry_ptr->flush_in_progress && cache_ptr->mdj_enabled) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "move on flush when journaling is enabled.\n") H5C__SEARCH_INDEX(cache_ptr, new_addr, test_entry_ptr, FAIL) @@ -2803,8 +2705,7 @@ H5C_move_entry(H5C_t * cache_ptr, */ H5C__UPDATE_TL_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr, FAIL); - H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, \ - had_jwip, FAIL); + H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, had_jwip, FAIL); } } @@ -3023,7 +2924,6 @@ H5C_protect(H5F_t * f, { H5C_t * cache_ptr; hbool_t hit; - hbool_t first_flush; hbool_t have_write_permitted = FALSE; hbool_t read_only = FALSE; hbool_t write_permitted; @@ -3124,7 +3024,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } } else { @@ -3132,7 +3031,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } HDassert( entry_ptr->size <= H5C_MAX_ENTRY_SIZE ); @@ -3203,10 +3101,8 @@ H5C_protect(H5F_t * f, * a previous version of the library. If this happens, we must * place the entry on the transaction list. */ - if ( entry_ptr->is_dirty ) { - + if(entry_ptr->is_dirty) H5C__INSERT_ENTRY_IN_TL(cache_ptr, entry_ptr, NULL); - } /* load the entry into the data structures used by the replacement * policy. We are just going to take it out again when we update @@ -3218,7 +3114,6 @@ H5C_protect(H5F_t * f, * just a simplified version of update for insertion that * avoids the problem. */ - H5C__UPDATE_RP_FOR_LOAD(cache_ptr, entry_ptr, NULL) } @@ -3282,7 +3177,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } } else { @@ -3290,7 +3184,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } } @@ -4539,13 +4432,12 @@ H5C_unprotect(H5F_t * f, } /* mark the entry as dirty if appropriate */ - if ( dirtied ) { - + if(dirtied) { entry_ptr->is_dirty = ( (entry_ptr->is_dirty) || dirtied ); entry_ptr->image_up_to_date = FALSE; H5C__UPDATE_TL_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr, FAIL) - } + } /* end if */ /* Pin or unpin the entry as requested. */ if ( pin_entry ) { @@ -4620,37 +4512,28 @@ H5C_unprotect(H5F_t * f, "hash table contains multiple entries for addr?!?.") } - if ( cache_ptr->mdj_enabled ) { - - /* if journaling is enabled, we have a bit of house keeping - * to do before we delete the entry. - * - * First, if a transaction is in progress, it is possible - * that the target entry is on the transaction list. If it is - * it must be removed before the flush destroy. - * - * Second, if the target entry is on the journal write in - * in progress list, it must be removed from that list as - * well. - */ - + /* if journaling is enabled, we have a bit of house keeping + * to do before we delete the entry. + * + * First, if a transaction is in progress, it is possible + * that the target entry is on the transaction list. If it is + * it must be removed before the flush destroy. + * + * Second, if the target entry is on the journal write in + * in progress list, it must be removed from that list as + * well. + */ + if(cache_ptr->mdj_enabled) { hbool_t entry_on_jwip_list = ( entry_ptr->last_trans != 0 ); - if ( cache_ptr->trans_in_progress ) { - - H5C__UPDATE_TL_FOR_ENTRY_CLEAR((cache_ptr), \ - (entry_ptr), \ - FAIL) - } - - if ( entry_on_jwip_list ) { + if(cache_ptr->trans_in_progress) + H5C__UPDATE_TL_FOR_ENTRY_CLEAR(cache_ptr, entry_ptr, FAIL) + if(entry_on_jwip_list) { entry_ptr->last_trans = 0; - H5C__UPDATE_RP_FOR_JOURNAL_WRITE_COMPLETE((cache_ptr), \ - (entry_ptr), \ - FAIL) - } - } + H5C__UPDATE_RP_FOR_JOURNAL_WRITE_COMPLETE(cache_ptr, entry_ptr, FAIL) + } /* end if */ + } /* end if */ if ( H5C_flush_single_entry(f, dxpl_id, @@ -5765,7 +5648,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, /* just skip the entry if it is dirty, as we can't do * anything with it now since we can't write. * - * Since all entries are clean, serialize() will no be called, + * Since all entries are clean, serialize() will not be called, * and thus we needn't test to see if the LRU has been changed * out from under us. */ @@ -6732,27 +6615,14 @@ done: * Attempts to flush a protected entry will result in an * error. * - * *first_flush_ptr should be true if only one - * flush is contemplated before the next load, or if this - * is the first of a sequence of flushes that will be - * completed before the next load. *first_flush_ptr is set - * to false if a flush actually takes place, and should be - * left false until the end of the sequence. - * - * The primary_dxpl_id is used if *first_flush_ptr is TRUE - * on entry, and a flush actually takes place. The - * secondary_dxpl_id is used in any subsequent flush where - * *first_flush_ptr is FALSE on entry. - * * If the H5C__FLUSH_INVALIDATE_FLAG flag is set, the entry will - * be cleared and not flushed -- in the case *first_flush_ptr, - * primary_dxpl_id, and secondary_dxpl_id are all irrelevent, - * and the call can't be part of a sequence of flushes. + * be cleared and not flushed, and the call can't be part of a + * sequence of flushes. * - * If the caller knows the address of the TBBT node at + * If the caller knows the address of the skip list node at * which the target entry resides, it can avoid a lookup * by supplying that address in the tgt_node_ptr parameter. - * If this parameter is NULL, the function will do a TBBT + * If this parameter is NULL, the function will do a skip list * search for the entry instead. * * The function does nothing silently if there is no entry @@ -7080,9 +6950,8 @@ H5C_flush_single_entry(const H5F_t * f, * scream incorrectly about flushing an entry with a pending * journal write. */ - if ( clear_only ) { + if(clear_only) H5C__UPDATE_TL_FOR_ENTRY_CLEAR(cache_ptr, entry_ptr, FAIL); - } /* We are either doing a flush or a clear. * @@ -7094,10 +6963,8 @@ H5C_flush_single_entry(const H5F_t * f, H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, FAIL) - if ( entry_ptr->in_slist ) - { + if(entry_ptr->in_slist) H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) - } } /* Clear the dirty flag only, if requested */ @@ -7154,8 +7021,7 @@ H5C_flush_single_entry(const H5F_t * f, * deallocate the old image, and allocate a new. */ if(serialize_flags & H5C__SERIALIZE_RESIZED_FLAG) { - H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, \ - entry_ptr, new_len) + H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_len) entry_ptr->size = new_len; entry_ptr->image_ptr = new_image_ptr; } /* end if */ @@ -7175,8 +7041,7 @@ H5C_flush_single_entry(const H5F_t * f, * cache data structures. */ if(serialize_flags & H5C__SERIALIZE_RESIZED_FLAG) { - H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, \ - entry_ptr, new_len) + H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_len) /* The replacement policy code thinks the * entry is already clean, so modify is_dirty @@ -7185,10 +7050,7 @@ H5C_flush_single_entry(const H5F_t * f, entry_ptr->is_dirty = FALSE; /* update the hash table for the size change*/ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE( \ - (cache_ptr), \ - (entry_ptr->size),\ - (new_len)); + H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_len); /* The entry can't be protected since we are * in the process of flushing it. Thus we must @@ -7196,9 +7058,7 @@ H5C_flush_single_entry(const H5F_t * f, * structures for the size change. The macro * deals with the pinned case. */ - H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, \ - entry_ptr, \ - new_len); + H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_len); /* The entry can't be in the slist, so no need * to update the slist for the size change. diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 9b744da..a6f2ae1 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -121,7 +121,7 @@ typedef struct H5C_t H5C_t; * * flags: Flags indicating class-specific behavior. * - * get_load_size: Pointer to the 'get load size' function. + * GET_LOAD_SIZE: Pointer to the 'get load size' function. * * This function must be able to determing the size of a disk image for * a metadata cache entry, given the 'udata' that will be passed to the @@ -154,7 +154,7 @@ typedef struct H5C_t H5C_t; * the value pointed to by the image_len_ptr. * * - * deserialize: Pointer to the deserialize function. + * DESERIALIZE: Pointer to the deserialize function. * * This function must be able to read an on disk image of a metadata * cache entry, allocate and load the equivalent in core representation, @@ -219,7 +219,7 @@ typedef struct H5C_t H5C_t; * update its on disk image length accordingly. * * - * image_len: Pointer to the image length callback. + * IMAGE_LEN: Pointer to the image length callback. * * In the best of all possible worlds, we would not have this callback. * It exists to allow clients to reduce the size of the on disk image of @@ -248,7 +248,7 @@ typedef struct H5C_t H5C_t; * the value pointed to by the image_len_ptr. * * - * serialize: Pointer to the serialize callback. + * SERIALIZE: Pointer to the serialize callback. * * The serialize callback is invoked by the metadata cache whenever * it needs a current on disk image of the metadata entry for purposes @@ -383,7 +383,7 @@ typedef struct H5C_t H5C_t; * routines. * * - * free_icr: Pointer to the free ICR Callback. + * FREE_ICR: Pointer to the free ICR Callback. * * The free ICR callback is invoked by the metadata cache when it * wishes to evict an entry, and needs the client to free the memory @@ -427,8 +427,8 @@ typedef void *(*H5C_deserialize_func_t)(const void *image_ptr, typedef herr_t (*H5C_image_len_func_t)(const void *thing, size_t *image_len_ptr); -#define H5C__SERIALIZE_RESIZED_FLAG 0x1 -#define H5C__SERIALIZE_MOVED_FLAG 0x2 +#define H5C__SERIALIZE_RESIZED_FLAG ((unsigned)0x1) +#define H5C__SERIALIZE_MOVED_FLAG ((unsigned)0x2) typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f, hid_t dxpl_id, @@ -443,9 +443,9 @@ typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f, typedef herr_t (*H5C_free_icr_func_t)(void *thing); -#define H5C__CLASS_NO_FLAGS_SET 0x0 -#define H5C__CLASS_SPECULATIVE_LOAD_FLAG 0x1 -#define H5C__CLASS_COMPRESSED_FLAG 0x2 +#define H5C__CLASS_NO_FLAGS_SET ((unsigned)0x0) +#define H5C__CLASS_SPECULATIVE_LOAD_FLAG ((unsigned)0x1) +#define H5C__CLASS_COMPRESSED_FLAG ((unsigned)0x2) typedef struct H5C_class_t { int id; @@ -1404,7 +1404,7 @@ H5_DLL herr_t H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags); H5_DLL herr_t H5C_flush_to_min_clean(H5F_t * f, - hid_t dxpl_id); + hid_t dxpl_id); H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr); diff --git a/src/H5F.c b/src/H5F.c index e563212..e12d6ed 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -936,7 +936,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) * The cache might be created with a different number of elements and * the access property list should be updated to reflect that. */ - if(H5AC_create(f, (H5AC_cache_config_t *)&(f->shared->mdc_initCacheCfg)) < 0) + if(H5AC_create(f, &(f->shared->mdc_initCacheCfg)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create metadata cache") /* Create the file's "open object" information */ @@ -3510,7 +3510,7 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr") /* Go get the resize configuration */ - if(H5AC_get_cache_auto_resize_config(file->shared->cache, (H5AC_cache_config_t *)config_ptr) < 0) + if(H5AC_get_cache_auto_resize_config(file->shared->cache, config_ptr) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_cache_auto_resize_config() failed.") done: @@ -3546,8 +3546,8 @@ H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) if(NULL == (file = H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - /* pass the resize configuration to the modified cache as well. */ - if(H5AC_set_cache_auto_resize_config(file->shared->cache, (H5AC_cache_config_t *)config_ptr) < 0) + /* set the resize configuration */ + if(H5AC_set_cache_auto_resize_config(file->shared->cache, config_ptr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "H5AC_set_cache_auto_resize_config() failed.") done: diff --git a/src/H5FScache.c b/src/H5FScache.c index 68addce..3ca73c7 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -303,7 +303,7 @@ done: static herr_t H5FS_cache_hdr_image_len(const void *_thing, size_t *image_len) { - H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to free space header */ + const H5FS_t *fspace = (const H5FS_t *)_thing; /* Pointer to free space header */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_hdr_image_len) @@ -755,7 +755,7 @@ done: static herr_t H5FS_cache_sinfo_image_len(const void *_thing, size_t *image_len) { - H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; + const H5FS_sinfo_t *sinfo = (const H5FS_sinfo_t *)_thing; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_sinfo_image_len) @@ -764,7 +764,7 @@ H5FS_cache_sinfo_image_len(const void *_thing, size_t *image_len) HDassert(image_len); /* Set the image length size */ - *image_len = sinfo->fspace->alloc_sect_size; + H5_ASSIGN_OVERFLOW(*image_len, sinfo->fspace->alloc_sect_size, hsize_t, size_t) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FS_cache_sinfo_image_len() */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 032ef48..53b173b 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -353,8 +353,8 @@ H5G_node_get_load_size(const void *_udata, size_t *image_len) * * Purpose: Deserialize the data structure from disk. * - * Return: Success: SUCCEED - * Failure: FAIL + * Return: Success: Ptr to the new node. + * Failure: NULL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -437,7 +437,7 @@ done: static herr_t H5G_node_image_len(const void *_thing, size_t *image_len) { - H5G_node_t *sym = (H5G_node_t *)_thing; /* Pointer to the Symbol Table node */ + const H5G_node_t *sym = (const H5G_node_t *)_thing; /* Pointer to the Symbol Table node */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_image_len) diff --git a/src/H5HFcache.c b/src/H5HFcache.c index ab44abe..679960d 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -51,6 +51,12 @@ #define H5HF_DBLOCK_VERSION 0 /* Direct block */ #define H5HF_IBLOCK_VERSION 0 /* Indirect block */ +/* Set speculative read size for header message */ +#define H5HF_SPEC_READ_SIZE(f) ( \ + H5HF_HDR_SIZE(H5F_SIZEOF_ADDR(f), H5F_SIZEOF_SIZE(f)) \ + + 50 \ +) + /******************/ /* Local Typedefs */ @@ -293,8 +299,8 @@ H5HF_cache_hdr_get_load_size(const void *_udata, size_t *image_len) * * Purpose: Deserialize the data structure from disk. * - * Return: Success: SUCCESS - * Failure: FAIL + * Return: Success: Pointer to a new fractal heap header + * Failure: NULL * * Programmer: Quincey Koziol * koziol@ncsa.uiuc.edu @@ -379,7 +385,7 @@ H5HF_cache_hdr_deserialize(const void *image, size_t UNUSED len, /* Check for I/O filter information to decode */ if(hdr->filter_len > 0) { - ptrdiff_t filter_info_off; /* Offset in header of filter information */ + ptrdiff_t filter_info_off; /* Offset in header of filter information */ size_t filter_info_size; /* Size of filter information */ H5O_pline_t *pline; /* Pipeline information from the header on disk */ @@ -545,8 +551,8 @@ H5HF_cache_hdr_serialize(const H5F_t *f, hid_t UNUSED dxpl_id, /* (bit 0: "huge" object IDs have wrapped) */ /* (bit 1: checksum direct blocks) */ heap_flags = 0; - heap_flags |= (hdr->huge_ids_wrapped ? H5HF_HDR_FLAGS_HUGE_ID_WRAPPED : 0); - heap_flags |= (hdr->checksum_dblocks ? H5HF_HDR_FLAGS_CHECKSUM_DBLOCKS : 0); + heap_flags = (uint8_t)(heap_flags | (hdr->huge_ids_wrapped ? H5HF_HDR_FLAGS_HUGE_ID_WRAPPED : 0)); + heap_flags = (uint8_t)(heap_flags | (hdr->checksum_dblocks ? H5HF_HDR_FLAGS_CHECKSUM_DBLOCKS : 0)); *p++ = heap_flags; /* "Huge" object information */ @@ -676,7 +682,6 @@ H5HF_cache_iblock_get_load_size(const void *_udata, size_t *image_len) * Purpose: Loads a fractal heap indirect block from the disk. * * Return: Success: Pointer to a new fractal heap indirect block - * * Failure: NULL * * Programmer: Quincey Koziol @@ -838,7 +843,7 @@ H5HF_cache_iblock_deserialize(const void *image, size_t UNUSED len, /* Allocate & initialize child indirect block pointer array */ if(NULL == (iblock->child_iblocks = H5FL_SEQ_CALLOC(H5HF_indirect_ptr_t, (size_t)(indir_rows * hdr->man_dtable.cparam.width)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for block entries") + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for block entries") } /* end if */ else iblock->child_iblocks = NULL; @@ -875,7 +880,7 @@ done: static herr_t H5HF_cache_iblock_image_len(const void *_thing, size_t *image_len) { - H5HF_indirect_t *iblock = (H5HF_indirect_t *)_thing; + const H5HF_indirect_t *iblock = (const H5HF_indirect_t *)_thing; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_iblock_image_len) @@ -1079,13 +1084,7 @@ H5HF_cache_dblock_get_load_size(const void *_udata, size_t *image_len) * associated in core representation of the fractal heap * direct block. * - * Note that this function is a heavily re-worked version - * of the old H5HF_cache_dblock_load() routine, which had - * to be replaced convert the fractal heap to use the new - * journaling version of the cache. - * * Return: Success: Pointer to a new fractal heap direct block - * * Failure: NULL * * Programmer: Quincey Koziol @@ -1248,6 +1247,10 @@ H5HF_cache_dblock_deserialize(const void *image, size_t len, void *_udata, ret_value = dblock; done: + if(!ret_value && dblock) + if(H5HF_man_dblock_dest(dblock) < 0) + HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap direct block") + FUNC_LEAVE_NOAPI(ret_value) } /* H5HF_cache_dblock_deserialize() */ @@ -1268,7 +1271,7 @@ done: static herr_t H5HF_cache_dblock_image_len(const void *_thing, size_t *image_len) { - H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; + const H5HF_direct_t *dblock = (const H5HF_direct_t *)_thing; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_dblock_image_len) @@ -1371,6 +1374,7 @@ H5HF_cache_dblock_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { + haddr_t new_dblock_addr = HADDR_UNDEF; /* New address for direct block */ H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ size_t nbytes; /* Number of bytes used */ unsigned filter_mask; /* Filter mask for block */ @@ -1415,22 +1419,17 @@ H5HF_cache_dblock_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") /* Allocate space for the compressed direct block */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + if(HADDR_UNDEF == (new_dblock_addr = H5MF_alloc(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") - *flags |= H5AC__SERIALIZE_RESIZED_FLAG; - *new_len = write_size; - /* Let the metadata cache know, if the block moved */ - if(!H5F_addr_eq(hdr->man_dtable.table_addr, addr)) { - *flags |= H5AC__SERIALIZE_MOVED_FLAG; - *new_addr = addr; - } /* end if */ + if(!H5F_addr_eq(addr, new_dblock_addr)) { + *new_addr = new_dblock_addr; + *flags |= H5AC__SERIALIZE_MOVED_FLAG; + } /* end if */ - /* Update information about compressed direct block's - * location & size - */ - hdr->man_dtable.table_addr = addr; + /* Update information about compressed direct block's location & size */ + hdr->man_dtable.table_addr = new_dblock_addr; hdr->pline_root_direct_size = write_size; /* Note that heap header was modified */ @@ -1468,22 +1467,17 @@ H5HF_cache_dblock_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") /* Allocate space for the compressed direct block */ - if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) + if(HADDR_UNDEF == (new_dblock_addr = H5MF_alloc(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block") - *flags |= H5AC__SERIALIZE_RESIZED_FLAG; - *new_len = write_size; - /* Let the metadata cache know, if the block moved */ - if(!H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)) { + if(!H5F_addr_eq(addr, new_dblock_addr)) { + *new_addr = new_dblock_addr; *flags |= H5AC__SERIALIZE_MOVED_FLAG; - *new_addr = addr; } /* end if */ - /* Update information about compressed direct - * block's location & size - */ - par_iblock->ents[par_entry].addr = addr; + /* Update information about compressed direct block's location & size */ + par_iblock->ents[par_entry].addr = new_dblock_addr; par_iblock->filt_ents[par_entry].size = write_size; /* Note that parent was modified */ @@ -1495,6 +1489,12 @@ H5HF_cache_dblock_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, if(H5HF_iblock_dirty(par_iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end else */ + + /* Let the metadata cache know, if the block changed size */ + if(len != write_size) { + *new_len = write_size; + *flags |= H5AC__SERIALIZE_RESIZED_FLAG; + } /* end if */ } /* end if */ else { write_buf = dblock->blk; diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index e8ecdb4..151ab7b 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -441,7 +441,7 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, dblock->blk_off_size); /* Allocate space for the free space markers */ - if(NULL == (marker = H5MM_calloc(dblock->size))) + if(NULL == (marker = (uint8_t *)H5MM_calloc(dblock->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Initialize the free space information for the heap */ diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 536df20..4adf07d 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -575,6 +575,7 @@ H5HF_man_dblock_locate(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t obj_off, HGOTO_ERROR(H5E_HEAP, H5E_CANTCOMPUTE, FAIL, "can't compute row & column of object") HDassert(row < iblock->nrows); /* child must be smaller than parent */ } /* end while */ + HDassert(obj_off >= iblock->block_off); /* Set return parameters */ if(ret_entry) diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index 073d2a9..1d18eba 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -446,7 +446,7 @@ H5HF_hdr_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) */ switch(cparam->id_len) { case 0: /* Set the length of heap IDs to just enough to hold the offset & length of 'normal' objects in the heap */ - hdr->id_len = 1 + hdr->heap_off_size + hdr->heap_len_size; + hdr->id_len = (unsigned)1 + hdr->heap_off_size + hdr->heap_len_size; break; case 1: /* Set the length of heap IDs to just enough to hold the information needed to directly access 'huge' objects in the heap */ @@ -1233,7 +1233,7 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) /* Walk backwards through entries, until we find one that has a child */ /* (Skip direct block that will be deleted, if we find it) */ - tmp_entry = curr_entry; + tmp_entry = (int)curr_entry; while(tmp_entry >= 0 && (H5F_addr_eq(iblock->ents[tmp_entry].addr, dblock_addr) || !H5F_addr_defined(iblock->ents[tmp_entry].addr))) @@ -1268,7 +1268,8 @@ H5HF_hdr_reverse_iter(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr) else { unsigned row; /* Row for entry */ - curr_entry = tmp_entry; + HDassert(tmp_entry >= 0); + curr_entry = (unsigned)tmp_entry; /* Check if entry is for a direct block */ row = curr_entry / hdr->man_dtable.cparam.width; diff --git a/src/H5HFman.c b/src/H5HFman.c index 6d7dcde..8700fa4 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -147,11 +147,12 @@ H5HF_man_insert(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t obj_size, const void *obj /* Lock direct block */ if(NULL == (dblock = H5HF_man_dblock_protect(hdr, dxpl_id, dblock_addr, dblock_size, sec_node->u.single.parent, sec_node->u.single.par_entry, H5AC_WRITE))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to load fractal heap direct block") + HDassert(dblock->parent == sec_node->u.single.parent); /* Insert object into block */ /* Get the offset of the object within the block */ - blk_off = sec_node->sect_info.addr - dblock->block_off; + blk_off = (size_t)(sec_node->sect_info.addr - dblock->block_off); /* Sanity checks */ HDassert(sec_node->sect_info.size >= obj_size); @@ -299,6 +300,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap direct block") } /* end if */ + HDassert(dblock->parent == iblock); /* Unlock indirect block */ if(H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) @@ -307,6 +309,7 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, } /* end else */ /* Compute offset of object within block */ + HDassert(obj_off >= dblock->block_off); HDassert((obj_off - dblock->block_off) < (hsize_t)dblock_size); blk_off = (size_t)(obj_off - dblock->block_off); diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index c741ed0..5662544 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -42,12 +42,6 @@ /* Package Private Macros */ /**************************/ -/* Set speculative read size for header message */ -#define H5HF_SPEC_READ_SIZE(f) ( \ - H5HF_HDR_SIZE(f) \ - + 50 \ -) - /* Size of signature information (on disk) */ #define H5HF_SIZEOF_MAGIC 4 @@ -67,13 +61,13 @@ ) /* Size of doubling-table information */ -#define H5HF_DTABLE_INFO_SIZE(h) ( \ +#define H5HF_DTABLE_INFO_SIZE(sizeof_addr, sizeof_size) ( \ 2 /* Width of table (i.e. # of columns) */ \ - + (h)->sizeof_size /* Starting block size */ \ - + (h)->sizeof_size /* Maximum direct block size */ \ + + sizeof_size /* Starting block size */ \ + + sizeof_size /* Maximum direct block size */ \ + 2 /* Max. size of heap (log2 of actual value - i.e. the # of bits) */ \ + 2 /* Starting # of rows in root indirect block */ \ - + (h)->sizeof_addr /* File address of table managed */ \ + + sizeof_addr /* File address of table managed */ \ + 2 /* Current # of rows in root indirect block */ \ ) @@ -82,7 +76,7 @@ #define H5HF_HDR_FLAGS_CHECKSUM_DBLOCKS 0x02 /* checksum direct blocks */ /* Size of fractal heap header */ -#define H5HF_HDR_SIZE(f) ( \ +#define H5HF_HDR_SIZE(sizeof_addr, sizeof_size) ( \ /* General metadata fields */ \ H5HF_METADATA_PREFIX_SIZE(TRUE) \ \ @@ -95,75 +89,37 @@ \ /* "Huge" object fields */ \ + 4 /* Max. size of "managed" object */ \ - + H5F_SIZEOF_SIZE(f) /* Next ID for "huge" object */ \ - + H5F_SIZEOF_ADDR(f) /* File address of "huge" object tracker B-tree */ \ + + sizeof_size /* Next ID for "huge" object */ \ + + sizeof_addr /* File address of "huge" object tracker B-tree */ \ \ /* "Managed" object free space fields */ \ - + H5F_SIZEOF_SIZE(f) /* Total man. free space */ \ - + H5F_SIZEOF_ADDR(f) /* File address of free section header */ \ + + sizeof_size /* Total man. free space */ \ + + sizeof_addr /* File address of free section header */ \ \ /* Statistics fields */ \ - + H5F_SIZEOF_SIZE(f) /* Size of man. space in heap */ \ - + H5F_SIZEOF_SIZE(f) /* Size of man. space iterator offset in heap */ \ - + H5F_SIZEOF_SIZE(f) /* Size of alloacted man. space in heap */ \ - + H5F_SIZEOF_SIZE(f) /* Number of man. objects in heap */ \ - + H5F_SIZEOF_SIZE(f) /* Size of huge space in heap */ \ - + H5F_SIZEOF_SIZE(f) /* Number of huge objects in heap */ \ - + H5F_SIZEOF_SIZE(f) /* Size of tiny space in heap */ \ - + H5F_SIZEOF_SIZE(f) /* Number of tiny objects in heap */ \ + + sizeof_size /* Size of man. space in heap */ \ + + sizeof_size /* Size of man. space iterator offset in heap */ \ + + sizeof_size /* Size of alloacted man. space in heap */ \ + + sizeof_size /* Number of man. objects in heap */ \ + + sizeof_size /* Size of huge space in heap */ \ + + sizeof_size /* Number of huge objects in heap */ \ + + sizeof_size /* Size of tiny space in heap */ \ + + sizeof_size /* Number of tiny objects in heap */ \ \ /* "Managed" object doubling table info */ \ - + 2 /* Width of table (i.e. # of columns) */ \ - + H5F_SIZEOF_SIZE(f) /* Starting block size */ \ - + H5F_SIZEOF_SIZE(f) /* Maximum direct block size */ \ - + 2 /* Max. size of heap (log2 of actual value - i.e. the # of bits) */ \ - + 2 /* Starting # of rows in root indirect block */ \ - + H5F_SIZEOF_ADDR(f) /* File address of table managed */ \ - + 2 /* Current # of rows in root indirect block */ \ + + H5HF_DTABLE_INFO_SIZE(sizeof_addr, sizeof_size) /* Size of managed obj. doubling-table info */ \ ) /* Size of the fractal heap header on disk */ /* (this is the fixed-len portion, the variable-len I/O filter information * follows this information, if there are I/O filters for the heap) */ -#define H5HF_HEADER_SIZE(h) ( \ - /* General metadata fields */ \ - H5HF_METADATA_PREFIX_SIZE(TRUE) \ - \ - /* Fractal Heap Header specific fields */ \ - \ - /* General heap information */ \ - + 2 /* Heap ID len */ \ - + 2 /* I/O filters' encoded len */ \ - + 1 /* Status flags */ \ - \ - /* "Huge" object fields */ \ - + 4 /* Max. size of "managed" object */ \ - + (h)->sizeof_size /* Next ID for "huge" object */ \ - + (h)->sizeof_addr /* File address of "huge" object tracker B-tree */ \ - \ - /* "Managed" object free space fields */ \ - + (h)->sizeof_size /* Total man. free space */ \ - + (h)->sizeof_addr /* File address of free section header */ \ - \ - /* Statistics fields */ \ - + (h)->sizeof_size /* Size of man. space in heap */ \ - + (h)->sizeof_size /* Size of man. space iterator offset in heap */ \ - + (h)->sizeof_size /* Size of alloacted man. space in heap */ \ - + (h)->sizeof_size /* Number of man. objects in heap */ \ - + (h)->sizeof_size /* Size of huge space in heap */ \ - + (h)->sizeof_size /* Number of huge objects in heap */ \ - + (h)->sizeof_size /* Size of tiny space in heap */ \ - + (h)->sizeof_size /* Number of tiny objects in heap */ \ - \ - /* "Managed" object doubling table info */ \ - + H5HF_DTABLE_INFO_SIZE(h) /* Size of managed obj. doubling-table info */ \ - ) +#define H5HF_HEADER_SIZE(h) H5HF_HDR_SIZE((h)->sizeof_addr, (h)->sizeof_size) /* Size of overhead for a direct block */ #define H5HF_MAN_ABS_DIRECT_OVERHEAD(h) ( \ /* General metadata fields */ \ - H5HF_METADATA_PREFIX_SIZE(h->checksum_dblocks) \ + (size_t)H5HF_METADATA_PREFIX_SIZE(h->checksum_dblocks) \ \ /* Fractal heap managed, absolutely mapped direct block specific fields */ \ + (h)->sizeof_addr /* File address of heap owning the block */ \ diff --git a/src/H5HGcache.c b/src/H5HGcache.c index 0b146eb..8ea4e96 100755 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -141,8 +141,8 @@ H5HG_get_load_size(const void *_udata, size_t *image_len) * * Purpose: Deserialize the data structure from disk. * - * Return: Success: SUCCESS - * Failure: FAIL + * Return: Success: Ptr to a global heap collection. + * Failure: NULL * * Programmer: Robb Matzke * Friday, March 27, 1998 diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 4f7a304..03f4c0d 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -152,13 +152,14 @@ const H5AC_class_t H5AC_LHEAP_DBLK[1] = {{ static herr_t H5HL_fl_deserialize(H5HL_t *heap, hsize_t free_block) { - H5HL_free_t *fl, *tail = NULL; /* Heap free block nodes */ + H5HL_free_t *fl = NULL, *tail = NULL; /* Heap free block nodes */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5HL_fl_deserialize) /* check arguments */ HDassert(heap); + HDassert(!heap->freelist); /* Build free list */ while(H5HL_FREE_NULL != free_block) { @@ -175,13 +176,6 @@ H5HL_fl_deserialize(H5HL_t *heap, hsize_t free_block) fl->prev = tail; fl->next = NULL; - /* Insert node into list */ - if(tail) - tail->next = fl; - tail = fl; - if(!heap->freelist) - heap->freelist = fl; - /* Decode offset of next free block */ p = heap->dblk_image + free_block; H5F_DECODE_LENGTH_LEN(p, free_block, heap->sizeof_size); @@ -192,9 +186,21 @@ H5HL_fl_deserialize(H5HL_t *heap, hsize_t free_block) H5F_DECODE_LENGTH_LEN(p, fl->size, heap->sizeof_size); if((fl->offset + fl->size) > heap->dblk_size) HGOTO_ERROR(H5E_HEAP, H5E_BADRANGE, FAIL, "bad heap free list") + + /* Append node onto list */ + if(tail) + tail->next = fl; + else + heap->freelist = fl; + tail = fl; + fl = NULL; } /* end while */ done: + if(ret_value < 0) + if(fl) + fl = H5FL_FREE(H5HL_free_t, fl); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5HL_fl_deserialize() */ @@ -278,8 +284,8 @@ H5HL_prfx_get_load_size(const void *_udata, size_t *image_len) * * Purpose: Deserialize the data structure from disk. * - * Return: Success: SUCCESS - * Failure: FAIL + * Return: Success: Ptr to a local heap prefix. + * Failure: NULL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -324,11 +330,11 @@ H5HL_prfx_deserialize(const void *image, size_t len, void *_udata, /* Allocate space in memory for the heap */ if(NULL == (heap = H5HL_new(udata->sizeof_size, udata->sizeof_addr, udata->sizeof_prfx))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate local heap structure") /* Allocate the heap prefix */ if(NULL == (prfx = H5HL_prfx_new(heap))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate local heap prefix") /* Store the prefix's address & length */ heap->prfx_addr = udata->prfx_addr; @@ -488,6 +494,11 @@ H5HL_prfx_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t UNUSED /* Serialize the free list into the heap data's image */ H5HL_fl_serialize(heap); + /* Set p to the start of the data block. This is necessary because + * there may be a gap between the used portion of the prefix and the + * data block due to alignment constraints. */ + p = (uint8_t *)image + heap->prfx_size; + /* Copy the heap data block into the cache image */ HDmemcpy(p, heap->dblk_image, heap->dblk_size); } /* end if */ @@ -570,8 +581,8 @@ H5HL_dblk_get_load_size(const void *_udata, size_t *image_len) * * Purpose: Deserialize the data structure from disk. * - * Return: Success: SUCCESS - * Failure: FAIL + * Return: Success: Ptr to a local heap data block. + * Failure: NULL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -585,7 +596,7 @@ H5HL_dblk_deserialize(const void *image, size_t UNUSED len, { H5HL_dblk_t *dblk = NULL; /* Local heap data block deserialized */ H5HL_cache_dblk_ud_t *udata = (H5HL_cache_dblk_ud_t *)_udata; /* User data for callback */ - H5HL_dblk_t *ret_value = NULL; /* Return value */ + H5HL_dblk_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5HL_dblk_deserialize) diff --git a/src/H5L.c b/src/H5L.c index 2302da6..c5d8d13 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -564,7 +564,7 @@ H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") done: - FUNC_LEAVE_API_META(ret_value); + FUNC_LEAVE_API_META(ret_value) } /* end H5Lcreate_ud() */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index e1dc382..7943684 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -66,14 +66,14 @@ /********************/ /* Metadata cache callbacks */ -static herr_t H5O_cache_get_load_size(const void *_udata, size_t *image_len); -static void *H5O_cache_deserialize(const void *image, size_t len, +static herr_t H5O_cache_prfx_get_load_size(const void *_udata, size_t *image_len); +static void *H5O_cache_prfx_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty); -static herr_t H5O_cache_image_len(const void *thing, size_t *image_len); -static herr_t H5O_cache_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, +static herr_t H5O_cache_prfx_image_len(const void *thing, size_t *image_len); +static herr_t H5O_cache_prfx_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t len, void *image, void *thing, unsigned *flags, haddr_t *new_addr, size_t *new_len, void **new_image); -static herr_t H5O_cache_free_icr(void *thing); +static herr_t H5O_cache_prfx_free_icr(void *thing); static herr_t H5O_cache_chk_get_load_size(const void *_udata, size_t *image_len); static void *H5O_cache_chk_deserialize(const void *image, size_t len, @@ -105,14 +105,14 @@ static herr_t H5O_add_cont_msg(H5O_cont_msgs_t *cont_msg_info, /* H5O object header prefix inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_OHDR[1] = {{ H5AC_OHDR_ID, - "object header", + "object header prefix", H5FD_MEM_OHDR, H5AC__CLASS_SPECULATIVE_LOAD_FLAG, - H5O_cache_get_load_size, - H5O_cache_deserialize, - H5O_cache_image_len, - H5O_cache_serialize, - H5O_cache_free_icr, + H5O_cache_prfx_get_load_size, + H5O_cache_prfx_deserialize, + H5O_cache_prfx_image_len, + H5O_cache_prfx_serialize, + H5O_cache_prfx_free_icr, }}; /* H5O object header chunk inherits cache-like properties from H5AC */ @@ -150,7 +150,7 @@ H5FL_SEQ_DEFINE(H5O_cont_t); /*------------------------------------------------------------------------- - * Function: H5O_cache_get_load_size + * Function: H5O_cache_prfx_get_load_size * * Purpose: Compute the size of the data structure on disk. * @@ -163,11 +163,11 @@ H5FL_SEQ_DEFINE(H5O_cont_t); *------------------------------------------------------------------------- */ static herr_t -H5O_cache_get_load_size(const void *_udata, size_t *image_len) +H5O_cache_prfx_get_load_size(const void *_udata, size_t *image_len) { const H5O_cache_ud_t *udata = (const H5O_cache_ud_t *)_udata; /* User data for callback */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cache_get_load_size) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cache_prfx_get_load_size) /* Check arguments */ HDassert(udata); @@ -177,11 +177,11 @@ H5O_cache_get_load_size(const void *_udata, size_t *image_len) *image_len = H5O_SPEC_READ_SIZE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_cache_get_load_size() */ +} /* end H5O_cache_prfx_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_deserialize + * Function: H5O_cache_prfx_deserialize * * Purpose: Deserializes an object header prefix + first chunk * @@ -195,7 +195,7 @@ H5O_cache_get_load_size(const void *_udata, size_t *image_len) *------------------------------------------------------------------------- */ static void * -H5O_cache_deserialize(const void *image, size_t len, void *_udata, +H5O_cache_prfx_deserialize(const void *image, size_t len, void *_udata, hbool_t *dirty) { H5O_t *oh = NULL; /* Object header info */ @@ -204,7 +204,7 @@ H5O_cache_deserialize(const void *image, size_t len, void *_udata, size_t prefix_size; /* Size of object header prefix */ H5O_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_cache_deserialize) + FUNC_ENTER_NOAPI_NOINIT(H5O_cache_prfx_deserialize) /* Check arguments */ HDassert(len > 0); @@ -362,11 +362,11 @@ done: HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header data") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cache_deserialize() */ +} /* end H5O_cache_prfx_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_image_len + * Function: H5O_cache_prfx_image_len * * Purpose: Compute the size of the data structure on disk. * @@ -379,11 +379,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_cache_image_len(const void *thing, size_t *image_len) +H5O_cache_prfx_image_len(const void *thing, size_t *image_len) { const H5O_t *oh = (const H5O_t *)thing; /* The object header */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cache_image_len) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cache_prfx_image_len) /* Check arguments */ HDassert(oh); @@ -396,11 +396,11 @@ H5O_cache_image_len(const void *thing, size_t *image_len) *image_len = oh->chunk[0].size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5O_cache_image_len() */ +} /* end H5O_cache_prfx_image_len() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_serialize + * Function: H5O_cache_prfx_serialize * * Purpose: Serializes an object header prefix+first chunk * @@ -413,7 +413,7 @@ H5O_cache_image_len(const void *thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5O_cache_serialize(const H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr, +H5O_cache_prfx_serialize(const H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr, size_t UNUSED len, void *image, void *_thing, unsigned *flags, haddr_t UNUSED *new_addr, size_t UNUSED *new_len, void UNUSED **new_image) { @@ -421,7 +421,7 @@ H5O_cache_serialize(const H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr, uint8_t *p; /* Pointer into raw data buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_cache_serialize, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5O_cache_prfx_serialize) /* check arguments */ HDassert(f); @@ -429,6 +429,10 @@ H5O_cache_serialize(const H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr, HDassert(oh); HDassert(flags); +#ifdef H5O_DEBUG +H5O_assert(oh); +#endif /* H5O_DEBUG */ + /* Get temporary pointer to chunk zero's buffer */ p = oh->chunk[0].image; @@ -442,8 +446,8 @@ H5O_cache_serialize(const H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr, HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); - /* Magic number */ - HDmemcpy(p, H5O_HDR_MAGIC, (size_t)H5O_SIZEOF_MAGIC); + /* Verify magic number */ + HDassert(!HDmemcmp(p, H5O_HDR_MAGIC, H5O_SIZEOF_MAGIC)); p += H5O_SIZEOF_MAGIC; /* Version */ @@ -528,11 +532,11 @@ H5O_cache_serialize(const H5F_t *f, hid_t UNUSED dxpl_id, haddr_t UNUSED addr, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_cache_serialize() */ +} /* H5O_cache_prfx_serialize() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_free_icr + * Function: H5O_cache_prfx_free_icr * * Purpose: Destroy/release an "in core representation" of a data * structure @@ -547,12 +551,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_cache_free_icr(void *thing) +H5O_cache_prfx_free_icr(void *thing) { H5O_t *oh = (H5O_t *)thing; /* Object header to destroy */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_cache_free_icr) + FUNC_ENTER_NOAPI_NOINIT(H5O_cache_prfx_free_icr) /* Check arguments */ HDassert(oh); @@ -564,7 +568,7 @@ H5O_cache_free_icr(void *thing) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5O_cache_free_icr() */ +} /* H5O_cache_prfx_free_icr() */ /*------------------------------------------------------------------------- @@ -632,7 +636,7 @@ H5O_cache_chk_deserialize(const void *image, size_t len, void *_udata, if(NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed") - /* Check if we are still decoding the object header */ + /* Check if we are still decoding the object header */ /* (as opposed to bringing a piece of it back from the file) */ if(udata->decoding) { /* Sanity check */ @@ -731,7 +735,7 @@ H5O_cache_chk_serialize(const H5F_t *f, hid_t UNUSED dxpl_id, H5O_chunk_proxy_t *chk_proxy = (H5O_chunk_proxy_t *)_thing; /* Pointer to the object header chunk proxy */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5O_cache_chk_serialize, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_serialize) /* check arguments */ HDassert(f); diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index be8a17d..a7f936e 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -216,10 +216,6 @@ H5P_facc_reg_prop(H5P_genclass_t *pclass) if(H5P_register(pclass, H5F_ACS_META_CACHE_INIT_CONFIG_NAME, H5F_ACS_META_CACHE_INIT_CONFIG_SIZE, &mdc_initCacheCfg, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the initial journaling configuration */ - if(H5P_register(pclass, H5F_ACS_JNL_INIT_CONFIG_NAME, H5F_ACS_JNL_INIT_CONFIG_SIZE, &initJnlCfg, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the size of raw data chunk cache (elements) */ if(H5P_register(pclass, H5F_ACS_DATA_CACHE_ELMT_SIZE_NAME, H5F_ACS_DATA_CACHE_ELMT_SIZE_SIZE, &rdcc_nelmts, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -288,6 +284,10 @@ H5P_facc_reg_prop(H5P_genclass_t *pclass) if(H5P_register(pclass, H5F_ACS_LATEST_FORMAT_NAME, H5F_ACS_LATEST_FORMAT_SIZE, &latest_format, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the initial journaling configuration */ + if(H5P_register(pclass, H5F_ACS_JNL_INIT_CONFIG_NAME, H5F_ACS_JNL_INIT_CONFIG_SIZE, &initJnlCfg, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_reg_prop() */ diff --git a/src/H5SMcache.c b/src/H5SMcache.c index f518399..9e41646 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -143,8 +143,8 @@ H5SM_table_get_load_size(const void *_udata, size_t *image_len) * * Purpose: Deserialize the data structure from disk. * - * Return: Success: SUCCEED - * Failure: FAIL + * Return: Success: Pointer to a new shared message master table + * Failure: NULL * * Programmer: James Laird * November 6, 2006 @@ -444,8 +444,8 @@ H5SM_list_get_load_size(const void *_udata, size_t *image_len) * * Purpose: Deserialize the data structure from disk. * - * Return: Success: SUCCEED - * Failure: FAIL + * Return: Success: Pointer to a new shared message list + * Failure: NULL * * Programmer: James Laird * November 6, 2006 diff --git a/test/cache.c b/test/cache.c index 80cfab3..b56888b 100644 --- a/test/cache.c +++ b/test/cache.c @@ -3391,8 +3391,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5C__NO_FLAGS_SET); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); if ( result < 0 ) { @@ -3403,8 +3402,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -3415,8 +3413,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_CLEAR_ONLY_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_CLEAR_ONLY_FLAG); if ( result < 0 ) { @@ -3428,8 +3425,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_MARKED_ENTRIES_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_MARKED_ENTRIES_FLAG); if ( result < 0 ) { @@ -5176,8 +5172,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -5409,8 +5404,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -5528,8 +5522,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -5556,8 +5550,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5574,8 +5568,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5635,8 +5629,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -5663,8 +5657,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -5681,8 +5675,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5739,8 +5733,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5757,8 +5751,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5817,8 +5811,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -5835,8 +5829,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5902,8 +5896,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5920,8 +5914,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -6019,8 +6013,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6037,8 +6031,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -6132,8 +6126,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6150,8 +6144,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -6243,8 +6237,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6261,8 +6255,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -6357,8 +6351,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6375,8 +6369,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6389,8 +6383,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6453,8 +6447,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6471,8 +6465,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -6485,8 +6479,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6548,8 +6542,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6566,8 +6560,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6580,8 +6574,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6643,8 +6637,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6661,8 +6655,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -6675,8 +6669,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6738,8 +6732,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6756,8 +6750,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6770,8 +6764,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6865,8 +6859,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6883,8 +6877,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6897,8 +6891,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -7004,8 +6998,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7032,8 +7026,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -7060,8 +7054,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7088,8 +7082,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -7106,8 +7100,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ TRUE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -7120,8 +7114,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ TRUE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -7134,8 +7128,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -7148,8 +7142,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -7215,8 +7209,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7243,8 +7237,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7271,8 +7265,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7299,8 +7293,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -7327,8 +7321,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7355,8 +7349,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -7373,8 +7367,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7387,8 +7381,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7401,8 +7395,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7415,8 +7409,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -7481,8 +7475,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7509,8 +7503,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7537,8 +7531,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7565,8 +7559,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE }, { @@ -7593,8 +7587,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7621,8 +7615,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -7639,8 +7633,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7653,8 +7647,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7667,8 +7661,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7681,8 +7675,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -7743,8 +7737,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7771,8 +7765,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7799,8 +7793,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -7817,8 +7811,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -7876,8 +7870,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7904,8 +7898,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7932,8 +7926,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -7950,8 +7944,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -8079,8 +8073,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8107,8 +8101,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8135,8 +8129,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8163,8 +8157,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8191,8 +8185,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8219,8 +8213,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8247,8 +8241,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8275,8 +8269,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8303,8 +8297,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8331,8 +8325,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -8349,8 +8343,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8363,8 +8357,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8377,8 +8371,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } @@ -8513,8 +8507,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8541,8 +8535,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8569,8 +8563,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8597,8 +8591,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8625,8 +8619,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8653,8 +8647,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8681,8 +8675,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8709,8 +8703,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8737,8 +8731,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8765,8 +8759,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -8783,8 +8777,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8797,8 +8791,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8811,8 +8805,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } @@ -8872,8 +8866,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8900,8 +8894,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8928,8 +8922,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8956,8 +8950,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8984,8 +8978,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -9002,8 +8996,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -9064,8 +9058,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9092,8 +9086,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9120,8 +9114,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9148,8 +9142,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9176,8 +9170,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } }, - /* expected_loaded = */ TRUE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -9194,8 +9188,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -9600,8 +9594,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -9871,15 +9864,15 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * (VET, 9) is pinned by (VET, 5), and (VET, 7) */ create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 1, - VARIABLE_ENTRY_TYPE, 0); + VARIABLE_ENTRY_TYPE, 0); create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 3, - VARIABLE_ENTRY_TYPE, 0); + VARIABLE_ENTRY_TYPE, 0); create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5, - VARIABLE_ENTRY_TYPE, 0); + VARIABLE_ENTRY_TYPE, 0); create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5, - VARIABLE_ENTRY_TYPE, 9); + VARIABLE_ENTRY_TYPE, 9); create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 7, - VARIABLE_ENTRY_TYPE, 9); + VARIABLE_ENTRY_TYPE, 9); /* Next, set up the flush operations: * @@ -9897,7 +9890,6 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 9) dirties (VET, 8) */ - add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0); add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__RESIZE, @@ -10806,8 +10798,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -12111,13 +12102,13 @@ check_flush_cache__single_entry(H5F_t * file_ptr) * This yields a total of 256 tests. * * The tests and their expected results are given in the spec table - * below. The values assigned to the expected_flushed, + * below. The values assigned to the expected_serialized, * and expected_destroyed fields are somewhat arcane, so the following * overview may be useful. * * In addition to simply checking to see if the test case runs, * we also check to see if the desired operations take place on the - * cache entry. Thus expected_flushed is set to TRUE if we + * cache entry. Thus expected_serialized is set to TRUE if we * we expect the entry to be flushed, and expected_destroyed is set * to TRUE if we expect the entry to be destroyed. * @@ -12594,8 +12585,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, /* clean up the cache to prep for the next test */ if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -12804,8 +12794,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, - H5C__FLUSH_INVALIDATE_FLAG); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -15842,8 +15831,7 @@ check_flush_protected_err(void) protect_entry(file_ptr, 0, 0); - if ( H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET) - >= 0 ) { + if ( H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET) >= 0 ) { pass = FALSE; failure_mssg = "flush succeeded on cache with protected entry.\n"; @@ -15852,8 +15840,7 @@ check_flush_protected_err(void) unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); - if ( H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET) - < 0 ) { + if ( H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET) < 0 ) { pass = FALSE; failure_mssg = "flush failed after unprotect.\n"; @@ -28256,7 +28243,6 @@ main(void) printf("\n"); } -#if 1 nerrs += smoke_check_1(); nerrs += smoke_check_2(); nerrs += smoke_check_3(); @@ -28267,10 +28253,8 @@ main(void) nerrs += smoke_check_8(); nerrs += smoke_check_9(); nerrs += smoke_check_10(); -#endif -#if 1 nerrs += write_permitted_check(); -#endif + /* for shorter tests, the overhead of using the core file driver doesn't * seem to allow us to realize any significant time saveings. Thus * set try_core_file_driver to FALSE for the remaining tests. diff --git a/test/cache_api.c b/test/cache_api.c index 7251cf7..9e5dd6b 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -148,7 +148,7 @@ check_fapl_mdc_api_calls(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; - result = H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch); + result = H5Pget_mdc_config(fapl_id, &scratch); if ( result < 0 ) { @@ -169,7 +169,7 @@ check_fapl_mdc_api_calls(void) if ( pass ) { - result = H5Pset_mdc_config(fapl_id, (H5AC_cache_config_t *)&mod_config); + result = H5Pset_mdc_config(fapl_id, &mod_config); if ( result < 0 ) { @@ -182,7 +182,7 @@ check_fapl_mdc_api_calls(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; - result = H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch); + result = H5Pget_mdc_config(fapl_id, &scratch); if ( result < 0 ) { @@ -294,7 +294,7 @@ check_fapl_mdc_api_calls(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; - result = H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch); + result = H5Pget_mdc_config(fapl_id, &scratch); if ( result < 0 ) { @@ -352,7 +352,7 @@ check_fapl_mdc_api_calls(void) if ( pass ) { - result = H5Pset_mdc_config(fapl_id, (H5AC_cache_config_t *)&mod_config); + result = H5Pset_mdc_config(fapl_id, &mod_config); if ( result < 0 ) { @@ -443,7 +443,7 @@ check_fapl_mdc_api_calls(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; - result = H5Pget_mdc_config(test_fapl_id, (H5AC_cache_config_t *)&scratch); + result = H5Pget_mdc_config(test_fapl_id, &scratch); if ( result < 0 ) { @@ -709,7 +709,7 @@ check_file_mdc_api_calls(void) /* set alternate config 1 */ if ( pass ) { - if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_1) < 0 ) { + if ( H5Fset_mdc_config(file_id, &mod_config_1) < 0 ) { pass = FALSE; failure_mssg = "H5Fset_mdc_config() failed 1.\n"; @@ -722,7 +722,7 @@ check_file_mdc_api_calls(void) /* set alternate config 2 */ if ( pass ) { - if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_2) < 0 ) { + if ( H5Fset_mdc_config(file_id, &mod_config_2) < 0 ) { pass = FALSE; failure_mssg = "H5Fset_mdc_config() failed 2.\n"; @@ -735,7 +735,7 @@ check_file_mdc_api_calls(void) /* set alternate config 3 */ if ( pass ) { - if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_3) < 0 ) { + if ( H5Fset_mdc_config(file_id, &mod_config_3) < 0 ) { pass = FALSE; failure_mssg = "H5Fset_mdc_config() failed 3.\n"; @@ -748,7 +748,7 @@ check_file_mdc_api_calls(void) /* set alternate config 4 */ if ( pass ) { - if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_4) < 0 ) { + if ( H5Fset_mdc_config(file_id, &mod_config_4) < 0 ) { pass = FALSE; failure_mssg = "H5Fset_mdc_config() failed 4.\n"; @@ -1049,7 +1049,7 @@ mdc_api_call_smoke_check(void) /* set alternate config 1 */ if ( pass ) { - if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_1) < 0 ) { + if ( H5Fset_mdc_config(file_id, &mod_config_1) < 0 ) { pass = FALSE; failure_mssg = "H5Fset_mdc_config() failed 1.\n"; @@ -1283,7 +1283,7 @@ mdc_api_call_smoke_check(void) /* set alternate config 2 */ if ( pass ) { - if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_2) < 0 ) { + if ( H5Fset_mdc_config(file_id, &mod_config_2) < 0 ) { pass = FALSE; failure_mssg = "H5Fset_mdc_config() failed 2.\n"; @@ -1434,7 +1434,7 @@ mdc_api_call_smoke_check(void) /* set alternate config 3 */ if ( pass ) { - if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_3) < 0 ) { + if ( H5Fset_mdc_config(file_id, &mod_config_3) < 0 ) { pass = FALSE; failure_mssg = "H5Fset_mdc_config() failed 3.\n"; @@ -3038,7 +3038,7 @@ check_fapl_mdc_api_errs(void) if ( pass ) { H5E_BEGIN_TRY { - result = H5Pget_mdc_config(-1, (H5AC_cache_config_t *)&scratch); + result = H5Pget_mdc_config(-1, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -3065,7 +3065,7 @@ check_fapl_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( ( pass ) && - ( ( H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch) < 0) || + ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0) || ( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) { pass = FALSE; @@ -3091,7 +3091,7 @@ check_fapl_mdc_api_errs(void) if ( pass ) { H5E_BEGIN_TRY { - result = H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch); + result = H5Pget_mdc_config(fapl_id, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -3109,7 +3109,7 @@ check_fapl_mdc_api_errs(void) if ( pass ) { H5E_BEGIN_TRY { - result = H5Pset_mdc_config(-1, (H5AC_cache_config_t *)&default_config); + result = H5Pset_mdc_config(-1, &default_config); } H5E_END_TRY; if ( result >= 0 ) { @@ -3136,7 +3136,7 @@ check_fapl_mdc_api_errs(void) while ( ( pass ) && ( i < NUM_INVALID_CONFIGS ) ) { H5E_BEGIN_TRY { - result = H5Pset_mdc_config(fapl_id, (H5AC_cache_config_t *)&(invalid_configs[i])); + result = H5Pset_mdc_config(fapl_id, &(invalid_configs[i])); } H5E_END_TRY; if ( result >= 0 ) { @@ -3154,7 +3154,7 @@ check_fapl_mdc_api_errs(void) */ scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( ( pass ) && - ( ( H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch) < 0 ) || + ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0 ) || ( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) { pass = FALSE; @@ -3260,7 +3260,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fget_mdc_config(-1, (H5AC_cache_config_t *)&scratch); + result = H5Fget_mdc_config(-1, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -3297,7 +3297,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fget_mdc_config(file_id, (H5AC_cache_config_t *)&scratch); + result = H5Fget_mdc_config(file_id, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -3319,7 +3319,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fset_mdc_config(-1, (H5AC_cache_config_t *)&default_config); + result = H5Fset_mdc_config(-1, &default_config); } H5E_END_TRY; if ( result >= 0 ) { @@ -3358,7 +3358,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&(invalid_configs[i])); + result = H5Fset_mdc_config(file_id, &(invalid_configs[i])); } H5E_END_TRY; if ( result >= 0 ) { diff --git a/test/cache_common.c b/test/cache_common.c index 60d231a..e1757af 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -22,11 +22,9 @@ #include -#include "H5private.h" - #include "h5test.h" -#include "H5Iprivate.h" #include "H5ACprivate.h" +#include "H5Iprivate.h" #include "H5MFprivate.h" #include "H5MMprivate.h" #include "cache_common.h" @@ -82,37 +80,37 @@ test_entry_t huge_entries[NUM_HUGE_ENTRIES]; test_entry_t monster_entries[NUM_MONSTER_ENTRIES]; test_entry_t variable_entries[NUM_VARIABLE_ENTRIES]; -static herr_t pico_get_load_size(const void * udata_ptr, size_t *image_len_ptr); -static herr_t nano_get_load_size(const void * udata_ptr, size_t *image_len_ptr); -static herr_t micro_get_load_size(const void * udata_ptr, size_t *image_len_ptr); -static herr_t tiny_get_load_size(const void * udata_ptr, size_t *image_len_ptr); -static herr_t small_get_load_size(const void * udata_ptr, size_t *image_len_ptr); -static herr_t medium_get_load_size(const void * udata_ptr, size_t *image_len_ptr); -static herr_t large_get_load_size(const void * udata_ptr, size_t *image_len_ptr); -static herr_t huge_get_load_size(const void * udata_ptr, size_t *image_len_ptr); -static herr_t monster_get_load_size(const void * udata_ptr, size_t *image_len_ptr); -static herr_t variable_get_load_size(const void * udata_ptr, size_t *image_len_ptr); - -static void * pico_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr); -static void * nano_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr); -static void * micro_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr); -static void * tiny_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr); -static void * small_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr); -static void * medium_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr); -static void * large_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr); -static void * huge_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr); -static void * monster_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr); -static void * variable_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr); +static herr_t pico_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t nano_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t micro_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t tiny_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t small_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t medium_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t large_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t huge_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t monster_get_load_size(const void *udata_ptr, size_t *image_len_ptr); +static herr_t variable_get_load_size(const void *udata_ptr, size_t *image_len_ptr); + +static void *pico_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *nano_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *micro_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *tiny_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *small_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *medium_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *large_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *huge_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *monster_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); +static void *variable_deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr); static herr_t pico_image_len(void *thing, size_t *image_len_ptr); static herr_t nano_image_len(void *thing, size_t *image_len_ptr); @@ -126,69 +124,61 @@ static herr_t monster_image_len(void *thing, size_t *image_len_ptr); static herr_t variable_image_len(void *thing, size_t *image_len_ptr); static herr_t pico_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, - size_t len, void * image_ptr, - void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr); + size_t len, void *image_ptr, void *thing, unsigned *flags_ptr, + haddr_t *new_addr_ptr, size_t *new_len_ptr, void **new_image_ptr_ptr); static herr_t nano_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, - size_t len, void * image_ptr, - void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr); + size_t len, void *image_ptr, void *thing, unsigned *flags_ptr, + haddr_t *new_addr_ptr, size_t *new_len_ptr, void **new_image_ptr_ptr); static herr_t micro_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, - size_t len, void * image_ptr, - void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr); + size_t len, void *image_ptr, void *thing, unsigned *flags_ptr, + haddr_t *new_addr_ptr, size_t *new_len_ptr, void **new_image_ptr_ptr); static herr_t tiny_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, - size_t len, void * image_ptr, - void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr); + size_t len, void *image_ptr, void *thing, unsigned *flags_ptr, + haddr_t *new_addr_ptr, size_t *new_len_ptr, void **new_image_ptr_ptr); static herr_t small_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, - size_t len, void * image_ptr, - void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr); + size_t len, void *image_ptr, void *thing, unsigned *flags_ptr, + haddr_t *new_addr_ptr, size_t *new_len_ptr, void **new_image_ptr_ptr); static herr_t medium_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, - size_t len, void * image_ptr, - void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr); + size_t len, void *image_ptr, void *thing, unsigned *flags_ptr, + haddr_t *new_addr_ptr, size_t *new_len_ptr, void **new_image_ptr_ptr); static herr_t large_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, - size_t len, void * image_ptr, - void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr); + size_t len, void *image_ptr, void *thing, unsigned *flags_ptr, + haddr_t *new_addr_ptr, size_t *new_len_ptr, void **new_image_ptr_ptr); static herr_t huge_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, - size_t len, void * image_ptr, - void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr); + size_t len, void *image_ptr, void *thing, unsigned *flags_ptr, + haddr_t *new_addr_ptr, size_t *new_len_ptr, void **new_image_ptr_ptr); static herr_t monster_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, - size_t len, void * image_ptr, - void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr); + size_t len, void *image_ptr, void *thing, unsigned *flags_ptr, + haddr_t *new_addr_ptr, size_t *new_len_ptr, void **new_image_ptr_ptr); static herr_t variable_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr, - size_t len, void * image_ptr, - void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr); - -static herr_t pico_free_icr(void * thing); -static herr_t nano_free_icr(void * thing); -static herr_t micro_free_icr(void * thing); -static herr_t tiny_free_icr(void * thing); -static herr_t small_free_icr(void * thing); -static herr_t medium_free_icr(void * thing); -static herr_t large_free_icr(void * thing); -static herr_t huge_free_icr(void * thing); -static herr_t monster_free_icr(void * thing); -static herr_t variable_free_icr(void * thing); - - -test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] = + size_t len, void *image_ptr, void *thing, unsigned *flags_ptr, + haddr_t *new_addr_ptr, size_t *new_len_ptr, void **new_image_ptr_ptr); + +static herr_t pico_free_icr(void *thing); +static herr_t nano_free_icr(void *thing); +static herr_t micro_free_icr(void *thing); +static herr_t tiny_free_icr(void *thing); +static herr_t small_free_icr(void *thing); +static herr_t medium_free_icr(void *thing); +static herr_t large_free_icr(void *thing); +static herr_t huge_free_icr(void *thing); +static herr_t monster_free_icr(void *thing); +static herr_t variable_free_icr(void *thing); + + +/* Generic callback routines */ +static herr_t get_load_size(const void *udata_ptr, size_t *image_len_ptr, + int32_t entry_type); +static void *deserialize(const void *image_ptr, size_t len, void *udata_ptr, + hbool_t *dirty_ptr, int32_t entry_type); +static herr_t image_len(void *thing, size_t *image_len_ptr, int32_t entry_type); +static herr_t serialize(haddr_t addr, size_t len, void *image_ptr, void *thing, + unsigned *flags_ptr, haddr_t *new_addr_ptr, size_t *new_len_ptr, + void **new_image_ptr_ptr, int32_t entry_type); +static herr_t free_icr(test_entry_t *entry, int32_t entry_type); + + +test_entry_t *entries[NUMBER_OF_ENTRY_TYPES] = { pico_entries, nano_entries, @@ -258,7 +248,7 @@ const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES] = VARIABLE_ALT_BASE_ADDR }; -const char * entry_type_names[NUMBER_OF_ENTRY_TYPES] = +const char *entry_type_names[NUMBER_OF_ENTRY_TYPES] = { "pico entries -- 1 B", "nano entries -- 4 B", @@ -389,28 +379,6 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = } }; -static herr_t get_load_size(const void * udata_ptr, - size_t *image_len_ptr); - -static void * deserialize(const void * image_ptr, - size_t len, - void * udata_ptr, - hbool_t * dirty_ptr); - -static herr_t image_len(void *thing, - size_t *image_len_ptr); - -static herr_t serialize(haddr_t addr, - size_t len, - void * image_ptr, - void * thing, - unsigned * flags_ptr, - haddr_t * new_addr_ptr, - size_t * new_len_ptr, - void ** new_image_ptr_ptr); - -static herr_t free_icr(test_entry_t *entry_ptr); - /* address translation funtions: */ @@ -429,8 +397,8 @@ static herr_t free_icr(test_entry_t *entry_ptr); */ void addr_to_type_and_index(haddr_t addr, - int32_t * type_ptr, - int32_t * index_ptr) + int32_t *type_ptr, + int32_t *index_ptr) { int i; int32_t type; @@ -489,6 +457,7 @@ addr_to_type_and_index(haddr_t addr, } /* addr_to_type_and_index() */ + /* Call back functions: */ @@ -513,9 +482,9 @@ addr_to_type_and_index(haddr_t addr, */ herr_t -check_write_permitted(const H5F_t UNUSED * f, +check_write_permitted(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, - hbool_t * write_permitted_ptr) + hbool_t *write_permitted_ptr) { HDassert( write_permitted_ptr ); @@ -540,90 +509,92 @@ check_write_permitted(const H5F_t UNUSED * f, *------------------------------------------------------------------------- */ static herr_t -get_load_size(const void * udata_ptr, size_t *image_len_ptr) +get_load_size(const void *udata, size_t *image_length, int32_t entry_type) { - haddr_t addr = *(const haddr_t *)udata_ptr; + test_entry_t *entry; + test_entry_t *base_addr; + haddr_t addr = *(const haddr_t *)udata; int32_t type; int32_t idx; - test_entry_t * entry_ptr; - test_entry_t * base_addr; addr_to_type_and_index(addr, &type, &idx); base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); + entry = &(base_addr[idx]); - HDassert( entry_ptr->type >= 0 ); - HDassert( entry_ptr->type < NUMBER_OF_ENTRY_TYPES ); - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->index >= 0 ); - HDassert( entry_ptr->index <= max_indices[type] ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->addr == addr ); + HDassert(entry->type >= 0); + HDassert(entry->type == type); + HDassert(entry->type == entry_type); + HDassert(entry->type < NUMBER_OF_ENTRY_TYPES); + HDassert(entry->index == idx); + HDassert(entry->index >= 0); + HDassert(entry->index <= max_indices[type]); + HDassert(entry == entry->self); + HDassert(entry->addr == addr); - *image_len_ptr = entry_ptr->size; + *image_length = entry->size; return(SUCCEED); } /* get_load_size() */ static herr_t -pico_get_load_size(const void *udata_ptr, size_t *image_len_ptr) +pico_get_load_size(const void *udata, size_t *image_length) { - return get_load_size(udata_ptr, image_len_ptr); + return get_load_size(udata, image_length, PICO_ENTRY_TYPE); } static herr_t -nano_get_load_size(const void *udata_ptr, size_t *image_len_ptr) +nano_get_load_size(const void *udata, size_t *image_length) { - return get_load_size(udata_ptr, image_len_ptr); + return get_load_size(udata, image_length, NANO_ENTRY_TYPE); } static herr_t -micro_get_load_size(const void *udata_ptr, size_t *image_len_ptr) +micro_get_load_size(const void *udata, size_t *image_length) { - return get_load_size(udata_ptr, image_len_ptr); + return get_load_size(udata, image_length, MICRO_ENTRY_TYPE); } static herr_t -tiny_get_load_size(const void *udata_ptr, size_t *image_len_ptr) +tiny_get_load_size(const void *udata, size_t *image_length) { - return get_load_size(udata_ptr, image_len_ptr); + return get_load_size(udata, image_length, TINY_ENTRY_TYPE); } static herr_t -small_get_load_size(const void *udata_ptr, size_t *image_len_ptr) +small_get_load_size(const void *udata, size_t *image_length) { - return get_load_size(udata_ptr, image_len_ptr); + return get_load_size(udata, image_length, SMALL_ENTRY_TYPE); } static herr_t -medium_get_load_size(const void *udata_ptr, size_t *image_len_ptr) +medium_get_load_size(const void *udata, size_t *image_length) { - return get_load_size(udata_ptr, image_len_ptr); + return get_load_size(udata, image_length, MEDIUM_ENTRY_TYPE); } static herr_t -large_get_load_size(const void *udata_ptr, size_t *image_len_ptr) +large_get_load_size(const void *udata, size_t *image_length) { - return get_load_size(udata_ptr, image_len_ptr); + return get_load_size(udata, image_length, LARGE_ENTRY_TYPE); } static herr_t -huge_get_load_size(const void *udata_ptr, size_t *image_len_ptr) +huge_get_load_size(const void *udata, size_t *image_length) { - return get_load_size(udata_ptr, image_len_ptr); + return get_load_size(udata, image_length, HUGE_ENTRY_TYPE); } static herr_t -monster_get_load_size(const void *udata_ptr, size_t *image_len_ptr) +monster_get_load_size(const void *udata, size_t *image_length) { - return get_load_size(udata_ptr, image_len_ptr); + return get_load_size(udata, image_length, MONSTER_ENTRY_TYPE); } static herr_t -variable_get_load_size(const void *udata_ptr, size_t *image_len_ptr) +variable_get_load_size(const void *udata, size_t *image_length) { - return get_load_size(udata_ptr, image_len_ptr); + return get_load_size(udata, image_length, VARIABLE_ENTRY_TYPE); } @@ -642,163 +613,135 @@ variable_get_load_size(const void *udata_ptr, size_t *image_len_ptr) *------------------------------------------------------------------------- */ static void * -deserialize(const void * image_ptr, size_t len, void *udata, hbool_t * dirty_ptr) +deserialize(const void *image, size_t len, void *udata, hbool_t *dirty, + int32_t entry_type) { + test_entry_t *entry; + test_entry_t *base_addr; haddr_t addr = *(haddr_t *)udata; int32_t type; int32_t idx; - test_entry_t * entry_ptr; - test_entry_t * base_addr; addr_to_type_and_index(addr, &type, &idx); base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); - - HDassert( entry_ptr->type >= 0 ); - HDassert( entry_ptr->type < NUMBER_OF_ENTRY_TYPES ); - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->index >= 0 ); - HDassert( entry_ptr->index <= max_indices[type] ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->size == len ); - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || - ( entry_ptr->size == entry_sizes[type] ) ); - HDassert( dirty_ptr != NULL ); - - /* for now *dirty_ptr will always be FALSE */ - *dirty_ptr = FALSE; - + entry = &(base_addr[idx]); + + HDassert(entry->type >= 0); + HDassert(entry->type == type); + HDassert(entry->type == entry_type); + HDassert(entry->type < NUMBER_OF_ENTRY_TYPES); + HDassert(entry->index == idx); + HDassert(entry->index >= 0); + HDassert(entry->index <= max_indices[type]); + HDassert(entry == entry->self); + HDassert(entry->addr == addr); + HDassert(entry->size == len); + HDassert((entry->type == VARIABLE_ENTRY_TYPE) || (entry->size == entry_sizes[type])); + HDassert(dirty != NULL); + + /* for now *dirty will always be FALSE */ + *dirty = FALSE; /* verify that the image contains the expected data. */ - HDassert( image_ptr != NULL ); - if ( ( ( entry_ptr->at_main_addr ) - && - ( entry_ptr->written_to_main_addr ) - ) - || - ( ( ! ( entry_ptr->at_main_addr ) ) - && - ( entry_ptr->written_to_alt_addr ) - ) - ) { - - if ( ( type == PICO_ENTRY_TYPE ) || ( type == VARIABLE_ENTRY_TYPE ) ) { - - if ( (*((const char *)image_ptr)) != (char)(idx & 0xFF) ) { - + HDassert(image != NULL); + if((entry->at_main_addr && entry->written_to_main_addr) || + (!entry->at_main_addr && entry->written_to_alt_addr)) { + if((type == PICO_ENTRY_TYPE) || (type == VARIABLE_ENTRY_TYPE)) { + if((*((const char *)image)) != (char)(idx & 0xFF)) { HDfprintf(stdout, "type = %d, idx = %d, addr = 0x%lx.\n", type, idx, (long)addr); - HDfprintf(stdout, "*image_ptr = 0x%x\n", - (int)(*((const char *)image_ptr))); - HDfprintf(stdout, "expected *image_ptr = 0x%x\n", + HDfprintf(stdout, "*image = 0x%x\n", + (int)(*((const char *)image))); + HDfprintf(stdout, "expected *image = 0x%x\n", (int)(idx & 0xFF)); - } - HDassert( (*((const char *)image_ptr)) == (char)(idx & 0xFF) ); - - } else { - - if ( (*(((const char *)image_ptr) + 2)) != (char)(idx & 0xFF) ) { - + } /* end if */ + HDassert((*((const char *)image)) == (char)(idx & 0xFF)); + } /* end if */ + else { + if((*(((const char *)image) + 2)) != (char)(idx & 0xFF)) { HDfprintf(stdout, "type = %d, idx = %d, addr = 0x%lx.\n", type, idx, (long)addr); - HDfprintf(stdout, "*image_ptr = 0x%x 0x%x 0x%x\n", - (int)(*((const char *)image_ptr)), - (int)(*(((const char *)image_ptr) + 1)), - (int)(*(((const char *)image_ptr) + 2))); - HDfprintf(stdout, "expected *image_ptr = 0x%x\n", + HDfprintf(stdout, "*image = 0x%x 0x%x 0x%x\n", + (int)(*((const char *)image)), + (int)(*(((const char *)image) + 1)), + (int)(*(((const char *)image) + 2))); + HDfprintf(stdout, "expected *image = 0x%x\n", (int)(idx & 0xFF), - (int)((idx & 0xFF00)>>8)); - } - HDassert( (*((const char *)image_ptr)) == (char)(type & 0xFF) ); - HDassert( (*(((const char *)image_ptr) + 1)) == - (char)((idx & 0xFF00)>>8) ); - HDassert( (*(((const char *)image_ptr) + 2)) == - (char)(idx & 0xFF) ); - - } - } - - entry_ptr->deserialized = TRUE; - - entry_ptr->header.is_dirty = FALSE; - entry_ptr->is_dirty = FALSE; - - (entry_ptr->deserializes)++; - - return((void *)entry_ptr); - + (int)((idx & 0xFF00) >> 8)); + } /* end if */ + HDassert((*((const char *)image)) == (char)(type & 0xFF)); + HDassert((*(((const char *)image) + 1)) == (char)((idx & 0xFF00) >> 8)); + HDassert((*(((const char *)image) + 2)) == (char)(idx & 0xFF)); + } /* end else */ + } /* end if */ + + entry->deserialized = TRUE; + entry->header.is_dirty = FALSE; + entry->is_dirty = FALSE; + (entry->deserializes)++; + + return((void *)entry); } /* deserialize() */ void * -pico_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr) +pico_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - return deserialize(image_ptr, len, udata_ptr, dirty_ptr); + return deserialize(image, len, udata, dirty, PICO_ENTRY_TYPE); } void * -nano_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr) +nano_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - return deserialize(image_ptr, len, udata_ptr, dirty_ptr); + return deserialize(image, len, udata, dirty, NANO_ENTRY_TYPE); } void * -micro_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr) +micro_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - return deserialize(image_ptr, len, udata_ptr, dirty_ptr); + return deserialize(image, len, udata, dirty, MICRO_ENTRY_TYPE); } void * -tiny_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr) +tiny_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - return deserialize(image_ptr, len, udata_ptr, dirty_ptr); + return deserialize(image, len, udata, dirty, TINY_ENTRY_TYPE); } void * -small_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr) +small_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - return deserialize(image_ptr, len, udata_ptr, dirty_ptr); + return deserialize(image, len, udata, dirty, SMALL_ENTRY_TYPE); } void * -medium_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr) +medium_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - return deserialize(image_ptr, len, udata_ptr, dirty_ptr); + return deserialize(image, len, udata, dirty, MEDIUM_ENTRY_TYPE); } void * -large_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr) +large_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - return deserialize(image_ptr, len, udata_ptr, dirty_ptr); + return deserialize(image, len, udata, dirty, LARGE_ENTRY_TYPE); } void * -huge_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr) +huge_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - return deserialize(image_ptr, len, udata_ptr, dirty_ptr); + return deserialize(image, len, udata, dirty, HUGE_ENTRY_TYPE); } void * -monster_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr) +monster_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - return deserialize(image_ptr, len, udata_ptr, dirty_ptr); + return deserialize(image, len, udata, dirty, MONSTER_ENTRY_TYPE); } void * -variable_deserialize(const void * image_ptr, size_t len, void * udata_ptr, - hbool_t * dirty_ptr) +variable_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - return deserialize(image_ptr, len, udata_ptr, dirty_ptr); + return deserialize(image, len, udata, dirty, VARIABLE_ENTRY_TYPE); } @@ -817,117 +760,101 @@ variable_deserialize(const void * image_ptr, size_t len, void * udata_ptr, * *------------------------------------------------------------------------- */ - herr_t -image_len(void *thing, size_t *image_len_ptr) +image_len(void *thing, size_t *image_length, int32_t entry_type) { + test_entry_t *entry; + test_entry_t *base_addr; int32_t type; int32_t idx; - test_entry_t * entry_ptr; - test_entry_t * base_addr; - HDassert( thing ); - HDassert( image_len_ptr ); + HDassert(thing); + HDassert(image_length); - entry_ptr = (test_entry_t *)thing; + entry = (test_entry_t *)thing; - HDassert( entry_ptr->self == entry_ptr ); + HDassert(entry->self == entry); - type = entry_ptr->type; - idx = entry_ptr->index; + type = entry->type; + idx = entry->index; - HDassert( ( type >= 0 ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( idx >= 0 ) && ( idx <= max_indices[type] ) ); + HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); + HDassert(type == entry_type); + HDassert((idx >= 0) && (idx <= max_indices[type])); base_addr = entries[type]; - HDassert( entry_ptr == &(base_addr[idx]) ); + HDassert(entry == &(base_addr[idx])); - if ( type != VARIABLE_ENTRY_TYPE ) { + if(type != VARIABLE_ENTRY_TYPE) + HDassert(entry->size == entry_sizes[type]); + else { + HDassert(entry->size <= entry_sizes[type]); + HDassert(entry->size > 0); + } /* end else */ - HDassert( entry_ptr->size == entry_sizes[type] ); - - } else { - - HDassert( entry_ptr->size <= entry_sizes[type] ); - HDassert( entry_ptr->size > 0 ); - } - - *image_len_ptr = entry_ptr->size; + *image_length = entry->size; return(SUCCEED); - } /* image_len() */ - herr_t -pico_image_len(void *thing, size_t *image_len_ptr) +pico_image_len(void *thing, size_t *image_length) { - HDassert( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); - return(image_len(thing, image_len_ptr)); + return image_len(thing, image_length, PICO_ENTRY_TYPE); } herr_t -nano_image_len(void *thing, size_t *image_len_ptr) +nano_image_len(void *thing, size_t *image_length) { - HDassert( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); - return(image_len(thing, image_len_ptr)); + return image_len(thing, image_length, NANO_ENTRY_TYPE); } herr_t -micro_image_len(void *thing, size_t *image_len_ptr) +micro_image_len(void *thing, size_t *image_length) { - HDassert( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); - return(image_len(thing, image_len_ptr)); + return image_len(thing, image_length, MICRO_ENTRY_TYPE); } herr_t -tiny_image_len(void *thing, size_t *image_len_ptr) +tiny_image_len(void *thing, size_t *image_length) { - HDassert( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); - return(image_len(thing, image_len_ptr)); + return image_len(thing, image_length, TINY_ENTRY_TYPE); } - herr_t -small_image_len(void *thing, size_t *image_len_ptr) +small_image_len(void *thing, size_t *image_length) { - HDassert( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); - return(image_len(thing, image_len_ptr)); + return image_len(thing, image_length, SMALL_ENTRY_TYPE); } herr_t -medium_image_len(void *thing, size_t *image_len_ptr) +medium_image_len(void *thing, size_t *image_length) { - HDassert( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); - return(image_len(thing, image_len_ptr)); + return image_len(thing, image_length, MEDIUM_ENTRY_TYPE); } herr_t -large_image_len(void *thing, size_t *image_len_ptr) +large_image_len(void *thing, size_t *image_length) { - HDassert( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); - return(image_len(thing, image_len_ptr)); + return image_len(thing, image_length, LARGE_ENTRY_TYPE); } herr_t -huge_image_len(void *thing, size_t *image_len_ptr) +huge_image_len(void *thing, size_t *image_length) { - HDassert( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); - return(image_len(thing, image_len_ptr)); + return image_len(thing, image_length, HUGE_ENTRY_TYPE); } herr_t -monster_image_len(void *thing, size_t *image_len_ptr) +monster_image_len(void *thing, size_t *image_length) { - HDassert( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); - return(image_len(thing, image_len_ptr)); + return image_len(thing, image_length, MONSTER_ENTRY_TYPE); } herr_t -variable_image_len(void *thing, size_t *image_len_ptr) +variable_image_len(void *thing, size_t *image_length) { - HDassert( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE ); - return(image_len(thing, image_len_ptr)); + return image_len(thing, image_length, VARIABLE_ENTRY_TYPE); } @@ -951,268 +878,218 @@ variable_image_len(void *thing, size_t *image_len_ptr) * *------------------------------------------------------------------------- */ - herr_t -serialize(haddr_t addr, size_t len, void * image_ptr, void * thing, - unsigned * flags_ptr, haddr_t * new_addr_ptr, size_t * new_len_ptr, - void ** new_image_ptr_ptr) +serialize(haddr_t addr, size_t len, void *image, void *thing, + unsigned *flags, haddr_t *new_addr, size_t *new_len, + void **new_image, int32_t entry_type) { - const char * fcn_name = "serialize()"; - hbool_t verbose = FALSE; - herr_t ret_val = SUCCEED; - int32_t i; + test_entry_t *entry; + test_entry_t *base_addr; int32_t type; int32_t idx; - test_entry_t * entry_ptr; - test_entry_t * base_addr; - - if ( verbose ) { - - HDfprintf(stdout, "%s: addr = 0x%lx, len = %ld.\n", fcn_name, - (long)addr, (long)len); - } + int32_t i; + herr_t ret_val = SUCCEED; - HDassert( image_ptr ); - HDassert( thing ); - HDassert( flags_ptr ); + HDassert(image); + HDassert(thing); + HDassert(flags); - *flags_ptr = 0; + *flags = 0; - HDassert( new_addr_ptr ); - HDassert( new_len_ptr ); - HDassert( new_image_ptr_ptr ); + HDassert(new_addr); + HDassert(new_len); + HDassert(new_image); - entry_ptr = (test_entry_t *)thing; + entry = (test_entry_t *)thing; - HDassert( entry_ptr->self == entry_ptr ); - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->size == len ); + HDassert(entry->self == entry); + HDassert(entry->addr == addr); + HDassert(entry->size == len); /* shouldn't serialize the entry unless it is dirty */ - HDassert( entry_ptr->is_dirty ); + HDassert(entry->is_dirty); - type = entry_ptr->type; - idx = entry_ptr->index; + type = entry->type; + idx = entry->index; - HDassert( ( type >= 0 ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( idx >= 0 ) && ( idx <= max_indices[type] ) ); + HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); + HDassert(type == entry_type); + HDassert((idx >= 0) && (idx <= max_indices[type])); base_addr = entries[type]; - HDassert( entry_ptr == &(base_addr[idx]) ); + HDassert(entry == &(base_addr[idx])); + HDassert(entry->num_flush_ops >= 0); + HDassert(entry->num_flush_ops < MAX_FLUSH_OPS); - HDassert( entry_ptr->num_flush_ops >= 0 ); - HDassert( entry_ptr->num_flush_ops < MAX_FLUSH_OPS ); - - if ( entry_ptr->num_flush_ops > 0 ) { - - for ( i = 0; i < entry_ptr->num_flush_ops; i++ ) - { - HDassert( entry_ptr->file_ptr ); + if(entry->num_flush_ops > 0) { + for(i = 0; i < entry->num_flush_ops; i++ ) { + HDassert(entry->file_ptr); - execute_flush_op(entry_ptr->file_ptr, - entry_ptr, - &((entry_ptr->flush_ops)[i]), - flags_ptr); - } - entry_ptr->num_flush_ops = 0; - entry_ptr->flush_op_self_resize_in_progress = FALSE; + execute_flush_op(entry->file_ptr, entry, + &((entry->flush_ops)[i]), flags); + } /* end for */ + entry->num_flush_ops = 0; + entry->flush_op_self_resize_in_progress = FALSE; - /* This looks wrong, but it isn't -- *flags_ptr will be modified + /* This looks wrong, but it isn't -- *flags will be modified * by execute_flush_op() only if the target is this entry -- * and the flags set will accumulate over the set of calls in * the for loop. */ - - if ( ( pass ) && - ( ((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) != 0 ) ) { - - /* re-allocate *image_ptr, and place the new pointer in - * *new_image_ptr_ptr. + if(pass && (((*flags) & H5C__SERIALIZE_RESIZED_FLAG) != 0)) { + /* re-allocate *image, and place the new pointer in + * *new_image. */ - image_ptr = H5MM_xfree(image_ptr); + image = H5MM_xfree(image); - if ( image_ptr != NULL ) { + HDassert(entry->type == VARIABLE_ENTRY_TYPE); + HDassert(entry->size > 0); + HDassert(entry->size <= VARIABLE_ENTRY_SIZE); + if(NULL == (image = H5MM_malloc((size_t)(entry->size)))) { ret_val = FAIL; pass = FALSE; - failure_mssg = "couldn't free image_ptr."; - } - - if ( pass ) { - - HDassert( entry_ptr->type == VARIABLE_ENTRY_TYPE ); - HDassert( entry_ptr->size > 0 ); - HDassert( entry_ptr->size <= VARIABLE_ENTRY_SIZE ); - - image_ptr = H5MM_malloc((size_t)(entry_ptr->size)); - - if ( image_ptr == NULL ) { - - ret_val = FAIL; - pass = FALSE; - failure_mssg = "couldn't allocate new image."; - - } else { - - *new_image_ptr_ptr = image_ptr; - *new_len_ptr = entry_ptr->size; - len = entry_ptr->size; - - } - } - } - - if ( ((*flags_ptr) & H5C__SERIALIZE_MOVED_FLAG) != 0 ) { - - HDassert( ((*flags_ptr) | H5C__SERIALIZE_RESIZED_FLAG) != 0 ); - - /* place the new address in *new_addr_ptr */ - - *new_addr_ptr = entry_ptr->addr; - } - } + failure_mssg = "couldn't allocate new image."; + } /* end if */ + else { + *new_image = image; + *new_len = entry->size; + len = entry->size; + } /* end else */ + } /* end if */ + + if(((*flags) & H5C__SERIALIZE_MOVED_FLAG) != 0) { + HDassert(((*flags) | H5C__SERIALIZE_RESIZED_FLAG) != 0); + + /* place the new address in *new_addr */ + *new_addr = entry->addr; + } /* end if */ + } /* end if */ /* null out the image to avoid spurious failures */ - HDmemset(image_ptr, 0, len); - - if ( ( type == PICO_ENTRY_TYPE ) || ( type == VARIABLE_ENTRY_TYPE ) ) { - - HDassert( entry_ptr->size >= PICO_ENTRY_SIZE ); - *((char *)image_ptr) = (char)((entry_ptr->index) & 0xFF); - - } else { - - HDassert(entry_ptr->size >= NANO_ENTRY_SIZE ); - *((char *)image_ptr) = (char)((entry_ptr->type) & 0xFF); - *(((char *)image_ptr) + 1) = - (char)(((entry_ptr->index) & 0xFF00) >> 8); - *(((char *)image_ptr) + 2) = (char)((entry_ptr->index) & 0xFF); - - } + HDmemset(image, 0, len); + + if((type == PICO_ENTRY_TYPE) || (type == VARIABLE_ENTRY_TYPE)) { + HDassert(entry->size >= PICO_ENTRY_SIZE); + *((char *)image) = (char)((entry->index) & 0xFF); + } /* end if */ + else { + HDassert(entry->size >= NANO_ENTRY_SIZE); + *((char *)image) = (char)((entry->type) & 0xFF); + *(((char *)image) + 1) = (char)(((entry->index) & 0xFF00) >> 8); + *(((char *)image) + 2) = (char)((entry->index) & 0xFF); + } /* end else */ /* We no longer do the actual write through an callback -- this is * as close to that callback as we will get. Hence mark the entry * clean here. If all goes well, it will be flushed shortly. */ - - entry_ptr->is_dirty = FALSE; + entry->is_dirty = FALSE; /* since the entry is about to be written to disk, we can mark it * as initialized. */ - if ( entry_ptr->at_main_addr ) { - entry_ptr->written_to_main_addr = TRUE; - } else { - entry_ptr->written_to_alt_addr = TRUE; - } + if(entry->at_main_addr) + entry->written_to_main_addr = TRUE; + else + entry->written_to_alt_addr = TRUE; /* do book keeping */ - (entry_ptr->serializes)++; - entry_ptr->serialized = TRUE; + (entry->serializes)++; + entry->serialized = TRUE; return(SUCCEED); - } /* serialize() */ herr_t pico_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - size_t len, void * image_ptr, void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, void ** new_image_ptr_ptr) + size_t len, void *image, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - HDassert( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); - return(serialize(addr, len, image_ptr, thing, flags_ptr, - new_addr_ptr, new_len_ptr, new_image_ptr_ptr)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, PICO_ENTRY_TYPE); } herr_t nano_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - size_t len, void * image_ptr, void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, void ** new_image_ptr_ptr) + size_t len, void *image, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - HDassert( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); - return(serialize(addr, len, image_ptr, thing, flags_ptr, - new_addr_ptr, new_len_ptr, new_image_ptr_ptr)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, NANO_ENTRY_TYPE); } herr_t micro_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - size_t len, void * image_ptr, void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, void ** new_image_ptr_ptr) + size_t len, void *image, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - HDassert( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); - return(serialize(addr, len, image_ptr, thing, flags_ptr, - new_addr_ptr, new_len_ptr, new_image_ptr_ptr)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, MICRO_ENTRY_TYPE); } herr_t tiny_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - size_t len, void * image_ptr, void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, void ** new_image_ptr_ptr) + size_t len, void *image, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - HDassert( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); - return(serialize(addr, len, image_ptr, thing, flags_ptr, - new_addr_ptr, new_len_ptr, new_image_ptr_ptr)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, TINY_ENTRY_TYPE); } herr_t small_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - size_t len, void * image_ptr, void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, void ** new_image_ptr_ptr) + size_t len, void *image, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - HDassert( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); - return(serialize(addr, len, image_ptr, thing, flags_ptr, - new_addr_ptr, new_len_ptr, new_image_ptr_ptr)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, SMALL_ENTRY_TYPE); } herr_t medium_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - size_t len, void * image_ptr, void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, void ** new_image_ptr_ptr) + size_t len, void *image, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - HDassert( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); - return(serialize(addr, len, image_ptr, thing, flags_ptr, - new_addr_ptr, new_len_ptr, new_image_ptr_ptr)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, MEDIUM_ENTRY_TYPE); } herr_t large_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - size_t len, void * image_ptr, void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, void ** new_image_ptr_ptr) + size_t len, void *image, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - HDassert( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); - return(serialize(addr, len, image_ptr, thing, flags_ptr, - new_addr_ptr, new_len_ptr, new_image_ptr_ptr)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, LARGE_ENTRY_TYPE); } herr_t huge_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - size_t len, void * image_ptr, void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, void ** new_image_ptr_ptr) + size_t len, void *image, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - HDassert( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); - return(serialize(addr, len, image_ptr, thing, flags_ptr, - new_addr_ptr, new_len_ptr, new_image_ptr_ptr)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, HUGE_ENTRY_TYPE); } herr_t monster_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - size_t len, void * image_ptr, void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, void ** new_image_ptr_ptr) + size_t len, void *image, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - HDassert( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); - return(serialize(addr, len, image_ptr, thing, flags_ptr, - new_addr_ptr, new_len_ptr, new_image_ptr_ptr)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, MONSTER_ENTRY_TYPE); } herr_t variable_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - size_t len, void * image_ptr, void * thing, unsigned * flags_ptr, - haddr_t * new_addr_ptr, size_t * new_len_ptr, void ** new_image_ptr_ptr) + size_t len, void *image, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - HDassert( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE ); - return(serialize(addr, len, image_ptr, thing, flags_ptr, - new_addr_ptr, new_len_ptr, new_image_ptr_ptr)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, VARIABLE_ENTRY_TYPE); } @@ -1238,171 +1115,127 @@ variable_serialize(const H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, * *------------------------------------------------------------------------- */ - herr_t -free_icr(test_entry_t *entry_ptr) +free_icr(test_entry_t *entry, int32_t entry_type) { - test_entry_t * base_addr; + test_entry_t *base_addr; - HDassert( entry_ptr ); + HDassert(entry); - base_addr = entries[entry_ptr->type]; + base_addr = entries[entry->type]; - HDassert( entry_ptr->index >= 0 ); - HDassert( entry_ptr->index <= max_indices[entry_ptr->type] ); - HDassert( entry_ptr == &(base_addr[entry_ptr->index]) ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->cache_ptr != NULL ); - HDassert( entry_ptr->cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( ( entry_ptr->header.destroy_in_progress ) || - ( entry_ptr->header.addr == entry_ptr->addr ) ); - HDassert( entry_ptr->header.size == entry_ptr->size ); - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || - ( entry_ptr->size == entry_sizes[entry_ptr->type] ) ); - - if ( entry_ptr->num_pins > 0 ) { - int i; + HDassert(entry->type == entry_type); + HDassert(entry->index >= 0); + HDassert(entry->index <= max_indices[entry->type]); + HDassert(entry == &(base_addr[entry->index])); + HDassert(entry == entry->self); + HDassert(entry->cache_ptr != NULL); + HDassert(entry->cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert((entry->header.destroy_in_progress) || + (entry->header.addr == entry->addr)); + HDassert(entry->header.size == entry->size); + HDassert((entry->type == VARIABLE_ENTRY_TYPE) || + (entry->size == entry_sizes[entry->type])); - for ( i = 0; i < entry_ptr->num_pins; i++ ) { - test_entry_t * pinned_entry_ptr; - test_entry_t * pinned_base_addr; + if(entry->num_pins > 0) { + int i; - pinned_base_addr = entries[entry_ptr->pin_type[i]]; - pinned_entry_ptr = &(pinned_base_addr[entry_ptr->pin_idx[i]]); + for(i = 0; i < entry->num_pins; i++) { + test_entry_t *pinned_entry; + test_entry_t *pinned_base_addr; - HDassert( 0 <= pinned_entry_ptr->type ); - HDassert( pinned_entry_ptr->type < NUMBER_OF_ENTRY_TYPES ); - HDassert( pinned_entry_ptr->type == entry_ptr->pin_type[i] ); - HDassert( pinned_entry_ptr->index >= 0 ); - HDassert( pinned_entry_ptr->index <= - max_indices[pinned_entry_ptr->type] ); - HDassert( pinned_entry_ptr->index == entry_ptr->pin_idx[i] ); - HDassert( pinned_entry_ptr == pinned_entry_ptr->self ); - HDassert( pinned_entry_ptr->header.is_pinned ); - HDassert( pinned_entry_ptr->is_pinned ); - HDassert( pinned_entry_ptr->pinning_ref_count > 0 ); + pinned_base_addr = entries[entry->pin_type[i]]; + pinned_entry = &(pinned_base_addr[entry->pin_idx[i]]); - pinned_entry_ptr->pinning_ref_count--; + HDassert(0 <= pinned_entry->type); + HDassert(pinned_entry->type < NUMBER_OF_ENTRY_TYPES); + HDassert(pinned_entry->type == entry->pin_type[i]); + HDassert(pinned_entry->index >= 0); + HDassert(pinned_entry->index <= max_indices[pinned_entry->type]); + HDassert(pinned_entry->index == entry->pin_idx[i]); + HDassert(pinned_entry == pinned_entry->self); + HDassert(pinned_entry->header.is_pinned); + HDassert(pinned_entry->is_pinned); + HDassert(pinned_entry->pinning_ref_count > 0); - if ( pinned_entry_ptr->pinning_ref_count <= 0 ) { + pinned_entry->pinning_ref_count--; - HDassert( pinned_entry_ptr->file_ptr ); + if(pinned_entry->pinning_ref_count <= 0) { + HDassert(pinned_entry->file_ptr); - unpin_entry(pinned_entry_ptr->type, - pinned_entry_ptr->index); - } + unpin_entry(pinned_entry->type, pinned_entry->index); + } /* end if */ - entry_ptr->pin_type[i] = -1; - entry_ptr->pin_idx[i] = -1; - } - entry_ptr->num_pins = 0; - } + entry->pin_type[i] = -1; + entry->pin_idx[i] = -1; + } /* end if */ + entry->num_pins = 0; + } /* end if */ - entry_ptr->destroyed = TRUE; - entry_ptr->cache_ptr = NULL; + entry->destroyed = TRUE; + entry->cache_ptr = NULL; return(SUCCEED); - } /* free_icr() */ herr_t -pico_free_icr(void * thing) +pico_free_icr(void *thing) { - test_entry_t * entry_ptr = (test_entry_t *)thing; - - HDassert( entry_ptr->type == PICO_ENTRY_TYPE ); - - return(free_icr(entry_ptr)); + return free_icr((test_entry_t *)thing, PICO_ENTRY_TYPE); } herr_t -nano_free_icr(void * thing) +nano_free_icr(void *thing) { - test_entry_t * entry_ptr = (test_entry_t *)thing; - - HDassert( entry_ptr->type == NANO_ENTRY_TYPE ); - - return(free_icr(entry_ptr)); + return free_icr((test_entry_t *)thing, NANO_ENTRY_TYPE); } herr_t -micro_free_icr(void * thing) +micro_free_icr(void *thing) { - test_entry_t * entry_ptr = (test_entry_t *)thing; - - HDassert( entry_ptr->type == MICRO_ENTRY_TYPE ); - - return(free_icr(entry_ptr)); + return free_icr((test_entry_t *)thing, MICRO_ENTRY_TYPE); } herr_t -tiny_free_icr(void * thing) +tiny_free_icr(void *thing) { - test_entry_t * entry_ptr = (test_entry_t *)thing; - - HDassert( entry_ptr->type == TINY_ENTRY_TYPE ); - - return(free_icr(entry_ptr)); + return free_icr((test_entry_t *)thing, TINY_ENTRY_TYPE); } herr_t -small_free_icr(void * thing) +small_free_icr(void *thing) { - test_entry_t * entry_ptr = (test_entry_t *)thing; - - HDassert( entry_ptr->type == SMALL_ENTRY_TYPE ); - - return(free_icr(entry_ptr)); + return free_icr((test_entry_t *)thing, SMALL_ENTRY_TYPE); } herr_t -medium_free_icr(void * thing) +medium_free_icr(void *thing) { - test_entry_t * entry_ptr = (test_entry_t *)thing; - - HDassert( entry_ptr->type == MEDIUM_ENTRY_TYPE ); - - return(free_icr(entry_ptr)); + return free_icr((test_entry_t *)thing, MEDIUM_ENTRY_TYPE); } herr_t -large_free_icr(void * thing) +large_free_icr(void *thing) { - test_entry_t * entry_ptr = (test_entry_t *)thing; - - HDassert( entry_ptr->type == LARGE_ENTRY_TYPE ); - - return(free_icr(entry_ptr)); + return free_icr((test_entry_t *)thing, LARGE_ENTRY_TYPE); } herr_t -huge_free_icr(void * thing) +huge_free_icr(void *thing) { - test_entry_t * entry_ptr = (test_entry_t *)thing; - - HDassert( entry_ptr->type == HUGE_ENTRY_TYPE ); - - return(free_icr(entry_ptr)); + return free_icr((test_entry_t *)thing, HUGE_ENTRY_TYPE); } herr_t -monster_free_icr(void * thing) +monster_free_icr(void *thing) { - test_entry_t * entry_ptr = (test_entry_t *)thing; - - HDassert( entry_ptr->type == MONSTER_ENTRY_TYPE ); - - return(free_icr(entry_ptr)); + return free_icr((test_entry_t *)thing, MONSTER_ENTRY_TYPE); } herr_t -variable_free_icr(void * thing) +variable_free_icr(void *thing) { - test_entry_t * entry_ptr = (test_entry_t *)thing; - - HDassert( entry_ptr->type == VARIABLE_ENTRY_TYPE ); - - return(free_icr(entry_ptr)); + return free_icr((test_entry_t *)thing, VARIABLE_ENTRY_TYPE); } @@ -1719,37 +1552,29 @@ execute_flush_op(H5F_t * file_ptr, break; case FLUSH_OP__MOVE: - if ( ( entry_ptr->type == op_ptr->type ) && - ( entry_ptr->index == op_ptr->idx ) ) { + if((entry_ptr->type == op_ptr->type) && + (entry_ptr->index == op_ptr->idx)) { /* the flush operation is acting on the entry to * which it is attached. Handle this here: */ - HDassert( ((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) - != 0 ); - + HDassert(((*flags_ptr) & H5C__SERIALIZE_RESIZED_FLAG) != 0); (*flags_ptr) |= H5C__SERIALIZE_MOVED_FLAG; - if ( op_ptr->flag ) { - - HDassert( entry_ptr->addr == entry_ptr->alt_addr ); + if(op_ptr->flag) { + HDassert(entry_ptr->addr == entry_ptr->alt_addr); entry_ptr->addr = entry_ptr->main_addr; entry_ptr->at_main_addr = TRUE; - - } else { - - HDassert( entry_ptr->addr == entry_ptr->main_addr ); + } /* end if */ + else { + HDassert(entry_ptr->addr == entry_ptr->main_addr); entry_ptr->addr = entry_ptr->alt_addr; entry_ptr->at_main_addr = FALSE; - - } - - } else { - - move_entry(cache_ptr, op_ptr->type, op_ptr->idx, - op_ptr->flag); - } + } /* end else */ + } /* end if */ + else + move_entry(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); break; default: @@ -2495,35 +2320,6 @@ setup_cache(size_t max_cache_size, saved_fid = -1; -#if 0 /* This debugging code is useful from time to time -- keep it for now */ - HDfprintf(stdout, "PICO_BASE_ADDR = 0x%lx, PICO_ALT_BASE_ADDR = 0x%lx.\n", - (long)PICO_BASE_ADDR, (long)PICO_ALT_BASE_ADDR); - HDfprintf(stdout, "NANO_BASE_ADDR = 0x%lx, NANO_ALT_BASE_ADDR = 0x%lx.\n", - (long)NANO_BASE_ADDR, (long)NANO_ALT_BASE_ADDR); - HDfprintf(stdout, - "MICRO_BASE_ADDR = 0x%lx, MICRO_ALT_BASE_ADDR = 0x%lx.\n", - (long)MICRO_BASE_ADDR, (long)MICRO_ALT_BASE_ADDR); - HDfprintf(stdout, "TINY_BASE_ADDR = 0x%lx, TINY_ALT_BASE_ADDR = 0x%lx.\n", - (long)TINY_BASE_ADDR, (long)TINY_ALT_BASE_ADDR); - HDfprintf(stdout, - "SMALL_BASE_ADDR = 0x%lx, SMALL_ALT_BASE_ADDR = 0x%lx.\n", - (long)SMALL_BASE_ADDR, (long)SMALL_ALT_BASE_ADDR); - HDfprintf(stdout, - "MEDIUM_BASE_ADDR = 0x%lx, MEDIUM_ALT_BASE_ADDR = 0x%lx.\n", - (long)MEDIUM_BASE_ADDR, (long)MEDIUM_ALT_BASE_ADDR); - HDfprintf(stdout, - "LARGE_BASE_ADDR = 0x%lx, LARGE_ALT_BASE_ADDR = 0x%lx.\n", - (long)LARGE_BASE_ADDR, (long)LARGE_ALT_BASE_ADDR); - HDfprintf(stdout, "HUGE_BASE_ADDR = 0x%lx, HUGE_ALT_BASE_ADDR = 0x%lx.\n", - (long)HUGE_BASE_ADDR, (long)HUGE_ALT_BASE_ADDR); - HDfprintf(stdout, - "MONSTER_BASE_ADDR = 0x%lx, MONSTER_ALT_BASE_ADDR = 0x%lx.\n", - (long)MONSTER_BASE_ADDR, (long)MONSTER_ALT_BASE_ADDR); - HDfprintf(stdout, - "VARIABLE_BASE_ADDR = 0x%lx, VARIABLE_ALT_BASE_ADDR = 0x%lx.\n", - (long)VARIABLE_BASE_ADDR, (long)VARIABLE_ALT_BASE_ADDR); -#endif /* JRM */ - /* setup the file name */ if ( pass ) { @@ -3251,65 +3047,48 @@ move_entry(H5C_t * cache_ptr, * *------------------------------------------------------------------------- */ - void -pin_protected_entry(H5F_t * file_ptr, - int32_t type, - int32_t idx) +pin_protected_entry(H5F_t *file_ptr, int32_t type, int32_t idx) { - /* const char * fcn_name = "pin_protected_entry()"; */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; - if ( pass ) { + if(pass) { #ifndef NDEBUG H5C_t * cache_ptr = file_ptr->shared->cache; #endif /* NDEBUG */ - HDassert( cache_ptr ); - HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); + HDassert(cache_ptr); + HDassert((0 <= type) && (type < NUMBER_OF_ENTRY_TYPES)); + HDassert((0 <= idx) && (idx <= max_indices[type])); base_addr = entries[type]; entry_ptr = &(base_addr[idx]); - HDassert( entry_ptr->index == idx ); - HDassert( entry_ptr->type == type ); - HDassert( entry_ptr == entry_ptr->self ); - HDassert( entry_ptr->cache_ptr == cache_ptr ); - HDassert( entry_ptr->header.is_protected ); - HDassert( ! entry_ptr->header.is_pinned ); + HDassert(entry_ptr->index == idx); + HDassert(entry_ptr->type == type); + HDassert(entry_ptr == entry_ptr->self); + HDassert(entry_ptr->cache_ptr == cache_ptr); + HDassert(entry_ptr->header.is_protected); + HDassert(!entry_ptr->header.is_pinned); result = H5C_pin_protected_entry((void *)entry_ptr); - if ( ( result < 0 ) - || - ( ! (entry_ptr->header.is_protected) ) - || - ( ! (entry_ptr->header.is_pinned) ) - || - ( entry_ptr->header.type != &(types[type]) ) - || - ( entry_ptr->size != entry_ptr->header.size ) - || - ( entry_ptr->addr != entry_ptr->header.addr ) ) { - + if((result < 0) || !entry_ptr->header.is_protected + || !entry_ptr->header.is_pinned + || (entry_ptr->header.type != &(types[type])) + || (entry_ptr->size != entry_ptr->header.size) + || (entry_ptr->addr != entry_ptr->header.addr)) { pass = FALSE; - failure_mssg = - "error in H5C_pin_protected_entry()."; - - } + failure_mssg = "error in H5C_pin_protected_entry()."; + } /* end if */ entry_ptr->is_pinned = TRUE; + HDassert(((entry_ptr->header).type)->id == type); + } /* end if */ - HDassert( ((entry_ptr->header).type)->id == type ); - - } - - return; - -} /* pin_protected_entry2() */ +} /* pin_protected_entry() */ /*------------------------------------------------------------------------- @@ -3354,8 +3133,7 @@ protect_entry(H5F_t * file_ptr, HDassert( !(entry_ptr->is_protected) ); cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, - &entry_ptr->addr, H5C__NO_FLAGS_SET); + &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__NO_FLAGS_SET); if ( ( cache_entry_ptr != (void *)entry_ptr ) || ( !(entry_ptr->header.is_protected) ) || @@ -3452,8 +3230,7 @@ protect_entry_ro(H5F_t * file_ptr, ( entry_ptr->ro_ref_count > 0 ) ) ); cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, - &entry_ptr->addr, H5C__READ_ONLY_FLAG); + &(types[type]), entry_ptr->addr, &entry_ptr->addr, H5C__READ_ONLY_FLAG); if ( ( cache_entry_ptr != (void *)entry_ptr ) || ( !(entry_ptr->header.is_protected) ) || @@ -3679,7 +3456,7 @@ unprotect_entry(H5F_t * file_ptr, void row_major_scan_forward(H5F_t * file_ptr, - int32_t max_index, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -3724,143 +3501,147 @@ row_major_scan_forward(H5F_t * file_ptr, while ( ( pass ) && ( idx <= (local_max_index + lag) ) ) { + int32_t tmp_idx; + if ( verbose ) { HDfprintf(stdout, "%d:%d: ", type, idx); } - if ( ( pass ) && ( do_inserts ) && ( (idx + lag) >= 0 ) && - ( (idx + lag) <= local_max_index ) && - ( ((idx + lag) % 2) == 0 ) && - ( ! entry_in_cache(cache_ptr, type, (idx + lag)) ) ) { + tmp_idx = idx + lag; + if ( ( pass ) && ( do_inserts ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( (tmp_idx % 2) == 0 ) && + ( ! entry_in_cache(cache_ptr, type, tmp_idx) ) ) { if ( verbose ) - HDfprintf(stdout, "1(i, %d, %d) ", type, (idx + lag)); + HDfprintf(stdout, "1(i, %d, %d) ", type, tmp_idx); - insert_entry(file_ptr, type, (idx + lag), H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - - if ( ( pass ) && ( (idx + lag - 1) >= 0 ) && - ( (idx + lag - 1) <= local_max_index ) && - ( ( (idx + lag - 1) % 3 ) == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "2(p, %d, %d) ", type, (idx + lag - 1)); + HDfprintf(stdout, "2(p, %d, %d) ", type, tmp_idx); - protect_entry(file_ptr, type, (idx + lag - 1)); + protect_entry(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx + lag - 2) >= 0 ) && - ( (idx + lag - 2) <= local_max_index ) && - ( ( (idx + lag - 2) % 3 ) == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "3(u, %d, %d) ", type, (idx + lag - 2)); + HDfprintf(stdout, "3(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx+lag-2, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - - if ( ( pass ) && ( do_moves ) && ( (idx + lag - 2) >= 0 ) && - ( (idx + lag - 2) <= local_max_index ) && - ( ( (idx + lag - 2) % 3 ) == 0 ) ) { + /* (don't decrement tmp_idx) */ + if ( ( pass ) && ( do_moves ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { if ( verbose ) HDfprintf(stdout, "4(r, %d, %d, %d) ", - type, (idx + lag - 2), (int)move_to_main_addr); + type, tmp_idx, (int)move_to_main_addr); - move_entry(cache_ptr, type, (idx + lag - 2), - move_to_main_addr); + move_entry(cache_ptr, type, tmp_idx, move_to_main_addr); } - - if ( ( pass ) && ( (idx + lag - 3) >= 0 ) && - ( (idx + lag - 3) <= local_max_index ) && - ( ( (idx + lag - 3) % 5 ) == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 5 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "5(p, %d, %d) ", type, (idx + lag - 3)); + HDfprintf(stdout, "5(p, %d, %d) ", type, tmp_idx); - protect_entry(file_ptr, type, (idx + lag - 3)); + protect_entry(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx + lag - 5) >= 0 ) && - ( (idx + lag - 5) <= local_max_index ) && - ( ( (idx + lag - 5) % 5 ) == 0 ) ) { + tmp_idx -= 2; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 5 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "6(u, %d, %d) ", type, (idx + lag - 5)); + HDfprintf(stdout, "6(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx+lag-5, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } if ( do_mult_ro_protects ) { - if ( ( pass ) && ( (idx + lag - 5) >= 0 ) && - ( (idx + lag - 5) < local_max_index ) && - ( (idx + lag - 5) % 9 == 0 ) ) { + /* (don't decrement tmp_idx) */ + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 9 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "7(p-ro, %d, %d) ", type, - (idx + lag - 5)); + HDfprintf(stdout, "7(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx + lag - 5)); + protect_entry_ro(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx + lag - 6) >= 0 ) && - ( (idx + lag - 6) < local_max_index ) && - ( (idx + lag - 6) % 11 == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 11 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "8(p-ro, %d, %d) ", type, - (idx + lag - 6)); + HDfprintf(stdout, "8(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx + lag - 6)); + protect_entry_ro(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx + lag - 7) >= 0 ) && - ( (idx + lag - 7) < local_max_index ) && - ( (idx + lag - 7) % 13 == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 13 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "9(p-ro, %d, %d) ", type, - (idx + lag - 7)); + HDfprintf(stdout, "9(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx + lag - 7)); + protect_entry_ro(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx + lag - 7) >= 0 ) && - ( (idx + lag - 7) < local_max_index ) && - ( (idx + lag - 7) % 9 == 0 ) ) { + /* (don't decrement tmp_idx) */ + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 9 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "10(u-ro, %d, %d) ", type, - (idx + lag - 7)); + HDfprintf(stdout, "10(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, (idx + lag - 7), H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( (idx + lag - 8) >= 0 ) && - ( (idx + lag - 8) < local_max_index ) && - ( (idx + lag - 8) % 11 == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 11 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "11(u-ro, %d, %d) ", type, - (idx + lag - 8)); + HDfprintf(stdout, "11(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, (idx + lag - 8), H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( (idx + lag - 9) >= 0 ) && - ( (idx + lag - 9) < local_max_index ) && - ( (idx + lag - 9) % 13 == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 13 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "12(u-ro, %d, %d) ", type, - (idx + lag - 9)); + HDfprintf(stdout, "12(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, (idx + lag - 9), H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } } /* if ( do_mult_ro_protects ) */ @@ -3872,88 +3653,83 @@ row_major_scan_forward(H5F_t * file_ptr, protect_entry(file_ptr, type, idx); } - if ( ( pass ) && ( (idx - lag + 2) >= 0 ) && - ( (idx - lag + 2) <= local_max_index ) && - ( ( (idx - lag + 2) % 7 ) == 0 ) ) { + tmp_idx = idx - lag + 2; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 7 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "14(u, %d, %d) ", type, (idx - lag + 2)); + HDfprintf(stdout, "14(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx-lag+2, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( (idx - lag + 1) >= 0 ) && - ( (idx - lag + 1) <= local_max_index ) && - ( ( (idx - lag + 1) % 7 ) == 0 ) ) { + tmp_idx--; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 7 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "15(p, %d, %d) ", type, (idx - lag + 1)); + HDfprintf(stdout, "15(p, %d, %d) ", type, tmp_idx); - protect_entry(file_ptr, type, (idx - lag + 1)); + protect_entry(file_ptr, type, tmp_idx); } if ( do_destroys ) { - if ( ( pass ) && ( (idx - lag) >= 0 ) && - ( ( idx - lag) <= local_max_index ) ) { + tmp_idx = idx - lag; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) ) { - switch ( (idx - lag) %4 ) { + switch ( tmp_idx %4 ) { case 0: /* we just did an insert */ if ( verbose ) - HDfprintf(stdout, - "16(u, %d, %d) ", type, (idx - lag)); + HDfprintf(stdout, "16(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx - lag, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); break; case 1: - if ( (entries[type])[idx-lag].is_dirty ) { + if ( (entries[type])[tmp_idx].is_dirty ) { - if ( verbose ) - HDfprintf(stdout, - "17(u, %d, %d) ", type, (idx - lag)); + if ( verbose ) + HDfprintf(stdout, "17(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx - lag, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } else { - if ( verbose ) - HDfprintf(stdout, - "18(u, %d, %d) ", type, (idx - lag)); + if ( verbose ) + HDfprintf(stdout, "18(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx - lag, + unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } break; - case 2: /* we just did an insrt */ + case 2: /* we just did an insert */ if ( verbose ) - HDfprintf(stdout, - "19(u-del, %d, %d) ", type, (idx - lag)); + HDfprintf(stdout, "19(u-del, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx - lag, H5C__DELETED_FLAG); + unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); break; case 3: - if ( (entries[type])[idx-lag].is_dirty ) { + if ( (entries[type])[tmp_idx].is_dirty ) { if ( verbose ) - HDfprintf(stdout, - "20(u-del, %d, %d) ", - type, (idx - lag)); + HDfprintf(stdout, "20(u-del, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx - lag, H5C__DELETED_FLAG); + unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); } else { if ( verbose ) - HDfprintf(stdout, - "21(u-del, %d, %d) ", - type, (idx - lag)); + HDfprintf(stdout, "21(u-del, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx - lag, + unprotect_entry(file_ptr, type, tmp_idx, (dirty_destroys ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | H5C__DELETED_FLAG); } @@ -3967,13 +3743,14 @@ row_major_scan_forward(H5F_t * file_ptr, } else { - if ( ( pass ) && ( (idx - lag) >= 0 ) && - ( ( idx - lag) <= local_max_index ) ) { + tmp_idx = idx - lag; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) ) { if ( verbose ) - HDfprintf(stdout, "22(u, %d, %d) ", type, (idx - lag)); + HDfprintf(stdout, "22(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx - lag, + unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } } @@ -4159,159 +3936,149 @@ row_major_scan_backward(H5F_t * file_ptr, { local_max_index = MIN(max_index, max_indices[type]); - /*idx = max_indices[type] + lag; */ idx = local_max_index + lag; while ( ( pass ) && ( idx >= -lag ) ) { - if ( ( pass ) && ( do_inserts ) && ( (idx - lag) >= 0 ) && - /*( (idx - lag) <= max_indices[type] ) && */ - ( (idx - lag) <= local_max_index ) && - ( ((idx - lag) % 2) == 1 ) && - ( ! entry_in_cache(cache_ptr, type, (idx - lag)) ) ) { + int32_t tmp_idx; + + tmp_idx = idx - lag; + if ( ( pass ) && ( do_inserts ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( (tmp_idx % 2) == 1 ) && + ( ! entry_in_cache(cache_ptr, type, tmp_idx) ) ) { if ( verbose ) - HDfprintf(stdout, "(i, %d, %d) ", type, (idx - lag)); + HDfprintf(stdout, "(i, %d, %d) ", type, tmp_idx); - insert_entry(file_ptr, type, (idx - lag), H5C__NO_FLAGS_SET); + insert_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - - if ( ( pass ) && ( (idx - lag + 1) >= 0 ) && - /*( (idx - lag + 1) <= max_indices[type] ) && */ - ( (idx - lag + 1) <= local_max_index ) && - ( ( (idx - lag + 1) % 3 ) == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, (idx - lag + 1)); + HDfprintf(stdout, "(p, %d, %d) ", type, tmp_idx); - protect_entry(file_ptr, type, (idx - lag + 1)); + protect_entry(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx - lag + 2) >= 0 ) && - /*( (idx - lag + 2) <= max_indices[type] ) && */ - ( (idx - lag + 2) <= local_max_index ) && - ( ( (idx - lag + 2) % 3 ) == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); + HDfprintf(stdout, "(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx-lag+2, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - - if ( ( pass ) && ( do_moves ) && ( (idx - lag + 2) >= 0 ) && - /*( (idx - lag + 2) <= max_indices[type] ) && */ - ( (idx - lag + 2) <= local_max_index ) && - ( ( (idx - lag + 2) % 3 ) == 0 ) ) { + /* (don't increment tmp_idx) */ + if ( ( pass ) && ( do_moves ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { if ( verbose ) HDfprintf(stdout, "(r, %d, %d, %d) ", - type, (idx + lag + 2), (int)move_to_main_addr); + type, tmp_idx, (int)move_to_main_addr); - move_entry(cache_ptr, type, (idx - lag + 2), - move_to_main_addr); + move_entry(cache_ptr, type, tmp_idx, move_to_main_addr); } - - if ( ( pass ) && ( (idx - lag + 3) >= 0 ) && - /*( (idx - lag + 3) <= max_indices[type] ) && */ - ( (idx - lag + 3) <= local_max_index ) && - ( ( (idx - lag + 3) % 5 ) == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 5 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, (idx - lag + 3)); + HDfprintf(stdout, "(p, %d, %d) ", type, tmp_idx); protect_entry(file_ptr, type, (idx - lag + 3)); } - if ( ( pass ) && ( (idx - lag + 5) >= 0 ) && - /*( (idx - lag + 5) <= max_indices[type] ) && */ - ( (idx - lag + 5) <= local_max_index ) && - ( ( (idx - lag + 5) % 5 ) == 0 ) ) { + tmp_idx += 2; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 5 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 5)); + HDfprintf(stdout, "(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx-lag+5, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } + /* (don't increment tmp_idx) */ if ( do_mult_ro_protects ) { - if ( ( pass ) && ( (idx - lag + 5) >= 0 ) && - /*( (idx - lag + 5) < max_indices[type] ) && */ - ( (idx - lag + 5) < local_max_index ) && - ( (idx - lag + 5) % 9 == 0 ) ) { + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 9 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p-ro, %d, %d) ", type, - (idx - lag + 5)); + HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx - lag + 5)); + protect_entry_ro(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx - lag + 6) >= 0 ) && - /*( (idx - lag + 6) < max_indices[type] ) && */ - ( (idx - lag + 6) < local_max_index ) && - ( (idx - lag + 6) % 11 == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 11 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p-ro, %d, %d) ", type, - (idx - lag + 6)); + HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx - lag + 6)); + protect_entry_ro(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx - lag + 7) >= 0 ) && - /* ( (idx - lag + 7) < max_indices[type] ) && */ - ( (idx - lag + 7) < local_max_index ) && - ( (idx - lag + 7) % 13 == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 13 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p-ro, %d, %d) ", type, - (idx - lag + 7)); + HDfprintf(stdout, "(p-ro, %d, %d) ", type, tmp_idx); - protect_entry_ro(file_ptr, type, (idx - lag + 7)); + protect_entry_ro(file_ptr, type, tmp_idx); } - if ( ( pass ) && ( (idx - lag + 7) >= 0 ) && - /*( (idx - lag + 7) < max_indices[type] ) && */ - ( (idx - lag + 7) < local_max_index ) && - ( (idx - lag + 7) % 9 == 0 ) ) { + /* (don't increment tmp_idx) */ + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 9 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u-ro, %d, %d) ", type, - (idx - lag + 7)); + HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, (idx - lag + 7), H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( (idx - lag + 8) >= 0 ) && - /*( (idx - lag + 8) < max_indices[type] ) && */ - ( (idx - lag + 8) < local_max_index ) && - ( (idx - lag + 8) % 11 == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 11 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u-ro, %d, %d) ", type, - (idx - lag + 8)); + HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, (idx - lag + 8), H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( (idx - lag + 9) >= 0 ) && - /*( (idx - lag + 9) < max_indices[type] ) && */ - ( (idx - lag + 9) < local_max_index ) && - ( (idx - lag + 9) % 13 == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx < local_max_index ) && + ( tmp_idx % 13 == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u-ro, %d, %d) ", type, - (idx - lag + 9)); + HDfprintf(stdout, "(u-ro, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, (idx - lag + 9), H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } } /* if ( do_mult_ro_protects ) */ - /*if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { */ if ( ( pass ) && ( idx >= 0 ) && ( idx <= local_max_index ) ) { if ( verbose ) @@ -4320,37 +4087,35 @@ row_major_scan_backward(H5F_t * file_ptr, protect_entry(file_ptr, type, idx); } - - if ( ( pass ) && ( (idx + lag - 2) >= 0 ) && - /*( (idx + lag - 2) <= max_indices[type] ) && */ - ( (idx + lag - 2) <= local_max_index ) && - ( ( (idx + lag - 2) % 7 ) == 0 ) ) { + tmp_idx = idx + lag - 2; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 7 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); + HDfprintf(stdout, "(u, %d, %d) ", type, tmp_idx); - unprotect_entry(file_ptr, type, idx+lag-2, H5C__NO_FLAGS_SET); + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } - if ( ( pass ) && ( (idx + lag - 1) >= 0 ) && - /*( (idx + lag - 1) <= max_indices[type] ) && */ - ( (idx + lag - 1) <= local_max_index ) && - ( ( (idx + lag - 1) % 7 ) == 0 ) ) { + tmp_idx++; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 7 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, (idx + lag - 1)); + HDfprintf(stdout, "(p, %d, %d) ", type, tmp_idx); - protect_entry(file_ptr, type, (idx + lag - 1)); + protect_entry(file_ptr, type, tmp_idx); } if ( do_destroys ) { if ( ( pass ) && ( (idx + lag) >= 0 ) && - /*( ( idx + lag) <= max_indices[type] ) ) { */ ( ( idx + lag) <= local_max_index ) ) { - switch ( (idx + lag) %4 ) { + switch ( (idx + lag) % 4 ) { case 0: if ( (entries[type])[idx+lag].is_dirty ) { @@ -4379,7 +4144,7 @@ row_major_scan_backward(H5F_t * file_ptr, } break; - case 3: /* we just did an insrt */ + case 3: /* we just did an insert */ unprotect_entry(file_ptr, type, idx + lag, H5C__DELETED_FLAG); break; @@ -4391,7 +4156,6 @@ row_major_scan_backward(H5F_t * file_ptr, } else { if ( ( pass ) && ( (idx + lag) >= 0 ) && - /*( ( idx + lag) <= max_indices[type] ) ) { */ ( ( idx + lag) <= local_max_index ) ) { if ( verbose ) @@ -4554,7 +4318,6 @@ col_major_scan_forward(H5F_t * file_ptr, { const char * fcn_name = "col_major_scan_forward()"; H5C_t * cache_ptr; - int i; int32_t type = 0; int32_t idx; int32_t local_max_index[NUMBER_OF_ENTRY_TYPES]; @@ -4563,13 +4326,12 @@ col_major_scan_forward(H5F_t * file_ptr, HDfprintf(stdout, "%s: entering.\n", fcn_name); if ( pass ) { + int i; cache_ptr = file_ptr->shared->cache; for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ ) - { local_max_index[i] = MIN(max_index, max_indices[i]); - } HDassert( lag > 5 ); @@ -4588,7 +4350,6 @@ col_major_scan_forward(H5F_t * file_ptr, while ( ( pass ) && ( type < NUMBER_OF_ENTRY_TYPES ) ) { if ( ( pass ) && ( do_inserts ) && ( (idx + lag) >= 0 ) && - /*( (idx + lag) <= max_indices[type] ) && */ ( (idx + lag) <= local_max_index[type] ) && ( ((idx + lag) % 3) == 0 ) && ( ! entry_in_cache(cache_ptr, type, (idx + lag)) ) ) { @@ -4599,7 +4360,6 @@ col_major_scan_forward(H5F_t * file_ptr, insert_entry(file_ptr, type, (idx + lag), H5C__NO_FLAGS_SET); } - /*if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { */ if ( ( pass ) && ( idx >= 0 ) && ( idx <= local_max_index[type] ) ) { @@ -4611,7 +4371,6 @@ col_major_scan_forward(H5F_t * file_ptr, } if ( ( pass ) && ( (idx - lag) >= 0 ) && - /*( (idx - lag) <= max_indices[type] ) ) { */ ( (idx - lag) <= local_max_index[type] ) ) { if ( verbose ) @@ -4726,7 +4485,6 @@ hl_col_major_scan_forward(H5F_t * file_ptr, } if ( ( pass ) && ( i >= 0 ) && - /*( i <= max_indices[type] ) ) { */ ( i <= local_max_index ) ) { if ( verbose ) @@ -4786,7 +4544,6 @@ col_major_scan_backward(H5F_t * file_ptr, { const char * fcn_name = "col_major_scan_backward()"; H5C_t * cache_ptr; - int i; int mile_stone = 1; int32_t type; int32_t idx; @@ -4796,15 +4553,14 @@ col_major_scan_backward(H5F_t * file_ptr, HDfprintf(stdout, "%s: entering.\n", fcn_name); if ( pass ) { + int i; cache_ptr = file_ptr->shared->cache; HDassert( cache_ptr != NULL ); for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ ) - { local_max_index[i] = MIN(max_index, max_indices[i]); - } HDassert( lag > 5 ); @@ -4814,7 +4570,6 @@ col_major_scan_backward(H5F_t * file_ptr, } } - /* idx = MAX_ENTRIES + lag; */ idx = local_max_index[NUMBER_OF_ENTRY_TYPES - 1] + lag; if ( verbose ) /* 1 */ @@ -4828,7 +4583,6 @@ col_major_scan_backward(H5F_t * file_ptr, while ( ( pass ) && ( type >= 0 ) ) { if ( ( pass ) && ( do_inserts) && ( (idx - lag) >= 0 ) && - /*( (idx - lag) <= max_indices[type] ) && */ ( (idx - lag) <= local_max_index[type] ) && ( ((idx - lag) % 3) == 0 ) && ( ! entry_in_cache(cache_ptr, type, (idx - lag)) ) ) { @@ -4839,7 +4593,6 @@ col_major_scan_backward(H5F_t * file_ptr, insert_entry(file_ptr, type, (idx - lag), H5C__NO_FLAGS_SET); } - /*if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { */ if ( ( pass ) && ( idx >= 0 ) && ( idx <= local_max_index[type] ) ) { @@ -4851,7 +4604,6 @@ col_major_scan_backward(H5F_t * file_ptr, } if ( ( pass ) && ( (idx + lag) >= 0 ) && - /*( (idx + lag) <= max_indices[type] ) ) { */ ( (idx + lag) <= local_max_index[type] ) ) { if ( verbose ) @@ -5038,7 +4790,6 @@ check_and_validate_cache_hit_rate(hid_t file_id, int64_t min_accesses, double min_hit_rate) { - /* const char * fcn_name = "check_and_validate_cache_hit_rate()"; */ herr_t result; int64_t cache_hits = 0; int64_t cache_accesses = 0; @@ -5172,7 +4923,6 @@ check_and_validate_cache_size(hid_t file_id, int32_t * cur_num_entries_ptr, hbool_t dump_data) { - /* const char * fcn_name = "check_and_validate_cache_size()"; */ herr_t result; size_t expected_max_size; size_t max_size; @@ -5303,7 +5053,6 @@ validate_mdc_config(hid_t file_id, hbool_t compare_init, int test_num) { - /* const char * fcn_name = "validate_mdc_config()"; */ static char msg[256]; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; @@ -5361,7 +5110,7 @@ validate_mdc_config(hid_t file_id, scratch.version = H5AC__CURR_CACHE_CONFIG_VERSION; - if ( H5Fget_mdc_config(file_id, (H5AC_cache_config_t *)&scratch) < 0 ) { + if ( H5Fget_mdc_config(file_id, &scratch) < 0 ) { pass = FALSE; HDsnprintf(msg, (size_t)128, diff --git a/test/cache_common.h b/test/cache_common.h index d4055c6..4a1a529 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -201,7 +201,7 @@ typedef struct test_entry_t * entry resides, or NULL if the entry * is not in a file. */ - H5C_t * cache_ptr; /* pointer to the cache in which + H5C_t * cache_ptr; /* pointer to the cache in which * the entry resides, or NULL if the * entry is not in cache. */ @@ -456,9 +456,9 @@ if ( ( (cache_ptr) == NULL ) || \ #define XLATE_EXT_TO_INT_MDC_CONFIG(i, e) \ { \ - (i).version = H5C__CURR_AUTO_SIZE_CTL_VER; \ + (i).version = H5C__CURR_AUTO_SIZE_CTL_VER; \ if ( (e).rpt_fcn_enabled ) \ - (i).rpt_fcn = H5C_def_auto_resize_rpt_fcn; \ + (i).rpt_fcn = H5C_def_auto_resize_rpt_fcn; \ else \ (i).rpt_fcn = NULL; \ (i).set_initial_size = (e).set_initial_size; \ diff --git a/test/fheap.c b/test/fheap.c index 1dd39bc..76213ba 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -415,13 +415,20 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off, if(keep_ids) { /* Check for needing to increase size of heap ID array */ if(keep_ids->num_ids + 1 > keep_ids->alloc_ids) { + unsigned char *tmp_ids; + size_t *tmp_lens; + size_t *tmp_offs; + keep_ids->alloc_ids = MAX(1024, (keep_ids->alloc_ids * 2)); - if(NULL == (keep_ids->ids = H5MM_realloc(keep_ids->ids, id_len * keep_ids->alloc_ids))) + if(NULL == (tmp_ids = H5MM_realloc(keep_ids->ids, id_len * keep_ids->alloc_ids))) TEST_ERROR - if(NULL == (keep_ids->lens = H5MM_realloc(keep_ids->lens, sizeof(size_t) * keep_ids->alloc_ids))) + keep_ids->ids = tmp_ids; + if(NULL == (tmp_lens = H5MM_realloc(keep_ids->lens, sizeof(size_t) * keep_ids->alloc_ids))) TEST_ERROR - if(NULL == (keep_ids->offs = H5MM_realloc(keep_ids->offs, sizeof(size_t) * keep_ids->alloc_ids))) + keep_ids->lens = tmp_lens; + if(NULL == (tmp_offs = H5MM_realloc(keep_ids->offs, sizeof(size_t) * keep_ids->alloc_ids))) TEST_ERROR + keep_ids->offs = tmp_offs; } /* end if */ /* Append the object info onto the array */ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 59f1a70..97d11a2 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -20,20 +20,17 @@ #include "h5test.h" #include "testpar.h" -#include "H5Iprivate.h" -#include "H5MFprivate.h" - -#define H5C_PACKAGE /*suppress error about including H5Cpkg */ - -#include "H5Cpkg.h" #define H5AC_PACKAGE /*suppress error about including H5ACpkg */ - -#include "H5ACpkg.h" - +#define H5C_PACKAGE /*suppress error about including H5Cpkg */ #define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#include "H5ACpkg.h" +#include "H5Cpkg.h" #include "H5Fpkg.h" +#include "H5Iprivate.h" +#include "H5MFprivate.h" + #define BASE_ADDR (haddr_t)1024 @@ -41,12 +38,6 @@ int nerrors = 0; int failures = 0; hbool_t verbose = TRUE; /* used to control error messages */ -#if 1 -/* So far we haven't needed this, but that may change. - * Keep it around for now - */ -hid_t noblock_dxpl_id=(-1); -#endif #define NFILENAME 2 #define PARATESTFILE filenames[0] @@ -2710,7 +2701,7 @@ lock_entry(H5F_t * file_ptr, HDassert( ! (entry_ptr->locked) ); - cache_entry_ptr = H5AC_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, + cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[0]), entry_ptr->base_addr, &entry_ptr->base_addr, H5AC_WRITE); @@ -3295,125 +3286,6 @@ setup_cache_for_test(hid_t * fid_ptr, /***************************************************************************** * - * Function: setup_noblock_dxpl_id() - * - * Purpose: Setup the noblock_dxpl_id global. Increment nerrors if - * errors are detected. Do nothing if nerrors is non-zero - * on entry. - * - * Return: void. - * - * Programmer: JRM -- 1/5/06 - * - * Modifications: - * - * None. - * - *****************************************************************************/ -/* So far we haven't needed this, but that may change. - * Keep it around for now - */ -#if 0 -void -setup_noblock_dxpl_id(void) -{ - const char * fcn_name = "setup_noblock_dxpl_id()"; - H5P_genclass_t *xfer_pclass; /* Dataset transfer property list - * class object - */ - H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */ - unsigned block_before_meta_write; /* "block before meta write" - * property value - */ - unsigned library_internal = 1; /* "library internal" property value */ - H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode property value */ - - /* Sanity check */ - HDassert(H5P_CLS_DATASET_XFER_g!=(-1)); - - /* Get the dataset transfer property list class object */ - if ( ( nerrors == 0 ) && - ( NULL == (xfer_pclass = H5I_object(H5P_CLS_DATASET_XFER_g)) ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: can't get property list class.\n", - world_mpi_rank, fcn_name); - } - } - - /* Get an ID for the non-blocking, collective H5AC dxpl */ - if ( ( nerrors == 0 ) && - ( (noblock_dxpl_id = H5P_create_id(xfer_pclass)) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: can't register property list.\n", - world_mpi_rank, fcn_name); - } - } - - /* Get the property list object */ - if ( ( nerrors == 0 ) && - ( NULL == (xfer_plist = H5I_object(H5AC_noblock_dxpl_id)) ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: can't get new property list object.\n", - world_mpi_rank, fcn_name); - } - } - - /* Insert 'block before metadata write' property */ - block_before_meta_write=0; - if ( ( nerrors == 0 ) && - ( H5P_insert(xfer_plist, H5AC_BLOCK_BEFORE_META_WRITE_NAME, - H5AC_BLOCK_BEFORE_META_WRITE_SIZE, - &block_before_meta_write, - NULL, NULL, NULL, NULL, NULL, NULL) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, - "%d:%s: can't insert metadata cache dxpl property 1.\n", - world_mpi_rank, fcn_name); - } - } - - /* Insert 'library internal' property */ - if ( ( nerrors == 0 ) && - ( H5P_insert(xfer_plist, H5AC_LIBRARY_INTERNAL_NAME, - H5AC_LIBRARY_INTERNAL_SIZE, &library_internal, - NULL, NULL, NULL, NULL, NULL, NULL ) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, - "%d:%s: can't insert metadata cache dxpl property 2.\n", - world_mpi_rank, fcn_name); - } - } - - /* Set the transfer mode */ - xfer_mode = H5FD_MPIO_COLLECTIVE; - if ( ( nerrors == 0 ) && - ( H5P_set(xfer_plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0 ) ) { - - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: unable to set value.\n", world_mpi_rank, - fcn_name); - } - } - - return(success); - -} /* setup_noblock_dxpl_id() */ -#endif - - -/***************************************************************************** - * * Function: setup_rand() * * Purpose: Use gettimeofday() to obtain a seed for rand(), print the -- cgit v0.12