diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2011-08-18 22:58:45 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2011-08-18 22:58:45 (GMT) |
commit | b51e303445eb8a06e882b2f6e68b39b2095aab4f (patch) | |
tree | 21ef2630d99b50a24e51be235ebb081ace8bbefc | |
parent | 598243af9b5613d55cc48ca9b169df9164f1e9a6 (diff) | |
download | hdf5-b51e303445eb8a06e882b2f6e68b39b2095aab4f.zip hdf5-b51e303445eb8a06e882b2f6e68b39b2095aab4f.tar.gz hdf5-b51e303445eb8a06e882b2f6e68b39b2095aab4f.tar.bz2 |
[svn-r21262] Description:
Bring changes for "journaling" cache into "merging" branch, for
further merging into the trunk.
Tested on:
Mac OS X/32 10.6.8 (amazon)
(h5committest not required on this branch)
-rwxr-xr-x | configure | 3 | ||||
-rw-r--r-- | src/H5AC.c | 416 | ||||
-rw-r--r-- | src/H5ACprivate.h | 64 | ||||
-rw-r--r-- | src/H5B2cache.c | 933 | ||||
-rw-r--r-- | src/H5B2int.c | 8 | ||||
-rw-r--r-- | src/H5Bcache.c | 329 | ||||
-rw-r--r-- | src/H5C.c | 1114 | ||||
-rw-r--r-- | src/H5Cprivate.h | 461 | ||||
-rw-r--r-- | src/H5F.c | 6 | ||||
-rw-r--r-- | src/H5FScache.c | 648 | ||||
-rw-r--r-- | src/H5Gnode.c | 348 | ||||
-rw-r--r-- | src/H5HFcache.c | 1342 | ||||
-rw-r--r-- | src/H5HFdbg.c | 2 | ||||
-rw-r--r-- | src/H5HFdblock.c | 1 | ||||
-rw-r--r-- | src/H5HFhdr.c | 7 | ||||
-rw-r--r-- | src/H5HFman.c | 5 | ||||
-rw-r--r-- | src/H5HFpkg.h | 49 | ||||
-rw-r--r-- | src/H5HGcache.c | 470 | ||||
-rw-r--r-- | src/H5HL.c | 4 | ||||
-rw-r--r-- | src/H5HLcache.c | 586 | ||||
-rw-r--r-- | src/H5HLpkg.h | 1 | ||||
-rw-r--r-- | src/H5Ocache.c | 710 | ||||
-rw-r--r-- | src/H5Pfapl.c | 2 | ||||
-rw-r--r-- | src/H5SMcache.c | 649 | ||||
-rw-r--r-- | test/cache.c | 6507 | ||||
-rw-r--r-- | test/cache_api.c | 71 | ||||
-rw-r--r-- | test/cache_common.c | 1928 | ||||
-rw-r--r-- | test/cache_common.h | 146 | ||||
-rw-r--r-- | test/fheap.c | 13 | ||||
-rw-r--r-- | testpar/t_cache.c | 962 |
30 files changed, 8874 insertions, 8911 deletions
@@ -25087,7 +25087,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" @@ -165,8 +165,7 @@ static herr_t H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, hbool_t do_barrier); static herr_t H5AC_receive_and_apply_clean_list(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, H5AC_t * cache_ptr); static herr_t H5AC_log_moved_entry(const H5F_t * f, @@ -174,6 +173,9 @@ static herr_t H5AC_log_moved_entry(const H5F_t * f, haddr_t new_addr); #endif /* H5_HAVE_PARALLEL */ +static herr_t H5AC_set_cache_config(H5AC_t * cache_ptr, + H5AC_cache_config_t *config_ptr); + /*------------------------------------------------------------------------- * Function: H5AC_init @@ -421,8 +423,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; @@ -430,6 +430,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) @@ -439,13 +440,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) ) { @@ -591,24 +585,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_auto_resize_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: @@ -688,7 +671,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) } #endif /* H5AC__TRACE_FILE_ENABLED */ - if ( H5C_dest(f, dxpl_id, H5AC_noblock_dxpl_id) < 0 ) { + if ( H5C_dest(f, dxpl_id) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache") } @@ -754,8 +737,6 @@ H5AC_expunge_entry(H5F_t *f, HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); - HDassert(type->clear); - HDassert(type->dest); HDassert(H5F_addr_defined(addr)); #if H5AC__TRACE_FILE_ENABLED @@ -779,7 +760,6 @@ H5AC_expunge_entry(H5F_t *f, result = H5C_expunge_entry(f, dxpl_id, - H5AC_noblock_dxpl_id, type, addr); @@ -934,8 +914,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags) aux_ptr->write_permitted = TRUE; status = H5C_flush_cache(f, - H5AC_noblock_dxpl_id, - H5AC_noblock_dxpl_id, + dxpl_id, init_flush_flags); aux_ptr->write_permitted = FALSE; @@ -961,7 +940,6 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags) status = H5C_flush_cache(f, dxpl_id, - H5AC_noblock_dxpl_id, flags); if ( status < 0 ) { @@ -1080,7 +1058,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 */ @@ -1097,8 +1074,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); - HDassert(type->flush); - HDassert(type->size); + HDassert(type->serialize); HDassert(H5F_addr_defined(addr)); HDassert(thing); @@ -1124,7 +1100,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add #endif /* H5AC__TRACE_FILE_ENABLED */ /* Insert entry into metadata cache */ - if(H5C_insert_entry(f, dxpl_id, H5AC_noblock_dxpl_id, type, addr, thing, flags) < 0) + if(H5C_insert_entry(f, dxpl_id, type, addr, thing, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_insert_entry() failed") #if H5AC__TRACE_FILE_ENABLED @@ -1427,8 +1403,7 @@ H5AC_protect(H5F_t *f, HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); - HDassert(type->flush); - HDassert(type->load); + HDassert(type->serialize); HDassert(H5F_addr_defined(addr)); /* Check for invalid access request */ @@ -1476,7 +1451,6 @@ H5AC_protect(H5F_t *f, thing = H5C_protect(f, dxpl_id, - H5AC_noblock_dxpl_id, type, addr, udata, @@ -1690,8 +1664,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); - HDassert(type->clear); - HDassert(type->flush); + HDassert(type->deserialize); HDassert(H5F_addr_defined(addr)); HDassert(thing); HDassert( ((H5AC_info_t *)thing)->addr == addr ); @@ -1718,22 +1691,6 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, ( ((H5AC_info_t *)thing)->dirtied ) ); deleted = (hbool_t)( (flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG ); - /* Check if the size changed out from underneath us, if we're not deleting - * the entry. - */ - if ( dirtied && !deleted ) { - size_t curr_size = 0; - - if ( (type->size)(f, thing, &curr_size) < 0 ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, \ - "Can't get size of thing") - } - - if(((H5AC_info_t *)thing)->size != curr_size) - HGOTO_ERROR(H5E_CACHE, H5E_BADSIZE, FAIL, "size of entry changed") - } - #ifdef H5_HAVE_PARALLEL if ( ( dirtied ) && ( ((H5AC_info_t *)thing)->is_dirty == FALSE ) && ( NULL != (aux_ptr = f->shared->cache->aux_ptr) ) ) { @@ -1760,7 +1717,6 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, result = H5C_unprotect(f, dxpl_id, - H5AC_noblock_dxpl_id, type, addr, thing, @@ -2126,139 +2082,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 */ - H5C_auto_size_ctl_t internal_config; #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"); - } - - 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 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5AC_close_trace_file() failed.") - } - } - - if ( config_ptr->open_trace_file ) { - - if ( H5AC_open_trace_file(cache_ptr, config_ptr->trace_file_name) < 0 ) - { - - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "H5AC_open_trace_file() failed.") - } - } - - 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_set_cache_auto_resize_config(cache_ptr, &internal_config) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed.") - - if(H5C_set_evictions_enabled(cache_ptr, config_ptr->evictions_enabled) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed.") - -#ifdef H5_HAVE_PARALLEL - 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 */ + 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 %f %f %d %d %d %f %f %d %d %d %d %f %d %d\n", - "H5AC_set_cache_auto_resize_config", + "%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", + FUNC, trace_config.version, (int)(trace_config.rpt_fcn_enabled), (int)(trace_config.open_trace_file), @@ -2274,11 +2139,11 @@ done: (int)(trace_config.incr_mode), trace_config.lower_hr_threshold, trace_config.increment, - (int)(trace_config.flash_incr_mode), - trace_config.flash_multiple, - trace_config.flash_threshold, (int)(trace_config.apply_max_increment), (int)(trace_config.max_increment), + (int)(trace_config.flash_incr_mode), + trace_config.flash_multiple, + trace_config.flash_threshold, (int)(trace_config.decr_mode), trace_config.upper_hr_threshold, trace_config.decrement, @@ -2289,13 +2154,87 @@ 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() */ + + +/*------------------------------------------------------------------------- + * Function: H5AC_set_cache_config + * + * Purpose: Handle all configuration switches in an instance of + * H5AC_cache_config_t. + * + * Return: SUCCEED on success, and FAIL on failure. + * + * Programmer: John Mainzer + * 7/7/08 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5AC_set_cache_config(H5AC_t * cache_ptr, + H5AC_cache_config_t *config_ptr) +{ + H5C_auto_size_ctl_t internal_config; + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5AC_set_cache_config) + + 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)) +#endif /* H5_HAVE_PARALLEL */ + ) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry.") + + 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, "can't get trace file pointer") + + 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->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 && H5AC_close_trace_file(cache_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "can't close trace file") + + 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.") + + if(H5C_set_cache_auto_resize_config(cache_ptr, &internal_config) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed.") + + if(H5C_set_evictions_enabled(cache_ptr, config_ptr->evictions_enabled) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed.") + +#ifdef H5_HAVE_PARALLEL + 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() */ + /*------------------------------------------------------------------------- * Function: H5AC_validate_config() @@ -2322,45 +2261,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 @@ -2368,67 +2290,60 @@ 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() */ + + +/*------------------------------------------------------------------------- + * Function: H5AC_validate_cache_config_ver() + * + * Purpose: Return true if the supplied H5AC_cache_config_t version + * number is valid, and FALSE otherwise. + * + * Return: TRUE if the version number is valid, and FALSE otherwise. + * + * Programmer: John Mainzer + * 8/13/08 + * + *------------------------------------------------------------------------- + */ +hbool_t +H5AC_validate_cache_config_ver(int version_num) +{ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5AC_validate_cache_config_ver) + + FUNC_LEAVE_NOAPI(version_num == H5AC__CURR_CACHE_CONFIG_VERSION) +} /* H5AC_validate_cache_config_ver() */ + /*------------------------------------------------------------------------- * Function: H5AC_close_trace_file() @@ -3738,7 +3653,7 @@ H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, aux_ptr->write_permitted = TRUE; - result = H5C_flush_to_min_clean(f, dxpl_id, H5AC_noblock_dxpl_id); + result = H5C_flush_to_min_clean(f, dxpl_id); aux_ptr->write_permitted = FALSE; @@ -3764,7 +3679,6 @@ H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, } else { if ( H5AC_receive_and_apply_clean_list(f, dxpl_id, - H5AC_noblock_dxpl_id, cache_ptr) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ @@ -3812,8 +3726,7 @@ done: #ifdef H5_HAVE_PARALLEL static herr_t H5AC_receive_and_apply_clean_list(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, H5AC_t * cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3905,8 +3818,9 @@ H5AC_receive_and_apply_clean_list(H5F_t * f, /* mark the indicated entries as clean */ - if ( H5C_mark_entries_as_clean(f, primary_dxpl_id, secondary_dxpl_id, - (int32_t)num_entries, &(haddr_buf_ptr[0])) < 0 ) { + if ( H5C_mark_entries_as_clean(f, dxpl_id, + (int32_t)num_entries, + &(haddr_buf_ptr[0])) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Can't mark entries clean.") diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 6aca0d3..4fa52bc 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -94,56 +94,25 @@ typedef enum { /* * Class methods pertaining to caching. Each type of cached object will * have a constant variable with permanent life-span that describes how - * to cache the object. That variable will be of type H5AC_class_t and - * have the following required fields... - * - * LOAD: Loads an object from disk to memory. The function - * should allocate some data structure and return it. - * - * FLUSH: Writes some data structure back to disk. It would be - * wise for the data structure to include dirty flags to - * indicate whether it really needs to be written. This - * function is also responsible for freeing memory allocated - * by the LOAD method if the DEST argument is non-zero (by - * calling the DEST method). - * - * DEST: Just frees memory allocated by the LOAD method. - * - * CLEAR: Just marks object as non-dirty. - * - * SIZE: Report the size (on disk) of the specified cache object. - * Note that the space allocated on disk may not be contiguous. + * to cache the object. */ -#define H5AC_CALLBACK__NO_FLAGS_SET H5C_CALLBACK__NO_FLAGS_SET -#define H5AC_CALLBACK__SIZE_CHANGED_FLAG H5C_CALLBACK__SIZE_CHANGED_FLAG -#define H5AC_CALLBACK__MOVED_FLAG H5C_CALLBACK__MOVED_FLAG - -typedef H5C_load_func_t H5AC_load_func_t; -typedef H5C_flush_func_t H5AC_flush_func_t; -typedef H5C_dest_func_t H5AC_dest_func_t; -typedef H5C_clear_func_t H5AC_clear_func_t; -typedef H5C_size_func_t H5AC_size_func_t; +#define H5AC__SERIALIZE_RESIZED_FLAG H5C__SERIALIZE_RESIZED_FLAG +#define H5AC__SERIALIZE_MOVED_FLAG H5C__SERIALIZE_MOVED_FLAG -typedef H5C_class_t H5AC_class_t; +#define H5AC__CLASS_NO_FLAGS_SET H5C__CLASS_NO_FLAGS_SET +#define H5AC__CLASS_SPECULATIVE_LOAD_FLAG H5C__CLASS_SPECULATIVE_LOAD_FLAG +#define H5AC__CLASS_COMPRESSED_FLAG H5C__CLASS_COMPRESSED_FLAG +typedef H5C_get_load_size_func_t H5AC_get_load_size_func_t; +typedef H5C_deserialize_func_t H5AC_deserialize_func_t; +typedef H5C_image_len_func_t H5AC_image_len_func_t; +typedef H5C_serialize_func_t H5AC_serialize_func_t; +typedef H5C_free_icr_func_t H5AC_free_icr_func_t; -/* The H5AC_NSLOTS #define is now obsolete, as the metadata cache no longer - * uses slots. However I am leaving it in for now to avoid modifying the - * interface between the metadata cache and the rest of HDF. It should - * be removed when we get to dealing with the size_hint parameter in - * H5AC_create(). - * JRM - 5/20/04 - * - * Old comment on H5AC_NSLOTS follows: - * - * A cache has a certain number of entries. Objects are mapped into a - * cache entry by hashing the object's file address. Each file has its - * own cache, an array of slots. - */ -#define H5AC_NSLOTS 10330 /* The library "likes" this number... */ - +typedef H5C_class_t H5AC_class_t; +/* Cache entry info */ typedef H5C_cache_entry_t H5AC_info_t; @@ -268,8 +237,7 @@ H5_DLL herr_t H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *typ haddr_t addr, void *thing, unsigned int flags); H5_DLL herr_t H5AC_pin_protected_entry(void *thing); H5_DLL void * H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, - haddr_t addr, void *udata, - H5AC_protect_t rw); + haddr_t addr, void *udata, H5AC_protect_t rw); H5_DLL herr_t H5AC_resize_entry(void *thing, size_t new_size); H5_DLL herr_t H5AC_unpin_entry(void *thing); H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, @@ -308,7 +276,9 @@ H5_DLL herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t * config_ptr); -H5_DLL herr_t H5AC_close_trace_file( H5AC_t * cache_ptr); +H5_DLL hbool_t H5AC_validate_cache_config_ver(int version_num); + +H5_DLL herr_t H5AC_close_trace_file(H5AC_t * cache_ptr); H5_DLL herr_t H5AC_open_trace_file(H5AC_t * cache_ptr, const char * trace_file_name); diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 8424103..4cbb817 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -48,9 +48,6 @@ #define H5B2_INT_VERSION 0 /* Internal node */ #define H5B2_LEAF_VERSION 0 /* Leaf node */ -/* Size of stack buffer for serialized headers */ -#define H5B2_HDR_BUF_SIZE 128 - /******************/ /* Local Typedefs */ @@ -67,21 +64,32 @@ /********************/ /* Metadata cache callbacks */ -static H5B2_t *H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_t *b, unsigned UNUSED * flags_ptr); -static herr_t H5B2_cache_hdr_dest(H5F_t *f, H5B2_t *bt2); -static herr_t H5B2_cache_hdr_clear(H5F_t *f, H5B2_t *b, hbool_t destroy); -static herr_t H5B2_cache_hdr_size(const H5F_t *f, const H5B2_t *bt, size_t *size_ptr); -static H5B2_internal_t *H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B2_cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *i, unsigned UNUSED * flags_ptr); -static herr_t H5B2_cache_internal_dest(H5F_t *f, H5B2_internal_t *internal); -static herr_t H5B2_cache_internal_clear(H5F_t *f, H5B2_internal_t *i, hbool_t destroy); -static herr_t H5B2_cache_internal_size(const H5F_t *f, const H5B2_internal_t *i, size_t *size_ptr); -static H5B2_leaf_t *H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B2_cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *l, unsigned UNUSED * flags_ptr); -static herr_t H5B2_cache_leaf_dest(H5F_t *f, H5B2_leaf_t *leaf); -static herr_t H5B2_cache_leaf_clear(H5F_t *f, H5B2_leaf_t *l, hbool_t destroy); -static herr_t H5B2_cache_leaf_size(const H5F_t *f, const H5B2_leaf_t *l, size_t *size_ptr); +static herr_t H5B2_cache_hdr_get_load_size(const void *udata, size_t *image_len); +static void *H5B2_cache_hdr_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5B2_cache_hdr_image_len(const void *thing, size_t *image_len); +static herr_t H5B2_cache_hdr_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 H5B2_cache_hdr_free_icr(void *thing); + +static herr_t H5B2_cache_int_get_load_size(const void *udata, size_t *image_len); +static void *H5B2_cache_int_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5B2_cache_int_image_len(const void *thing, size_t *image_len); +static herr_t H5B2_cache_int_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 H5B2_cache_int_free_icr(void *thing); + +static herr_t H5B2_cache_leaf_get_load_size(const void *udata, size_t *image_len); +static void *H5B2_cache_leaf_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5B2_cache_leaf_image_len(const void *thing, size_t *image_len); +static herr_t H5B2_cache_leaf_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 H5B2_cache_leaf_free_icr(void *thing); /*********************/ /* Package Variables */ @@ -90,31 +98,40 @@ static herr_t H5B2_cache_leaf_size(const H5F_t *f, const H5B2_leaf_t *l, size_t /* H5B2 inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_BT2_HDR[1] = {{ H5AC_BT2_HDR_ID, - (H5AC_load_func_t)H5B2_cache_hdr_load, - (H5AC_flush_func_t)H5B2_cache_hdr_flush, - (H5AC_dest_func_t)H5B2_cache_hdr_dest, - (H5AC_clear_func_t)H5B2_cache_hdr_clear, - (H5AC_size_func_t)H5B2_cache_hdr_size, + "v2 b-tree header", + H5FD_MEM_BTREE, + H5AC__CLASS_NO_FLAGS_SET, + H5B2_cache_hdr_get_load_size, + H5B2_cache_hdr_deserialize, + H5B2_cache_hdr_image_len, + H5B2_cache_hdr_serialize, + H5B2_cache_hdr_free_icr, }}; /* H5B2 inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_BT2_INT[1] = {{ H5AC_BT2_INT_ID, - (H5AC_load_func_t)H5B2_cache_internal_load, - (H5AC_flush_func_t)H5B2_cache_internal_flush, - (H5AC_dest_func_t)H5B2_cache_internal_dest, - (H5AC_clear_func_t)H5B2_cache_internal_clear, - (H5AC_size_func_t)H5B2_cache_internal_size, + "v2 b-tree internal node", + H5FD_MEM_BTREE, + H5AC__CLASS_NO_FLAGS_SET, + H5B2_cache_int_get_load_size, + H5B2_cache_int_deserialize, + H5B2_cache_int_image_len, + H5B2_cache_int_serialize, + H5B2_cache_int_free_icr, }}; /* H5B2 inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_BT2_LEAF[1] = {{ H5AC_BT2_LEAF_ID, - (H5AC_load_func_t)H5B2_cache_leaf_load, - (H5AC_flush_func_t)H5B2_cache_leaf_flush, - (H5AC_dest_func_t)H5B2_cache_leaf_dest, - (H5AC_clear_func_t)H5B2_cache_leaf_clear, - (H5AC_size_func_t)H5B2_cache_leaf_size, + "v2 b-tree leaf node", + H5FD_MEM_BTREE, + H5AC__CLASS_NO_FLAGS_SET, + H5B2_cache_leaf_get_load_size, + H5B2_cache_leaf_deserialize, + H5B2_cache_leaf_image_len, + H5B2_cache_leaf_serialize, + H5B2_cache_leaf_free_icr, }}; /*****************************/ @@ -129,7 +146,38 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{ /*------------------------------------------------------------------------- - * Function: H5B2_cache_hdr_load + * Function: H5B2_cache_hdr_get_load_size + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5B2_cache_hdr_get_load_size(const void *_udata, size_t *image_len) +{ + const H5B2_hdr_cache_ud_t *udata = (const H5B2_hdr_cache_ud_t *)_udata; /* User data for callback */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_hdr_get_load_size) + + /* Check arguments */ + HDassert(udata); + HDassert(image_len); + + /* Set the image length size */ + *image_len = H5B2_HEADER_SIZE(udata->f); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B2_cache_hdr_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5B2_cache_hdr_deserialize * * Purpose: Loads a B-tree header from the disk. * @@ -143,8 +191,9 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{ * *------------------------------------------------------------------------- */ -static H5B2_t * -H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5B2_cache_hdr_deserialize(const void *image, size_t UNUSED len, + void *_udata, hbool_t UNUSED *dirty) { H5B2_hdr_cache_ud_t *udata = (H5B2_hdr_cache_ud_t *)_udata; unsigned depth; /* Depth of B-tree */ @@ -153,17 +202,13 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) H5B2_t *bt2 = NULL; /* B-tree info */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5B2_HDR_BUF_SIZE]; /* Buffer for header */ - uint8_t *hdr; /* Pointer to header buffer */ const uint8_t *p; /* Pointer into raw data buffer */ H5B2_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_load) + FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_deserialize) /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(udata); /* Allocate space for the B-tree data structure */ @@ -171,23 +216,11 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") HDmemset(&bt2->cache_info, 0, sizeof(H5AC_info_t)); - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, NULL, "can't wrap buffer") - /* Compute the size of the serialized B-tree header on disk */ bt2->hdr_size = H5B2_HEADER_SIZE(udata->f); - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (hdr = (uint8_t *)H5WB_actual(wb, bt2->hdr_size))) - HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_BTREE, addr, bt2->hdr_size, dxpl_id, hdr) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree header") - /* Get temporary pointer to serialized header */ - p = hdr; + p = (const uint8_t *)image; /* Magic number */ if(HDmemcmp(p, H5B2_HDR_MAGIC, (size_t)H5B2_SIZEOF_MAGIC)) @@ -223,11 +256,8 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Metadata checksum */ UINT32DECODE(p, stored_chksum); - /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)hdr) == bt2->hdr_size); - /* Compute checksum on entire header */ - computed_chksum = H5_checksum_metadata(hdr, (bt2->hdr_size - H5B2_SIZEOF_CHKSUM), 0); + computed_chksum = H5_checksum_metadata(image, (bt2->hdr_size - H5B2_SIZEOF_CHKSUM), 0); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -237,23 +267,54 @@ H5B2_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(H5B2_shared_init(udata->f, bt2, udata->type, depth, node_size, rrec_size, split_percent, merge_percent) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't create shared B-tree info") + /* Sanity check */ + HDassert((size_t)(p - (const uint8_t *)image) <= len); + /* Set return value */ ret_value = bt2; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && bt2) if(H5B2_hdr_dest(bt2) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree header node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_cache_hdr_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5B2_cache_hdr_deserialize() */ /*lint !e818 Can't make udata a pointer to const */ + + +/*------------------------------------------------------------------------- + * Function: H5B2_cache_hdr_image_len + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5B2_cache_hdr_image_len(const void *_thing, size_t *image_len) +{ + const H5B2_t *bt2 = (const H5B2_t *)_thing; /* Pointer to the B-tree header */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_hdr_image_len) + + /* Check arguments */ + HDassert(bt2); + HDassert(image_len); + + /* Set the image length size */ + *image_len = bt2->hdr_size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B2_cache_hdr_image_len() */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_hdr_flush + * Function: H5B2_cache_hdr_serialize * * Purpose: Flushes a dirty B-tree header to disk. * @@ -266,203 +327,150 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B2_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_t *bt2, unsigned UNUSED * flags_ptr) +H5B2_cache_hdr_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) { - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5B2_HDR_BUF_SIZE]; /* Buffer for header */ - herr_t ret_value = SUCCEED; /* Return value */ + H5B2_t *bt2 = (H5B2_t *)_thing; /* Pointer to the B-tree header */ + H5B2_shared_t *shared; /* Shared B-tree information */ + uint8_t *p; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_hdr_serialize) /* check arguments */ HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(bt2); + HDassert(flags); - if (bt2->cache_info.is_dirty) { - H5B2_shared_t *shared; /* Shared B-tree information */ - uint8_t *hdr; /* Pointer to header buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - - /* Get the pointer to the shared B-tree info */ - shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2->shared); - HDassert(shared); - - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (hdr = (uint8_t *)H5WB_actual(wb, bt2->hdr_size))) - HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, FAIL, "can't get actual buffer") - - /* Get temporary pointer to serialized header */ - p = hdr; - - /* Magic number */ - HDmemcpy(p, H5B2_HDR_MAGIC, (size_t)H5B2_SIZEOF_MAGIC); - p += H5B2_SIZEOF_MAGIC; + /* Get the pointer to the shared B-tree info */ + shared = (H5B2_shared_t *)H5RC_GET_OBJ(bt2->shared); + HDassert(shared); - /* Version # */ - *p++ = H5B2_HDR_VERSION; + /* Get temporary pointer to serialized header */ + p = (uint8_t *)image; - /* B-tree type */ - *p++ = shared->type->id; + /* Magic number */ + HDmemcpy(p, H5B2_HDR_MAGIC, (size_t)H5B2_SIZEOF_MAGIC); + p += H5B2_SIZEOF_MAGIC; - /* Node size (in bytes) */ - UINT32ENCODE(p, shared->node_size); + /* Version # */ + *p++ = H5B2_HDR_VERSION; - /* Raw key size (in bytes) */ - UINT16ENCODE(p, shared->rrec_size); + /* B-tree type */ + *p++ = shared->type->id; - /* Depth of tree */ - UINT16ENCODE(p, shared->depth); + /* Node size (in bytes) */ + UINT32ENCODE(p, shared->node_size); - /* Split & merge %s */ - H5_CHECK_OVERFLOW(shared->split_percent, /* From: */ unsigned, /* To: */ uint8_t); - *p++ = (uint8_t)shared->split_percent; - H5_CHECK_OVERFLOW(shared->merge_percent, /* From: */ unsigned, /* To: */ uint8_t); - *p++ = (uint8_t)shared->merge_percent; + /* Raw key size (in bytes) */ + UINT16ENCODE(p, shared->rrec_size); - /* Root node pointer */ - H5F_addr_encode(f, &p, bt2->root.addr); - UINT16ENCODE(p, bt2->root.node_nrec); - H5F_ENCODE_LENGTH(f, p, bt2->root.all_nrec); + /* Depth of tree */ + UINT16ENCODE(p, shared->depth); - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(hdr, (bt2->hdr_size - H5B2_SIZEOF_CHKSUM), 0); + /* Split & merge %s */ + H5_CHECK_OVERFLOW(shared->split_percent, /* From: */ unsigned, /* To: */ uint8_t); + *p++ = (uint8_t)shared->split_percent; + H5_CHECK_OVERFLOW(shared->merge_percent, /* From: */ unsigned, /* To: */ uint8_t); + *p++ = (uint8_t)shared->merge_percent; - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + /* Root node pointer */ + H5F_addr_encode(f, &p, bt2->root.addr); + UINT16ENCODE(p, bt2->root.node_nrec); + H5F_ENCODE_LENGTH(f, p, bt2->root.all_nrec); - /* Write the B-tree header. */ - HDassert((size_t)(p - hdr) == bt2->hdr_size); - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, bt2->hdr_size, dxpl_id, hdr) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree header to disk") + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(image, (bt2->hdr_size - H5B2_SIZEOF_CHKSUM), 0); - bt2->cache_info.is_dirty = FALSE; - } /* end if */ + /* Metadata checksum */ + UINT32ENCODE(p, metadata_chksum); - if(destroy) - if(H5B2_hdr_dest(bt2) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header") + /* Reset the cache flags for this operation */ + *flags = 0; -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_BTREE, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + /* Sanity check */ + HDassert((size_t)(p - (uint8_t *)image) <= len); - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_cache_hdr_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5B2_cache_hdr_serialize() */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_hdr_dest + * Function: H5B2_cache_hdr_free_icr * - * Purpose: Destroys a B-tree header in memory. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 1 2005 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * June 18, 2008 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5B2_cache_hdr_dest(H5F_t UNUSED *f, H5B2_t *bt2) +H5B2_cache_hdr_free_icr(void *thing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_dest) + FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_free_icr) /* Check arguments */ - HDassert(bt2); + HDassert(thing); /* Destroy v2 b-tree header */ - if(H5B2_hdr_dest(bt2) < 0) + if(H5B2_hdr_dest((H5B2_t *)thing) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header node") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_cache_hdr_dest() */ +} /* H5B2_cache_hdr_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_hdr_clear + * Function: H5B2_cache_int_get_load_size * - * Purpose: Mark a B-tree header in memory as non-dirty. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 1 2005 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5B2_cache_hdr_clear(H5F_t UNUSED *f, H5B2_t *bt2, hbool_t destroy) +H5B2_cache_int_get_load_size(const void *_udata, size_t *image_len) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5B2_internal_cache_ud_t *udata = (const H5B2_internal_cache_ud_t *)_udata; /* User data for callback */ + H5B2_shared_t *shared; /* Pointer to B-tree's shared information */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_hdr_clear) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_int_get_load_size) - /* - * Check arguments. - */ - HDassert(bt2); - - /* Reset the dirty flag. */ - bt2->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5B2_hdr_dest(bt2) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_cache_hdr_clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5B2_cache_hdr_size - * - * Purpose: Compute the size in bytes of a B-tree header - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 1 2005 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5B2_cache_hdr_size(const H5F_t UNUSED *f, const H5B2_t *bt2, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_hdr_size) + /* Check arguments */ + HDassert(udata); + HDassert(image_len); - /* check arguments */ - HDassert(f); - HDassert(size_ptr); + /* Get the pointer to the shared B-tree info */ + shared = (H5B2_shared_t *)H5RC_GET_OBJ(udata->bt2_shared); + HDassert(shared); - /* Set size value */ - *size_ptr = bt2->hdr_size; + /* Set the image length size */ + *image_len = shared->node_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_cache_hdr_size() */ +} /* end H5B2_cache_int_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_internal_load + * Function: H5B2_cache_int_deserialize * - * Purpose: Loads a B-tree internal node from the disk. + * Purpose: Deserialize a B-tree internal node from the disk. * * Return: Success: Pointer to a new B-tree internal node. * Failure: NULL @@ -473,8 +481,9 @@ H5B2_cache_hdr_size(const H5F_t UNUSED *f, const H5B2_t *bt2, size_t *size_ptr) * *------------------------------------------------------------------------- */ -static H5B2_internal_t * -H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5B2_cache_int_deserialize(const void *image, size_t UNUSED len, + void *_udata, hbool_t UNUSED *dirty) { H5B2_internal_cache_ud_t *udata = (H5B2_internal_cache_ud_t *)_udata; /* Pointer to user data */ H5B2_shared_t *shared; /* Shared B-tree information */ @@ -487,11 +496,10 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) unsigned u; /* Local index variable */ H5B2_internal_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_internal_load) + FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_int_deserialize) /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(udata); /* Allocate new internal node and reset cache info */ @@ -507,11 +515,7 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) shared = (H5B2_shared_t *)H5RC_GET_OBJ(internal->shared); HDassert(shared); - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_BTREE, addr, shared->node_size, dxpl_id, shared->page)<0) - HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree internal node") - - p = shared->page; + p = (const uint8_t *)image; /* Magic number */ if(HDmemcmp(p, H5B2_INT_MAGIC, (size_t)H5B2_SIZEOF_MAGIC)) @@ -566,13 +570,13 @@ H5B2_cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end for */ /* Compute checksum on internal node */ - computed_chksum = H5_checksum_metadata(shared->page, (size_t)(p - (const uint8_t *)shared->page), 0); + computed_chksum = H5_checksum_metadata(image, (size_t)(p - (const uint8_t *)image), 0); /* Metadata checksum */ UINT32DECODE(p, stored_chksum); /* Sanity check parsing */ - HDassert((size_t)(p - (const uint8_t *)shared->page) <= shared->node_size); + HDassert((size_t)(p - (const uint8_t *)image) <= len); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -587,219 +591,213 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_cache_internal_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* H5B2_cache_int_deserialize() */ /*lint !e818 Can't make udata a pointer to const */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_internal_flush + * Function: H5B2_cache_int_image_len * - * Purpose: Flushes a dirty B-tree internal node to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 3 2005 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5B2_cache_internal_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_internal_t *internal, unsigned UNUSED * flags_ptr) +H5B2_cache_int_image_len(const void *_thing, size_t *image_len) { - herr_t ret_value = SUCCEED; /* Return value */ + 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(H5B2_cache_internal_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_int_image_len) - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(internal); + HDassert(image_len); - if(internal->cache_info.is_dirty) { - H5B2_shared_t *shared; /* Shared B-tree information */ - uint8_t *p; /* Pointer into raw data buffer */ - uint8_t *native; /* Pointer to native record info */ - H5B2_node_ptr_t *int_node_ptr; /* Pointer to node pointer info */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - unsigned u; /* Local index variable */ - - /* Get the pointer to the shared B-tree info */ - shared = (H5B2_shared_t *)H5RC_GET_OBJ(internal->shared); - HDassert(shared); - - p = shared->page; - - /* Magic number */ - HDmemcpy(p, H5B2_INT_MAGIC, (size_t)H5B2_SIZEOF_MAGIC); - p += H5B2_SIZEOF_MAGIC; - - /* Version # */ - *p++ = H5B2_INT_VERSION; - - /* B-tree type */ - *p++ = shared->type->id; - HDassert((size_t)(p - shared->page) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); - - /* Serialize records for internal node */ - native = internal->int_native; - for(u = 0; u < internal->nrec; u++) { - /* Encode record */ - if((shared->type->encode)(f, p, native) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record") - - /* Move to next record */ - p += shared->rrec_size; - native += shared->type->nrec_size; - } /* end for */ - - /* Serialize node pointers for internal node */ - int_node_ptr = internal->node_ptrs; - for(u = 0; u < internal->nrec + 1; u++) { - /* Encode node pointer */ - H5F_addr_encode(f, &p, int_node_ptr->addr); - UINT64ENCODE_VAR(p, int_node_ptr->node_nrec, shared->max_nrec_size); - if(internal->depth > 1) - UINT64ENCODE_VAR(p, int_node_ptr->all_nrec, shared->node_info[internal->depth - 1].cum_max_nrec_size); - - /* Move to next node pointer */ - int_node_ptr++; - } /* end for */ - - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(shared->page, (size_t)(p - shared->page), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Write the B-tree internal node */ - HDassert((size_t)(p - shared->page) <= shared->node_size); - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, shared->node_size, dxpl_id, shared->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree internal node to disk") - - internal->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5B2_internal_dest(internal) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree internal node") + /* Get the pointer to the shared B-tree info */ + shared = (H5B2_shared_t *)H5RC_GET_OBJ(internal->shared); + HDassert(shared); -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_cache_internal_flush() */ + /* Set the image length size */ + *image_len = shared->node_size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B2_cache_int_image_len() */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_internal_dest + * Function: H5B2_cache_int_serialize * - * Purpose: Destroys a B-tree internal node in memory. + * Purpose: Serializes a B-tree internal node for writing to disk. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * koziol@ncsa.uiuc.edu - * Feb 2 2005 + * Feb 3 2005 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5B2_cache_internal_dest(H5F_t UNUSED *f, H5B2_internal_t *internal) +H5B2_cache_int_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) { - herr_t ret_value = SUCCEED; /* Return value */ + H5B2_internal_t *internal = (H5B2_internal_t *)_thing; /* Pointer to the B-tree internal node */ + H5B2_shared_t *shared; /* Shared B-tree information */ + uint8_t *p; /* Pointer into raw data buffer */ + uint8_t *native; /* Pointer to native record info */ + H5B2_node_ptr_t *int_node_ptr; /* Pointer to node pointer info */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_internal_dest) + FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_int_serialize) - /* Check arguments */ + /* check arguments */ + HDassert(f); + HDassert(image); HDassert(internal); + HDassert(flags); - /* Destroy v2 b-tree internal node */ - if(H5B2_internal_dest(internal) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree internal node") + /* Get the pointer to the shared B-tree info */ + shared = (H5B2_shared_t *)H5RC_GET_OBJ(internal->shared); + HDassert(shared); + + p = (uint8_t *)image; + + /* Magic number */ + HDmemcpy(p, H5B2_INT_MAGIC, (size_t)H5B2_SIZEOF_MAGIC); + p += H5B2_SIZEOF_MAGIC; + + /* Version # */ + *p++ = H5B2_INT_VERSION; + + /* B-tree type */ + *p++ = shared->type->id; + HDassert((size_t)(p - (uint8_t *)image) == (H5B2_INT_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); + + /* Serialize records for internal node */ + native = internal->int_native; + for(u = 0; u < internal->nrec; u++) { + /* Encode record */ + if((shared->type->encode)(f, p, native) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record") + + /* Move to next record */ + p += shared->rrec_size; + native += shared->type->nrec_size; + } /* end for */ + + /* Serialize node pointers for internal node */ + int_node_ptr = internal->node_ptrs; + for(u = 0; u < internal->nrec + 1; u++) { + /* Encode node pointer */ + H5F_addr_encode(f, &p, int_node_ptr->addr); + UINT64ENCODE_VAR(p, int_node_ptr->node_nrec, shared->max_nrec_size); + if(internal->depth > 1) + UINT64ENCODE_VAR(p, int_node_ptr->all_nrec, shared->node_info[internal->depth - 1].cum_max_nrec_size); + + /* Move to next node pointer */ + int_node_ptr++; + } /* end for */ + + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(image, (size_t)(p - (uint8_t *)image), 0); + + /* Metadata checksum */ + UINT32ENCODE(p, metadata_chksum); + + /* Reset the cache flags for this operation */ + *flags = 0; + + /* Sanity check */ + HDassert((size_t)(p - (uint8_t *)image) <= len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_cache_internal_dest() */ +} /* H5B2_cache_int_serialize() */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_internal_clear + * Function: H5B2_cache_int_free_icr * - * Purpose: Mark a B-tree internal node in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * June 18, 2008 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5B2_cache_internal_clear(H5F_t UNUSED *f, H5B2_internal_t *internal, hbool_t destroy) +H5B2_cache_int_free_icr(void *thing) { - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_internal_clear) + herr_t ret_value = SUCCEED; /* Return value */ - /* - * Check arguments. - */ - HDassert(internal); + FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_int_free_icr) - /* Reset the dirty flag. */ - internal->cache_info.is_dirty = FALSE; + /* Check arguments */ + HDassert(thing); - if(destroy) - if(H5B2_internal_dest(internal) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree internal node") + /* Destroy v2 b-tree internal node */ + if(H5B2_internal_dest((H5B2_internal_t *)thing) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree internal node") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_cache_internal_clear() */ +} /* H5B2_cache_int_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_internal_size + * Function: H5B2_cache_leaf_get_load_size * - * Purpose: Compute the size in bytes of a B-tree internal node - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5B2_cache_internal_size(const H5F_t UNUSED *f, const H5B2_internal_t *internal, size_t *size_ptr) +H5B2_cache_leaf_get_load_size(const void *_udata, size_t *image_len) { - H5B2_shared_t *shared; /* Shared B-tree information */ + const H5B2_leaf_cache_ud_t *udata = (const H5B2_leaf_cache_ud_t *)_udata; /* User data for callback */ + H5B2_shared_t *shared; /* Pointer to B-tree's shared information */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_internal_size) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_leaf_get_load_size) - /* check arguments */ - HDassert(internal); - HDassert(size_ptr); + /* Check arguments */ + HDassert(udata); + HDassert(image_len); /* Get the pointer to the shared B-tree info */ - shared = (H5B2_shared_t *)H5RC_GET_OBJ(internal->shared); + shared = (H5B2_shared_t *)H5RC_GET_OBJ(udata->bt2_shared); HDassert(shared); - /* Set size value */ - *size_ptr = shared->node_size; + /* Set the image length size */ + *image_len = shared->node_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_cache_internal_size() */ +} /* end H5B2_cache_leaf_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_leaf_load + * Function: H5B2_cache_leaf_deserialize * - * Purpose: Loads a B-tree leaf from the disk. + * Purpose: Deserialize a B-tree leaf from the disk. * * Return: Success: Pointer to a new B-tree leaf node. * Failure: NULL @@ -810,8 +808,9 @@ H5B2_cache_internal_size(const H5F_t UNUSED *f, const H5B2_internal_t *internal, * *------------------------------------------------------------------------- */ -static H5B2_leaf_t * -H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5B2_cache_leaf_deserialize(const void *image, size_t UNUSED len, + void *_udata, hbool_t UNUSED *dirty) { H5B2_leaf_cache_ud_t *udata = (H5B2_leaf_cache_ud_t *)_udata; H5B2_shared_t *shared; /* Shared B-tree information */ @@ -823,11 +822,10 @@ H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) unsigned u; /* Local index variable */ H5B2_leaf_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_load) + FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_deserialize) /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(udata); if(NULL == (leaf = H5FL_MALLOC(H5B2_leaf_t))) @@ -842,11 +840,7 @@ H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) shared = (H5B2_shared_t *)H5RC_GET_OBJ(leaf->shared); HDassert(shared); - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_BTREE, addr, shared->node_size, dxpl_id, shared->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree leaf node") - - p = shared->page; + p = (const uint8_t *)image; /* Magic number */ if(HDmemcmp(p, H5B2_LEAF_MAGIC, (size_t)H5B2_SIZEOF_MAGIC)) @@ -880,19 +874,22 @@ H5B2_cache_leaf_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) native += shared->type->nrec_size; } /* end for */ - /* Compute checksum on internal node */ - computed_chksum = H5_checksum_metadata(shared->page, (size_t)(p - (const uint8_t *)shared->page), 0); + /* Compute checksum on leaf node */ + computed_chksum = H5_checksum_metadata(image, (size_t)(p - (const uint8_t *)image), 0); /* Metadata checksum */ UINT32DECODE(p, stored_chksum); /* Sanity check parsing */ - HDassert((size_t)(p - (const uint8_t *)shared->page) <= shared->node_size); + HDassert((size_t)(p - (const uint8_t *)image) <= shared->node_size); /* Verify checksum */ if(stored_chksum != computed_chksum) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "incorrect metadata checksum for v2 leaf node") + /* Sanity check */ + HDassert((size_t)(p - (const uint8_t *)image) <= len); + /* Set return value */ ret_value = leaf; @@ -902,97 +899,49 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_cache_leaf_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* H5B2_cache_leaf_deserialize() */ /*lint !e818 Can't make udata a pointer to const */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_leaf_flush + * Function: H5B2_cache_leaf_image_len * - * Purpose: Flushes a dirty B-tree leaf node to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5B2_cache_leaf_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B2_leaf_t *leaf, unsigned UNUSED * flags_ptr) +H5B2_cache_leaf_image_len(const void *_thing, size_t *image_len) { - herr_t ret_value = SUCCEED; /* Return value */ + 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(H5B2_cache_leaf_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_leaf_image_len) - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(leaf); + HDassert(image_len); - if(leaf->cache_info.is_dirty) { - H5B2_shared_t *shared; /* Shared B-tree information */ - uint8_t *p; /* Pointer into raw data buffer */ - uint8_t *native; /* Pointer to native keys */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - unsigned u; /* Local index variable */ - - /* Get the pointer to the shared B-tree info */ - shared = (H5B2_shared_t *)H5RC_GET_OBJ(leaf->shared); - HDassert(shared); - - p = shared->page; - - /* magic number */ - HDmemcpy(p, H5B2_LEAF_MAGIC, (size_t)H5B2_SIZEOF_MAGIC); - p += H5B2_SIZEOF_MAGIC; - - /* version # */ - *p++ = H5B2_LEAF_VERSION; - - /* b-tree type */ - *p++ = shared->type->id; - HDassert((size_t)(p - shared->page) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); - - /* Serialize records for leaf node */ - native = leaf->leaf_native; - for(u = 0; u < leaf->nrec; u++) { - /* Encode record */ - if((shared->type->encode)(f, p, native) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record") - - /* Move to next record */ - p += shared->rrec_size; - native += shared->type->nrec_size; - } /* end for */ - - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(shared->page, (size_t)(p - shared->page), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Write the B-tree leaf node */ - HDassert((size_t)(p - shared->page) <= shared->node_size); - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, shared->node_size, dxpl_id, shared->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree leaf node to disk") - - leaf->cache_info.is_dirty = FALSE; - } /* end if */ + /* Get the pointer to the shared B-tree info */ + shared = (H5B2_shared_t *)H5RC_GET_OBJ(leaf->shared); + HDassert(shared); - if(destroy) - if(H5B2_leaf_dest(leaf) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") + /* Set the image length size */ + *image_len = shared->node_size; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5B2_cache_leaf_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B2_cache_leaf_image_len() */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_leaf_dest + * Function: H5B2_cache_leaf_serialize * - * Purpose: Destroys a B-tree leaf node in memory. + * Purpose: Serializes a B-tree leaf node for writing to disk. * * Return: Non-negative on success/Negative on failure * @@ -1002,97 +951,103 @@ done: * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5B2_cache_leaf_dest(H5F_t UNUSED *f, H5B2_leaf_t *leaf) +H5B2_cache_leaf_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) { - herr_t ret_value = SUCCEED; /* Return value */ + H5B2_leaf_t *leaf = (H5B2_leaf_t *)_thing; /* Pointer to the B-tree leaf node */ + H5B2_shared_t *shared; /* Shared B-tree information */ + uint8_t *p; /* Pointer into raw data buffer */ + uint8_t *native; /* Pointer to native keys */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_dest) + FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_serialize) - /* Check arguments */ + /* check arguments */ + HDassert(f); + HDassert(image); HDassert(leaf); + HDassert(flags); - /* Destroy v2 b-tree leaf node */ - if(H5B2_leaf_dest(leaf) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") + /* Get the pointer to the shared B-tree info */ + shared = (H5B2_shared_t *)H5RC_GET_OBJ(leaf->shared); + HDassert(shared); -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_cache_leaf_dest() */ + p = (uint8_t *)image; - -/*------------------------------------------------------------------------- - * Function: H5B2_cache_leaf_clear - * - * Purpose: Mark a B-tree leaf node in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static herr_t -H5B2_cache_leaf_clear(H5F_t UNUSED *f, H5B2_leaf_t *leaf, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; + /* magic number */ + HDmemcpy(p, H5B2_LEAF_MAGIC, (size_t)H5B2_SIZEOF_MAGIC); + p += H5B2_SIZEOF_MAGIC; - FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_clear) + /* version # */ + *p++ = H5B2_LEAF_VERSION; - /* - * Check arguments. - */ - HDassert(leaf); + /* b-tree type */ + *p++ = shared->type->id; + HDassert((size_t)(p - (const uint8_t *)image) == (H5B2_LEAF_PREFIX_SIZE - H5B2_SIZEOF_CHKSUM)); - /* Reset the dirty flag. */ - leaf->cache_info.is_dirty = FALSE; + /* Serialize records for leaf node */ + native = leaf->leaf_native; + for(u = 0; u < leaf->nrec; u++) { + /* Encode record */ + if((shared->type->encode)(f, p, native) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree record") - if(destroy) - if(H5B2_leaf_dest(leaf) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") + /* Move to next record */ + p += shared->rrec_size; + native += shared->type->nrec_size; + } /* end for */ + + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(image, (size_t)((const uint8_t *)p - (const uint8_t *)image), 0); + + /* Metadata checksum */ + UINT32ENCODE(p, metadata_chksum); + + /* Reset the cache flags for this operation */ + *flags = 0; + + /* Sanity check */ + HDassert((size_t)(p - (uint8_t *)image) <= len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B2_cache_leaf_clear() */ +} /* H5B2_cache_leaf_serialize() */ /*------------------------------------------------------------------------- - * Function: H5B2_cache_leaf_size + * Function: H5B2_cache_leaf_free_icr * - * Purpose: Compute the size in bytes of a B-tree leaf node - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Destroy/release an "in core representation" of a data + * structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 2 2005 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * June 18, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5B2_cache_leaf_size(const H5F_t UNUSED *f, const H5B2_leaf_t *leaf, size_t *size_ptr) +H5B2_cache_leaf_free_icr(void *thing) { - H5B2_shared_t *shared; /* Shared B-tree information */ - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B2_cache_leaf_size) + herr_t ret_value = SUCCEED; /* Return value */ - /* check arguments */ - HDassert(leaf); - HDassert(size_ptr); + FUNC_ENTER_NOAPI_NOINIT(H5B2_cache_leaf_free_icr) - /* Get the pointer to the shared B-tree info */ - shared = (H5B2_shared_t *)H5RC_GET_OBJ(leaf->shared); - HDassert(shared); + /* Check arguments */ + HDassert(thing); - /* Set size value */ - *size_ptr = shared->node_size; + /* Destroy v2 b-tree leaf node */ + if(H5B2_leaf_dest((H5B2_leaf_t *)thing) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B2_cache_leaf_size() */ +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5B2_cache_leaf_free_icr() */ 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; u<leaf->nrec; 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; u<leaf->nrec; 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; u<internal->nrec; 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; u<internal->nrec; u++) diff --git a/src/H5Bcache.c b/src/H5Bcache.c index 0537502..a3ee75e 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -54,11 +54,14 @@ /********************/ /* Metadata cache callbacks */ -static H5B_t *H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b, unsigned UNUSED * flags_ptr); -static herr_t H5B_dest(H5F_t *f, H5B_t *bt); -static herr_t H5B_clear(H5F_t *f, H5B_t *b, hbool_t destroy); -static herr_t H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr); +static herr_t H5B_get_load_size(const void *udata, size_t *image_len); +static void *H5B_deserialize( const void *image, size_t len, void *udata, + hbool_t *dirty); +static herr_t H5B_image_len(const void *thing, size_t *image_len); +static herr_t H5B_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 H5B_free_icr(void *thing); /*********************/ @@ -68,11 +71,14 @@ static herr_t H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr /* H5B inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_BT[1] = {{ H5AC_BT_ID, - (H5AC_load_func_t)H5B_load, - (H5AC_flush_func_t)H5B_flush, - (H5AC_dest_func_t)H5B_dest, - (H5AC_clear_func_t)H5B_clear, - (H5AC_size_func_t)H5B_compute_size, + "v1 B-tree", + H5FD_MEM_BTREE, + H5AC__CLASS_NO_FLAGS_SET, + H5B_get_load_size, + H5B_deserialize, + H5B_image_len, + H5B_serialize, + H5B_free_icr, }}; /*******************/ @@ -82,35 +88,71 @@ const H5AC_class_t H5AC_BT[1] = {{ /*------------------------------------------------------------------------- - * Function: H5B_load + * Function: H5B_get_load_size * - * Purpose: Loads a B-tree node from the disk. + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5B_get_load_size(const void *_udata, size_t *image_len) +{ + const H5B_cache_ud_t *udata = (const H5B_cache_ud_t *)_udata; /* User data for callback */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_get_load_size) + + /* Check arguments */ + HDassert(udata); + HDassert(image_len); + + /* Get shared info for B-tree */ + shared = (H5B_shared_t *)H5RC_GET_OBJ(udata->rc_shared); + HDassert(shared); + + /* Set the image length size */ + *image_len = shared->sizeof_rnode; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5B_deserialize + * + * Purpose: Deserialize the data structure from disk. * * Return: Success: Pointer to a new B-tree node. * Failure: NULL * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 24, 2008 * *------------------------------------------------------------------------- */ -static H5B_t * -H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5B_deserialize(const void *image, size_t UNUSED len, void *_udata, + hbool_t UNUSED *dirty) { H5B_t *bt = NULL; /* Pointer to the deserialized B-tree node */ H5B_cache_ud_t *udata = (H5B_cache_ud_t *)_udata; /* User data for callback */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ - const uint8_t *p; /* Pointer into raw data buffer */ + const uint8_t *p; /* Pointer into image buffer */ uint8_t *native; /* Pointer to native keys */ unsigned u; /* Local index variable */ H5B_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B_load) + FUNC_ENTER_NOAPI_NOINIT(H5B_deserialize) - /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* check arguments */ + HDassert(image); HDassert(udata); /* Allocate the B-tree node in memory */ @@ -132,11 +174,8 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(NULL == (bt->child = H5FL_SEQ_MALLOC(haddr_t, (size_t)shared->two_k))) HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "can't allocate buffer for child addresses") - if(H5F_block_read(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_READERROR, NULL, "can't read B-tree node") - - /* Set the pointer into the raw data buffer */ - p = shared->page; + /* Set the pointer into the image */ + p = (const uint8_t *)image; /* magic number */ if(HDmemcmp(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC)) @@ -175,6 +214,9 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, NULL, "unable to decode key") } /* end if */ + /* Sanity check */ + HDassert((size_t)((const uint8_t *)p - (const uint8_t *)image) <= len); + /* Set return value */ ret_value = bt; @@ -184,207 +226,156 @@ done: HDONE_ERROR(H5E_BTREE, H5E_CANTFREE, NULL, "unable to destroy B-tree node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5B_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5B_flush + * Function: H5B_image_len * - * Purpose: Flushes a dirty B-tree node to disk. + * Purpose: Compute the size of the data structure on disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt, unsigned UNUSED * flags_ptr) +H5B_image_len(const void *_thing, size_t *image_len) { + const H5B_t *bt = (const H5B_t *)_thing; /* Pointer to the B-tree node */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ - herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_image_len) - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(bt); + HDassert(image_len); + + /* Get shared info for B-tree */ shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); HDassert(shared); - HDassert(shared->type); - HDassert(shared->type->encode); - - if(bt->cache_info.is_dirty) { - uint8_t *p; /* Pointer into raw data buffer */ - uint8_t *native; /* Pointer to native keys */ - unsigned u; /* Local index variable */ - - p = shared->page; - - /* magic number */ - HDmemcpy(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC); - p += 4; - - /* node type and level */ - *p++ = (uint8_t)shared->type->id; - H5_CHECK_OVERFLOW(bt->level, unsigned, uint8_t); - *p++ = (uint8_t)bt->level; - - /* entries used */ - UINT16ENCODE(p, bt->nchildren); - - /* sibling pointers */ - H5F_addr_encode(f, &p, bt->left); - H5F_addr_encode(f, &p, bt->right); - - /* child keys and pointers */ - native = bt->native; - for(u = 0; u < bt->nchildren; ++u) { - /* encode the key */ - if(shared->type->encode(shared, p, native) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") - p += shared->sizeof_rkey; - native += shared->type->sizeof_nkey; - - /* encode the child address */ - H5F_addr_encode(f, &p, bt->child[u]); - } /* end for */ - if(bt->nchildren > 0) { - /* Encode the final key */ - if(shared->type->encode(shared, p, native) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") - } /* end if */ - - /* - * Write the disk page. We always write the header, but we don't - * bother writing data for the child entries that don't exist or - * for the final unchanged children. - */ - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, shared->sizeof_rnode, dxpl_id, shared->page) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to save B-tree node to disk") - - bt->cache_info.is_dirty = FALSE; - } /* end if */ - if(destroy) - if(H5B_node_dest(bt) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") + /* Set the image length size */ + *image_len = shared->sizeof_rnode; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5B_image_len() */ /*------------------------------------------------------------------------- - * Function: H5B_dest + * Function: H5B_serialize * - * Purpose: Destroys a B-tree node in memory. + * Purpose: Serialize the data structure for writing to disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 24, 2008 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5B_dest(H5F_t UNUSED *f, H5B_t *bt) +H5B_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) { + H5B_t *bt = (H5B_t *)_thing; /* Pointer to the B-tree node */ + H5B_shared_t *shared; /* Pointer to shared B-tree info */ + uint8_t *p; /* Pointer into image buffer */ + uint8_t *native; /* Pointer to native keys */ + unsigned u; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5B_dest) + FUNC_ENTER_NOAPI_NOINIT(H5B_serialize) - /* - * Check arguments. - */ + /* check arguments */ + HDassert(image); HDassert(bt); HDassert(bt->rc_shared); + HDassert(flags); + shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); + HDassert(shared); - /* Destroy B-tree node */ - if(H5B_node_dest(bt) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") + /* Set the local pointer into the serialized image */ + p = (uint8_t *)image; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_dest() */ + /* magic number */ + HDmemcpy(p, H5B_MAGIC, (size_t)H5B_SIZEOF_MAGIC); + p += 4; - -/*------------------------------------------------------------------------- - * Function: H5B_clear - * - * Purpose: Mark a B-tree node in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static herr_t -H5B_clear(H5F_t UNUSED *f, H5B_t *bt, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; + /* node type and level */ + *p++ = (uint8_t)shared->type->id; + H5_CHECK_OVERFLOW(bt->level, unsigned, uint8_t); + *p++ = (uint8_t)bt->level; - FUNC_ENTER_NOAPI_NOINIT(H5B_clear) + /* entries used */ + UINT16ENCODE(p, bt->nchildren); - /* - * Check arguments. - */ - HDassert(bt); + /* sibling pointers */ + H5F_addr_encode(f, &p, bt->left); + H5F_addr_encode(f, &p, bt->right); + + /* child keys and pointers */ + native = bt->native; + for(u = 0; u < bt->nchildren; ++u) { + /* encode the key */ + if(shared->type->encode(shared, p, native) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") + p += shared->sizeof_rkey; + native += shared->type->sizeof_nkey; + + /* encode the child address */ + H5F_addr_encode(f, &p, bt->child[u]); + } /* end for */ + if(bt->nchildren > 0) { + /* Encode the final key */ + if(shared->type->encode(shared, p, native) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTENCODE, FAIL, "unable to encode B-tree key") + } /* end if */ - /* Reset the dirty flag. */ - bt->cache_info.is_dirty = FALSE; + /* Reset the cache flags for this operation (metadata not resized or renamed) */ + *flags = 0; - if(destroy) - if(H5B_node_dest(bt) < 0) - HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") + /* Sanity check */ + HDassert((size_t)((const uint8_t *)p - (const uint8_t *)image) <= len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_clear() */ +} /* end H5B_serialize() */ /*------------------------------------------------------------------------- - * Function: H5B_compute_size + * Function: H5B_free_icr * - * Purpose: Compute the size in bytes of the specified instance of - * H5B_t on disk, and return it in *len_ptr. On failure, - * the value of *len_ptr is undefined. + * Purpose: Destroy/release an "in core representation" of a data structure * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: John Mainzer - * 5/13/04 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 26, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5B_compute_size(const H5F_t UNUSED *f, const H5B_t *bt, size_t *size_ptr) +H5B_free_icr(void *thing) { - H5B_shared_t *shared; /* Pointer to shared B-tree info */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5B_compute_size) + FUNC_ENTER_NOAPI_NOINIT(H5B_free_icr) - /* check arguments */ - HDassert(f); - HDassert(bt); - HDassert(bt->rc_shared); - shared = (H5B_shared_t *)H5RC_GET_OBJ(bt->rc_shared); - HDassert(shared); - HDassert(shared->type); - HDassert(size_ptr); + /* Check arguments */ + HDassert(thing); - /* Set size value */ - *size_ptr = shared->sizeof_rnode; + /* Destroy B-tree node */ + if(H5B_node_dest((H5B_t *)thing) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5B_compute_size() */ +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5B_free_icr() */ @@ -88,6 +88,16 @@ /* + * Private macros. + */ +#if H5C_DO_MEMORY_SANITY_CHECKS +#define H5C_IMAGE_EXTRA_SPACE 8 +#define H5C_IMAGE_SANITY_VALUE "DeadBeef" +#else /* H5C_DO_MEMORY_SANITY_CHECKS */ +#define H5C_IMAGE_EXTRA_SPACE 0 +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + +/* * Private file-scope variables. */ @@ -100,27 +110,21 @@ H5FL_DEFINE_STATIC(H5C_t); */ static herr_t H5C__auto_adjust_cache_size(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr); + hid_t dxpl_id, + hbool_t write_permitted); static herr_t H5C__autoadjust__ageout(H5F_t * f, + hid_t dxpl_id, double hit_rate, enum H5C_resize_status * status_ptr, size_t * new_max_cache_size_ptr, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr); + hbool_t write_permitted); static herr_t H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr); static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr); + hid_t dxpl_id, + hbool_t write_permitted); static herr_t H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr); @@ -132,19 +136,16 @@ static herr_t H5C__flash_increase_cache_size(H5C_t * cache_ptr, size_t old_entry_size, size_t new_entry_size); -static herr_t H5C_flush_single_entry(const H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +static herr_t H5C_flush_single_entry(const H5F_t * f, + hid_t dxpl_id, const H5C_class_t * type_ptr, - haddr_t addr, - unsigned flags, - hbool_t * first_flush_ptr, - hbool_t del_entry_from_slist_on_destroy); + haddr_t addr, + unsigned flags, + hbool_t del_entry_from_slist_on_destroy); static herr_t H5C_flush_invalidate_cache(const H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - unsigned flags); + hid_t dxpl_id, + unsigned flags); static void * H5C_load_entry(H5F_t * f, hid_t dxpl_id, @@ -153,11 +154,10 @@ static void * H5C_load_entry(H5F_t * f, void * udata); static herr_t H5C_make_space_in_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - size_t space_needed, - hbool_t write_permitted, - hbool_t * first_flush_ptr); + hid_t dxpl_id, + size_t space_needed, + hbool_t write_permitted); + #if H5C_DO_EXTREME_SANITY_CHECKS static herr_t H5C_validate_lru_list(H5C_t * cache_ptr); static herr_t H5C_verify_not_in_index(H5C_t * cache_ptr, @@ -182,25 +182,41 @@ static herr_t H5C_verify_not_in_index(H5C_t * cache_ptr, #define H5C__EPOCH_MARKER_TYPE H5C__MAX_NUM_TYPE_IDS -static void *H5C_epoch_marker_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, - void *udata); -static herr_t H5C_epoch_marker_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, - unsigned *flags_ptr); -static herr_t H5C_epoch_marker_dest(H5F_t *f, void *thing); -static herr_t H5C_epoch_marker_clear(H5F_t *f, void *thing, hbool_t dest); -static herr_t H5C_epoch_marker_size(const H5F_t *f, const void *thing, size_t *size_ptr); +static herr_t H5C_epoch_marker_get_load_size(const void *udata_ptr, + size_t *image_len_ptr); +static void * H5C_epoch_marker_deserialize(const void * image_ptr, + size_t len, + void * udata, + hbool_t * dirty_ptr); +static herr_t H5C_epoch_marker_image_len(const void * thing, + size_t *image_len_ptr); +static herr_t H5C_epoch_marker_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 H5C_epoch_marker_free_icr(void * thing); const H5C_class_t epoch_marker_class = { - /* id = */ H5C__EPOCH_MARKER_TYPE, - /* load = */ &H5C_epoch_marker_load, - /* flush = */ &H5C_epoch_marker_flush, - /* dest = */ &H5C_epoch_marker_dest, - /* clear = */ &H5C_epoch_marker_clear, - /* size = */ &H5C_epoch_marker_size + /* id = */ H5C__EPOCH_MARKER_TYPE, + /* 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, }; + + /*************************************************************************** * Class functions for H5C__EPOCH_MAKER_TYPE: * @@ -209,84 +225,66 @@ const H5C_class_t epoch_marker_class = * JRM - 11/16/04 * ***************************************************************************/ - -static void * -H5C_epoch_marker_load(H5F_t UNUSED * f, - hid_t UNUSED dxpl_id, - haddr_t UNUSED addr, - void UNUSED * udata) +static herr_t +H5C_epoch_marker_get_load_size(const void UNUSED *udata_ptr, + size_t UNUSED *image_len_ptr) { - void * ret_value = NULL; /* Return value */ + FUNC_ENTER_NOAPI_NOINIT(H5C_epoch_marker_get_load_size) - FUNC_ENTER_NOAPI(H5C_epoch_marker_load, NULL) + HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn.") - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "called unreachable fcn.") + FUNC_LEAVE_NOAPI(FAIL) +} /* end H5C_epoch_marker_get_load_size() */ -done: - FUNC_LEAVE_NOAPI(ret_value) -} - -static herr_t -H5C_epoch_marker_flush(H5F_t UNUSED *f, - hid_t UNUSED dxpl_id, - hbool_t UNUSED dest, - haddr_t UNUSED addr, - void UNUSED *thing, - unsigned UNUSED * flags_ptr) + +static void * +H5C_epoch_marker_deserialize(const void UNUSED * image_ptr, size_t UNUSED len, + void UNUSED * udata, hbool_t UNUSED * dirty_ptr) { - herr_t ret_value = FAIL; /* Return value */ - - FUNC_ENTER_NOAPI(H5C_epoch_marker_flush, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5C_epoch_marker_deserialize) - 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(NULL) +} /* end H5C_epoch_marker_deserialize() */ + static herr_t -H5C_epoch_marker_dest(H5F_t UNUSED * f, - void UNUSED * thing) +H5C_epoch_marker_image_len(const void UNUSED *thing, + 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_dest, 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_clear(H5F_t UNUSED * f, - void UNUSED * thing, - hbool_t UNUSED dest) +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(H5C_epoch_marker_clear, FAIL) + FUNC_ENTER_NOAPI_NOINIT(H5C_epoch_marker_serialize) - 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_serialize() */ + static herr_t -H5C_epoch_marker_size(const H5F_t UNUSED * f, - const void UNUSED * thing, - size_t UNUSED * size_ptr) +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_size, 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() */ /*------------------------------------------------------------------------- @@ -476,6 +474,8 @@ H5C_create(size_t max_cache_size, #endif /* NDEBUG */ ((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i; ((cache_ptr->epoch_markers)[i]).size = (size_t)0; + ((cache_ptr->epoch_markers)[i]).image_ptr = NULL; + ((cache_ptr->epoch_markers)[i]).image_up_to_date = FALSE; ((cache_ptr->epoch_markers)[i]).type = &epoch_marker_class; ((cache_ptr->epoch_markers)[i]).is_dirty = FALSE; ((cache_ptr->epoch_markers)[i]).dirtied = FALSE; @@ -738,37 +738,29 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, *------------------------------------------------------------------------- */ herr_t -H5C_dest(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_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 ); - - if ( H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, - H5C__FLUSH_INVALIDATE_FLAG) < 0 ) { + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + 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; - } + } /* end if */ cache_ptr->magic = 0; - cache_ptr = H5FL_FREE(H5C_t, cache_ptr); done: FUNC_LEAVE_NOAPI(ret_value) - } /* H5C_dest() */ @@ -839,95 +831,60 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_expunge_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_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; - hbool_t first_flush = TRUE; 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( type->clear ); - HDassert( type->dest ); - 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.") /* 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, - primary_dxpl_id, - secondary_dxpl_id, - entry_ptr->type, - entry_ptr->addr, - H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, - &first_flush, - 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() */ @@ -958,7 +915,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsigned flags) +H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags) { H5C_t * cache_ptr = f->shared->cache; herr_t status; @@ -966,7 +923,6 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign hbool_t destroy; hbool_t flushed_entries_last_pass; hbool_t flush_marked_entries; - hbool_t first_flush = TRUE; hbool_t ignore_protected; hbool_t tried_to_flush_protected_entry = FALSE; int32_t passes = 0; @@ -1006,8 +962,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign if ( destroy ) { status = H5C_flush_invalidate_cache(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, flags); if ( status < 0 ) { @@ -1068,7 +1023,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign * or may not flush all the entries in the slist. * * To make things more entertaining, with the advent of the - * fractal heap, the entry flush callback can cause entries + * fractal heap, the entry serialize callback can cause entries * to be dirtied, resized, and/or moved. * * To deal with this, we first make note of the initial @@ -1105,11 +1060,11 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign { entry_ptr = next_entry_ptr; - /* With the advent of the fractal heap, it is possible - * that the flush callback will dirty and/or resize + /* With the advent of the fractal heap, it is possible + * that the serialize callback will dirty and/or resize * other entries in the cache. In particular, while * Quincey has promised me that this will never happen, - * it is possible that the flush callback for an + * it is possible that the serialize callback for an * entry may protect an entry that is not in the cache, * perhaps causing the cache to flush and possibly * evict the entry associated with node_ptr to make @@ -1207,12 +1162,10 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign flushed_entries_size += entry_ptr->size; #endif /* H5C_DO_SANITY_CHECKS */ status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - NULL, + dxpl_id, + entry_ptr->type, entry_ptr->addr, flags, - &first_flush, FALSE); if ( status < 0 ) { @@ -1230,12 +1183,10 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign flushed_entries_size += entry_ptr->size; #endif /* H5C_DO_SANITY_CHECKS */ status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - NULL, + dxpl_id, + entry_ptr->type, entry_ptr->addr, flags, - &first_flush, FALSE); if ( status < 0 ) { @@ -1325,12 +1276,10 @@ done: */ herr_t H5C_flush_to_min_clean(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id) + hid_t dxpl_id) { H5C_t * cache_ptr; herr_t result; - hbool_t first_flush = TRUE; hbool_t write_permitted; #if 0 /* modified code -- commented out for now */ int i; @@ -1355,7 +1304,7 @@ H5C_flush_to_min_clean(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + dxpl_id, &write_permitted); if ( result < 0 ) { @@ -1375,11 +1324,9 @@ H5C_flush_to_min_clean(H5F_t * f, } #if 1 /* original code */ result = H5C_make_space_in_cache(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, (size_t)0, - write_permitted, - &first_flush); + write_permitted); if ( result < 0 ) { @@ -1882,8 +1829,7 @@ H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr, */ herr_t H5C_insert_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * thing, @@ -1891,7 +1837,6 @@ H5C_insert_entry(H5F_t * f, { H5C_t * cache_ptr; herr_t result; - hbool_t first_flush = TRUE; hbool_t insert_pinned; hbool_t set_flush_marker; hbool_t write_permitted = TRUE; @@ -1909,8 +1854,6 @@ H5C_insert_entry(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); - HDassert( type->flush ); - HDassert( type->size ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); @@ -1940,6 +1883,9 @@ H5C_insert_entry(H5F_t * f, entry_ptr->addr = addr; entry_ptr->type = type; + entry_ptr->image_ptr = NULL; + entry_ptr->image_up_to_date = FALSE; + /* newly inserted entries are assumed to be dirty */ entry_ptr->is_dirty = TRUE; @@ -1947,7 +1893,7 @@ H5C_insert_entry(H5F_t * f, entry_ptr->dirtied = FALSE; /* Retrieve the size of the thing */ - if((type->size)(f, thing, &(entry_ptr->size)) < 0) + if((type->image_len)(thing, &(entry_ptr->size)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing") HDassert(entry_ptr->size > 0 && entry_ptr->size < H5C_MAX_ENTRY_SIZE); @@ -1994,7 +1940,7 @@ H5C_insert_entry(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + dxpl_id, &write_permitted); if ( result < 0 ) { @@ -2042,11 +1988,9 @@ H5C_insert_entry(H5F_t * f, */ result = H5C_make_space_in_cache(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, space_needed, - write_permitted, - &first_flush); + write_permitted); if ( result < 0 ) { @@ -2071,7 +2015,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) } } @@ -2164,13 +2108,11 @@ done: #ifdef H5_HAVE_PARALLEL herr_t H5C_mark_entries_as_clean(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, int32_t ce_array_len, haddr_t * ce_array_ptr) { H5C_t * cache_ptr; - hbool_t first_flush = TRUE; int entries_cleared; int entries_examined; int i; @@ -2270,12 +2212,10 @@ H5C_mark_entries_as_clean(H5F_t * f, } else { if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, entry_ptr->type, addr, H5C__FLUSH_CLEAR_ONLY_FLAG, - &first_flush, TRUE) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.") @@ -2329,12 +2269,10 @@ H5C_mark_entries_as_clean(H5F_t * f, entries_cleared++; if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, clear_ptr->type, clear_ptr->addr, H5C__FLUSH_CLEAR_ONLY_FLAG, - &first_flush, TRUE) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.") @@ -2366,12 +2304,10 @@ H5C_mark_entries_as_clean(H5F_t * f, entries_cleared++; if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, clear_ptr->type, clear_ptr->addr, H5C__FLUSH_CLEAR_ONLY_FLAG, - &first_flush, TRUE) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't clear entry.") @@ -2469,6 +2405,7 @@ H5C_mark_entry_dirty(void *thing) /* mark the entry as dirty if it isn't already */ entry_ptr->is_dirty = TRUE; + entry_ptr->image_up_to_date = FALSE; if ( ! (entry_ptr->in_slist) ) { @@ -2611,6 +2548,8 @@ H5C_move_entry(H5C_t * cache_ptr, if ( ! ( entry_ptr->flush_in_progress ) ) { entry_ptr->is_dirty = TRUE; + /* This shouldn't be needed, but it keeps the test code happy */ + entry_ptr->image_up_to_date = FALSE; } H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL) @@ -2702,6 +2641,11 @@ H5C_resize_entry(void *thing, size_t new_size) /* mark the entry as dirty if it isn't already */ entry_ptr->is_dirty = TRUE; + entry_ptr->image_up_to_date = FALSE; + + /* Release the current image */ + if( entry_ptr->image_ptr ) + entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); /* do a flash cache size increase if appropriate */ if ( cache_ptr->flash_size_increase_possible ) { @@ -2821,18 +2765,6 @@ done: * or flushed -- nor may it be accessed by another call to * H5C_protect. Any attempt to do so will result in a failure. * - * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used on the first write occasioned - * by the insertion (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the - * metadata cache, but may not be needed elsewhere. If so, - * just use the same dxpl_id for both parameters. - * - * All reads are performed with the primary_dxpl_id. - * - * Similarly, the primary_dxpl_id is passed to the - * check_write_permitted function if it is called. - * * Return: Success: Ptr to the desired entry * Failure: NULL * @@ -2842,8 +2774,7 @@ done: */ void * H5C_protect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * udata, @@ -2851,7 +2782,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; @@ -2871,8 +2801,6 @@ H5C_protect(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); - HDassert( type->flush ); - HDassert( type->load ); HDassert( H5F_addr_defined(addr) ); #if H5C_DO_EXTREME_SANITY_CHECKS @@ -2903,7 +2831,7 @@ H5C_protect(H5F_t * f, hit = FALSE; - thing = H5C_load_entry(f, primary_dxpl_id, type, addr, udata); + thing = H5C_load_entry(f, dxpl_id, type, addr, udata); if ( thing == NULL ) { @@ -2942,7 +2870,7 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + dxpl_id, &write_permitted); if ( result < 0 ) { @@ -2954,7 +2882,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } } else { @@ -2962,7 +2889,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } HDassert( entry_ptr->size <= H5C_MAX_ENTRY_SIZE ); @@ -3003,10 +2929,10 @@ H5C_protect(H5F_t * f, * see no point in worrying about the fourth. */ - result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, - space_needed, write_permitted, - &first_flush); + result = H5C_make_space_in_cache(f, + dxpl_id, + space_needed, + write_permitted); if ( result < 0 ) { @@ -3084,7 +3010,7 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + dxpl_id, &write_permitted); if ( result < 0 ) { @@ -3096,7 +3022,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } } else { @@ -3104,7 +3029,6 @@ H5C_protect(H5F_t * f, have_write_permitted = TRUE; - first_flush = TRUE; } } @@ -3113,10 +3037,8 @@ H5C_protect(H5F_t * f, (cache_ptr->resize_ctl).epoch_length ) ) { result = H5C__auto_adjust_cache_size(f, - primary_dxpl_id, - secondary_dxpl_id, - write_permitted, - &first_flush); + dxpl_id, + write_permitted); if ( result != SUCCEED ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ @@ -3136,10 +3058,10 @@ H5C_protect(H5F_t * f, cache_ptr->cache_full = TRUE; - result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, - (size_t)0, write_permitted, - &first_flush); + result = H5C_make_space_in_cache(f, + dxpl_id, + (size_t)0, + write_permitted); if ( result < 0 ) { @@ -3522,7 +3444,8 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, */ if ( ( evictions_enabled != TRUE ) && ( ( cache_ptr->resize_ctl.incr_mode != H5C_incr__off ) || - ( cache_ptr->resize_ctl.decr_mode != H5C_decr__off ) ) ) { + ( cache_ptr->resize_ctl.flash_incr_mode != H5C_flash_incr__off ) || + ( cache_ptr->resize_ctl.decr_mode != H5C_decr__off ) ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Can't disable evictions when auto resize enabled.") @@ -4204,8 +4127,7 @@ done: */ herr_t H5C_unprotect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * thing, @@ -4240,8 +4162,6 @@ H5C_unprotect(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( type ); - HDassert( type->clear ); - HDassert( type->flush ); HDassert( H5F_addr_defined(addr) ); HDassert( thing ); HDassert( ! ( pin_entry && unpin_entry ) ); @@ -4357,7 +4277,10 @@ H5C_unprotect(H5F_t * f, } /* mark the entry as dirty if appropriate */ - entry_ptr->is_dirty = ( (entry_ptr->is_dirty) || dirtied ); + if(dirtied) { + entry_ptr->is_dirty = ( (entry_ptr->is_dirty) || dirtied ); + entry_ptr->image_up_to_date = FALSE; + } /* end if */ /* Pin or unpin the entry as requested. */ if ( pin_entry ) { @@ -4414,13 +4337,6 @@ H5C_unprotect(H5F_t * f, */ if ( deleted ) { - /* the following first flush flag will never be used as we are - * calling H5C_flush_single_entry with both the - * H5C__FLUSH_CLEAR_ONLY_FLAG and H5C__FLUSH_INVALIDATE_FLAG flags. - * However, it is needed for the function call. - */ - hbool_t dummy_first_flush = TRUE; - /* we can't delete a pinned entry */ HDassert ( ! (entry_ptr->is_pinned ) ); @@ -4440,12 +4356,10 @@ H5C_unprotect(H5F_t * f, } if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, type, addr, (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_INVALIDATE_FLAG), - &dummy_first_flush, TRUE) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush.") @@ -4454,13 +4368,6 @@ H5C_unprotect(H5F_t * f, #ifdef H5_HAVE_PARALLEL else if ( clear_entry ) { - /* the following first flush flag will never be used as we are - * calling H5C_flush_single_entry with the - * H5C__FLUSH_CLEAR_ONLY_FLAG flag. However, it is needed for - * the function call. - */ - hbool_t dummy_first_flush = TRUE; - /* verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) @@ -4477,12 +4384,10 @@ H5C_unprotect(H5F_t * f, } if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, type, addr, H5C__FLUSH_CLEAR_ONLY_FLAG, - &dummy_first_flush, TRUE) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't clear.") @@ -4792,10 +4697,8 @@ done: */ static herr_t H5C__auto_adjust_cache_size(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr) + hid_t dxpl_id, + hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; herr_t result; @@ -4996,13 +4899,11 @@ H5C__auto_adjust_cache_size(H5F_t * f, } else { result = H5C__autoadjust__ageout(f, + dxpl_id, hit_rate, &status, &new_max_cache_size, - primary_dxpl_id, - secondary_dxpl_id, - write_permitted, - first_flush_ptr); + write_permitted); if ( result != SUCCEED ) { @@ -5145,13 +5046,11 @@ done: */ static herr_t H5C__autoadjust__ageout(H5F_t * f, + hid_t dxpl_id, double hit_rate, enum H5C_resize_status * status_ptr, size_t * new_max_cache_size_ptr, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr) + hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; herr_t result; @@ -5192,8 +5091,7 @@ H5C__autoadjust__ageout(H5F_t * f, if ( cache_ptr->max_cache_size > (cache_ptr->resize_ctl).min_size ){ /* evict aged out cache entries if appropriate... */ - if(H5C__autoadjust__ageout__evict_aged_out_entries(f, primary_dxpl_id, - secondary_dxpl_id, write_permitted, first_flush_ptr) < 0) + if(H5C__autoadjust__ageout__evict_aged_out_entries(f, dxpl_id, write_permitted) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error flushing aged out entries.") /* ... and then reduce cache size if appropriate */ @@ -5394,10 +5292,8 @@ done: */ static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - hbool_t write_permitted, - hbool_t * first_flush_ptr) + hid_t dxpl_id, + hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; herr_t result; @@ -5451,24 +5347,20 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, if ( entry_ptr->is_dirty ) { result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, entry_ptr->type, entry_ptr->addr, H5C__NO_FLAGS_SET, - first_flush_ptr, FALSE); } else { bytes_evicted += entry_ptr->size; result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, entry_ptr->type, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, TRUE); } @@ -5561,12 +5453,10 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, if ( ! (entry_ptr->is_dirty) ) { result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, entry_ptr->type, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, TRUE); if ( result < 0 ) { @@ -5577,6 +5467,10 @@ 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 not be called, + * and thus we needn't test to see if the LRU has been changed + * out from under us. */ entry_ptr = prev_ptr; @@ -6048,16 +5942,12 @@ done: */ static herr_t H5C_flush_invalidate_cache(const H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, unsigned flags) { H5C_t * cache_ptr = f->shared->cache; herr_t status; hbool_t done = FALSE; - hbool_t first_flush = TRUE; - hbool_t first_pass = TRUE; - hbool_t have_pinned_entries; int32_t protected_entries = 0; int32_t i; int32_t cur_pel_len; @@ -6135,10 +6025,6 @@ H5C_flush_invalidate_cache(const H5F_t * f, while ( ! done ) { - first_pass = FALSE; - - have_pinned_entries = ( cur_pel_len > 0 ); - /* first, try to flush-destroy any dirty entries. Do this by * making a scan through the slist. Note that new dirty entries * may be created by the flush call backs. Thus it is possible @@ -6207,26 +6093,26 @@ H5C_flush_invalidate_cache(const H5F_t * f, { entry_ptr = next_entry_ptr; - /* With the advent of the fractal heap, it is possible - * that the flush callback will dirty and/or resize - * other entries in the cache. In particular, while - * Quincey has promised me that this will never happen, - * it is possible that the flush callback for an - * entry may protect an entry that is not in the cache, - * perhaps causing the cache to flush and possibly - * evict the entry associated with node_ptr to make - * space for the new entry. - * - * Thus we do a bit of extra sanity checking on entry_ptr, - * and break out of this scan of the skip list if we - * detect major problems. We have a bit of leaway on the - * number of passes though the skip list, so this shouldn't - * be an issue in the flush in and of itself, as it should - * be all but impossible for this to happen more than once - * in any flush. - * - * Observe that that breaking out of the scan early - * shouldn't break the sanity checks just after the end + /* With the advent of the fractal heap, it is possible + * that the serialize callback will dirty and/or resize + * other entries in the cache. In particular, while + * Quincey has promised me that this will never happen, + * it is possible that the serialize callback for an + * entry may protect an entry that is not in the cache, + * perhaps causing the cache to flush and possibly + * evict the entry associated with node_ptr to make + * space for the new entry. + * + * Thus we do a bit of extra sanity checking on entry_ptr, + * and break out of this scan of the skip list if we + * detect major problems. We have a bit of leaway on the + * number of passes though the skip list, so this shouldn't + * be an issue in the flush in and of itself, as it should + * be all but impossible for this to happen more than once + * in any flush. + * + * Observe that that breaking out of the scan early + * shouldn't break the sanity checks just after the end * of this while loop. * * If an entry has merely been marked clean and removed from @@ -6327,12 +6213,10 @@ H5C_flush_invalidate_cache(const H5F_t * f, */ status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - NULL, + dxpl_id, + entry_ptr->type, entry_ptr->addr, H5C__NO_FLAGS_SET, - &first_flush, FALSE); if ( status < 0 ) { @@ -6347,12 +6231,10 @@ H5C_flush_invalidate_cache(const H5F_t * f, } else { status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - NULL, + dxpl_id, + entry_ptr->type, entry_ptr->addr, (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG), - &first_flush, TRUE); if ( status < 0 ) { @@ -6427,12 +6309,10 @@ H5C_flush_invalidate_cache(const H5F_t * f, } else if ( ! ( entry_ptr->is_pinned ) ) { status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - NULL, + dxpl_id, + entry_ptr->type, entry_ptr->addr, (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG), - &first_flush, TRUE); if ( status < 0 ) { @@ -6452,16 +6332,17 @@ H5C_flush_invalidate_cache(const H5F_t * f, * of pinned entries from pass to pass. If it stops * shrinking before it hits zero, we scream and die. */ - /* if the flush function on the entry we last evicted - * loaded an entry into cache (as Quincey has promised me - * it never will), and if the cache was full, it is - * possible that *next_entry_ptr was flushed or evicted. - * - * Test to see if this happened here. Note that if this - * test is triggred, we are accessing a deallocated piece - * of dynamically allocated memory, so we just scream and - * die. - */ + + /* if the serialize function on the entry we last evicted + * loaded an entry into cache (as Quincey has promised me + * it never will), and if the cache was full, it is + * possible that *nexte_entry_ptr was flushed or evicted. + * + * Test to see if this happened here, and set next_entry_ptr + * to NULL if it did. Note that if this test is triggred, + * we are accessing a deallocated piece of dynamically + * allocated memory, so we just scream and die. + */ #ifndef NDEBUG if ( ( next_entry_ptr != NULL ) && ( next_entry_ptr->magic != @@ -6554,27 +6435,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 @@ -6590,12 +6458,10 @@ done: */ static herr_t H5C_flush_single_entry(const H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type_ptr, haddr_t addr, unsigned flags, - hbool_t * first_flush_ptr, hbool_t del_entry_from_slist_on_destroy) { H5C_t * cache_ptr = f->shared->cache; @@ -6604,7 +6470,10 @@ H5C_flush_single_entry(const H5F_t * f, hbool_t was_dirty; herr_t status; int type_id; - unsigned flush_flags = H5C_CALLBACK__NO_FLAGS_SET; + unsigned serialize_flags = 0; + haddr_t new_addr; + size_t new_len; + void * new_image_ptr; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -6613,8 +6482,8 @@ H5C_flush_single_entry(const H5F_t * f, HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); + HDassert( type_ptr ); HDassert( H5F_addr_defined(addr) ); - HDassert( first_flush_ptr ); destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ); clear_only = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); @@ -6693,7 +6562,7 @@ H5C_flush_single_entry(const H5F_t * f, H5FD_mpio_xfer_t xfer_mode; /* I/O xfer mode property value */ /* Get the dataset transfer property list */ - if ( NULL == (dxpl = H5I_object(primary_dxpl_id)) ) { + if ( NULL == (dxpl = H5I_object(dxpl_id)) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \ "not a dataset creation property list") @@ -6707,6 +6576,12 @@ H5C_flush_single_entry(const H5F_t * f, } /* Sanity check transfer mode */ + /* I'm surprised that this sanity check is working at + * present -- will need to look into it at some point. + * + * JRM -- 7/7/07 + */ + HDassert( xfer_mode == H5FD_MPIO_COLLECTIVE ); } @@ -6733,9 +6608,6 @@ H5C_flush_single_entry(const H5F_t * f, * once rather than remove the entries one by one, so we only delete * from the slist only if requested. * - * We must do deletions now as the callback routines will free the - * entry if destroy is true. - * * Note that it is possible that the entry will be moved during * its call to flush. This will upset H5C_move_entry() if we * don't tell it that it doesn't have to worry about updating the @@ -6755,10 +6627,8 @@ H5C_flush_single_entry(const H5F_t * f, } } - /* Update the replacement policy for the flush or eviction. - * Again, do this now so we don't have to reference freed - * memory in the destroy case. - */ + + /* Update the replacement policy for the flush or eviction. */ if ( destroy ) { /* AKA eviction */ #if 0 /* JRM */ @@ -6892,82 +6762,162 @@ H5C_flush_single_entry(const H5F_t * f, } else { + /* We are either doing a flush or a clear. + * + * A clear and a flush are the same from the point of view of + * the replacement policy and the slist. Hence no + * differentiation between them. + * JRM -- 7/7/07 + */ + H5C__UPDATE_RP_FOR_FLUSH(cache_ptr, entry_ptr, FAIL) + + if(entry_ptr->in_slist) + H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) } /* Clear the dirty flag only, if requested */ - if ( clear_only ) { - - if ( destroy ) { -#ifndef NDEBUG - /* we are about to call the clear callback with the - * destroy flag set -- this will result in *entry_ptr - * being freed. Set the magic field to bad magic - * so we can detect a freed cache entry if we see - * one. - */ - entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; -#endif /* NDEBUG */ - entry_ptr->cache_ptr = NULL; - } - /* Call the callback routine to clear all dirty flags for object */ - if ( (entry_ptr->type->clear)(f, entry_ptr, destroy) < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry") - } - } else { - + if(clear_only) + entry_ptr->is_dirty = FALSE; + else if(entry_ptr->is_dirty) { + /* The entry is dirty, and we are doing either a flush, + * or a flush destroy. In either case, serialize the + * entry and write it to disk. + * + * If the serialize function changes the size or location + * of the entry, and we are not doing a flush destroy, we + * will have to touch up the cache to account for the + * change(s). + */ #if H5C_DO_SANITY_CHECKS - if ( ( entry_ptr->is_dirty ) && - ( cache_ptr->check_write_permitted == NULL ) && - ( ! (cache_ptr->write_permitted) ) ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Write when writes are always forbidden!?!?!") - } + if((cache_ptr->check_write_permitted == NULL) && !(cache_ptr->write_permitted)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Write when writes are always forbidden!?!?!") #endif /* H5C_DO_SANITY_CHECKS */ - if ( destroy ) { -#ifndef NDEBUG - /* we are about to call the flush callback with the - * destroy flag set -- this will result in *entry_ptr - * being freed. Set the magic field to bad magic - * so we can detect a freed cache entry if we see - * one. - */ - entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; -#endif /* NDEBUG */ - entry_ptr->cache_ptr = NULL; - } - - /* Only block for all the processes on the first piece of metadata - */ - - if ( *first_flush_ptr && entry_ptr->is_dirty ) { + if(NULL == entry_ptr->image_ptr) { + if(NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for on disk image buffer") +#if H5C_DO_MEMORY_SANITY_CHECKS + HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + } /* end if */ + + if(!(entry_ptr->image_up_to_date)) { + if(entry_ptr->type->serialize(f, dxpl_id, entry_ptr->addr, + entry_ptr->size, entry_ptr->image_ptr, (void *)entry_ptr, + &serialize_flags, &new_addr, &new_len, &new_image_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to serialize entry") + + if(serialize_flags != 0) { + /* Check for unexpected flags from serialize callback */ + if(serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | H5C__SERIALIZE_MOVED_FLAG)) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unknown serialize flag(s)") + + if(destroy) { + /* We have already removed the entry from the + * cache's data structures, so no need to update + * them for the re-size and/or move. All we need + * to do is update the cache entry so we will have + * the correct values when we actually write the + * image of the entry to disk. + * + * Note that if the serialize function changes the + * size of the disk image of the entry, it must + * 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) + entry_ptr->size = new_len; + entry_ptr->image_ptr = new_image_ptr; + } /* end if */ + + /* Check for move */ + if(serialize_flags & H5C__SERIALIZE_MOVED_FLAG) { + H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) + entry_ptr->addr = new_addr; + } /* end if */ + } /* end if */ + else { + /* The entry is not being destroyed, and thus has not + * been removed from the cache's data structures. + * + * Thus, in addition to updating the entry for the + * re-size and/or move, we must also update the + * cache data structures. + */ + if(serialize_flags & H5C__SERIALIZE_RESIZED_FLAG) { + 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 + * to meet this expectation. + */ + entry_ptr->is_dirty = FALSE; - status = (entry_ptr->type->flush)(f, primary_dxpl_id, destroy, - entry_ptr->addr, entry_ptr, - &flush_flags); - *first_flush_ptr = FALSE; + /* update the hash table for the size change*/ + H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_len); - } else { + /* The entry can't be protected since we are + * in the process of flushing it. Thus we must + * update the replacement policy data + * structures for the size change. The macro + * deals with the pinned case. + */ + H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_len); - status = (entry_ptr->type->flush)(f, secondary_dxpl_id, - destroy, entry_ptr->addr, - entry_ptr, &flush_flags); - } + /* The entry can't be in the slist, so no need + * to update the slist for the size change. + */ - if ( status < 0 ) { + /* finally, set is_dirty to TRUE again, and + * update the size and image_ptr. + */ + entry_ptr->is_dirty = TRUE; + entry_ptr->size = new_len; + entry_ptr->image_ptr = new_image_ptr; + } /* end if */ + + /* Check for move */ + if(serialize_flags & H5C__SERIALIZE_MOVED_FLAG) { + /* The replacement policy code thinks the + * entry is already clean, so modify is_dirty + * to meet this expectation. + */ + entry_ptr->is_dirty = FALSE; + + H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) + + /* first update the hash table for the move */ + H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) + entry_ptr->addr = new_addr; + H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL) + + /* finally, set is_dirty to TRUE again */ + entry_ptr->is_dirty = TRUE; + } /* end if */ + } /* end else */ + } /* end if */ +#if H5C_DO_MEMORY_SANITY_CHECKS + HDassert(0 == HDmemcmp(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE)); +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + entry_ptr->image_up_to_date = TRUE; + } /* end if */ + + /* now write the image to disk */ + if(H5F_block_write(f, type_ptr->mem_type, entry_ptr->addr, + entry_ptr->size, dxpl_id, entry_ptr->image_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file.") - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "unable to flush entry") - } #ifdef H5_HAVE_PARALLEL - if ( flush_flags != H5C_CALLBACK__NO_FLAGS_SET ) { + /* note that we initialized the serialize_flags to 0, so if + * the image was up to date on entry, serialize_flags should + * still be 0 at this point. + */ + if ( serialize_flags != 0 ) { - /* In the parallel case, flush operations can - * cause problems. If they occur, scream and - * die. + /* In the parallel case, resizes and moves in + * the serialize operation can cause problems. + * If they occur, scream and die. * * At present, in the parallel case, the aux_ptr * will only be set if there is more than one @@ -6999,87 +6949,41 @@ H5C_flush_single_entry(const H5F_t * f, } } #endif /* H5_HAVE_PARALLEL */ - } - - if ( ( ! destroy ) && ( entry_ptr->in_slist ) ) { - H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) + entry_ptr->is_dirty = FALSE; } - if ( ! destroy ) { /* i.e. if the entry still exists */ - - HDassert( !(entry_ptr->is_dirty) ); - HDassert( !(entry_ptr->flush_marker) ); - HDassert( !(entry_ptr->in_slist) ); - HDassert( !(entry_ptr->is_protected) ); - HDassert( !(entry_ptr->is_read_only) ); - HDassert( (entry_ptr->ro_ref_count) == 0 ); - - if ( (flush_flags & H5C_CALLBACK__SIZE_CHANGED_FLAG) != 0 ) { - /* The entry size changed as a result of the flush. - * - * Most likely, the entry was compressed, and the - * new version is of a different size than the old. - * - * In any case, we must update entry and cache size - * accordingly. - */ - size_t new_size; - - if ( (entry_ptr->type->size)(f, (void *)entry_ptr, &new_size) - < 0 ) { - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, \ - "Can't get entry size after flush") - } - - if ( new_size != entry_ptr->size ) { - - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); - - /* update the hash table for the size change*/ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE((cache_ptr), \ - (entry_ptr->size),\ - (new_size)); - - /* The entry can't be protected since we just flushed it. - * Thus we must update the replacement policy data - * structures for the size change. The macro deals - * with the pinned case. - */ - H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, \ - new_size) + if ( destroy ) /* time to discard the entry */ + { + /* start by freeing the buffer for the on disk image */ + if ( entry_ptr->image_ptr != NULL ) { - /* The entry can't be in the slist, so no need to update - * the slist for the size change. - */ + entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr); - /* update stats for the size change */ - H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, \ - entry_ptr, \ - new_size) + if ( entry_ptr->image_ptr != NULL ) { - /* finally, update the entry size proper */ - entry_ptr->size = new_size; + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "*image_ptr free failed.") } } - if ( (flush_flags & H5C_CALLBACK__MOVED_FLAG) != 0 ) { - - /* The entry was moved as the result of the flush. - * - * Most likely, the entry was compressed, and the - * new version is larger than the old and thus had - * to be relocated. - * - * At preset, all processing for this case is - * handled elsewhere. But lets keep the if statement - * around just in case. - */ - - } + /* we are about to discard the in core representation -- + * set the magic field to bad magic so we can detect a + * freed entry if we see one. + * + * Also reset the pointer to the cache the entry is within. -QAK + */ +#ifndef NDEBUG + entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC; +#endif /* NDEBUG */ + entry_ptr->cache_ptr = NULL; + if(type_ptr->free_icr((void *)entry_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "free_icr callback failed.") + } + else /* just flushing or clearing */ + { entry_ptr->flush_in_progress = FALSE; } @@ -7128,8 +7032,11 @@ H5C_load_entry(H5F_t * f, haddr_t addr, void * udata) { + hbool_t dirty = FALSE; /* Flag indicating whether thing was dirtied during deserialize */ + void * image = NULL; /* Buffer for disk image */ void * thing = NULL; /* Pointer to thing loaded */ H5C_cache_entry_t * entry; /* Alias for thing loaded, as cache entry */ + size_t len; /* Size of image in file */ void * ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5C_load_entry) @@ -7138,14 +7045,108 @@ H5C_load_entry(H5F_t * f, HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); - HDassert(type->load); - HDassert(type->size); HDassert(H5F_addr_defined(addr)); + HDassert(type->get_load_size); + HDassert(type->deserialize); + + /* Call the get_load_size callback, to retrieve the initial size of image */ + if(type->get_load_size(udata, &len) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't retrieve image size") + + /* Check for possible speculative read off the end of the file */ + if(type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) { + haddr_t eoa; /* End-of-allocation in the file */ + haddr_t base_addr; /* Base address of file data */ + + /* Get the file's end-of-allocation value */ + eoa = H5F_get_eoa(f); + HDassert(H5F_addr_defined(eoa)); + + /* Get the file's base address */ + base_addr = H5F_BASE_ADDR(f); + HDassert(H5F_addr_defined(base_addr)); + + /* Check for bad address in general */ + if((addr + base_addr) > eoa) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "address of object past end of allocation") + + /* Check if the amount of data to read will be past the eoa */ + if((addr + base_addr + len) > eoa) + /* Trim down the length of the metadata */ + len = (size_t)(eoa - (addr + base_addr)); + } /* end if */ - if(NULL == (thing = (type->load)(f, dxpl_id, addr, udata))) + /* Allocate the buffer for reading the on-disk entry image */ + if(NULL == (image = H5MM_malloc(len + H5C_IMAGE_EXTRA_SPACE))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "memory allocation failed for on disk image buffer.") +#if H5C_DO_MEMORY_SANITY_CHECKS + HDmemcpy(((uint8_t *)image) + len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + + /* Get the on-disk entry image */ + if(H5F_block_read(f, type->mem_type, addr, len, dxpl_id, image) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_READERROR, NULL, "Can't read image*") + + /* Deserialize the on-disk image into the native memory form */ + if(NULL == (thing = type->deserialize(image, len, udata, &dirty))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "Can't deserialize image") + + /* If the client's cache has an image_len callback, check it */ + if(type->image_len) { + size_t new_len; /* New size of on-disk image */ + + /* Get the actual image size for the thing */ + if(type->image_len(thing, &new_len) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't retrieve image length") + else if(new_len == 0) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "image length is 0") + else if(new_len != len) { + /* Check for size changing on non-speculatively loaded, non-compressed thing */ + if(type->flags & ~(H5C__CLASS_SPECULATIVE_LOAD_FLAG | H5C__CLASS_COMPRESSED_FLAG)) + HGOTO_ERROR(H5E_CACHE, H5E_UNSUPPORTED, NULL, "size of non-speculative, non-compressed object changed") + else { + void *new_image; /* Buffer for disk image */ + + /* Allocate differently sized buffer */ + if(NULL == (new_image = H5MM_realloc(image, new_len + H5C_IMAGE_EXTRA_SPACE))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "image null after H5MM_realloc()") + image = new_image; +#if H5C_DO_MEMORY_SANITY_CHECKS + HDmemcpy(((uint8_t *)image) + new_len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); +#endif /* H5C_DO_MEMORY_SANITY_CHECKS */ + + /* If the thing's image needs to be bigger for a speculatively + * loaded thing, free the thing and retry with new length + */ + if((type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) && new_len > len) { + /* Release previous (possibly partially initialized) thing */ + if(type->free_icr(thing) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, NULL, "free_icr callback failed") + + /* Go get the on-disk image again */ + if(H5F_block_read(f, type->mem_type, addr, new_len, dxpl_id, image) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "Can't read image") + + /* Deserialize on-disk image into native memory form again */ + if(NULL == (thing = type->deserialize(image, new_len, udata, &dirty))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "Can't deserialize image") + +#ifndef NDEBUG + { + size_t new_new_len; - HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, NULL, "unable to load entry") + /* Get the actual image size for the thing again */ + type->image_len(thing, &new_new_len); + HDassert(new_new_len == new_len); + } +#endif /* NDEBUG */ + } /* end else */ + } /* end if */ + /* Retain adjusted size */ + len = new_len; + } /* end if */ + } /* end if */ entry = (H5C_cache_entry_t *)thing; @@ -7153,18 +7154,14 @@ H5C_load_entry(H5F_t * f, * * However, when this code is used in the metadata cache, it is * possible that object headers will be dirty at this point, as - * the load function will alter object headers if necessary to + * the deserialize function will alter object headers if necessary to * fix an old bug. * - * To support this bug fix, I have replace the old assert: - * - * HDassert( entry->is_dirty == FALSE ); + * In the following assert: * - * with: + * HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); * - * HDassert( ( entry->is_dirty == FALSE ) || ( type->id == 5 ) ); - * - * Note that type id 5 is associated with object headers in the metadata + * note that type ids 5 & 6 are associated with object headers in the metadata * cache. * * When we get to using H5C for other purposes, we may wish to @@ -7172,16 +7169,23 @@ H5C_load_entry(H5F_t * f, * metadata cache. */ - HDassert( ( entry->is_dirty == FALSE ) || ( type->id == 5 ) ); + HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6) ); + HDassert( entry->size < H5C_MAX_ENTRY_SIZE ); #ifndef NDEBUG entry->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; #endif /* NDEBUG */ entry->cache_ptr = f->shared->cache; entry->addr = addr; + entry->size = len; + entry->image_ptr = image; + entry->image_up_to_date = TRUE; entry->type = type; + entry->is_dirty = dirty; + entry->dirtied = FALSE; entry->is_protected = FALSE; entry->is_read_only = FALSE; entry->ro_ref_count = 0; + entry->is_pinned = FALSE; entry->in_slist = FALSE; entry->flush_marker = FALSE; #ifdef H5_HAVE_PARALLEL @@ -7190,12 +7194,6 @@ H5C_load_entry(H5F_t * f, entry->flush_in_progress = FALSE; entry->destroy_in_progress = FALSE; - if((type->size)(f, thing, &(entry->size)) < 0) - - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, NULL, "Can't get size of thing") - - HDassert( entry->size < H5C_MAX_ENTRY_SIZE ); - entry->ht_next = NULL; entry->ht_prev = NULL; @@ -7210,6 +7208,14 @@ H5C_load_entry(H5F_t * f, ret_value = thing; done: + /* Cleanup on error */ + if(NULL == ret_value) { + /* Release resources */ + if(thing && type->free_icr(thing) < 0) + HDONE_ERROR(H5E_CACHE, H5E_CANTFLUSH, NULL, "free_icr callback failed") + if(image) + image = H5MM_xfree(image); + } /* end if */ FUNC_LEAVE_NOAPI(ret_value) } /* H5C_load_entry() */ @@ -7252,11 +7258,9 @@ done: */ static herr_t H5C_make_space_in_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, size_t space_needed, - hbool_t write_permitted, - hbool_t * first_flush_ptr) + hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; herr_t result; @@ -7277,8 +7281,6 @@ H5C_make_space_in_cache(H5F_t * f, HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( first_flush_ptr != NULL ); - HDassert( ( *first_flush_ptr == TRUE ) || ( *first_flush_ptr == FALSE ) ); if ( write_permitted ) { @@ -7314,22 +7316,18 @@ H5C_make_space_in_cache(H5F_t * f, if ( entry_ptr->is_dirty ) { result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, entry_ptr->type, entry_ptr->addr, H5C__NO_FLAGS_SET, - first_flush_ptr, FALSE); } else { result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, entry_ptr->type, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, TRUE); } } else { @@ -7432,12 +7430,10 @@ H5C_make_space_in_cache(H5F_t * f, } result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, entry_ptr->type, entry_ptr->addr, H5C__NO_FLAGS_SET, - first_flush_ptr, FALSE); if ( result < 0 ) { @@ -7535,12 +7531,10 @@ H5C_make_space_in_cache(H5F_t * f, prev_ptr = entry_ptr->aux_prev; result = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + dxpl_id, entry_ptr->type, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, TRUE); if ( result < 0 ) { @@ -7549,6 +7543,12 @@ H5C_make_space_in_cache(H5F_t * f, "unable to flush entry") } + /* we are scanning the clean LRU, so the serialize function + * will not be called on any entry -- thus there is no + * concern about the list being modified out from under + * this function. + */ + entry_ptr = prev_ptr; entries_examined++; } diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 4b40278..eecade6 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -37,8 +37,17 @@ #include "H5Fprivate.h" /* File access */ -#define H5C_DO_SANITY_CHECKS 0 +#define H5C_DO_SANITY_CHECKS 1 #define H5C_DO_EXTREME_SANITY_CHECKS 0 +/* Note: The memory sanity checks aren't going to work until I/O filters are + * changed to call a particular alloc/free routine for their buffers, + * because the H5AC__SERIALIZE_RESIZED_FLAG set by the fractal heap + * direct block serialize callback calls H5Z_pipeline(). When the I/O + * filters are changed, then we should implement "cache image alloc/free" + * routines that the fractal heap direct block (and global heap) serialize + * calls can use when resizing (and re-allocating) their image in the + * cache. -QAK */ +#define H5C_DO_MEMORY_SANITY_CHECKS 0 /* This sanity checking constant was picked out of the air. Increase * or decrease it if appropriate. Its purposes is to detect corrupt @@ -51,7 +60,7 @@ /* H5C_COLLECT_CACHE_STATS controls overall collection of statistics * on cache activity. In general, this #define should be set to 0. */ -#define H5C_COLLECT_CACHE_STATS 0 +#define H5C_COLLECT_CACHE_STATS 1 /* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics * in individual cache entries. @@ -93,60 +102,361 @@ typedef struct H5C_t H5C_t; -/* - * Class methods pertaining to caching. Each type of cached object will - * have a constant variable with permanent life-span that describes how - * to cache the object. That variable will be of type H5C_class_t and - * have the following required fields... +/*************************************************************************** * - * LOAD: Loads an object from disk to memory. The function - * should allocate some data structure and return it. + * Struct H5C_class_t * - * FLUSH: Writes some data structure back to disk. It would be - * wise for the data structure to include dirty flags to - * indicate whether it really needs to be written. This - * function is also responsible for freeing memory allocated - * by the LOAD method if the DEST argument is non-zero (by - * calling the DEST method). + * Instances of H5C_class_t are used to specify the callback functions + * used by the metadata cache for each class of metadata cache entry. + * The fields of the structure are discussed below: * - * DEST: Just frees memory allocated by the LOAD method. + * id: Integer field containing the unique ID of the class of metadata + * cache entries. * - * CLEAR: Just marks object as non-dirty. + * name: Pointer to a string containing the name of the class of metadata + * cache entries. * - * SIZE: Report the size (on disk) of the specified cache object. - * Note that the space allocated on disk may not be contiguous. - */ + * mem_type: Instance of H5FD_mem_t, that is used to supply the + * mem type passed into H5F_block_read(). + * + * flags: Flags indicating class-specific behavior. + * + * 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 + * 'deserialize' callback. + * + * The typedef for the deserialize callback is as follows: + * + * typedef herr_t (*H5C_get_load_size_func_t)(void *udata_ptr, + * size_t *image_len_ptr); + * + * The parameters of the deserialize callback are as follows: + * + * udata_ptr: Pointer to user data provided in the protect call, which + * will also be passed through to the deserialize callback. + * + * image_len_ptr: Length in bytes of the in file image to be deserialized. + * + * This parameter is used by the cache to determine the size of + * the disk image for the metadata, in order to read the disk + * image from the file. + * + * Processing in the get_load_size function should proceed as follows: + * + * If successful, the function will place the length of the on disk + * image associated with the in core representation provided in the + * thing parameter in *image_len_ptr, and then return SUCCEED. + * + * On failure, the function must return FAIL and push error information + * onto the error stack with the error API routines, without modifying + * the value pointed to by the image_len_ptr. + * + * + * 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, + * and return a pointer to that representation. + * + * The typedef for the deserialize callback is as follows: + * + * typedef void *(*H5C_deserialize_func_t)(const void * image_ptr, + * size_t len, + * void * udata_ptr, + * boolean * dirty_ptr); + * + * The parameters of the deserialize callback are as follows: + * + * image_ptr: Pointer to a buffer of length len containing the + * contents of the file starting at addr and continuing + * for len bytes. + * + * len: Length in bytes of the in file image to be deserialized. + * + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. + * + * udata_ptr: Pointer to user data provided in the protect call, which + * must be passed through to the deserialize callback. + * + * dirty_ptr: Pointer to boolean which the deserialize function + * must use to mark the entry dirty if it has to modify + * the entry to clean up file corruption left over from + * an old bug in the HDF5 library. + * + * Processing in the deserialize function should proceed as follows: + * + * If the image contains valid data, and is of the correct length, + * the deserialize function must allocate space for an in core + * representation of that data, load the contents of the image into + * the space allocated for the in core representation, and return + * a pointer to the in core representation. Observe that an + * instance of H5C_cache_entry_t must be the first item in this + * representation. It will have to be initialized appropriately + * after the callback returns. + * + * Note that the structure of the in core representation is otherwise + * up to the cache client. All that is required is that the pointer + * returned be sufficient for the clients purposes when it is returned + * on a protect call. + * + * If the deserialize function has to clean up file corruption + * left over from an old bug in the HDF5 library, it must set + * *dirty_ptr to TRUE. If it doesn't, no action is needed as + * *dirty_ptr will be set to FALSE before the deserialize call. + * + * If the operation fails for any reason (i.e. bad data in buffer, bad + * buffer length, malloc failure, etc.) the function must return NULL and + * push error information on the error stack with the error API routines. + * + * If the protect call which occasioned the call to the deserialize + * callback had the check length flag set, after the deserialize call + * returns, the cache must call the image_len callback (see below) and + * update its on disk image length accordingly. + * + * + * 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 + * an entry in the deserialize callback. + * + * The typedef for the image_len callback is as follows: + * + * typedef herr_t (*H5C_image_len_func_t)(void *thing, + * size_t *image_len_ptr); + * + * The parameters of the image_len callback are as follows: + * + * thing: Pointer to the in core representation of the entry. + * + * image_len_ptr: Pointer to size_t in which the callback will return + * the length of the on disk image of the cache entry. + * + * Processing in the image_len function should proceed as follows: + * + * If successful, the function will place the length of the on disk + * image associated with the in core representation provided in the + * thing parameter in *image_len_ptr, and then return SUCCEED. + * + * On failure, the function must return FAIL and push error information + * onto the error stack with the error API routines, without modifying + * the value pointed to by the image_len_ptr. + * + * + * 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 + * either constructing a journal or flushing the entry to disk. + * + * At this point, one would think that the base address and length of + * the length of the entry's image on disk would be well known. + * However, that need not be the case as fractal heap blocks can + * change size (and therefor possible location as well) on + * serialization if compression is enabled. In the old H5C code, + * this happened on a flush, and occasioned a move in the midst + * of the flush. To avoid this in H5C, the serialize callback + * will return the new base address, length, and image pointer to + * the caller when necessary. The caller must then update the + * metadata cache's internal structures accordingly. + * + * The typedef for the serialize callback is as follows: + * + * typedef herr_t (*H5C_serialize_func_t)(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); + * + * The parameters of the serialize callback are as follows: + * + * f: File pointer -- needed if other metadata cache entries + * must be modified in the process of serializing the + * target entry. + * + * dxpl_id: dxpl_id passed with the file pointer to the cache, and + * passed on to the callback. Necessary as some callbacks + * revise the size and location of the target entry, or + * possibly other entries on serialize. + * + * addr: Base address in file of the entry to be serialized. + * + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. + * + * len: Length in bytes of the in file image of the entry to be + * serialized. Also the size of *image_ptr (below). + * + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. + * + * image_ptr: Pointer to a buffer of length len bytes into which a + * serialized image of the target metadata cache entry is + * to be written. + * + * Note that this buffer will not in general be initialized + * to any particular value. Thus the serialize function may + * not assume any initial value and must set each byte in + * the buffer. + * + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. + * This is the same pointer returned by a protect of the + * addr and len given above. + * + * flags_ptr: Pointer to an unsigned integer used to return flags + * indicating whether the resize function resized or moved + * the entry. If the entry was neither resized or moved, + * the serialize function must set *flags_ptr to zero. + * H5C__SERIALIZE_RESIZED_FLAG and H5C__SERIALIZE_MOVED_FLAG + * must be set to indicate a resize and a move respectively. + * + * If the H5C__SERIALIZE_RESIZED_FLAG is set, the new length + * and image pointer must be stored in *new_len_ptr and + * *new_image_ptr_ptr respectively. + * + * If the H5C__SERIALIZE_MOVED_FLAG flag is also set, the + * new image base address must be stored in *new_addr_ptr. + * Observe that the H5C__SERIALIZE_MOVED_FLAG must not + * appear without the H5C__SERIALIZE_RESIZED_FLAG. + * + * Except as noted above, the locations pointed to by the + * remaining parameters are undefined, and should be ignored + * by the caller. + * + * new_addr_ptr: Pointer to haddr_t. If the entry is moved by + * the serialize function, the new on disk base address must + * be stored in *new_addr_ptr. If the entry is not moved + * by the serialize function, *new_addr_ptr is undefined. + * + * new_len_ptr: Pointer to size_t. If the entry is resized by the + * serialize function, the new length of the on disk image + * must be stored in *new_len_ptr. If the entry is not + * resized by the serialize function, *new_len_ptr is + * undefined. + * + * new_image_ptr_ptr: Pointer to pointer to void. If the entry is + * resized by the serialize function, the pointer to the + * new buffer containing the on disk image must be stored + * in *new_image_ptr_ptr. If the entry is not resized by + * the serialize function, *new_image_ptr_ptr is undefined. + * + * Processing in the serialize function should proceed as follows: + * + * The serialize function must examine the in core representation + * indicated by the thing parameter, and write a serialized image + * of its contents into the provided buffer. + * + * If the serialize function does not change the size or location + * of the on disk image, it must set *flags_ptr to zero. + * + * If the size of the on disk image must be changed, the serialize + * function must free the old image buffer (base address in image_ptr), + * allocate a new one, load the image into the new buffer, load the + * base address of the new buffer into *new_image_ptr_ptr, load the + * length of the new image into *new_len_ptr, and set the + * H5C__SERIALIZE_RESIZED_FLAG in *flags_ptr. + * + * If in addition, the base address of the on disk image must + * be changed, the serialize function must also set *new_addr_ptr + * to the new base address, and set the H5C__SERIALIZE_MOVED_FLAG + * in *flags_ptr. + * + * If it is successful, the function must return SUCCEED. + * + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. + * + * + * 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 + * allocated for the in core representation. + * + * The typedef for the free ICR callback is as follows: + * + * typedef herr_t (*N5C_free_icr_func_t)(void * thing); + * + * The parameters of the free ICR callback are as follows: + * + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. This + * is the same pointer that would be returned by a protect + * of the addr and len above. + * + * Processing in the free ICR function should proceed as follows: + * + * The free ICR function must free all memory allocated to the + * in core representation. + * + * If the function is successful, it must return SUCCEED. + * + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. + * + * At least when compiled with debug, it would be useful if the + * free ICR call would fail if the in core representation has been + * modified since the last serialize of clear callback. + * + ***************************************************************************/ +typedef herr_t (*H5C_get_load_size_func_t)(const void *udata_ptr, + size_t *image_len_ptr); -#define H5C_CALLBACK__NO_FLAGS_SET 0x0 -#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1 -#define H5C_CALLBACK__MOVED_FLAG 0x2 - -typedef void *(*H5C_load_func_t)(H5F_t *f, - hid_t dxpl_id, - haddr_t addr, - void *udata); -typedef herr_t (*H5C_flush_func_t)(H5F_t *f, - hid_t dxpl_id, - hbool_t dest, - haddr_t addr, - void *thing, - unsigned * flags_ptr); -typedef herr_t (*H5C_dest_func_t)(H5F_t *f, - void *thing); -typedef herr_t (*H5C_clear_func_t)(H5F_t *f, - void *thing, - hbool_t dest); -typedef herr_t (*H5C_size_func_t)(const H5F_t *f, - const void *thing, - size_t *size_ptr); +typedef void *(*H5C_deserialize_func_t)(const void *image_ptr, + size_t len, + void *udata_ptr, + hbool_t *dirty_ptr); + +typedef herr_t (*H5C_image_len_func_t)(const void *thing, + size_t *image_len_ptr); + +#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, + 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); + +typedef herr_t (*H5C_free_icr_func_t)(void *thing); + +#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; - H5C_load_func_t load; - H5C_flush_func_t flush; - H5C_dest_func_t dest; - H5C_clear_func_t clear; - H5C_size_func_t size; + int id; + const char * name; + H5FD_mem_t mem_type; + unsigned flags; + H5C_get_load_size_func_t get_load_size; + H5C_deserialize_func_t deserialize; + H5C_image_len_func_t image_len; + H5C_serialize_func_t serialize; + H5C_free_icr_func_t free_icr; } H5C_class_t; @@ -207,7 +517,7 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * just before the entry is freed. * * This is necessary, as the LRU list can be changed out - * from under H5C_make_space_in_cache() by the flush + * from under H5C_make_space_in_cache() by the serialize * callback which may change the size of an existing entry, * and/or load a new entry while serializing the target entry. * @@ -220,7 +530,7 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * detect this case, and re-start its scan from the bottom * of the LRU when this situation occurs. * - * This field is only compiled in debug mode. + * cache_ptr: Pointer to the cache that this entry is contained within. * * addr: Base address of the cache entry on disk. * @@ -233,6 +543,21 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * we fix this, we can't do much with writing back adjacent * entries. * + * Update: This has now been changed -- all metadata cache + * entries must now be associated with a single contiguous + * block of memory on disk. The image of this block (i.e. + * the on disk image) is stored in *image_ptr (discussed below). + * + * image_ptr: Pointer to void. When not NULL, this field points to a + * dynamically allocated block of size bytes in which the + * on disk image of the metadata cache entry is stored. + * + * If the entry is dirty, the serialize callback must be used + * to update this image before it is written to disk + * + * image_up_to_date: Boolean flag that is set to TRUE when *image_ptr + * is up to date, and set to false when the entry is dirtied. + * * type: Pointer to the instance of H5C_class_t containing pointers * to the methods for cache entries of the current type. This * field should be NULL when the instance of H5C_cache_entry_t @@ -261,15 +586,18 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * modules using the cache. These still clear the * is_dirty field as before. -- JRM 7/5/05 * + * Update: Management of the is_dirty field is now entirely + * in the cache. -- JRM 7/5/07 + * * dirtied: Boolean flag used to indicate that the entry has been * dirtied while protected. * * This field is set to FALSE in the protect call, and may * be set to TRUE by the - * H5C_mark_pinned_or_protected_entry_dirty() + * H5C_mark_entry_dirty() * call at an time prior to the unprotect call. * - * The H5C_mark_pinned_or_protected_entry_dirty() call exists + * The H5C_mark_entry_dirty() call exists * as a convenience function for the fractal heap code which * may not know if an entry is protected or pinned, but knows * that is either protected or pinned. The dirtied field was @@ -506,6 +834,8 @@ typedef struct H5C_cache_entry_t H5C_t * cache_ptr; haddr_t addr; size_t size; + void * image_ptr; + hbool_t image_up_to_date; const H5C_class_t * type; hbool_t is_dirty; hbool_t dirtied; @@ -972,25 +1302,20 @@ H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, size_t new_min_clean_size); H5_DLL herr_t H5C_dest(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id); + hid_t dxpl_id); H5_DLL herr_t H5C_dest_empty(H5C_t * cache_ptr); H5_DLL herr_t H5C_expunge_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type, haddr_t addr); -H5_DLL herr_t H5C_flush_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - unsigned flags); +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 primary_dxpl_id, - hid_t secondary_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); @@ -1021,16 +1346,14 @@ H5_DLL herr_t H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_p FILE **trace_file_ptr_ptr); H5_DLL herr_t H5C_insert_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * thing, unsigned int flags); H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, int32_t ce_array_len, haddr_t *ce_array_ptr); @@ -1044,8 +1367,7 @@ H5_DLL herr_t H5C_move_entry(H5C_t * cache_ptr, H5_DLL herr_t H5C_pin_protected_entry(void *thing); H5_DLL void * H5C_protect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * udata, @@ -1075,8 +1397,7 @@ H5_DLL void H5C_stats__reset(H5C_t * cache_ptr); H5_DLL herr_t H5C_unpin_entry(void *thing); H5_DLL herr_t H5C_unprotect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, + hid_t dxpl_id, const H5C_class_t * type, haddr_t addr, void * thing, @@ -874,7 +874,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get byte number for object size") if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, &f->shared->btree_k[0]) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to get rank for btree internal nodes") - if(H5P_get(plist, H5F_CRT_SHMSG_NINDEXES_NAME, &f->shared->sohm_nindexes)<0) + if(H5P_get(plist, H5F_CRT_SHMSG_NINDEXES_NAME, &f->shared->sohm_nindexes) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get number of SOHM indexes") HDassert(f->shared->sohm_nindexes < 255); @@ -3356,7 +3356,7 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr) /* Check args */ if(NULL == (file = H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - if((NULL == config_ptr) || (config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)) + if((NULL == config_ptr) || !H5AC_validate_cache_config_ver(config_ptr->version)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr") /* Go get the resize configuration */ @@ -3396,7 +3396,7 @@ 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") - /* set the resize configuration */ + /* 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.") diff --git a/src/H5FScache.c b/src/H5FScache.c index 3948c13..3ca73c7 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -48,9 +48,6 @@ #define H5FS_HDR_VERSION 0 /* Header */ #define H5FS_SINFO_VERSION 0 /* Serialized sections */ -/* Size of stack buffer for serialized headers */ -#define H5FS_HDR_BUF_SIZE 256 - /******************/ /* Local Typedefs */ @@ -78,16 +75,23 @@ static herr_t H5FS_sinfo_serialize_sect_cb(void *_item, void UNUSED *key, void * static herr_t H5FS_sinfo_serialize_node_cb(void *_item, void UNUSED *key, void *_udata); /* Metadata cache callbacks */ -static H5FS_t *H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned UNUSED * flags_ptr); -static herr_t H5FS_cache_hdr_dest(H5F_t *f, H5FS_t *fspace); -static herr_t H5FS_cache_hdr_clear(H5F_t *f, H5FS_t *fspace, hbool_t destroy); -static herr_t H5FS_cache_hdr_size(const H5F_t *f, const H5FS_t *fspace, size_t *size_ptr); -static H5FS_sinfo_t *H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned UNUSED * flags_ptr); -static herr_t H5FS_cache_sinfo_dest(H5F_t *f, H5FS_sinfo_t *sinfo); -static herr_t H5FS_cache_sinfo_clear(H5F_t *f, H5FS_sinfo_t *sinfo, hbool_t destroy); -static herr_t H5FS_cache_sinfo_size(const H5F_t *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr); +static herr_t H5FS_cache_hdr_get_load_size(const void *udata, size_t *image_len); +static void *H5FS_cache_hdr_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5FS_cache_hdr_image_len(const void *thing, size_t *image_len); +static herr_t H5FS_cache_hdr_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 H5FS_cache_hdr_free_icr(void *thing); + +static herr_t H5FS_cache_sinfo_get_load_size(const void *udata, size_t *image_len); +static void *H5FS_cache_sinfo_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5FS_cache_sinfo_image_len(const void *thing, size_t *image_len); +static herr_t H5FS_cache_sinfo_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 H5FS_cache_sinfo_free_icr(void *thing); /*********************/ @@ -97,21 +101,27 @@ static herr_t H5FS_cache_sinfo_size(const H5F_t *f, const H5FS_sinfo_t *sinfo, s /* H5FS header inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FSPACE_HDR[1] = {{ H5AC_FSPACE_HDR_ID, - (H5AC_load_func_t)H5FS_cache_hdr_load, - (H5AC_flush_func_t)H5FS_cache_hdr_flush, - (H5AC_dest_func_t)H5FS_cache_hdr_dest, - (H5AC_clear_func_t)H5FS_cache_hdr_clear, - (H5AC_size_func_t)H5FS_cache_hdr_size, + "Free space header", + H5FD_MEM_FSPACE_HDR, + H5AC__CLASS_NO_FLAGS_SET, + H5FS_cache_hdr_get_load_size, + H5FS_cache_hdr_deserialize, + H5FS_cache_hdr_image_len, + H5FS_cache_hdr_serialize, + H5FS_cache_hdr_free_icr, }}; /* H5FS serialized sections inherit cache-like properties from H5AC */ const H5AC_class_t H5AC_FSPACE_SINFO[1] = {{ H5AC_FSPACE_SINFO_ID, - (H5AC_load_func_t)H5FS_cache_sinfo_load, - (H5AC_flush_func_t)H5FS_cache_sinfo_flush, - (H5AC_dest_func_t)H5FS_cache_sinfo_dest, - (H5AC_clear_func_t)H5FS_cache_sinfo_clear, - (H5AC_size_func_t)H5FS_cache_sinfo_size, + "Free space section info", + H5FD_MEM_FSPACE_SINFO, + H5AC__CLASS_NO_FLAGS_SET, + H5FS_cache_sinfo_get_load_size, + H5FS_cache_sinfo_deserialize, + H5FS_cache_sinfo_image_len, + H5FS_cache_sinfo_serialize, + H5FS_cache_sinfo_free_icr, }}; @@ -124,15 +134,43 @@ const H5AC_class_t H5AC_FSPACE_SINFO[1] = {{ /* Local Variables */ /*******************/ -/* Declare a free list to manage free space section data to/from disk */ -H5FL_BLK_DEFINE_STATIC(sect_block); + +/*------------------------------------------------------------------------- + * Function: H5FS_cache_hdr_get_load_size + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FS_cache_hdr_get_load_size(const void *_udata, size_t *image_len) +{ + const H5FS_hdr_cache_ud_t *udata = (const H5FS_hdr_cache_ud_t *)_udata; /* User data for callback */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_hdr_get_load_size) + + /* Check arguments */ + HDassert(udata); + HDassert(image_len); + + /* Set the image length size */ + *image_len = H5FS_HEADER_SIZE(udata->f); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FS_cache_hdr_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_hdr_load + * Function: H5FS_cache_hdr_deserialize * - * Purpose: Loads a free space manager header from the disk. + * Purpose: Deserialize the data structure from disk. * * Return: Success: Pointer to a new free space header * Failure: NULL @@ -143,24 +181,22 @@ H5FL_BLK_DEFINE_STATIC(sect_block); * *------------------------------------------------------------------------- */ -static H5FS_t * -H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5FS_cache_hdr_deserialize(const void *image, size_t UNUSED len, + void *_udata, hbool_t UNUSED *dirty) { H5FS_t *fspace = NULL; /* Free space header info */ H5FS_hdr_cache_ud_t *udata = (H5FS_hdr_cache_ud_t *)_udata; /* user data for callback */ - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5FS_HDR_BUF_SIZE]; /* Buffer for header */ - uint8_t *hdr; /* Pointer to header buffer */ const uint8_t *p; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ unsigned nclasses; /* Number of section classes */ H5FS_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_hdr_load) + FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_hdr_deserialize) /* Check arguments */ - HDassert(f); + HDassert(image); HDassert(udata); /* Allocate a new free space manager */ @@ -170,19 +206,7 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Set free space manager's internal information */ fspace->addr = udata->addr; - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (hdr = H5WB_actual(wb, fspace->hdr_size))) - HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_FSPACE_HDR, addr, fspace->hdr_size, dxpl_id, hdr) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_READERROR, NULL, "can't read free space header") - - p = hdr; + p = (const uint8_t *)image; /* Magic number */ if(HDmemcmp(p, H5FS_HDR_MAGIC, (size_t)H5FS_SIZEOF_MAGIC)) @@ -238,255 +262,225 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) H5F_DECODE_LENGTH(udata->f, p, fspace->alloc_sect_size); /* Compute checksum on indirect block */ - computed_chksum = H5_checksum_metadata(hdr, (size_t)(p - (const uint8_t *)hdr), 0); + computed_chksum = H5_checksum_metadata(image, (size_t)(p - (const uint8_t *)image), 0); /* Metadata checksum */ UINT32DECODE(p, stored_chksum); - HDassert((size_t)(p - (const uint8_t *)hdr) == fspace->hdr_size); - /* Verify checksum */ if(stored_chksum != computed_chksum) HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap indirect block") + /* Sanity check */ + HDassert((size_t)(p - (const uint8_t *)image) <= len); + /* Set return value */ ret_value = fspace; done: /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_FSPACE, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && fspace) if(H5FS_hdr_dest(fspace) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, NULL, "unable to destroy free space header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_hdr_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5FS_cache_hdr_deserialize() */ /*lint !e818 Can't make udata a pointer to const */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_hdr_flush + * Function: H5FS_cache_hdr_image_len * - * Purpose: Flushes a dirty free space header to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * May 2 2006 + * koziol@hdfgroup.org + * May 20, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_t *fspace, unsigned UNUSED * flags_ptr) +H5FS_cache_hdr_image_len(const void *_thing, size_t *image_len) { - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5FS_HDR_BUF_SIZE]; /* Buffer for header */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5FS_t *fspace = (const H5FS_t *)_thing; /* Pointer to free space header */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_hdr_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_hdr_image_len) - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(fspace); + HDassert(image_len); - if(fspace->cache_info.is_dirty) { - uint8_t *hdr; /* Pointer to header buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ + /* Set the image length size */ + *image_len = fspace->hdr_size; - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't wrap buffer") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FS_cache_hdr_image_len() */ - /* Get a pointer to a buffer that's large enough for header */ - if(NULL == (hdr = H5WB_actual(wb, fspace->hdr_size))) - HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, FAIL, "can't get actual buffer") + +/*------------------------------------------------------------------------- + * Function: H5FS_cache_hdr_serialize + * + * Purpose: Serializes the data structure for writing to disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * May 2 2006 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FS_cache_hdr_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) +{ + H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to free space header */ + uint8_t *p; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ - /* Get temporary pointer to header */ - p = hdr; + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_hdr_serialize) - /* Magic number */ - HDmemcpy(p, H5FS_HDR_MAGIC, (size_t)H5FS_SIZEOF_MAGIC); - p += H5FS_SIZEOF_MAGIC; + /* check arguments */ + HDassert(f); + HDassert(image); + HDassert(fspace); + HDassert(flags); - /* Version # */ - *p++ = H5FS_HDR_VERSION; + /* Get temporary pointer to header */ + p = (uint8_t *)image; - /* Client ID */ - *p++ = fspace->client; + /* Magic number */ + HDmemcpy(p, H5FS_HDR_MAGIC, (size_t)H5FS_SIZEOF_MAGIC); + p += H5FS_SIZEOF_MAGIC; - /* Total space tracked */ - H5F_ENCODE_LENGTH(f, p, fspace->tot_space); + /* Version # */ + *p++ = H5FS_HDR_VERSION; - /* Total # of free space sections tracked */ - H5F_ENCODE_LENGTH(f, p, fspace->tot_sect_count); + /* Client ID */ + *p++ = fspace->client; - /* # of serializable free space sections tracked */ - H5F_ENCODE_LENGTH(f, p, fspace->serial_sect_count); + /* Total space tracked */ + H5F_ENCODE_LENGTH(f, p, fspace->tot_space); - /* # of ghost free space sections tracked */ - H5F_ENCODE_LENGTH(f, p, fspace->ghost_sect_count); + /* Total # of free space sections tracked */ + H5F_ENCODE_LENGTH(f, p, fspace->tot_sect_count); - /* # of section classes */ - UINT16ENCODE(p, fspace->nclasses); + /* # of serializable free space sections tracked */ + H5F_ENCODE_LENGTH(f, p, fspace->serial_sect_count); - /* Shrink percent */ - UINT16ENCODE(p, fspace->shrink_percent); + /* # of ghost free space sections tracked */ + H5F_ENCODE_LENGTH(f, p, fspace->ghost_sect_count); - /* Expand percent */ - UINT16ENCODE(p, fspace->expand_percent); + /* # of section classes */ + UINT16ENCODE(p, fspace->nclasses); - /* Size of address space free space sections are within (log2 of actual value) */ - UINT16ENCODE(p, fspace->max_sect_addr); + /* Shrink percent */ + UINT16ENCODE(p, fspace->shrink_percent); - /* Max. size of section to track */ - H5F_ENCODE_LENGTH(f, p, fspace->max_sect_size); + /* Expand percent */ + UINT16ENCODE(p, fspace->expand_percent); - /* Address of serialized free space sections */ - H5F_addr_encode(f, &p, fspace->sect_addr); + /* Size of address space free space sections are within (log2 of actual value) */ + UINT16ENCODE(p, fspace->max_sect_addr); - /* Size of serialized free space sections */ - H5F_ENCODE_LENGTH(f, p, fspace->sect_size); + /* Max. size of section to track */ + H5F_ENCODE_LENGTH(f, p, fspace->max_sect_size); - /* Allocated size of serialized free space sections */ - H5F_ENCODE_LENGTH(f, p, fspace->alloc_sect_size); + /* Address of serialized free space sections */ + H5F_addr_encode(f, &p, fspace->sect_addr); - /* Compute checksum */ - metadata_chksum = H5_checksum_metadata(hdr, (size_t)(p - (uint8_t *)hdr), 0); + /* Size of serialized free space sections */ + H5F_ENCODE_LENGTH(f, p, fspace->sect_size); - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + /* Allocated size of serialized free space sections */ + H5F_ENCODE_LENGTH(f, p, fspace->alloc_sect_size); - /* Write the free space header. */ - HDassert((size_t)(p - hdr) == fspace->hdr_size); - if(H5F_block_write(f, H5FD_MEM_FSPACE_HDR, addr, fspace->hdr_size, dxpl_id, hdr) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFLUSH, FAIL, "unable to save free space header to disk") + /* Compute checksum */ + metadata_chksum = H5_checksum_metadata(image, (size_t)(p - (uint8_t *)image), 0); - fspace->cache_info.is_dirty = FALSE; - } /* end if */ + /* Metadata checksum */ + UINT32ENCODE(p, metadata_chksum); - if(destroy) - if(H5FS_hdr_dest(fspace) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space header") + /* Reset the cache flags for this operation */ + *flags = 0; -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_FSPACE, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + /* Sanity check */ + HDassert((size_t)(p - (uint8_t *)image) <= len); - FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_cache_hdr_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5FS_cache_hdr_serialize() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_hdr_dest + * Function: H5FS_cache_hdr_free_icr * - * Purpose: Destroys a free space header in memory. + * Purpose: Destroy/release an "in core representation" of a data structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * May 2 2006 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * May 29, 2008 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5FS_cache_hdr_dest(H5F_t UNUSED *f, H5FS_t *fspace) +H5FS_cache_hdr_free_icr(void *thing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_hdr_dest) + FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_hdr_free_icr) /* Check arguments */ - HDassert(fspace); + HDassert(thing); /* Destroy free space header */ - if(H5FS_hdr_dest(fspace) < 0) + if(H5FS_hdr_dest((H5FS_t *)thing) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space header") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_hdr_dest() */ +} /* H5FS_cache_hdr_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_hdr_clear + * Function: H5FS_cache_sinfo_get_load_size * - * Purpose: Mark a free space header in memory as non-dirty. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * May 2 2006 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5FS_cache_hdr_clear(H5F_t UNUSED *f, H5FS_t *fspace, hbool_t destroy) +H5FS_cache_sinfo_get_load_size(const void *_udata, size_t *image_len) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_hdr_clear) - - /* - * Check arguments. - */ - HDassert(fspace); + const H5FS_sinfo_cache_ud_t *udata = (const H5FS_sinfo_cache_ud_t *)_udata; /* user data for callback */ - /* Reset the dirty flag. */ - fspace->cache_info.is_dirty = FALSE; + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_sinfo_get_load_size) - if(destroy) - if(H5FS_hdr_dest(fspace) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space header") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_hdr_clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5FS_cache_hdr_size - * - * Purpose: Compute the size in bytes of a free space header - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * May 2 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5FS_cache_hdr_size(const H5F_t UNUSED *f, const H5FS_t *fspace, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_hdr_size) - - /* check arguments */ - HDassert(f); - HDassert(fspace); - HDassert(size_ptr); + /* Check arguments */ + HDassert(udata); + HDassert(image_len); - /* Set size value */ - *size_ptr = fspace->hdr_size; + /* Set the image length size */ + H5_ASSIGN_OVERFLOW(/* To: */ *image_len, /* From: */ udata->fspace->alloc_sect_size, /* From: */ hsize_t, /* To: */ size_t); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FS_cache_hdr_size() */ +} /* end H5FS_cache_sinfo_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_sinfo_load + * Function: H5FS_cache_sinfo_deserialize * - * Purpose: Loads free space sections from the disk. + * Purpose: Deserialize the data structure from disk. * * Return: Success: Pointer to a new free space section info * Failure: NULL @@ -497,23 +491,23 @@ H5FS_cache_hdr_size(const H5F_t UNUSED *f, const H5FS_t *fspace, size_t *size_pt * *------------------------------------------------------------------------- */ -static H5FS_sinfo_t * -H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5FS_cache_sinfo_deserialize(const void *image, size_t UNUSED len, + void *_udata, hbool_t UNUSED *dirty) { H5FS_sinfo_t *sinfo = NULL; /* Free space section info */ H5FS_sinfo_cache_ud_t *udata = (H5FS_sinfo_cache_ud_t *)_udata; /* user data for callback */ haddr_t fs_addr; /* Free space header address */ size_t old_sect_size; /* Old section size */ - uint8_t *buf = NULL; /* Temporary buffer */ const uint8_t *p; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ H5FS_sinfo_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_load) + FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_deserialize) /* Check arguments */ - HDassert(f); + HDassert(image); HDassert(udata); /* Allocate a new free space section info */ @@ -527,15 +521,9 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Allocate space for the buffer to serialize the sections into */ H5_ASSIGN_OVERFLOW(/* To: */ old_sect_size, /* From: */ udata->fspace->sect_size, /* From: */ hsize_t, /* To: */ size_t); - if(NULL == (buf = H5FL_BLK_MALLOC(sect_block, (size_t)udata->fspace->sect_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - - /* Read buffer from disk */ - if(H5F_block_read(f, H5FD_MEM_FSPACE_SINFO, udata->fspace->sect_addr, (size_t)udata->fspace->sect_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_READERROR, NULL, "can't read free space sections") /* Deserialize free sections from buffer available */ - p = buf; + p = (const uint8_t *)image; /* Magic number */ if(HDmemcmp(p, H5FS_SINFO_MAGIC, (size_t)H5FS_SIZEOF_MAGIC)) @@ -613,10 +601,10 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(H5FS_sect_add(udata->f, udata->dxpl_id, udata->fspace, new_sect, H5FS_ADD_DESERIALIZING, NULL) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, NULL, "can't add section to free space manager") } /* end for */ - } while(p < ((buf + old_sect_size) - H5FS_SIZEOF_CHKSUM)); + } while(p < (((const uint8_t *)image + old_sect_size) - H5FS_SIZEOF_CHKSUM)); /* Sanity check */ - HDassert((size_t)(p - buf) == (old_sect_size - H5FS_SIZEOF_CHKSUM)); + HDassert((size_t)(p - (const uint8_t *)image) == (old_sect_size - H5FS_SIZEOF_CHKSUM)); HDassert(old_sect_size == udata->fspace->sect_size); HDassert(old_tot_sect_count == udata->fspace->tot_sect_count); HDassert(old_serial_sect_count == udata->fspace->serial_sect_count); @@ -625,7 +613,7 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end if */ /* Compute checksum on indirect block */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - (const uint8_t *)buf), 0); + computed_chksum = H5_checksum_metadata(image, (size_t)(p - (const uint8_t *)image), 0); /* Metadata checksum */ UINT32DECODE(p, stored_chksum); @@ -635,20 +623,18 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap indirect block") /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == old_sect_size); + HDassert((size_t)(p - (const uint8_t *)image) <= len); /* Set return value */ ret_value = sinfo; done: - if(buf) - buf = H5FL_BLK_FREE(sect_block, buf); if(!ret_value && sinfo) if(H5FS_sinfo_dest(sinfo) < 0) HDONE_ERROR(H5E_FSPACE, H5E_CANTFREE, NULL, "unable to destroy free space info") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_sinfo_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5FS_cache_sinfo_deserialize() */ /*lint !e818 Can't make udata a pointer to const */ /*------------------------------------------------------------------------- @@ -754,200 +740,152 @@ done: /*------------------------------------------------------------------------- - * Function: H5FS_cache_sinfo_flush + * Function: H5FS_cache_sinfo_image_len * - * Purpose: Flushes a dirty free space section info to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * July 31 2006 + * koziol@hdfgroup.org + * May 20, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_sinfo_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5FS_sinfo_t *sinfo, unsigned UNUSED * flags_ptr) +H5FS_cache_sinfo_image_len(const void *_thing, size_t *image_len) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5FS_sinfo_t *sinfo = (const H5FS_sinfo_t *)_thing; - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_sinfo_image_len) - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(sinfo); - HDassert(sinfo->fspace); - HDassert(sinfo->fspace->sect_cls); - - if(sinfo->cache_info.is_dirty) { - H5FS_iter_ud_t udata; /* User data for callbacks */ - uint8_t *buf = NULL; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - unsigned bin; /* Current bin we are on */ + HDassert(image_len); - /* Sanity check address */ - if(H5F_addr_ne(addr, sinfo->fspace->sect_addr)) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, FAIL, "incorrect address for free space sections") + /* Set the image length size */ + H5_ASSIGN_OVERFLOW(*image_len, sinfo->fspace->alloc_sect_size, hsize_t, size_t) - /* Allocate temporary buffer */ - if((buf = H5FL_BLK_MALLOC(sect_block, (size_t)sinfo->fspace->sect_size)) == NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - - p = buf; - - /* Magic number */ - HDmemcpy(p, H5FS_SINFO_MAGIC, (size_t)H5FS_SIZEOF_MAGIC); - p += H5FS_SIZEOF_MAGIC; - - /* Version # */ - *p++ = H5FS_SINFO_VERSION; - - /* Address of free space header for these sections */ - H5F_addr_encode(f, &p, sinfo->fspace->addr); - - /* Set up user data for iterator */ - udata.sinfo = sinfo; - udata.p = &p; - udata.sect_cnt_size = H5V_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); - - /* Iterate over all the bins */ - for(bin = 0; bin < sinfo->nbins; bin++) { - /* Check if there are any sections in this bin */ - if(sinfo->bins[bin].bin_list) { - /* Iterate over list of section size nodes for bin */ - if(H5SL_iterate(sinfo->bins[bin].bin_list, H5FS_sinfo_serialize_node_cb, &udata) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section size nodes") - } /* end if */ - } /* end for */ - - /* Compute checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - - /* Sanity check */ - HDassert((size_t)(p - buf) == sinfo->fspace->sect_size); - HDassert(sinfo->fspace->sect_size <= sinfo->fspace->alloc_sect_size); - - /* Write buffer to disk */ - if(H5F_block_write(f, H5FD_MEM_FSPACE_SINFO, sinfo->fspace->sect_addr, (size_t)sinfo->fspace->sect_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFLUSH, FAIL, "unable to save free space sections to disk") - - buf = H5FL_BLK_FREE(sect_block, buf); - - sinfo->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5FS_sinfo_dest(sinfo) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space section info") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5FS_cache_sinfo_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FS_cache_sinfo_image_len() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_sinfo_dest + * Function: H5FS_cache_sinfo_serialize * - * Purpose: Destroys a free space section info in memory. + * Purpose: Serialize the data structure for writing to disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * July 31 2006 + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * July 31 2006 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5FS_cache_sinfo_dest(H5F_t UNUSED *f, H5FS_sinfo_t *sinfo) +H5FS_cache_sinfo_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) { + H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to section info */ + H5FS_iter_ud_t udata; /* User data for callbacks */ + uint8_t *p; /* Pointer into raw data buffer */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + unsigned bin; /* Current bin we are on */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_dest) + FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_serialize) - /* Check arguments */ + /* check arguments */ + HDassert(f); + HDassert(image); HDassert(sinfo); + HDassert(sinfo->fspace); + HDassert(sinfo->fspace->sect_cls); + HDassert(flags); - /* Destroy free space info */ - if(H5FS_sinfo_dest(sinfo) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space info") + /* Sanity check address */ + if(H5F_addr_ne(addr, sinfo->fspace->sect_addr)) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTLOAD, FAIL, "incorrect address for free space sections") -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_sinfo_dest() */ + /* Point to disk image buffer */ + p = (uint8_t *)image; - -/*------------------------------------------------------------------------- - * Function: H5FS_cache_sinfo_clear - * - * Purpose: Mark a free space section info in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * July 31 2006 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static herr_t -H5FS_cache_sinfo_clear(H5F_t UNUSED *f, H5FS_sinfo_t *sinfo, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; /* Return value */ + /* Magic number */ + HDmemcpy(p, H5FS_SINFO_MAGIC, (size_t)H5FS_SIZEOF_MAGIC); + p += H5FS_SIZEOF_MAGIC; - FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_clear) + /* Version # */ + *p++ = H5FS_SINFO_VERSION; - /* - * Check arguments. - */ - HDassert(sinfo); + /* Address of free space header for these sections */ + H5F_addr_encode(f, &p, sinfo->fspace->addr); + + /* Set up user data for iterator */ + udata.sinfo = sinfo; + udata.p = &p; + udata.sect_cnt_size = H5V_limit_enc_size((uint64_t)sinfo->fspace->serial_sect_count); + + /* Iterate over all the bins */ + for(bin = 0; bin < sinfo->nbins; bin++) { + /* Check if there are any sections in this bin */ + if(sinfo->bins[bin].bin_list) { + /* Iterate over list of section size nodes for bin */ + if(H5SL_iterate(sinfo->bins[bin].bin_list, H5FS_sinfo_serialize_node_cb, &udata) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over section size nodes") + } /* end if */ + } /* end for */ - /* Reset the dirty flag. */ - sinfo->cache_info.is_dirty = FALSE; + /* Compute checksum */ + metadata_chksum = H5_checksum_metadata(image, (size_t)(p - (uint8_t *)image), 0); - if(destroy) - if(H5FS_sinfo_dest(sinfo) < 0) - HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space section info") + /* Metadata checksum */ + UINT32ENCODE(p, metadata_chksum); + + /* Sanity check */ + HDassert((size_t)(p - (uint8_t *)image) == sinfo->fspace->sect_size); + HDassert(sinfo->fspace->sect_size <= sinfo->fspace->alloc_sect_size); + + /* Sanity check */ + HDassert((size_t)(p - (uint8_t *)image) <= len); + + /* Reset the cache flags for this operation */ + *flags = 0; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FS_cache_sinfo_clear() */ +} /* H5FS_cache_sinfo_serialize() */ /*------------------------------------------------------------------------- - * Function: H5FS_cache_sinfo_size + * Function: H5FS_cache_sinfo_free_icr * - * Purpose: Compute the size in bytes of a free space section info - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Destroy/release an "in core representation" of a data structure * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * July 31 2006 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * May 29, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5FS_cache_sinfo_size(const H5F_t UNUSED *f, const H5FS_sinfo_t *sinfo, size_t *size_ptr) +H5FS_cache_sinfo_free_icr(void *thing) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FS_cache_sinfo_size) + herr_t ret_value = SUCCEED; /* Return value */ - /* check arguments */ - HDassert(sinfo); - HDassert(size_ptr); + FUNC_ENTER_NOAPI_NOINIT(H5FS_cache_sinfo_free_icr) - /* Set size value */ - H5_ASSIGN_OVERFLOW(/* To: */ *size_ptr, /* From: */ sinfo->fspace->sect_size, /* From: */ hsize_t, /* To: */ size_t); + /* Check arguments */ + HDassert(thing); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5FS_cache_sinfo_size() */ + /* Destroy free space info */ + if(H5FS_sinfo_dest((H5FS_sinfo_t *)thing) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "unable to destroy free space info") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5FS_cache_sinfo_free_icr() */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 60d0960..53b173b 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -83,19 +83,15 @@ typedef struct H5G_node_t { ) -/* Size of stack buffer for serialized nodes */ -#define H5G_NODE_BUF_SIZE 512 - -/* PRIVATE PROTOTYPES */ -static herr_t H5G_node_free(H5G_node_t *sym); - /* Metadata cache callbacks */ -static H5G_node_t *H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata); -static herr_t H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5G_node_t *sym, unsigned UNUSED * flags_ptr); -static herr_t H5G_node_dest(H5F_t *f, H5G_node_t *sym); -static herr_t H5G_node_clear(H5F_t *f, H5G_node_t *sym, hbool_t destroy); -static herr_t H5G_node_size(const H5F_t *f, const H5G_node_t *sym, size_t *size_ptr); +static herr_t H5G_node_get_load_size(const void *udata, size_t *image_len); +static void *H5G_node_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5G_node_image_len(const void *thing, size_t *image_len); +static herr_t H5G_node_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 H5G_node_free_icr(void *thing); /* B-tree callbacks */ static H5RC_t *H5G_node_get_shared(const H5F_t *f, const void *_udata); @@ -122,11 +118,14 @@ static herr_t H5G_node_debug_key(FILE *stream, int indent, int fwidth, /* H5G symbol table node inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_SNODE[1] = {{ H5AC_SNODE_ID, - (H5AC_load_func_t)H5G_node_load, - (H5AC_flush_func_t)H5G_node_flush, - (H5AC_dest_func_t)H5G_node_dest, - (H5AC_clear_func_t)H5G_node_clear, - (H5AC_size_func_t)H5G_node_size, + "symbol table node", + H5FD_MEM_BTREE, + H5AC__CLASS_NO_FLAGS_SET, + H5G_node_get_load_size, + H5G_node_deserialize, + H5G_node_image_len, + H5G_node_serialize, + H5G_node_free_icr, }}; /* H5G inherits B-tree like properties from H5B */ @@ -319,63 +318,67 @@ H5G_node_free(H5G_node_t *sym) /*------------------------------------------------------------------------- - * Function: H5G_node_load + * Function: H5G_node_get_load_size * - * Purpose: Loads a symbol table node from the file. + * Purpose: Compute the size of the data structure on disk. * - * Return: Success: Ptr to the new table. - * Failure: NULL + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * *------------------------------------------------------------------------- */ -static H5G_node_t * -H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +static herr_t +H5G_node_get_load_size(const void *_udata, size_t *image_len) { - H5G_node_t *sym = NULL; - H5WB_t *wb = NULL; /* Wrapped buffer for node data */ - uint8_t node_buf[H5G_NODE_BUF_SIZE]; /* Buffer for node */ - uint8_t *node; /* Pointer to node buffer */ - const uint8_t *p; - H5G_node_t *ret_value; /* Return value */ + const H5F_t *f = (const H5F_t *)_udata; /* Get file pointer from user data */ - FUNC_ENTER_NOAPI_NOINIT(H5G_node_load) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_get_load_size) - /* - * Check arguments. - */ + /* Check arguments */ HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata); + HDassert(image_len); - /* - * Initialize variables. - */ + /* Set the image length size */ + *image_len = H5G_NODE_SIZE(f); - /* Allocate symbol table data structures */ - if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - sym->node_size = H5G_NODE_SIZE(f); - if(NULL == (sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t, (size_t)(2 * H5F_SYM_LEAF_K(f))))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5G_node_get_load_size() */ - /* Wrap the local buffer for serialized node info */ - if(NULL == (wb = H5WB_wrap(node_buf, sizeof(node_buf)))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "can't wrap buffer") + +/*------------------------------------------------------------------------- + * Function: H5G_node_deserialize + * + * Purpose: Deserialize the data structure from disk. + * + * Return: Success: Ptr to the new node. + * Failure: NULL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Apr 14, 2008 + * + *------------------------------------------------------------------------- + */ +static void * +H5G_node_deserialize(const void *image, size_t UNUSED len, void *udata, + hbool_t UNUSED *dirty) +{ + H5G_node_t *sym = NULL; /* Pointer to the deserialized symbol table node */ + H5F_t *f = (H5F_t *)udata; /* Get file pointer from user data */ + const uint8_t *p; /* Pointer into image buffer */ + H5G_node_t *ret_value; /* Return value */ - /* Get a pointer to a buffer that's large enough for node */ - if(NULL == (node = H5WB_actual(wb, sym->node_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't get actual buffer") + FUNC_ENTER_NOAPI_NOINIT(H5G_node_deserialize) - /* Read the serialized symbol table node. */ - if(H5F_block_read(f, H5FD_MEM_BTREE, addr, sym->node_size, dxpl_id, node) < 0) - HGOTO_ERROR(H5E_SYM, H5E_READERROR, NULL, "unable to read symbol table node") + /* check arguments */ + HDassert(image); + HDassert(f); - /* Get temporary pointer to serialized node */ - p = node; + /* Get temporary pointer to serialized symbol table node */ + p = (const uint8_t *)image; /* magic */ if(HDmemcmp(p, H5G_NODE_MAGIC, (size_t)H5G_NODE_SIZEOF_MAGIC)) @@ -389,6 +392,13 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) /* reserved */ p++; + /* Allocate symbol table data structures */ + if(NULL == (sym = H5FL_CALLOC(H5G_node_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + sym->node_size = H5G_NODE_SIZE(f); + if(NULL == (sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t, (size_t)(2 * H5F_SYM_LEAF_K(f))))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + /* number of symbols */ UINT16DECODE(p, sym->nsyms); @@ -396,219 +406,145 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) if(H5G_ent_decode_vec(f, &p, sym->entry, sym->nsyms) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, NULL, "unable to decode symbol table entries") + /* Sanity check */ + HDassert((size_t)((const uint8_t *)p - (const uint8_t *)image) <= len); + /* Set return value */ ret_value = sym; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value) if(sym && H5G_node_free(sym) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTFREE, NULL, "unable to destroy symbol table node") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_load() */ +} /* end H5G_node_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5G_node_flush + * Function: H5G_node_image_len * - * Purpose: Flush a symbol table node to disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 23 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_t *sym, unsigned UNUSED * flags_ptr) +H5G_node_image_len(const void *_thing, size_t *image_len) { - H5WB_t *wb = NULL; /* Wrapped buffer for node data */ - uint8_t node_buf[H5G_NODE_BUF_SIZE]; /* Buffer for node */ - unsigned u; - herr_t ret_value = SUCCEED; /* Return value */ + const H5G_node_t *sym = (const H5G_node_t *)_thing; /* Pointer to the Symbol Table node */ - FUNC_ENTER_NOAPI_NOINIT(H5G_node_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_image_len) - /* - * Check arguments. - */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(sym); + HDassert(image_len); - /* - * Write the symbol node to disk. - */ - if(sym->cache_info.is_dirty) { - uint8_t *node; /* Node buffer */ - uint8_t *p; /* Pointer into node buffer */ - - /* Wrap the local buffer for serialized node info */ - if(NULL == (wb = H5WB_wrap(node_buf, sizeof(node_buf)))) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for node */ - if(NULL == (node = H5WB_actual(wb, sym->node_size))) - HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't get actual buffer") - - /* Serialize symbol table node into buffer */ - p = node; - - /* magic number */ - HDmemcpy(p, H5G_NODE_MAGIC, (size_t)H5G_NODE_SIZEOF_MAGIC); - p += 4; + /* Set the image length size */ + *image_len = sym->node_size; - /* version number */ - *p++ = H5G_NODE_VERS; - - /* reserved */ - *p++ = 0; - - /* number of symbols */ - UINT16ENCODE(p, sym->nsyms); - - /* entries */ - if(H5G_ent_encode_vec(f, &p, sym->entry, sym->nsyms) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't serialize") - HDmemset(p, 0, sym->node_size - (size_t)(p - node)); - - /* Write the serialized symbol table node. */ - if(H5F_block_write(f, H5FD_MEM_BTREE, addr, sym->node_size, dxpl_id, node) < 0) - HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "unable to write symbol table node to the file") - - /* Reset the node's dirty flag */ - sym->cache_info.is_dirty = FALSE; - } /* end if */ - - /* - * Destroy the symbol node? This might happen if the node is being - * preempted from the cache. - */ - if(destroy) - if(H5G_node_dest(f, sym) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to destroy symbol table node") - -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5G_node_image_len() */ /*------------------------------------------------------------------------- - * Function: H5G_node_dest + * Function: H5G_node_serialize * - * Purpose: Destroy a symbol table node in memory. + * Purpose: Serialize the data structure for writing to disk. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Mar 24, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5G_node_dest(H5F_t UNUSED *f, H5G_node_t *sym) +H5G_node_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) { + H5G_node_t *sym = (H5G_node_t *)_thing; /* Pointer to the Symbol Table node */ + uint8_t *p; /* Pointer into image buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5G_node_dest) + FUNC_ENTER_NOAPI_NOINIT(H5G_node_serialize) - /* Check arguments */ + /* check arguments */ + HDassert(image); HDassert(sym); + HDassert(flags); - /* Verify that node is clean */ - HDassert(sym->cache_info.is_dirty == FALSE); + /* Set the local pointer into the serialized image */ + p = (uint8_t *)image; - /* Destroy symbol table node */ - if(H5G_node_free(sym) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to destroy symbol table node") + /* magic number */ + HDmemcpy(p, H5G_NODE_MAGIC, (size_t)H5G_NODE_SIZEOF_MAGIC); + p += 4; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_dest() */ + /* version number */ + *p++ = H5G_NODE_VERS; - -/*------------------------------------------------------------------------- - * Function: H5G_node_clear - * - * Purpose: Mark a symbol table node in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5G_node_clear(H5F_t *f, H5G_node_t *sym, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; + /* reserved */ + *p++ = 0; - FUNC_ENTER_NOAPI_NOINIT(H5G_node_clear) + /* number of symbols */ + UINT16ENCODE(p, sym->nsyms); - /* - * Check arguments. - */ - HDassert(sym); + /* entries */ + if(H5G_ent_encode_vec(f, &p, sym->entry, sym->nsyms) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTENCODE, FAIL, "can't serialize") + HDmemset(p, 0, sym->node_size - (size_t)(p - (uint8_t *)image)); - /* Mark the node as clean */ - sym->cache_info.is_dirty = FALSE; + /* Reset the cache flags for this operation (metadata not resized or renamed) */ + *flags = 0; - /* - * Destroy the symbol node? This might happen if the node is being - * preempted from the cache. - */ - if(destroy) - if(H5G_node_dest(f, sym) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to destroy symbol table node") + /* Sanity check */ + HDassert((size_t)(p - (uint8_t *)image) <= len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5G_node_clear() */ +} /* end H5G_node_serialize() */ /*------------------------------------------------------------------------- - * Function: H5G_node_size + * Function: H5G_node_free_icr * - * Purpose: Compute the size in bytes of the specified instance of - * H5G_node_t on disk, and return it in *size_ptr. On failure - * the value of size_ptr is undefined. + * Purpose: Destroy/release an "in core representation" of a data structure * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 5/13/04 + * Return: Success: SUCCEED + * Failure: FAIL * - * Modifications: + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 30, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5G_node_size(const H5F_t UNUSED *f, const H5G_node_t *sym, size_t *size_ptr) +H5G_node_free_icr(void *thing) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_size) + herr_t ret_value = SUCCEED; /* Return value */ - /* - * Check arguments. - */ - HDassert(f); - HDassert(size_ptr); + FUNC_ENTER_NOAPI_NOINIT(H5G_node_free_icr) - *size_ptr = sym->node_size; + /* Check arguments */ + HDassert(thing); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5G_node_size() */ + /* Destroy symbol table node */ + if(H5G_node_free((H5G_node_t *)thing) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to destroy symbol table node") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5G_node_free_icr() */ /*------------------------------------------------------------------------- diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 5c6f54d..679960d 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -51,11 +51,11 @@ #define H5HF_DBLOCK_VERSION 0 /* Direct block */ #define H5HF_IBLOCK_VERSION 0 /* Indirect block */ -/* Size of stack buffer for serialized headers */ -#define H5HF_HDR_BUF_SIZE 512 - -/* Size of stack buffer for serialized indirect blocks */ -#define H5HF_IBLOCK_BUF_SIZE 4096 +/* 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 \ +) /******************/ @@ -77,21 +77,33 @@ static herr_t H5HF_dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dt static herr_t H5HF_dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *dtable); /* Metadata cache (H5AC) callbacks */ -static H5HF_hdr_t *H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_hdr_t *hdr, unsigned UNUSED * flags_ptr); -static herr_t H5HF_cache_hdr_dest(H5F_t *f, H5HF_hdr_t *hdr); -static herr_t H5HF_cache_hdr_clear(H5F_t *f, H5HF_hdr_t *hdr, hbool_t destroy); -static herr_t H5HF_cache_hdr_size(const H5F_t *f, const H5HF_hdr_t *hdr, size_t *size_ptr); -static H5HF_indirect_t *H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_indirect_t *iblock, unsigned UNUSED * flags_ptr); -static herr_t H5HF_cache_iblock_dest(H5F_t *f, H5HF_indirect_t *iblock); -static herr_t H5HF_cache_iblock_clear(H5F_t *f, H5HF_indirect_t *iblock, hbool_t destroy); -static herr_t H5HF_cache_iblock_size(const H5F_t *f, const H5HF_indirect_t *iblock, size_t *size_ptr); -static H5HF_direct_t *H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_direct_t *dblock, unsigned UNUSED * flags_ptr); -static herr_t H5HF_cache_dblock_dest(H5F_t *f, H5HF_direct_t *dblock); -static herr_t H5HF_cache_dblock_clear(H5F_t *f, H5HF_direct_t *dblock, hbool_t destroy); -static herr_t H5HF_cache_dblock_size(const H5F_t *f, const H5HF_direct_t *dblock, size_t *size_ptr); +static herr_t H5HF_cache_hdr_get_load_size(const void *udata, size_t *image_len); +static void *H5HF_cache_hdr_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HF_cache_hdr_image_len(const void *thing, size_t *image_len_ptr); +static herr_t H5HF_cache_hdr_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 H5HF_cache_hdr_free_icr(void *thing); + +static herr_t H5HF_cache_iblock_get_load_size(const void *udata, size_t *image_len); +static void *H5HF_cache_iblock_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HF_cache_iblock_image_len(const void *thing, size_t *image_len_ptr); +static herr_t H5HF_cache_iblock_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 H5HF_cache_iblock_free_icr(void *thing); + +static herr_t H5HF_cache_dblock_get_load_size(const void *udata, size_t *image_len); +static void *H5HF_cache_dblock_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HF_cache_dblock_image_len(const void *thing, size_t *image_len_ptr); +static herr_t H5HF_cache_dblock_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 H5HF_cache_dblock_free_icr(void *thing); + /*********************/ /* Package Variables */ @@ -100,31 +112,40 @@ static herr_t H5HF_cache_dblock_size(const H5F_t *f, const H5HF_direct_t *dblock /* H5HF header inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FHEAP_HDR[1] = {{ H5AC_FHEAP_HDR_ID, - (H5AC_load_func_t)H5HF_cache_hdr_load, - (H5AC_flush_func_t)H5HF_cache_hdr_flush, - (H5AC_dest_func_t)H5HF_cache_hdr_dest, - (H5AC_clear_func_t)H5HF_cache_hdr_clear, - (H5AC_size_func_t)H5HF_cache_hdr_size, + "fractal heap header", + H5FD_MEM_FHEAP_HDR, + H5AC__CLASS_SPECULATIVE_LOAD_FLAG, + H5HF_cache_hdr_get_load_size, + H5HF_cache_hdr_deserialize, + H5HF_cache_hdr_image_len, + H5HF_cache_hdr_serialize, + H5HF_cache_hdr_free_icr, }}; /* H5HF indirect block inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FHEAP_IBLOCK[1] = {{ H5AC_FHEAP_IBLOCK_ID, - (H5AC_load_func_t)H5HF_cache_iblock_load, - (H5AC_flush_func_t)H5HF_cache_iblock_flush, - (H5AC_dest_func_t)H5HF_cache_iblock_dest, - (H5AC_clear_func_t)H5HF_cache_iblock_clear, - (H5AC_size_func_t)H5HF_cache_iblock_size, + "fractal heap indirect block", + H5FD_MEM_FHEAP_IBLOCK, + H5AC__CLASS_NO_FLAGS_SET, + H5HF_cache_iblock_get_load_size, + H5HF_cache_iblock_deserialize, + H5HF_cache_iblock_image_len, + H5HF_cache_iblock_serialize, + H5HF_cache_iblock_free_icr, }}; /* H5HF direct block inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_FHEAP_DBLOCK[1] = {{ H5AC_FHEAP_DBLOCK_ID, - (H5AC_load_func_t)H5HF_cache_dblock_load, - (H5AC_flush_func_t)H5HF_cache_dblock_flush, - (H5AC_dest_func_t)H5HF_cache_dblock_dest, - (H5AC_clear_func_t)H5HF_cache_dblock_clear, - (H5AC_size_func_t)H5HF_cache_dblock_size, + "fractal heap direct block", + H5FD_MEM_FHEAP_DBLOCK, + H5AC__CLASS_COMPRESSED_FLAG, + H5HF_cache_dblock_get_load_size, + H5HF_cache_dblock_deserialize, + H5HF_cache_dblock_image_len, + H5HF_cache_dblock_serialize, + H5HF_cache_dblock_free_icr, }}; @@ -243,11 +264,42 @@ H5HF_dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) /*------------------------------------------------------------------------- - * Function: H5HF_cache_hdr_load + * Function: H5HF_cache_hdr_get_load_size * - * Purpose: Loads a fractal heap header from the disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Success: Pointer to a new fractal heap + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF_cache_hdr_get_load_size(const void *_udata, size_t *image_len) +{ + const H5HF_hdr_cache_ud_t *udata = (const H5HF_hdr_cache_ud_t *)_udata; + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_hdr_get_load_size) + + /* Check arguments */ + HDassert(udata); + HDassert(image_len); + + /* Set the image length size */ + *image_len = H5HF_SPEC_READ_SIZE(udata->f); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF_cache_hdr_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF_cache_hdr_deserialize + * + * Purpose: Deserialize the data structure from disk. + * + * Return: Success: Pointer to a new fractal heap header * Failure: NULL * * Programmer: Quincey Koziol @@ -256,49 +308,33 @@ H5HF_dtable_encode(H5F_t *f, uint8_t **pp, const H5HF_dtable_t *dtable) * *------------------------------------------------------------------------- */ -static H5HF_hdr_t * -H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5HF_cache_hdr_deserialize(const void *image, size_t UNUSED len, + void *_udata, hbool_t UNUSED *dirty) { H5HF_hdr_t *hdr = NULL; /* Fractal heap info */ H5HF_hdr_cache_ud_t *udata = (H5HF_hdr_cache_ud_t *)_udata; size_t size; /* Header size */ - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5HF_HDR_BUF_SIZE]; /* Buffer for header */ - uint8_t *buf; /* Pointer to header buffer */ const uint8_t *p; /* Pointer into raw data buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ uint8_t heap_flags; /* Status flags for heap */ H5HF_hdr_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_load) + FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_deserialize) /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata); + HDassert(image); /* Allocate space for the fractal heap data structure */ if(NULL == (hdr = H5HF_hdr_alloc(udata->f))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't wrap buffer") - /* Compute the 'base' size of the fractal heap header on disk */ size = H5HF_HEADER_SIZE(hdr); - /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = H5WB_actual(wb, size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_FHEAP_HDR, addr, size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "can't read fractal heap header") - /* Get temporary pointer to serialized header */ - p = buf; + p = (const uint8_t *)image; /* Magic number */ if(HDmemcmp(p, H5HF_HDR_MAGIC, (size_t)H5HF_SIZEOF_MAGIC)) @@ -345,16 +381,16 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Sanity check */ /* (allow for checksum not decoded yet) */ - HDassert((size_t)(p - (const uint8_t *)buf) == (size - H5HF_SIZEOF_CHKSUM)); + HDassert((size_t)(p - (const uint8_t *)image) == (size - H5HF_SIZEOF_CHKSUM)); /* Check for I/O filter information to decode */ if(hdr->filter_len > 0) { - size_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 */ /* Compute the offset of the filter info in the header */ - filter_info_off = p - (const uint8_t *)buf; + filter_info_off = p - (const uint8_t *)image; /* Compute the size of the extra filter information */ filter_info_size = hdr->sizeof_size /* Size of size for filtered root direct block */ @@ -364,17 +400,8 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Compute the heap header's size */ hdr->heap_size = size + filter_info_size; - /* Re-size current buffer */ - if(NULL == (buf = H5WB_actual(wb, hdr->heap_size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read in I/O filter information */ - /* (and the checksum) */ - if(H5F_block_read(f, H5FD_MEM_FHEAP_HDR, (addr + filter_info_off), (filter_info_size + H5HF_SIZEOF_CHKSUM), dxpl_id, (buf + filter_info_off)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "can't read fractal heap header's I/O pipeline filter info") - /* Point at correct offset in header for the filter information */ - p = buf + filter_info_off; + p = (const uint8_t *)image + filter_info_off; /* Decode the size of a filtered root direct block */ H5F_DECODE_LENGTH(udata->f, p, hdr->pline_root_direct_size); @@ -400,13 +427,13 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Compute checksum on entire header */ /* (including the filter information, if present) */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - (const uint8_t *)buf), 0); + computed_chksum = H5_checksum_metadata(image, (size_t)(p - (const uint8_t *)image), 0); /* Metadata checksum */ UINT32DECODE(p, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == hdr->heap_size); + HDassert((size_t)(p - (const uint8_t *)image) == hdr->heap_size); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -421,22 +448,53 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) done: /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && hdr) if(H5HF_hdr_dest(hdr) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap header") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_hdr_load() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5HF_cache_hdr_deserialize() */ /*lint !e818 Can't make udata a pointer to const */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_hdr_flush + * Function: H5HF_cache_hdr_image_len * - * Purpose: Flushes a dirty fractal heap header to disk. + * Purpose: Tell the metadata cache about the actual size + * of the fractal heap header * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure + * + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * July 25, 2008 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF_cache_hdr_image_len(const void *thing, size_t *image_len_ptr) +{ + const H5HF_hdr_t *hdr = (const H5HF_hdr_t *)thing; /* Fractal heap header */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_hdr_image_len) + + /* Check arguments */ + HDassert(hdr); + HDassert(image_len_ptr); + + /* Report the fractal heap header's prefix + I/O filter length */ + *image_len_ptr = hdr->heap_size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF_cache_hdr_image_len() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF_cache_hdr_serialize + * + * Purpose: Serialize the data structure for writing to disk. + * + * Return: Success: SUCCEED + * Failure: FAIL * * Programmer: Quincey Koziol * koziol@ncsa.uiuc.edu @@ -445,242 +503,185 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_hdr_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_hdr_t *hdr, unsigned UNUSED * flags_ptr) +H5HF_cache_hdr_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) { - H5WB_t *wb = NULL; /* Wrapped buffer for header data */ - uint8_t hdr_buf[H5HF_HDR_BUF_SIZE]; /* Buffer for header */ - herr_t ret_value = SUCCEED; /* Return value */ + H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* fractal heap header */ + uint8_t *p; /* Pointer into raw data buffer */ + size_t size; /* Header size on disk */ + uint8_t heap_flags; /* Status flags for heap */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_flush) + FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_serialize) /* check arguments */ HDassert(f); HDassert(H5F_addr_defined(addr)); HDassert(hdr); + HDassert(image); + HDassert(flags); - if(hdr->cache_info.is_dirty) { - uint8_t *buf; /* Temporary raw data buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - size_t size; /* Header size on disk */ - uint8_t heap_flags; /* Status flags for heap */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ + /* Sanity check */ + HDassert(hdr->dirty); - /* Sanity check */ - HDassert(hdr->dirty); - - /* Set the shared heap header's file context for this operation */ - hdr->f = f; - - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(hdr_buf, sizeof(hdr_buf)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't wrap buffer") - - /* Compute the size of the heap header on disk */ - size = hdr->heap_size; - - /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = H5WB_actual(wb, size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "can't get actual buffer") - - /* Get temporary pointer to serialized header */ - p = buf; - - /* Magic number */ - HDmemcpy(p, H5HF_HDR_MAGIC, (size_t)H5HF_SIZEOF_MAGIC); - p += H5HF_SIZEOF_MAGIC; - - /* Version # */ - *p++ = H5HF_HDR_VERSION; - - /* General heap information */ - UINT16ENCODE(p, hdr->id_len); /* Heap ID length */ - UINT16ENCODE(p, hdr->filter_len); /* I/O filters' encoded length */ - - /* Heap status flags */ - /* (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); - *p++ = heap_flags; - - /* "Huge" object information */ - UINT32ENCODE(p, hdr->max_man_size); /* Max. size of "managed" objects */ - H5F_ENCODE_LENGTH(f, p, hdr->huge_next_id); /* Next ID to use for "huge" object */ - H5F_addr_encode(f, &p, hdr->huge_bt2_addr); /* Address of "huge" object tracker B-tree */ - - /* "Managed" object free space information */ - H5F_ENCODE_LENGTH(f, p, hdr->total_man_free); /* Internal free space in managed direct blocks */ - H5F_addr_encode(f, &p, hdr->fs_addr); /* Address of free section header */ - - /* Heap statistics */ - H5F_ENCODE_LENGTH(f, p, hdr->man_size); - H5F_ENCODE_LENGTH(f, p, hdr->man_alloc_size); - H5F_ENCODE_LENGTH(f, p, hdr->man_iter_off); - H5F_ENCODE_LENGTH(f, p, hdr->man_nobjs); - H5F_ENCODE_LENGTH(f, p, hdr->huge_size); - H5F_ENCODE_LENGTH(f, p, hdr->huge_nobjs); - H5F_ENCODE_LENGTH(f, p, hdr->tiny_size); - H5F_ENCODE_LENGTH(f, p, hdr->tiny_nobjs); - - /* Managed objects' doubling-table info */ - if(H5HF_dtable_encode(hdr->f, &p, &(hdr->man_dtable)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, FAIL, "unable to encode managed obj. doubling table info") - - /* Check for I/O filter information to encode */ - if(hdr->filter_len > 0) { - /* Encode the size of a filtered root direct block */ - H5F_ENCODE_LENGTH(f, p, hdr->pline_root_direct_size); + /* Set the shared heap header's file context for this operation */ + hdr->f = f; - /* Encode the filter mask for a filtered root direct block */ - UINT32ENCODE(p, hdr->pline_root_direct_filter_mask); + /* Compute the size of the heap header on disk */ + size = hdr->heap_size; - /* Encode I/O filter information */ - if(H5O_msg_encode(hdr->f, H5O_PLINE_ID, FALSE, p, &(hdr->pline)) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, FAIL, "can't encode I/O pipeline fiters") - p += hdr->filter_len; - } /* end if */ + /* Get temporary pointer to serialized header */ + p = (uint8_t *)image; - /* Compute metadata checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); + /* Magic number */ + HDmemcpy(p, H5HF_HDR_MAGIC, (size_t)H5HF_SIZEOF_MAGIC); + p += H5HF_SIZEOF_MAGIC; - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + /* Version # */ + *p++ = H5HF_HDR_VERSION; - /* Write the heap header. */ - HDassert((size_t)(p - buf) == size); - if(H5F_block_write(f, H5FD_MEM_FHEAP_HDR, addr, size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFLUSH, FAIL, "unable to save fractal heap header to disk") + /* General heap information */ + UINT16ENCODE(p, hdr->id_len); /* Heap ID length */ + UINT16ENCODE(p, hdr->filter_len); /* I/O filters' encoded length */ - hdr->dirty = FALSE; - hdr->cache_info.is_dirty = FALSE; - } /* end if */ + /* Heap status flags */ + /* (bit 0: "huge" object IDs have wrapped) */ + /* (bit 1: checksum direct blocks) */ + heap_flags = 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; - if(destroy) - if(H5HF_cache_hdr_dest(f, hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap header") + /* "Huge" object information */ + UINT32ENCODE(p, hdr->max_man_size); /* Max. size of "managed" objects */ + H5F_ENCODE_LENGTH(f, p, hdr->huge_next_id); /* Next ID to use for "huge" object */ + H5F_addr_encode(f, &p, hdr->huge_bt2_addr); /* Address of "huge" object tracker B-tree */ -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + /* "Managed" object free space information */ + H5F_ENCODE_LENGTH(f, p, hdr->total_man_free); /* Internal free space in managed direct blocks */ + H5F_addr_encode(f, &p, hdr->fs_addr); /* Address of free section header */ - FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_cache_hdr_flush() */ + /* Heap statistics */ + H5F_ENCODE_LENGTH(f, p, hdr->man_size); + H5F_ENCODE_LENGTH(f, p, hdr->man_alloc_size); + H5F_ENCODE_LENGTH(f, p, hdr->man_iter_off); + H5F_ENCODE_LENGTH(f, p, hdr->man_nobjs); + H5F_ENCODE_LENGTH(f, p, hdr->huge_size); + H5F_ENCODE_LENGTH(f, p, hdr->huge_nobjs); + H5F_ENCODE_LENGTH(f, p, hdr->tiny_size); + H5F_ENCODE_LENGTH(f, p, hdr->tiny_nobjs); - -/*------------------------------------------------------------------------- - * Function: H5HF_cache_hdr_dest - * - * Purpose: Destroys a fractal heap header in memory. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 - * - *------------------------------------------------------------------------- - */ -/* ARGSUSED */ -static herr_t -H5HF_cache_hdr_dest(H5F_t UNUSED *f, H5HF_hdr_t *hdr) -{ - herr_t ret_value = SUCCEED; /* Return value */ + /* Managed objects' doubling-table info */ + if(H5HF_dtable_encode(hdr->f, &p, &(hdr->man_dtable)) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, FAIL, "unable to encode managed obj. doubling table info") - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_dest) + /* Check for I/O filter information to encode */ + if(hdr->filter_len > 0) { + /* Encode the size of a filtered root direct block */ + H5F_ENCODE_LENGTH(f, p, hdr->pline_root_direct_size); - /* - * Check arguments. - */ - HDassert(hdr); - HDassert(hdr->rc == 0); + /* Encode the filter mask for a filtered root direct block */ + UINT32ENCODE(p, hdr->pline_root_direct_filter_mask); - /* Destroy fractal heap header */ - if(H5HF_hdr_dest(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap header") + /* Encode I/O filter information */ + if(H5O_msg_encode(hdr->f, H5O_PLINE_ID, FALSE, p, &(hdr->pline)) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTENCODE, FAIL, "can't encode I/O pipeline fiters") + p += hdr->filter_len; + } /* end if */ + + /* Compute metadata checksum */ + metadata_chksum = H5_checksum_metadata(image, (size_t)(p - (const uint8_t *)image), 0); + + /* Metadata checksum */ + UINT32ENCODE(p, metadata_chksum); + + /* Sanity check */ + HDassert((size_t)(p - (const uint8_t *)image) == size); + + /* Reset the cache flags for this operation (metadata not resized or moved) */ + *flags = 0; + + /* Sanity check */ + HDassert((size_t)((const uint8_t *)p - (const uint8_t *)image) <= len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_hdr_dest() */ +} /* H5HF_cache_hdr_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_hdr_clear + * Function: H5HF_cache_hdr_free_icr * - * Purpose: Mark a fractal heap header in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data structure * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * July 25, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_hdr_clear(H5F_t *f, H5HF_hdr_t *hdr, hbool_t destroy) +H5HF_cache_hdr_free_icr(void *thing) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_clear) + herr_t ret_value = SUCCEED; /* Return value */ - /* - * Check arguments. - */ - HDassert(hdr); + FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_hdr_free_icr) - /* Reset the dirty flag. */ - hdr->cache_info.is_dirty = FALSE; + /* Check arguments */ + HDassert(thing); - if(destroy) - if(H5HF_cache_hdr_dest(f, hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap header") + /* Destroy fractal heap header */ + if(H5HF_hdr_dest((H5HF_hdr_t *)thing) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap header") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_hdr_clear() */ +} /* end H5HF_cache_hdr_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_hdr_size + * Function: H5HF_cache_iblock_get_load_size * - * Purpose: Compute the size in bytes of a fractal heap header - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_hdr_size(const H5F_t UNUSED *f, const H5HF_hdr_t *hdr, size_t *size_ptr) +H5HF_cache_iblock_get_load_size(const void *_udata, size_t *image_len) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_hdr_size) + const H5HF_iblock_cache_ud_t *udata = (const H5HF_iblock_cache_ud_t *)_udata; /* user data for callback */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_iblock_get_load_size) /* Check arguments */ - HDassert(f); - HDassert(hdr); - HDassert(size_ptr); + HDassert(udata); + HDassert(image_len); - /* Set size value */ - *size_ptr = hdr->heap_size; + /* Set the image length size */ + *image_len = H5HF_MAN_INDIRECT_SIZE(udata->par_info->hdr, *udata->nrows); FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_cache_hdr_size() */ +} /* end H5HF_cache_iblock_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_load + * Function: H5HF_cache_iblock_deserialize * * 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 @@ -689,15 +690,13 @@ H5HF_cache_hdr_size(const H5F_t UNUSED *f, const H5HF_hdr_t *hdr, size_t *size_p * *------------------------------------------------------------------------- */ -static H5HF_indirect_t * -H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5HF_cache_iblock_deserialize(const void *image, size_t UNUSED len, + void *_udata, hbool_t UNUSED *dirty) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ H5HF_iblock_cache_ud_t *udata = (H5HF_iblock_cache_ud_t *)_udata; /* user data for callback */ H5HF_indirect_t *iblock = NULL; /* Indirect block info */ - H5WB_t *wb = NULL; /* Wrapped buffer for indirect block data */ - uint8_t iblock_buf[H5HF_IBLOCK_BUF_SIZE]; /* Buffer for indirect block */ - uint8_t *buf; /* Temporary buffer */ const uint8_t *p; /* Pointer into raw data buffer */ haddr_t heap_addr; /* Address of heap header in the file */ uint32_t stored_chksum; /* Stored metadata checksum value */ @@ -705,12 +704,10 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) size_t u; /* Local index variable */ H5HF_indirect_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_iblock_load) + FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_iblock_deserialize) /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata); + HDassert(image); /* Allocate space for the fractal heap indirect block */ if(NULL == (iblock = H5FL_CALLOC(H5HF_indirect_t))) @@ -733,23 +730,11 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) iblock->nrows = *udata->nrows; iblock->nchildren = 0; - /* Wrap the local buffer for serialized indirect block */ - if(NULL == (wb = H5WB_wrap(iblock_buf, sizeof(iblock_buf)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't wrap buffer") - /* Compute size of indirect block */ iblock->size = H5HF_MAN_INDIRECT_SIZE(hdr, iblock->nrows); - /* Get a pointer to a buffer that's large enough for serialized indirect block */ - if(NULL == (buf = H5WB_actual(wb, iblock->size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read indirect block from disk */ - if(H5F_block_read(f, H5FD_MEM_FHEAP_IBLOCK, addr, iblock->size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "can't read fractal heap indirect block") - /* Get temporary pointer to serialized indirect block */ - p = buf; + p = (const uint8_t *)image; /* Magic number */ if(HDmemcmp(p, H5HF_IBLOCK_MAGIC, (size_t)H5HF_SIZEOF_MAGIC)) @@ -837,13 +822,13 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HDassert(iblock->nchildren); /* indirect blocks w/no children should have been deleted */ /* Compute checksum on indirect block */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - (const uint8_t *)buf), 0); + computed_chksum = H5_checksum_metadata(image, (size_t)(p - (const uint8_t *)image), 0); /* Metadata checksum */ UINT32DECODE(p, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == iblock->size); + HDassert((size_t)(p - (const uint8_t *)image) == iblock->size); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -866,20 +851,52 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Set return value */ ret_value = iblock; + /* Sanity check */ + HDassert((size_t)((const uint8_t *)p - (const uint8_t *)image) <= len); + done: /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && iblock) if(H5HF_man_iblock_dest(iblock) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap indirect block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_iblock_load() */ +} /* end H5HF_cache_iblock_deserialize() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF_cache_iblock_image_len + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF_cache_iblock_image_len(const void *_thing, size_t *image_len) +{ + const H5HF_indirect_t *iblock = (const H5HF_indirect_t *)_thing; + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_iblock_image_len) + + /* Check arguments */ + HDassert(iblock); + HDassert(image_len); + + /* Set the image length size */ + *image_len = iblock->size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF_cache_iblock_image_len() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_flush + * Function: H5HF_cache_iblock_serialize * * Purpose: Flushes a dirty fractal heap indirect block to disk. * @@ -892,245 +909,182 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_indirect_t *iblock, unsigned UNUSED * flags_ptr) +H5HF_cache_iblock_serialize(const H5F_t *f, hid_t UNUSED dxpl_id, + haddr_t UNUSED addr, size_t UNUSED len, void *image, void *_thing, + unsigned UNUSED *flags, haddr_t UNUSED *new_addr, size_t UNUSED *new_len, + void UNUSED **new_image) { - H5WB_t *wb = NULL; /* Wrapped buffer for indirect block data */ - uint8_t iblock_buf[H5HF_IBLOCK_BUF_SIZE]; /* Buffer for indirect block */ - herr_t ret_value = SUCCEED; /* Return value */ + H5HF_hdr_t *hdr; /* Shared fractal heap information */ + H5HF_indirect_t *iblock = (H5HF_indirect_t *)_thing; + uint8_t *p; /* Pointer into raw data buffer */ +#ifndef NDEBUG + unsigned nchildren = 0; /* Track # of children */ + unsigned max_child = 0; /* Track max. child entry used */ +#endif /* NDEBUG */ + uint32_t metadata_chksum; /* Computed metadata checksum value */ + size_t u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_iblock_flush) -#ifdef QAK -HDfprintf(stderr, "%s: Flushing indirect block, addr = %a, destroy = %u\n", FUNC, addr, (unsigned)destroy); -#endif /* QAK */ + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_iblock_serialize) /* check arguments */ HDassert(f); HDassert(H5F_addr_defined(addr)); HDassert(iblock); - if(iblock->cache_info.is_dirty) { - H5HF_hdr_t *hdr; /* Shared fractal heap information */ - uint8_t *buf; /* Temporary buffer */ - uint8_t *p; /* Pointer into raw data buffer */ -#ifndef NDEBUG - unsigned nchildren = 0; /* Track # of children */ - unsigned max_child = 0; /* Track max. child entry used */ -#endif /* NDEBUG */ - uint32_t metadata_chksum; /* Computed metadata checksum value */ - size_t u; /* Local index variable */ + /* Get the pointer to the shared heap header */ + hdr = iblock->hdr; - /* Get the pointer to the shared heap header */ - hdr = iblock->hdr; + /* Set the shared heap header's file context for this operation */ + hdr->f = f; - /* Set the shared heap header's file context for this operation */ - hdr->f = f; + /* Get temporary pointer to buffer for serialized indirect block */ + p = (uint8_t *)image; - /* Wrap the local buffer for serialized indirect block */ - if(NULL == (wb = H5WB_wrap(iblock_buf, sizeof(iblock_buf)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't wrap buffer") + /* Magic number */ + HDmemcpy(p, H5HF_IBLOCK_MAGIC, (size_t)H5HF_SIZEOF_MAGIC); + p += H5HF_SIZEOF_MAGIC; - /* Get a pointer to a buffer that's large enough for serialized indirect block */ - if(NULL == (buf = H5WB_actual(wb, iblock->size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "can't get actual buffer") + /* Version # */ + *p++ = H5HF_IBLOCK_VERSION; - /* Get temporary pointer to buffer for serialized indirect block */ - p = buf; + /* Address of heap header for heap which owns this block */ + H5F_addr_encode(f, &p, hdr->heap_addr); - /* Magic number */ - HDmemcpy(p, H5HF_IBLOCK_MAGIC, (size_t)H5HF_SIZEOF_MAGIC); - p += H5HF_SIZEOF_MAGIC; + /* Offset of block in heap */ + UINT64ENCODE_VAR(p, iblock->block_off, hdr->heap_off_size); - /* Version # */ - *p++ = H5HF_IBLOCK_VERSION; + /* Encode indirect block-specific fields */ + for(u = 0; u < (iblock->nrows * hdr->man_dtable.cparam.width); u++) { + /* Encode child block address */ + H5F_addr_encode(f, &p, iblock->ents[u].addr); - /* Address of heap header for heap which owns this block */ - H5F_addr_encode(f, &p, hdr->heap_addr); + /* Check for heap with I/O filters */ + if(hdr->filter_len > 0) { + /* Sanity check */ + HDassert(iblock->filt_ents); - /* Offset of block in heap */ - UINT64ENCODE_VAR(p, iblock->block_off, hdr->heap_off_size); + /* Encode extra information for direct blocks */ + if(u < (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width)) { + /* Sanity check */ + /* (either both the address & size are defined or both are + * not defined) + */ + HDassert((H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) + || (!H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); - /* Encode indirect block-specific fields */ - for(u = 0; u < (iblock->nrows * hdr->man_dtable.cparam.width); u++) { - /* Encode child block address */ - H5F_addr_encode(f, &p, iblock->ents[u].addr); + /* Size of filtered direct block */ + H5F_ENCODE_LENGTH(f, p, iblock->filt_ents[u].size); - /* Check for heap with I/O filters */ - if(hdr->filter_len > 0) { - /* Sanity check */ - HDassert(iblock->filt_ents); - - /* Encode extra information for direct blocks */ - if(u < (hdr->man_dtable.max_direct_rows * hdr->man_dtable.cparam.width)) { - /* Sanity check */ - /* (either both the address & size are defined or both are - * not defined) - */ - HDassert((H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size) - || (!H5F_addr_defined(iblock->ents[u].addr) && iblock->filt_ents[u].size == 0)); - - /* Size of filtered direct block */ - H5F_ENCODE_LENGTH(f, p, iblock->filt_ents[u].size); - - /* I/O filter mask for filtered direct block */ - UINT32ENCODE(p, iblock->filt_ents[u].filter_mask); - } /* end if */ + /* I/O filter mask for filtered direct block */ + UINT32ENCODE(p, iblock->filt_ents[u].filter_mask); } /* end if */ + } /* end if */ #ifndef NDEBUG - /* Count child blocks */ - if(H5F_addr_defined(iblock->ents[u].addr)) { - nchildren++; - if(u > max_child) - max_child = u; - } /* end if */ + /* Count child blocks */ + if(H5F_addr_defined(iblock->ents[u].addr)) { + nchildren++; + if(u > max_child) + max_child = u; + } /* end if */ #endif /* NDEBUG */ - } /* end for */ - - /* Compute checksum */ - metadata_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); - - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); + } /* end for */ - /* Sanity check */ - HDassert((size_t)(p - buf) == iblock->size); -#ifndef NDEBUG - HDassert(nchildren == iblock->nchildren); - HDassert(max_child == iblock->max_child); -#endif /* NDEBUG */ + /* Compute checksum */ + metadata_chksum = H5_checksum_metadata(image, (size_t)((const uint8_t *)p - (const uint8_t *)image), 0); - /* Write the indirect block */ - if(H5F_block_write(f, H5FD_MEM_FHEAP_IBLOCK, addr, iblock->size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFLUSH, FAIL, "unable to save fractal heap indirect block to disk") + /* Metadata checksum */ + UINT32ENCODE(p, metadata_chksum); - /* Reset dirty flags */ - iblock->cache_info.is_dirty = FALSE; - } /* end if */ + /* Reset the cache flags for this operation (metadata not resized or moved) */ + *flags = 0; - if(destroy) - if(H5HF_cache_iblock_dest(f, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") + /* Sanity check */ + HDassert((size_t)((const uint8_t *)p - (const uint8_t *)image) <= len); -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + /* Sanity check */ + HDassert((size_t)(p - (const uint8_t *)image) == iblock->size); +#ifndef NDEBUG + HDassert(nchildren == iblock->nchildren); + HDassert(max_child == iblock->max_child); +#endif /* NDEBUG */ - FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_cache_iblock_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5HF_cache_iblock_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_dest + * Function: H5HF_cache_iblock_free_icr * - * Purpose: Destroys a fractal heap indirect block in memory. + * Purpose: Destroy/release an "in core representation" of a data structure * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 6 2006 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * July 25, 2008 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5HF_cache_iblock_dest(H5F_t UNUSED *f, H5HF_indirect_t *iblock) +H5HF_cache_iblock_free_icr(void *thing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_iblock_dest) + FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_iblock_free_icr) - /* - * Check arguments. - */ - HDassert(iblock); - HDassert(iblock->rc == 0); + /* Check arguments */ + HDassert(thing); /* Destroy fractal heap indirect block */ - if(H5HF_man_iblock_dest(iblock) < 0) + if(H5HF_man_iblock_dest((H5HF_indirect_t *)thing) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_iblock_dest() */ +} /* H5HF_cache_iblock_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_clear + * Function: H5HF_cache_dblock_get_load_size * - * Purpose: Mark a fractal heap indirect block in memory as non-dirty. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 6 2006 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_iblock_clear(H5F_t *f, H5HF_indirect_t *iblock, hbool_t destroy) +H5HF_cache_dblock_get_load_size(const void *_udata, size_t *image_len) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_iblock_clear) - - /* - * Check arguments. - */ - HDassert(iblock); - - /* Reset the dirty flag. */ - iblock->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5HF_cache_iblock_dest(f, iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap indirect block") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_iblock_clear() */ + const H5HF_dblock_cache_ud_t *udata = (const H5HF_dblock_cache_ud_t *)_udata; /* pointer to user data */ - -/*------------------------------------------------------------------------- - * Function: H5HF_cache_iblock_size - * - * Purpose: Compute the size in bytes of a fractal heap indirect block - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 6 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5HF_cache_iblock_size(const H5F_t UNUSED *f, const H5HF_indirect_t *iblock, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_iblock_size) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_dblock_get_load_size) /* Check arguments */ - HDassert(iblock); - HDassert(size_ptr); + HDassert(udata); + HDassert(image_len); - /* Set size value */ - *size_ptr = iblock->size; + /* Set the image length size */ + *image_len = udata->odi_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_cache_iblock_size() */ +} /* end H5HF_cache_dblock_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_load + * Function: H5HF_cache_dblock_deserialize * - * Purpose: Loads a fractal heap direct block from the disk. + * Purpose: Given a direct block disk image, construct and return the + * associated in core representation of the fractal heap + * direct block. * * Return: Success: Pointer to a new fractal heap direct block - * * Failure: NULL * * Programmer: Quincey Koziol @@ -1139,8 +1093,9 @@ H5HF_cache_iblock_size(const H5F_t UNUSED *f, const H5HF_indirect_t *iblock, siz * *------------------------------------------------------------------------- */ -static H5HF_direct_t * -H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5HF_cache_dblock_deserialize(const void *image, size_t len, void *_udata, + hbool_t UNUSED *dirty) { H5HF_dblock_cache_ud_t *udata = (H5HF_dblock_cache_ud_t *)_udata; /* pointer to user data */ H5HF_hdr_t *hdr; /* Shared fractal heap information */ @@ -1150,11 +1105,11 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) haddr_t heap_addr; /* Address of heap header in the file */ H5HF_direct_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_load) + FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_deserialize) /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(len > 0); + HDassert(image != NULL); HDassert(udata != NULL); HDassert(udata->f != NULL); HDassert(udata->dblock_size > 0); @@ -1185,7 +1140,9 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") - /* Check for I/O filters on this heap */ + /* copy the disk image into the in core image, with filtering + * if appropriate. + */ if(hdr->filter_len > 0) { H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ @@ -1193,33 +1150,27 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) size_t read_size; /* Size of filtered direct block to read */ unsigned filter_mask; /* Excluded filters for direct block */ - /* Check for root direct block */ - if(par_info->iblock == NULL) { - /* Sanity check */ - HDassert(H5F_addr_eq(hdr->man_dtable.table_addr, addr)); - - /* Set up parameters to read filtered direct block */ - read_size = hdr->pline_root_direct_size; - } /* end if */ - else { - /* Sanity check */ - HDassert(H5F_addr_eq(par_info->iblock->ents[par_info->entry].addr, addr)); - - /* Set up parameters to read filtered direct block */ - read_size = par_info->iblock->filt_ents[par_info->entry].size; - } /* end else */ - - /* Allocate buffer to perform I/O filtering on */ - if(NULL == (read_buf = H5MM_malloc(read_size))) + /* Allocate buffer to perform I/O filtering on, and + * then copy the on disk image into it. + * + * Note that one could argue that we should just do the + * filtering in the buffer provided by the cache, and in + * theory there is no reason why we shouldn't. However, + * I can see some scenarios in which this would cause problems, + * and in any case, we have declared it to be constant. Thus + * we will make a copy instead. + */ + if(NULL == (read_buf = H5MM_malloc(len))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for pipeline buffer") - /* Read filtered direct block from disk */ - if(H5F_block_read(f, H5FD_MEM_FHEAP_DBLOCK, addr, read_size, dxpl_id, read_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "can't read fractal heap direct block") + /* Copy disk image into read_buf */ + HDmemcpy(read_buf, image, len); /* Push direct block data through I/O filter pipeline */ - nbytes = read_size; + nbytes = len; + read_size = len; filter_mask = udata->filter_mask; + if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &read_size, &read_buf) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, NULL, "output pipeline failed") @@ -1233,10 +1184,12 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) H5MM_xfree(read_buf); } /* end if */ else { - /* Read direct block from disk */ - if(H5F_block_read(f, H5FD_MEM_FHEAP_DBLOCK, addr, dblock->size, dxpl_id, dblock->blk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "can't read fractal heap direct block") - } /* end else */ + /* Sanity check */ + HDassert(len == dblock->size); + + /* just copy the disk image into dblock->blk */ + HDmemcpy(dblock->blk, image, len); + } /* end no filtering case */ /* Start decoding direct block */ p = dblock->blk; @@ -1299,13 +1252,45 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy fractal heap direct block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_dblock_load() */ +} /* H5HF_cache_dblock_deserialize() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF_cache_dblock_image_len + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF_cache_dblock_image_len(const void *_thing, size_t *image_len) +{ + const H5HF_direct_t *dblock = (const H5HF_direct_t *)_thing; + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_dblock_image_len) + + /* Check arguments */ + HDassert(dblock); + HDassert(image_len); + + /* Set the image length size */ + *image_len = dblock->size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HF_cache_dblock_image_len() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_flush + * Function: H5HF_cache_dblock_serialize * - * Purpose: Flushes a dirty fractal heap direct block to disk. + * Purpose: Construct the on disk image of the target direct block + * in preparation for writing the direct block to disk. * * Return: Non-negative on success/Negative on failure * @@ -1316,199 +1301,237 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HF_direct_t *dblock, unsigned UNUSED * flags_ptr) +H5HF_cache_dblock_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) { - herr_t ret_value = SUCCEED; /* Return value */ + H5HF_hdr_t *hdr; /* Shared fractal heap information */ + H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; + void * write_buf; /* Pointer to buffer to write out */ + size_t write_size; /* Size of buffer to write out */ + uint8_t * p; /* Pointer into raw data buffer */ +#ifndef NDEBUG + hbool_t entry_filtered = FALSE; +#endif + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_flush) + FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_serialize) /* check arguments */ HDassert(f); HDassert(H5F_addr_defined(addr)); + HDassert(len > 0); + HDassert(image); HDassert(dblock); - if(dblock->cache_info.is_dirty) { - H5HF_hdr_t *hdr; /* Shared fractal heap information */ - void *write_buf; /* Pointer to buffer to write out */ - size_t write_size; /* Size of buffer to write out */ - uint8_t *p; /* Pointer into raw data buffer */ + HDassert(dblock->cache_info.is_dirty); + HDassert(flags); + HDassert(new_addr); + HDassert(new_len); + HDassert(new_image); - /* Get the pointer to the shared heap header */ - hdr = dblock->hdr; + /* set *flags to 0 -- will overwrite if needed */ + *flags = 0; - /* Set the shared heap header's file context for this operation */ - hdr->f = f; + /* Get the pointer to the shared heap header */ + hdr = dblock->hdr; - HDassert(dblock->blk); - p = dblock->blk; + /* Set the shared heap header's file context for this operation */ + hdr->f = f; - /* Magic number */ - HDmemcpy(p, H5HF_DBLOCK_MAGIC, (size_t)H5HF_SIZEOF_MAGIC); - p += H5HF_SIZEOF_MAGIC; + HDassert(dblock->blk); + p = dblock->blk; - /* Version # */ - *p++ = H5HF_DBLOCK_VERSION; + /* Magic number */ + HDmemcpy(p, H5HF_DBLOCK_MAGIC, (size_t)H5HF_SIZEOF_MAGIC); + p += H5HF_SIZEOF_MAGIC; - /* Address of heap header for heap which owns this block */ - H5F_addr_encode(f, &p, hdr->heap_addr); + /* Version # */ + *p++ = H5HF_DBLOCK_VERSION; - /* Offset of block in heap */ - UINT64ENCODE_VAR(p, dblock->block_off, hdr->heap_off_size); + /* Address of heap header for heap which owns this block */ + H5F_addr_encode(f, &p, hdr->heap_addr); - /* Metadata checksum */ - if(hdr->checksum_dblocks) { - uint32_t metadata_chksum; /* Computed metadata checksum value */ + /* Offset of block in heap */ + UINT64ENCODE_VAR(p, dblock->block_off, hdr->heap_off_size); - /* Clear the checksum field, to compute the checksum */ - HDmemset(p, 0, (size_t)H5HF_SIZEOF_CHKSUM); + /* Metadata checksum */ + if(hdr->checksum_dblocks) { + uint32_t metadata_chksum; /* Computed metadata checksum value */ - /* Compute checksum on entire direct block */ - metadata_chksum = H5_checksum_metadata(dblock->blk, dblock->size, 0); + /* Clear the checksum field, to compute the checksum */ + HDmemset(p, 0, (size_t)H5HF_SIZEOF_CHKSUM); - /* Metadata checksum */ - UINT32ENCODE(p, metadata_chksum); - } /* end if */ + /* Compute checksum on entire direct block */ + metadata_chksum = H5_checksum_metadata(dblock->blk, dblock->size, 0); - /* Sanity check */ - HDassert((size_t)(p - dblock->blk) == H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)); + /* Metadata checksum */ + UINT32ENCODE(p, metadata_chksum); + } /* end if */ - /* Check for I/O filters on this heap */ - if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ - size_t nbytes; /* Number of bytes used */ - unsigned filter_mask; /* Filter mask for block */ + /* Sanity check */ + HDassert((size_t)(p - dblock->blk) == H5HF_MAN_ABS_DIRECT_OVERHEAD(hdr)); + + /* 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 */ - /* Allocate buffer to perform I/O filtering on */ - write_size = dblock->size; - if(NULL == (write_buf = H5MM_malloc(write_size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline buffer") - HDmemcpy(write_buf, dblock->blk, write_size); +#ifndef NDEBUG + entry_filtered = TRUE; +#endif /* NDEBUG */ - /* Push direct block data through I/O filter pipeline */ - nbytes = write_size; - if(H5Z_pipeline(&(hdr->pline), 0, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &write_size, &write_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "output pipeline failed") + /* Allocate buffer to perform I/O filtering on */ + write_size = dblock->size; + if(NULL == (write_buf = H5MM_malloc(write_size))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline buffer") - /* Use the compressed number of bytes as the size to write */ - write_size = nbytes; + HDmemcpy(write_buf, dblock->blk, write_size); - /* Check for root direct block */ - if(dblock->parent == NULL) { - hbool_t hdr_changed = FALSE; /* Whether the header information changed */ + /* Push direct block data through I/O filter pipeline */ + nbytes = write_size; + if(H5Z_pipeline(&(hdr->pline), 0, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &write_size, &write_buf) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "output pipeline failed") - /* Sanity check */ - HDassert(H5F_addr_eq(hdr->man_dtable.table_addr, addr)); - HDassert(hdr->pline_root_direct_size > 0); + /* Use the compressed number of bytes as the size to write */ + write_size = nbytes; - /* Check if the filter mask changed */ - if(hdr->pline_root_direct_filter_mask != filter_mask) { - hdr->pline_root_direct_filter_mask = filter_mask; - hdr_changed = TRUE; - } /* end if */ + /* Check for root direct block */ + if(dblock->parent == NULL) { + hbool_t hdr_changed = FALSE; /* Whether the header information changed */ - /* Check if we need to re-size the block on disk */ - if(hdr->pline_root_direct_size != write_size) { - /* Release direct block's current disk space */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)hdr->pline_root_direct_size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") + /* Sanity check */ + HDassert(H5F_addr_eq(hdr->man_dtable.table_addr, addr)); + HDassert(hdr->pline_root_direct_size > 0); - /* Allocate space for the compressed direct block */ - if(HADDR_UNDEF == (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") + /* Check if the filter mask changed */ + if(hdr->pline_root_direct_filter_mask != filter_mask) { + hdr->pline_root_direct_filter_mask = filter_mask; + hdr_changed = TRUE; + } /* end if */ - /* Let the metadata cache know, if the block moved */ - if(!H5F_addr_eq(hdr->man_dtable.table_addr, addr)) - if(H5AC_move_entry(f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block") + /* Check if we need to re-size the block on disk */ + if(hdr->pline_root_direct_size != write_size) { + /* Release direct block's current disk space */ + if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)hdr->pline_root_direct_size) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") - /* Update information about compressed direct block's location & size */ - hdr->man_dtable.table_addr = addr; - hdr->pline_root_direct_size = write_size; + /* Allocate space for the compressed direct block */ + 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") - /* Note that heap header was modified */ - hdr_changed = TRUE; + /* Let the metadata cache know, if the block moved */ + if(!H5F_addr_eq(addr, new_dblock_addr)) { + *new_addr = new_dblock_addr; + *flags |= H5AC__SERIALIZE_MOVED_FLAG; } /* end if */ - /* Check if heap header was modified */ - if(hdr_changed) - if(H5HF_hdr_dirty(hdr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") + /* 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 */ + hdr_changed = TRUE; } /* end if */ - else { - hbool_t par_changed = FALSE; /* Whether the parent's information changed */ - H5HF_indirect_t *par_iblock; /* Parent indirect block */ - unsigned par_entry; /* Entry in parent indirect block */ - /* Get parent information */ - par_iblock = dblock->parent; - par_entry = dblock->par_entry; + /* Check if heap header was modified */ + if(hdr_changed) + if(H5HF_hdr_dirty(hdr) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") + } /* end if */ + else { + hbool_t par_changed = FALSE; /* Whether the parent's information changed */ + H5HF_indirect_t *par_iblock; /* Parent indirect block */ + unsigned par_entry; /* Entry in parent indirect block */ - /* Sanity check */ - HDassert(H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)); - HDassert(par_iblock->filt_ents[par_entry].size > 0); + /* Get parent information */ + par_iblock = dblock->parent; + par_entry = dblock->par_entry; - /* Check if the filter mask changed */ - if(par_iblock->filt_ents[par_entry].filter_mask != filter_mask) { - par_iblock->filt_ents[par_entry].filter_mask = filter_mask; - par_changed = TRUE; - } /* end if */ + /* Sanity check */ + HDassert(H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)); + HDassert(par_iblock->filt_ents[par_entry].size > 0); - /* Check if we need to re-size the block on disk */ - if(par_iblock->filt_ents[par_entry].size != write_size) { - /* Release direct block's current disk space */ - if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)par_iblock->filt_ents[par_entry].size) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") + /* Check if the filter mask changed */ + if(par_iblock->filt_ents[par_entry].filter_mask != filter_mask) { + par_iblock->filt_ents[par_entry].filter_mask = filter_mask; + par_changed = TRUE; + } /* end if */ - /* Allocate space for the compressed direct block */ - if(HADDR_UNDEF == (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") + /* Check if we need to re-size the block on disk */ + if(par_iblock->filt_ents[par_entry].size != write_size) { + /* Release direct block's current disk space */ + if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)par_iblock->filt_ents[par_entry].size) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block") - /* Let the metadata cache know, if the block moved */ - if(!H5F_addr_eq(par_iblock->ents[par_entry].addr, addr)) - if(H5AC_move_entry(f, H5AC_FHEAP_DBLOCK, par_iblock->ents[par_entry].addr, addr) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block") + /* Allocate space for the compressed direct block */ + 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") - /* Update information about compressed direct block's location & size */ - par_iblock->ents[par_entry].addr = addr; - par_iblock->filt_ents[par_entry].size = write_size; + /* Let the metadata cache know, if the block moved */ + if(!H5F_addr_eq(addr, new_dblock_addr)) { + *new_addr = new_dblock_addr; + *flags |= H5AC__SERIALIZE_MOVED_FLAG; + } /* end if */ - /* Note that parent was modified */ - par_changed = TRUE; - } /* end if */ + /* 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; - /* Check if parent was modified */ - if(par_changed) - if(H5HF_iblock_dirty(par_iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") - } /* end else */ - } /* end if */ - else { - write_buf = dblock->blk; - write_size = dblock->size; + /* Note that parent was modified */ + par_changed = TRUE; + } /* end if */ + + /* Check if parent was modified */ + if(par_changed) + if(H5HF_iblock_dirty(par_iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty") } /* end else */ - /* Write the direct block */ - if(H5F_block_write(f, H5FD_MEM_FHEAP_DBLOCK, addr, write_size, dxpl_id, write_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFLUSH, FAIL, "unable to save fractal heap direct block to disk") + /* 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; + write_size = dblock->size; + } /* end else */ - /* Release the write buffer, if it was allocated */ - if(write_buf != dblock->blk) - H5MM_xfree(write_buf); + if(write_size == len) { + HDassert(*flags == 0); + HDassert(write_buf != NULL); + HDassert(entry_filtered || (write_buf == dblock->blk)); + + HDmemcpy(image, write_buf, write_size); - dblock->cache_info.is_dirty = FALSE; + if(write_buf != dblock->blk) + H5MM_xfree(write_buf); } /* end if */ + else { + /* On disk image has been resized, and possibly moved -- *flags, + * *new_len, and *new_addr should all be set up by now. + * Thus all we need to do here is free the old image, and assign the + * space for the new image. + */ + HDassert(write_buf != NULL); + HDassert(write_buf != dblock->blk); + + H5MM_xfree(image); - if(destroy) - if(H5HF_cache_dblock_dest(f, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") + *new_image = write_buf; + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HF_cache_dblock_flush() */ +} /* H5HF_cache_dblock_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_dest + * Function: H5HF_cache_dblock_free_icr * * Purpose: Destroys a fractal heap direct block in memory. * @@ -1520,92 +1543,23 @@ done: * *------------------------------------------------------------------------- */ -/* ARGSUSED */ -static herr_t -H5HF_cache_dblock_dest(H5F_t UNUSED *f, H5HF_direct_t *dblock) +herr_t +H5HF_cache_dblock_free_icr(void *thing) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_dest) + FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_free_icr) /* * Check arguments. */ - HDassert(dblock); + HDassert(thing); /* Destroy fractal heap direct block */ - if(H5HF_man_dblock_dest(dblock) < 0) + if(H5HF_man_dblock_dest((H5HF_direct_t *)thing) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_dblock_dest() */ - - -/*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_clear - * - * Purpose: Mark a fractal heap direct block in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 27 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5HF_cache_dblock_clear(H5F_t *f, H5HF_direct_t *dblock, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5HF_cache_dblock_clear) - - /* - * Check arguments. - */ - HDassert(dblock); - - /* Reset the dirty flag. */ - dblock->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5HF_cache_dblock_dest(f, dblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy fractal heap direct block") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HF_cache_dblock_clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5HF_cache_dblock_size - * - * Purpose: Compute the size in bytes of a fractal heap direct block - * on disk, and return it in *size_ptr. On failure, - * the value of *size_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5HF_cache_dblock_size(const H5F_t UNUSED *f, const H5HF_direct_t *dblock, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HF_cache_dblock_size) - - /* check arguments */ - HDassert(dblock); - HDassert(size_ptr); - - /* Set size value */ - *size_ptr = dblock->size; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HF_cache_dblock_size() */ +} /* end H5HF_cache_dblock_free_icr() */ 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 ef14598..5662544 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -61,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 */ \ ) @@ -75,11 +75,8 @@ #define H5HF_HDR_FLAGS_HUGE_ID_WRAPPED 0x01 /* "huge" object IDs have wrapped */ #define H5HF_HDR_FLAGS_CHECKSUM_DBLOCKS 0x02 /* checksum direct blocks */ -/* 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) ( \ +/* Size of fractal heap header */ +#define H5HF_HDR_SIZE(sizeof_addr, sizeof_size) ( \ /* General metadata fields */ \ H5HF_METADATA_PREFIX_SIZE(TRUE) \ \ @@ -92,31 +89,37 @@ \ /* "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 */ \ + + sizeof_size /* Next ID for "huge" object */ \ + + 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 */ \ + + sizeof_size /* Total man. free space */ \ + + 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 */ \ + + 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 */ \ - + H5HF_DTABLE_INFO_SIZE(h) /* Size of managed obj. doubling-table info */ \ + + 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) 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 bcc9f6c..8ea4e96 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -46,6 +46,8 @@ /* Local Macros */ /****************/ +#define H5HG_SPEC_READ_SIZE 4096 + /******************/ /* Local Typedefs */ @@ -62,12 +64,14 @@ /********************/ /* Metadata cache callbacks */ -static H5HG_heap_t *H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - H5HG_heap_t *heap, unsigned UNUSED * flags_ptr); -static herr_t H5HG_dest(H5F_t *f, H5HG_heap_t *heap); -static herr_t H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy); -static herr_t H5HG_size(const H5F_t *f, const H5HG_heap_t *heap, size_t *size_ptr); +static herr_t H5HG_get_load_size(const void *udata, size_t *image_len); +static void *H5HG_deserialize(const void *image, size_t len, void *udata, + hbool_t *dirty); +static herr_t H5HG_image_len(const void *thing, size_t *image_len_ptr); +static herr_t H5HG_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 H5HG_free_icr(void *thing); /*********************/ @@ -79,11 +83,14 @@ static herr_t H5HG_size(const H5F_t *f, const H5HG_heap_t *heap, size_t *size_pt */ const H5AC_class_t H5AC_GHEAP[1] = {{ H5AC_GHEAP_ID, - (H5AC_load_func_t)H5HG_load, - (H5AC_flush_func_t)H5HG_flush, - (H5AC_dest_func_t)H5HG_dest, - (H5AC_clear_func_t)H5HG_clear, - (H5AC_size_func_t)H5HG_size, + "global heap", + H5FD_MEM_GHEAP, + H5AC__CLASS_SPECULATIVE_LOAD_FLAG, + H5HG_get_load_size, + H5HG_deserialize, + H5HG_image_len, + H5HG_serialize, + H5HG_free_icr, }}; @@ -99,12 +106,42 @@ const H5AC_class_t H5AC_GHEAP[1] = {{ /*------------------------------------------------------------------------- - * Function: H5HG_load + * Function: H5HG_get_load_size * - * Purpose: Loads a global heap collection from disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Success: Ptr to a global heap collection. + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HG_get_load_size(const void *_udata, size_t *image_len) +{ + const H5F_t *f = (const H5F_t *)_udata; + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_get_load_size) + + /* Check arguments */ + HDassert(f); + HDassert(image_len); + + /* Set the image length size */ + *image_len = H5HG_SPEC_READ_SIZE; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HG_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5HG_deserialize + * + * Purpose: Deserialize the data structure from disk. * + * Return: Success: Ptr to a global heap collection. * Failure: NULL * * Programmer: Robb Matzke @@ -112,31 +149,28 @@ const H5AC_class_t H5AC_GHEAP[1] = {{ * *------------------------------------------------------------------------- */ -static H5HG_heap_t * -H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +static void * +H5HG_deserialize(const void *image, size_t UNUSED len, void *_udata, + hbool_t UNUSED *dirty) { H5HG_heap_t *heap = NULL; + H5F_t *f = (H5F_t *)_udata; uint8_t *p; size_t nalloc, need; size_t max_idx = 0; /* The maximum index seen */ H5HG_heap_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HG_load) + FUNC_ENTER_NOAPI_NOINIT(H5HG_deserialize) /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(udata); + HDassert(image); /* Allocate space for heap */ if(NULL == (heap = H5FL_CALLOC(H5HG_heap_t))) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") heap->shared = f->shared; - if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, (size_t)H5HG_MINSIZE))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") - if(H5F_block_read(f, H5FD_MEM_GHEAP, addr, (size_t)H5HG_MINSIZE, dxpl_id, heap->chunk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read global heap collection") - p = heap->chunk; + + p = (uint8_t *)image; /* Magic number */ if(HDmemcmp(p, H5HG_MAGIC, (size_t)H5HG_SIZEOF_MAGIC)) @@ -154,128 +188,126 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) H5F_DECODE_LENGTH(f, p, heap->size); HDassert(heap->size >= H5HG_MINSIZE); - /* - * If we didn't read enough in the first try, then read the rest of the - * collection now. - */ - if(heap->size > H5HG_MINSIZE) { - haddr_t next_addr = addr + (hsize_t)H5HG_MINSIZE; - - if(NULL == (heap->chunk = H5FL_BLK_REALLOC(gheap_chunk, heap->chunk, heap->size))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") - if(H5F_block_read(f, H5FD_MEM_GHEAP, next_addr, (heap->size - H5HG_MINSIZE), dxpl_id, heap->chunk + H5HG_MINSIZE) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read global heap collection") - } /* end if */ - - /* Decode each object */ - p = heap->chunk + H5HG_SIZEOF_HDR(f); - nalloc = H5HG_NOBJS(f, heap->size); - - /* Calloc the obj array because the file format spec makes no guarantee - * about the order of the objects, and unused slots must be set to zero. - */ - if(NULL == (heap->obj = H5FL_SEQ_CALLOC(H5HG_obj_t, nalloc))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") - - heap->nalloc = nalloc; - while(p < (heap->chunk + heap->size)) { - if((p + H5HG_SIZEOF_OBJHDR(f)) > (heap->chunk + heap->size)) { - /* - * The last bit of space is too tiny for an object header, so we - * assume that it's free space. - */ - HDassert(NULL == heap->obj[0].begin); - heap->obj[0].size = ((const uint8_t *)heap->chunk + heap->size) - p; - heap->obj[0].begin = p; - p += heap->obj[0].size; - } /* end if */ - else { - unsigned idx; - uint8_t *begin = p; - - UINT16DECODE(p, idx); - - /* Check if we need more room to store heap objects */ - if(idx >= heap->nalloc) { - size_t new_alloc; /* New allocation number */ - H5HG_obj_t *new_obj; /* New array of object descriptions */ - - /* Determine the new number of objects to index */ - new_alloc = MAX(heap->nalloc * 2, (idx + 1)); - HDassert(idx < new_alloc); - - /* Reallocate array of objects */ - if(NULL == (new_obj = H5FL_SEQ_REALLOC(H5HG_obj_t, heap->obj, new_alloc))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") - - /* Clear newly allocated space */ - HDmemset(&new_obj[heap->nalloc], 0, (new_alloc - heap->nalloc) * sizeof(heap->obj[0])); - - /* Update heap information */ - heap->nalloc = new_alloc; - heap->obj = new_obj; - HDassert(heap->nalloc > heap->nused); - } /* end if */ - - UINT16DECODE(p, heap->obj[idx].nrefs); - p += 4; /*reserved*/ - H5F_DECODE_LENGTH(f, p, heap->obj[idx].size); - heap->obj[idx].begin = begin; - - /* - * The total storage size includes the size of the object header - * and is zero padded so the next object header is properly - * aligned. The entire obj array was calloc'ed, so no need to zero - * the space here. The last bit of space is the free space object - * whose size is never padded and already includes the object - * header. - */ - if(idx > 0) { - need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(heap->obj[idx].size); - - if(idx > max_idx) - max_idx = idx; + /* if heap->size is more than the allocated image size, then we need to do nothing and wait for correctly sized image to come in */ + if(heap->size <= len) { + /* Allocate space for the heap->chunk */ + if(NULL == (heap->chunk = H5FL_BLK_MALLOC(gheap_chunk, (size_t)heap->size))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") + + /* Copy image into chunk */ + HDmemcpy(heap->chunk, image, heap->size); + + /* Decode each object */ + p = heap->chunk + H5HG_SIZEOF_HDR(f); + + /* Calloc the obj array because the file format spec makes no guarantee + * about the order of the objects, and unused slots must be set to zero. + */ + nalloc = H5HG_NOBJS(f, heap->size); + if(NULL == (heap->obj = H5FL_SEQ_CALLOC(H5HG_obj_t, nalloc))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") + heap->nalloc = nalloc; + while(p < (heap->chunk + heap->size)) { + if((p + H5HG_SIZEOF_OBJHDR(f)) > (heap->chunk + heap->size)) { + /* + * The last bit of space is too tiny for an object header, so we + * assume that it's free space. + */ + HDassert(NULL == heap->obj[0].begin); + heap->obj[0].size = ((const uint8_t *)heap->chunk + heap->size) - p; + heap->obj[0].begin = p; + p += heap->obj[0].size; } /* end if */ - else - need = heap->obj[idx].size; - p = begin + need; - } /* end else */ - } /* end while */ - HDassert(p == heap->chunk + heap->size); - HDassert(H5HG_ISALIGNED(heap->obj[0].size)); - - /* Set the next index value to use */ - if(max_idx > 0) - heap->nused = max_idx + 1; - else - heap->nused = 1; - - HDassert(max_idx < heap->nused); - - /* - * Add the new heap to the CWFS list, removing some other entry if - * necessary to make room. We remove the right-most entry that has less - * free space than this heap. - */ - if(!f->shared->cwfs) { - if(NULL == (f->shared->cwfs = (H5HG_heap_t **)H5MM_malloc(H5HG_NCWFS * sizeof(H5HG_heap_t *)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") - f->shared->ncwfs = 1; - f->shared->cwfs[0] = heap; - } else if(H5HG_NCWFS == f->shared->ncwfs) { - int i; /* Local index variable */ - - for(i = H5HG_NCWFS - 1; i >= 0; --i) - if(f->shared->cwfs[i]->obj[0].size < heap->obj[0].size) { - HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, i * sizeof(H5HG_heap_t *)); - f->shared->cwfs[0] = heap; - break; - } /* end if */ - } else { - HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, f->shared->ncwfs * sizeof(H5HG_heap_t *)); - f->shared->ncwfs += 1; - f->shared->cwfs[0] = heap; - } /* end else */ + else { + unsigned idx; + uint8_t *begin = p; + + UINT16DECODE(p, idx); + + /* Check if we need more room to store heap objects */ + if(idx >= heap->nalloc) { + size_t new_alloc; /* New allocation number */ + H5HG_obj_t *new_obj; /* New array of object descriptions */ + + /* Determine the new number of objects to index */ + new_alloc = MAX(heap->nalloc * 2, (idx + 1)); + HDassert(idx < new_alloc); + + /* Reallocate array of objects */ + if(NULL == (new_obj = H5FL_SEQ_REALLOC(H5HG_obj_t, heap->obj, new_alloc))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") + + /* Clear newly allocated space */ + HDmemset(&new_obj[heap->nalloc], 0, (new_alloc - heap->nalloc) * sizeof(heap->obj[0])); + + /* Update heap information */ + heap->nalloc = new_alloc; + heap->obj = new_obj; + HDassert(heap->nalloc > heap->nused); + } /* end if */ + + UINT16DECODE(p, heap->obj[idx].nrefs); + p += 4; /*reserved*/ + H5F_DECODE_LENGTH(f, p, heap->obj[idx].size); + heap->obj[idx].begin = begin; + /* + * The total storage size includes the size of the object header + * and is zero padded so the next object header is properly + * aligned. The entire obj array was calloc'ed, so no need to zero + * the space here. The last bit of space is the free space object + * whose size is never padded and already includes the object + * header. + */ + if(idx > 0) { + need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(heap->obj[idx].size); + + if(idx > max_idx) + max_idx = idx; + } /* end if */ + else + need = heap->obj[idx].size; + p = begin + need; + } /* end else */ + } /* end while */ + HDassert(p == heap->chunk + heap->size); + HDassert(H5HG_ISALIGNED(heap->obj[0].size)); + + /* Set the next index value to use */ + if(max_idx > 0) + heap->nused = max_idx + 1; + else + heap->nused = 1; + + HDassert(max_idx < heap->nused); + + /* + * Add the new heap to the CWFS list, removing some other entry if + * necessary to make room. We remove the right-most entry that has less + * free space than this heap. + */ + if(!f->shared->cwfs) { + if(NULL == (f->shared->cwfs = (H5HG_heap_t **)H5MM_malloc(H5HG_NCWFS * sizeof(H5HG_heap_t *)))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") + f->shared->ncwfs = 1; + f->shared->cwfs[0] = heap; + } else if(H5HG_NCWFS == f->shared->ncwfs) { + int i; /* Local index variable */ + + for(i = H5HG_NCWFS - 1; i >= 0; --i) + if(f->shared->cwfs[i]->obj[0].size < heap->obj[0].size) { + HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, i * sizeof(H5HG_heap_t *)); + f->shared->cwfs[0] = heap; + break; + } /* end if */ + } else { + HDmemmove(f->shared->cwfs + 1, f->shared->cwfs, f->shared->ncwfs * sizeof(H5HG_heap_t *)); + f->shared->ncwfs += 1; + f->shared->cwfs[0] = heap; + } /* end else */ + + /* Sanity check */ + HDassert((size_t)((const uint8_t *)p - (const uint8_t *)heap->chunk) <= len); + } /* end if heap->size <= len */ ret_value = heap; @@ -285,144 +317,128 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTFREE, NULL, "unable to destroy global heap collection") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HG_load() */ +} /* end H5HG_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HG_flush + * Function: H5HG_image_len * - * Purpose: Flushes a global heap collection from memory to disk if it's - * dirty. Optionally deletes teh heap from memory. + * Purpose: Tell the metadata cache about the actual size + * of the global heap * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Friday, March 27, 1998 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * July 28, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HG_heap_t *heap, unsigned UNUSED * flags_ptr) +H5HG_image_len(const void *thing, size_t *image_len_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5HG_heap_t *heap = (const H5HG_heap_t *)thing; /* Global heap */ - FUNC_ENTER_NOAPI_NOINIT(H5HG_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_image_len) /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); - HDassert(H5F_addr_eq(addr, heap->addr)); HDassert(heap); + HDassert(image_len_ptr); - if(heap->cache_info.is_dirty) { - if(H5F_block_write(f, H5FD_MEM_GHEAP, addr, heap->size, dxpl_id, heap->chunk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "unable to write global heap collection to file") - heap->cache_info.is_dirty = FALSE; - } /* end if */ - - if(destroy) - if(H5HG_dest(f, heap) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy global heap collection") + /* Report the global heap's total size */ + *image_len_ptr = heap->size; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HG_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HG_image_len() */ /*------------------------------------------------------------------------- - * Function: H5HG_dest + * Function: H5HG_serialize * - * Purpose: Destroys a global heap collection in memory + * Purpose: Serialize the data structure for writing to disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Wednesday, January 15, 2003 + * Programmer: Robb Matzke + * Friday, March 27, 1998 * *------------------------------------------------------------------------- */ -/* ARGSUSED */ static herr_t -H5HG_dest(H5F_t UNUSED *f, H5HG_heap_t *heap) +H5HG_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) { - herr_t ret_value = SUCCEED; /* Return value */ + H5HG_heap_t *heap = (H5HG_heap_t *)_thing; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HG_dest) + FUNC_ENTER_NOAPI_NOINIT(H5HG_serialize) /* Check arguments */ + HDassert(f); + HDassert(H5F_addr_defined(addr)); + HDassert(H5F_addr_eq(addr, heap->addr)); HDassert(heap); - /* Verify that node is clean */ - HDassert(heap->cache_info.is_dirty == FALSE); + /* Need to increase image size if we need to copy a bigger thing into it */ + if(heap->size > len) { + /* free old image buffer */ + H5MM_free(image); - /* Destroy global heap collection */ - if(H5HG_free(heap) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy global heap collection") + /* allocate new image buffer */ + if(NULL == (*new_image = H5MM_malloc(heap->size))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "new image null after H5MM_realloc()\n") -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* H5HG_dest() */ + /* copy the heap->chunk into the new image buffer */ + HDmemcpy(*new_image, heap->chunk, heap->size); - -/*------------------------------------------------------------------------- - * Function: H5HG_clear - * - * Purpose: Mark a global heap in memory as non-dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * Thursday, March 20, 2003 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT(H5HG_clear) - - /* Check arguments */ - HDassert(heap); + /* set new length of image */ + *new_len = heap->size; - /* Mark heap as clean */ - heap->cache_info.is_dirty = FALSE; + /* specify in flags that image has been resized */ + *flags = H5AC__SERIALIZE_RESIZED_FLAG; + } /* end if */ + else { + /* copy the heap->chunk into the image buffer */ + HDmemcpy(image, heap->chunk, heap->size); - if(destroy) - if(H5HG_dest(f, heap) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy global heap collection") + /* Reset the cache flags for this operation */ + *flags = 0; + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5HG_clear() */ +} /* end H5HG_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HG_size + * Function: H5HG_free_icr * - * Purpose: Compute the size in bytes of the specified instance of - * H5HG_heap_t on disk, and return it in *len_ptr. On failure, - * the value of *len_ptr is undefined. + * Purpose: Destroy/release an "in core representation" of a data structure * * Return: Non-negative on success/Negative on failure * - * Programmer: John Mainzer - * 5/13/04 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * July 28, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5HG_size(const H5F_t UNUSED *f, const H5HG_heap_t *heap, size_t *size_ptr) +H5HG_free_icr(void *thing) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_size) + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT(H5HG_free_icr) /* Check arguments */ - HDassert(heap); - HDassert(size_ptr); + HDassert(thing); - *size_ptr = heap->size; + /* Destroy global heap collection */ + if(H5HG_free((H5HG_heap_t *)thing) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy global heap") - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HG_size() */ +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HG_free_icr() */ @@ -456,6 +456,7 @@ H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr, H5AC_protect_t rw) HDassert(H5F_addr_defined(addr)); /* Construct the user data for protect callback */ + prfx_udata.made_attempt = FALSE; prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; @@ -1077,6 +1078,7 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) HDassert(H5F_addr_defined(addr)); /* Construct the user data for protect callback */ + prfx_udata.made_attempt = FALSE; prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; @@ -1176,6 +1178,7 @@ H5HL_get_size(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t *size) HDassert(size); /* Construct the user data for protect callback */ + prfx_udata.made_attempt = FALSE; prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; @@ -1230,6 +1233,7 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size) HDassert(heap_size); /* Construct the user data for protect callback */ + prfx_udata.made_attempt = FALSE; prfx_udata.sizeof_size = H5F_SIZEOF_SIZE(f); prfx_udata.sizeof_addr = H5F_SIZEOF_ADDR(f); prfx_udata.prfx_addr = addr; diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 647f0cc..03f4c0d 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -37,7 +37,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5HLpkg.h" /* Local Heaps */ -#include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ @@ -72,18 +71,23 @@ /********************/ /* Metadata cache callbacks */ -static void *H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned *flags_ptr); -static herr_t H5HL_prefix_dest(H5F_t *f, void *thing); -static herr_t H5HL_prefix_clear(H5F_t *f, void *thing, hbool_t destroy); -static herr_t H5HL_prefix_size(const H5F_t *f, const void *thing, size_t *size_ptr); -static void *H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned *flags_ptr); -static herr_t H5HL_datablock_dest(H5F_t *f, void *thing); -static herr_t H5HL_datablock_clear(H5F_t *f, void *thing, hbool_t destroy); -static herr_t H5HL_datablock_size(const H5F_t *f, const void *thing, size_t *size_ptr); +static herr_t H5HL_prfx_get_load_size(const void *_udata, size_t *image_len); +static void *H5HL_prfx_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HL_prfx_image_len(const void *thing, size_t *image_len_ptr); +static herr_t H5HL_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 H5HL_prfx_free_icr(void *thing); + +static herr_t H5HL_dblk_get_load_size(const void *_udata, size_t *image_len); +static void *H5HL_dblk_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5HL_dblk_image_len(const void *thing, size_t *image_len_ptr); +static herr_t H5HL_dblk_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 H5HL_dblk_free_icr(void *thing); /*********************/ @@ -91,24 +95,33 @@ static herr_t H5HL_datablock_size(const H5F_t *f, const void *thing, size_t *siz /*********************/ /* - * H5HL inherits cache-like properties from H5AC + * H5HL prefix inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_LHEAP_PRFX[1] = {{ H5AC_LHEAP_PRFX_ID, - H5HL_prefix_load, - H5HL_prefix_flush, - H5HL_prefix_dest, - H5HL_prefix_clear, - H5HL_prefix_size, + "local heap prefix", + H5FD_MEM_LHEAP, + H5AC__CLASS_SPECULATIVE_LOAD_FLAG, + H5HL_prfx_get_load_size, + H5HL_prfx_deserialize, + H5HL_prfx_image_len, + H5HL_prfx_serialize, + H5HL_prfx_free_icr, }}; +/* + * H5HL data block inherits cache-like properties from H5AC + */ const H5AC_class_t H5AC_LHEAP_DBLK[1] = {{ H5AC_LHEAP_DBLK_ID, - H5HL_datablock_load, - H5HL_datablock_flush, - H5HL_datablock_dest, - H5HL_datablock_clear, - H5HL_datablock_size, + "local heap data block", + H5FD_MEM_LHEAP, + H5AC__CLASS_NO_FLAGS_SET, + H5HL_dblk_get_load_size, + H5HL_dblk_deserialize, + H5HL_dblk_image_len, + H5HL_dblk_serialize, + H5HL_dblk_free_icr, }}; @@ -236,58 +249,72 @@ H5HL_fl_serialize(const H5HL_t *heap) /*------------------------------------------------------------------------- - * Function: H5HL_prefix_load + * Function: H5HL_prfx_get_load_size + * + * Purpose: Compute the size of the data structure on disk. + * + * Return: Non-negative on success/Negative on failure * - * Purpose: Loads a local heap prefix from disk. + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * - * Return: Success: Ptr to a local heap memory data structure. + *------------------------------------------------------------------------- + */ +static herr_t +H5HL_prfx_get_load_size(const void *_udata, size_t *image_len) +{ + const H5HL_cache_prfx_ud_t *udata = (const H5HL_cache_prfx_ud_t *)_udata; /* User data for callback */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_prfx_get_load_size) + + /* Check arguments */ + HDassert(udata); + HDassert(image_len); + + /* Set the image length size */ + *image_len = H5HL_SPEC_READ_SIZE; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HL_prfx_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5HL_prfx_deserialize + * + * Purpose: Deserialize the data structure from disk. + * + * Return: Success: Ptr to a local heap prefix. * Failure: NULL * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 17 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Oct 11 2008 * *------------------------------------------------------------------------- */ static void * -H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +H5HL_prfx_deserialize(const void *image, size_t len, void *_udata, + hbool_t UNUSED *dirty) { H5HL_t *heap = NULL; /* Local heap */ H5HL_prfx_t *prfx = NULL; /* Heap prefix deserialized */ H5HL_cache_prfx_ud_t *udata = (H5HL_cache_prfx_ud_t *)_udata; /* User data for callback */ - uint8_t buf[H5HL_SPEC_READ_SIZE]; /* Buffer for decoding */ - size_t spec_read_size; /* Size of buffer to speculatively read in */ - const uint8_t *p; /* Pointer into decoding buffer */ - haddr_t abs_eoa; /* Absolute end of file address */ - haddr_t rel_eoa; /* Relative end of file address */ + const uint8_t *p; /* Pointer into image buffer */ H5HL_prfx_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_prefix_load) + FUNC_ENTER_NOAPI_NOINIT(H5HL_prfx_deserialize) /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(len > 0); + HDassert(image); HDassert(udata); HDassert(udata->sizeof_size > 0); HDassert(udata->sizeof_addr > 0); HDassert(udata->sizeof_prfx > 0); - HDassert(udata->sizeof_prfx <= sizeof(buf)); - - /* Make certain we don't speculatively read off the end of the file */ - if(HADDR_UNDEF == (abs_eoa = H5F_get_eoa(f))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to determine file size") - - /* Adjust absolute EOA address to relative EOA address */ - rel_eoa = abs_eoa - H5F_get_base_addr(f); - - /* Compute the size of the speculative local heap prefix buffer */ - H5_ASSIGN_OVERFLOW(spec_read_size, MIN(rel_eoa - addr, H5HL_SPEC_READ_SIZE), /* From: */ hsize_t, /* To: */ size_t); - HDassert(spec_read_size >= udata->sizeof_prfx); - /* Attempt to speculatively read both local heap prefix and heap data */ - if(H5F_block_read(f, H5FD_MEM_LHEAP, addr, spec_read_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read local heap prefix") - p = buf; + /* Point to beginning of image buffer */ + p = (const uint8_t *)image; /* Check magic number */ if(HDmemcmp(p, H5HL_MAGIC, (size_t)H5HL_SIZEOF_MAGIC)) @@ -331,29 +358,26 @@ H5HL_prefix_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Note that the heap should be a single object in the cache */ heap->single_cache_obj = TRUE; - /* Allocate space for the heap data image */ - if(NULL == (heap->dblk_image = H5FL_BLK_MALLOC(lheap_chunk, heap->dblk_size))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") + /* Check if the current image from the cache is big enough to hold the heap data */ + if(len >= (heap->prfx_size + heap->dblk_size)) { + /* Allocate space for the heap data image */ + if(NULL == (heap->dblk_image = H5FL_BLK_MALLOC(lheap_chunk, heap->dblk_size))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") - /* Check if the current buffer from the speculative read already has the heap data */ - if(spec_read_size >= (heap->prfx_size + heap->dblk_size)) { - /* 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 = buf + heap->prfx_size; - - /* Copy the heap data from the speculative read buffer */ + /* Copy the heap data from the image */ HDmemcpy(heap->dblk_image, p, heap->dblk_size); + + /* Build free list */ + if(H5HL_fl_deserialize(heap, udata->free_block) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list") } /* end if */ - else { - /* Read the local heap data block directly into buffer */ - if(H5F_block_read(f, H5FD_MEM_LHEAP, heap->dblk_addr, heap->dblk_size, dxpl_id, heap->dblk_image) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read heap data") - } /* end else */ - - /* Build free list */ - if(H5HL_fl_deserialize(heap, udata->free_block) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't initialize free list") + else + /* Make certain the length was OK on the retry */ + HDassert(!udata->made_attempt); + + /* Note that we've made one attempt at decoding the local heap already */ + /* (useful when the length is incorrect and the cache will retry with a larger one) */ + udata->made_attempt = TRUE; } /* end if */ else /* Note that the heap should _NOT_ be a single object in the cache */ @@ -380,241 +404,204 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_prefix_load() */ +} /* end H5HL_prfx_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HL_prefix_flush + * Function: H5HL_prfx_image_len * - * Purpose: Flushes a heap from memory to disk if it's dirty. Optionally - * deletes the heap from memory. + * Purpose: Compute the size of the data structure on disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 17 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Oct 11 2008 * *------------------------------------------------------------------------- */ static herr_t -H5HL_prefix_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - void *thing, unsigned UNUSED *flags_ptr) +H5HL_prfx_image_len(const void *_thing, size_t *image_len) { - H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* Local heap prefix to flush */ - H5WB_t *wb = NULL; /* Wrapped buffer for heap data */ - uint8_t heap_buf[H5HL_SPEC_READ_SIZE]; /* Buffer for heap */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5HL_prfx_t *prfx = (const H5HL_prfx_t *)_thing; /* The local heap prefix */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_prefix_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_prfx_image_len) - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(prfx); + HDassert(prfx->heap); + HDassert(image_len); - if(prfx->cache_info.is_dirty) { - H5HL_t *heap = prfx->heap; /* Pointer to the local heap */ - H5HL_free_t *fl = heap->freelist; /* Pointer to heap's free list */ - uint8_t *buf; /* Pointer to heap buffer */ - size_t buf_size; /* Size of buffer for encoding & writing heap info */ - uint8_t *p; /* Pointer into raw data buffer */ - - /* Wrap the local buffer for serialized heap info */ - if(NULL == (wb = H5WB_wrap(heap_buf, sizeof(heap_buf)))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "can't wrap buffer") - - /* Compute the size of the buffer to encode & write */ - buf_size = heap->prfx_size; - if(heap->single_cache_obj) - buf_size += heap->dblk_size; - - /* Get a pointer to a buffer that's large enough for serialized heap */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, buf_size))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "can't get actual buffer") - - /* Serialize the heap prefix */ - p = buf; - HDmemcpy(p, H5HL_MAGIC, (size_t)H5HL_SIZEOF_MAGIC); - p += H5HL_SIZEOF_MAGIC; - *p++ = H5HL_VERSION; - *p++ = 0; /*reserved*/ - *p++ = 0; /*reserved*/ - *p++ = 0; /*reserved*/ - H5F_ENCODE_LENGTH_LEN(p, heap->dblk_size, heap->sizeof_size); - H5F_ENCODE_LENGTH_LEN(p, fl ? fl->offset : H5HL_FREE_NULL, heap->sizeof_size); - H5F_addr_encode_len(heap->sizeof_addr, &p, heap->dblk_addr); - - /* Check if the local heap is a single object in cache */ - if(heap->single_cache_obj) { - /* 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 = buf + heap->prfx_size; - - /* Serialize the free list into the heap data's image */ - H5HL_fl_serialize(heap); - - /* Copy the heap data block into the cache image */ - HDmemcpy(p, heap->dblk_image, heap->dblk_size); - } /* end if */ - - /* Write the prefix [and possibly the data block] to the file */ - if(H5F_block_write(f, H5FD_MEM_LHEAP, addr, buf_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "unable to write heap header and data to file") - - prfx->cache_info.is_dirty = FALSE; - } /* end if */ - - /* Should we destroy the memory version? */ - if(destroy) - if(H5HL_prefix_dest(f, prfx) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap prefix") - -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_HEAP, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + /* Report the local heap's size, including the data block, if it's contiguous w/prefix */ + if(prfx->heap->single_cache_obj) + *image_len = prfx->heap->prfx_size + prfx->heap->dblk_size; + else + *image_len = prfx->heap->prfx_size; - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_prefix_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HL_prfx_image_len() */ /*------------------------------------------------------------------------- - * Function: H5HL_prefix_dest + * Function: H5HL_prfx_serialize * - * Purpose: Destroys a heap prefix in memory. + * Purpose: Serializes a 'in core' representation of data structure * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * koziol@hdfgroup.org + * Oct 11 2008 * *------------------------------------------------------------------------- */ static herr_t -H5HL_prefix_dest(H5F_t UNUSED *f, void *thing) +H5HL_prfx_serialize(const H5F_t UNUSED *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) { - H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* Local heap prefix to destroy */ - herr_t ret_value = SUCCEED; /* Return value */ + H5HL_prfx_t *prfx = (H5HL_prfx_t *)_thing; /* Pointer to the local heap prefix */ + H5HL_t *heap; /* Pointer to the local heap */ + uint8_t *p; /* Pointer into raw data buffer */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_prefix_dest) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_prfx_serialize) /* check arguments */ + HDassert(image); HDassert(prfx); + HDassert(prfx->heap); + HDassert(flags); - /* Verify that entry is clean */ - HDassert(prfx->cache_info.is_dirty == FALSE); + /* Get the pointer to the heap */ + heap = prfx->heap; - /* Destroy local heap prefix */ - if(H5HL_prfx_dest(prfx) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't destroy local heap prefix") + /* Point to the cache image */ + p = (uint8_t *)image; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_prefix_dest() */ + /* Serialize the header */ + HDmemcpy(p, H5HL_MAGIC, (size_t)H5HL_SIZEOF_MAGIC); + p += H5HL_SIZEOF_MAGIC; + *p++ = H5HL_VERSION; + *p++ = 0; /*reserved*/ + *p++ = 0; /*reserved*/ + *p++ = 0; /*reserved*/ + H5F_ENCODE_LENGTH_LEN(p, heap->dblk_size, heap->sizeof_size); + H5F_ENCODE_LENGTH_LEN(p, heap->freelist ? heap->freelist->offset : H5HL_FREE_NULL, heap->sizeof_size); + H5F_addr_encode_len(heap->sizeof_addr, &p, heap->dblk_addr); + + /* Check if the local heap is a single object in cache */ + if(heap->single_cache_obj) { + /* 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 */ + + /* Reset the cache flags for this operation */ + *flags = 0; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5HL_prfx_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HL_prefix_clear + * Function: H5HL_prfx_free_icr * - * Purpose: Mark a local heap prefix in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data + * structure * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 + * koziol@hdfgroup.org + * October 11, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5HL_prefix_clear(H5F_t UNUSED *f, void *thing, hbool_t destroy) +H5HL_prfx_free_icr(void *thing) { - H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* The local heap prefix to operate on */ - herr_t ret_value = SUCCEED; /* Return value */ + H5HL_prfx_t *prfx = (H5HL_prfx_t *)thing; /* Local heap prefix to destroy */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_prefix_clear) + FUNC_ENTER_NOAPI_NOINIT(H5HL_prfx_free_icr) - /* check arguments */ + /* Check arguments */ HDassert(prfx); - /* Mark heap prefix as clean */ - prfx->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5HL_prefix_dest(f, prfx) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap prefix") + /* Destroy local heap prefix */ + if(H5HL_prfx_dest(prfx) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't destroy local heap prefix") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_prefix_clear() */ +} /* H5HL_prfx_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5HL_prefix_size + * Function: H5HL_dblk_get_load_size * - * Purpose: Compute the size in bytes of the heap prefix on disk, - * and return it in *len_ptr. On failure, the value of *len_ptr - * is undefined. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: John Mainzer - * 5/13/04 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5HL_prefix_size(const H5F_t UNUSED *f, const void *thing, size_t *size_ptr) +H5HL_dblk_get_load_size(const void *_udata, size_t *image_len) { - const H5HL_prfx_t *prfx = (const H5HL_prfx_t *)thing; /* Pointer to local heap prefix to query */ + const H5HL_cache_dblk_ud_t *udata = (const H5HL_cache_dblk_ud_t *)_udata; /* User data for callback */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_prefix_size) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_dblk_get_load_size) - /* check arguments */ - HDassert(prfx); - HDassert(prfx->heap); - HDassert(size_ptr); - - /* Calculate size of prefix in cache */ - *size_ptr = prfx->heap->prfx_size; + /* Check arguments */ + HDassert(udata); + HDassert(image_len); - /* If the heap is stored as a single object, add in the data block size also */ - if(prfx->heap->single_cache_obj) - *size_ptr += prfx->heap->dblk_size; + /* Set the image length size */ + *image_len = udata->heap->dblk_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HL_prefix_size() */ +} /* end H5HL_dblk_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5HL_datablock_load + * Function: H5HL_dblk_deserialize * - * Purpose: Loads a local heap data block from disk. + * Purpose: Deserialize the data structure from disk. * - * Return: Success: Ptr to a local heap data block memory data structure. + * Return: Success: Ptr to a local heap data block. * Failure: NULL * * Programmer: Quincey Koziol * koziol@hdfgroup.org - * Jan 5 2010 + * Oct 12 2008 * *------------------------------------------------------------------------- */ static void * -H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +H5HL_dblk_deserialize(const void *image, size_t UNUSED len, + void *_udata, hbool_t UNUSED *dirty) { 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; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_load) + FUNC_ENTER_NOAPI_NOINIT(H5HL_dblk_deserialize) /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(image); HDassert(udata); HDassert(udata->heap); HDassert(!udata->heap->single_cache_obj); @@ -628,11 +615,10 @@ H5HL_datablock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(NULL == udata->heap->dblk_image) { /* Allocate space for the heap data image */ if(NULL == (udata->heap->dblk_image = H5FL_BLK_MALLOC(lheap_chunk, udata->heap->dblk_size))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "can't allocate data block image buffer") + HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, NULL, "memory allocation failed") - /* Read local heap data block */ - if(H5F_block_read(f, H5FD_MEM_LHEAP, udata->heap->dblk_addr, udata->heap->dblk_size, dxpl_id, udata->heap->dblk_image) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_READERROR, NULL, "unable to read local heap data block") + /* Copy the cache image into the heap's data image */ + HDmemcpy(udata->heap->dblk_image, image, udata->heap->dblk_size); /* Build free list */ if(H5HL_fl_deserialize(udata->heap, udata->free_block) < 0) @@ -652,163 +638,113 @@ done: HDONE_ERROR(H5E_HEAP, H5E_CANTRELEASE, NULL, "unable to destroy local heap data block") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_datablock_load() */ +} /* end H5HL_dblk_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5HL_datablock_flush + * Function: H5HL_dblk_image_len * - * Purpose: Flushes a heap's data block from memory to disk if it's dirty. - * Optionally deletes the heap data block from memory. + * Purpose: Compute the size of the data structure on disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 17 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20 2010 * *------------------------------------------------------------------------- */ static herr_t -H5HL_datablock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - void *_thing, unsigned UNUSED * flags_ptr) +H5HL_dblk_image_len(const void *_thing, size_t *image_len) { - H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5HL_dblk_t *dblk = (const H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_dblk_image_len) - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(dblk); - HDassert(dblk->heap); - HDassert(!dblk->heap->single_cache_obj); - - if(dblk->cache_info.is_dirty) { - H5HL_t *heap = dblk->heap; /* Pointer to the local heap */ - - /* Serialize the free list into the heap data's image */ - H5HL_fl_serialize(heap); - - /* Write the data block to the file */ - if(H5F_block_write(f, H5FD_MEM_LHEAP, heap->dblk_addr, heap->dblk_size, dxpl_id, heap->dblk_image) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_WRITEERROR, FAIL, "unable to write heap data block to file") - - dblk->cache_info.is_dirty = FALSE; - } /* end if */ + HDassert(image_len); - /* Should we destroy the memory version? */ - if(destroy) - if(H5HL_datablock_dest(f, dblk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap data block") + /* Set the image length size */ + *image_len = dblk->heap->dblk_size; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_datablock_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5HL_dblk_image_len() */ /*------------------------------------------------------------------------- - * Function: H5HL_datablock_dest + * Function: H5HL_dblk_serialize * - * Purpose: Destroys a local heap data block in memory. + * Purpose: Serializes a 'in core' representation of data structure * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * koziol@hdfgroup.org + * Oct 12 2008 * *------------------------------------------------------------------------- */ static herr_t -H5HL_datablock_dest(H5F_t UNUSED *f, void *_thing) +H5HL_dblk_serialize(const H5F_t UNUSED *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) { - H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - herr_t ret_value = SUCCEED; /* Return value */ + H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ + H5HL_t *heap = dblk->heap; /* Pointer to the local heap */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_dest) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_dblk_serialize) /* check arguments */ + HDassert(image); HDassert(dblk); + HDassert(dblk->heap); + HDassert(flags); - /* Verify that entry is clean */ - HDassert(dblk->cache_info.is_dirty == FALSE); + /* Serialize the free list into the heap data's image */ + H5HL_fl_serialize(heap); - /* Destroy local heap data block */ - if(H5HL_dblk_dest(dblk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't destroy local heap data block") + /* Copy the heap's data block into the cache's image */ + HDmemcpy(image, heap->dblk_image, heap->dblk_size); -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_datablock_dest() */ + /* Reset the cache flags for this operation */ + *flags = 0; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* H5HL_dblk_serialize() */ /*------------------------------------------------------------------------- - * Function: H5HL_datablock_clear + * Function: H5HL_dblk_free_icr * - * Purpose: Mark a local heap data block in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data + * structure * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 + * koziol@hdfgroup.org + * October 12, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5HL_datablock_clear(H5F_t *f, void *_thing, hbool_t destroy) +H5HL_dblk_free_icr(void *thing) { - H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - herr_t ret_value = SUCCEED; /* Return value */ + H5HL_dblk_t *dblk = (H5HL_dblk_t *)thing; /* Local heap data block to destroy */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5HL_datablock_clear) + FUNC_ENTER_NOAPI_NOINIT(H5HL_dblk_free_icr) - /* check arguments */ + /* Check arguments */ HDassert(dblk); - /* Mark local heap data block as clean */ - dblk->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5HL_datablock_dest(f, dblk) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap data block") + /* Destroy local heap data block */ + if(H5HL_dblk_dest(dblk) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "unable to destroy local heap data block") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5HL_datablock_clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5HL_datablock_size - * - * Purpose: Compute the size in bytes of the local heap data block on disk, - * and return it in *len_ptr. On failure, the value of *len_ptr - * is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 5/13/04 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5HL_datablock_size(const H5F_t UNUSED *f, const void *_thing, size_t *size_ptr) -{ - const H5HL_dblk_t *dblk = (const H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ - - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_datablock_size) - - /* check arguments */ - HDassert(dblk); - HDassert(dblk->heap); - HDassert(size_ptr); - - /* Set size of data block in cache */ - *size_ptr = dblk->heap->dblk_size; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5HL_datablock_size() */ +} /* H5HL_dblk_free_icr() */ diff --git a/src/H5HLpkg.h b/src/H5HLpkg.h index 4e0e57b..26b9621 100644 --- a/src/H5HLpkg.h +++ b/src/H5HLpkg.h @@ -121,6 +121,7 @@ struct H5HL_prfx_t { /* Callback information for loading local heap prefix from disk */ typedef struct H5HL_cache_prfx_ud_t { /* Downwards */ + hbool_t made_attempt; /* Whether the deserialize routine was already attempted */ size_t sizeof_size; /* Size of file sizes */ size_t sizeof_addr; /* Size of file addresses */ haddr_t prfx_addr; /* Address of prefix */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 720e4aa..7943684 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -38,7 +38,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5Opkg.h" /* Object headers */ -#include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ @@ -67,17 +66,23 @@ /********************/ /* Metadata cache callbacks */ -static H5O_t *H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh, unsigned UNUSED * flags_ptr); -static herr_t H5O_dest(H5F_t *f, H5O_t *oh); -static herr_t H5O_clear(H5F_t *f, H5O_t *oh, hbool_t destroy); -static herr_t H5O_size(const H5F_t *f, const H5O_t *oh, size_t *size_ptr); - -static H5O_chunk_proxy_t *H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5O_cache_chk_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_chunk_proxy_t *chk_proxy, unsigned UNUSED * flags_ptr); -static herr_t H5O_cache_chk_dest(H5F_t *f, H5O_chunk_proxy_t *chk_proxy); -static herr_t H5O_cache_chk_clear(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t destroy); -static herr_t H5O_cache_chk_size(const H5F_t *f, const H5O_chunk_proxy_t *chk_proxy, size_t *size_ptr); +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_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_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, + void *udata, hbool_t *dirty); +static herr_t H5O_cache_chk_image_len(const void *thing, size_t *image_len); +static herr_t H5O_cache_chk_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_chk_free_icr(void *thing); /* Chunk proxy routines */ static herr_t H5O_chunk_proxy_dest(H5O_chunk_proxy_t *chunk_proxy); @@ -85,7 +90,8 @@ static herr_t H5O_chunk_proxy_dest(H5O_chunk_proxy_t *chunk_proxy); /* Chunk routines */ static herr_t H5O_chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len, const uint8_t *image, H5O_common_cache_ud_t *udata, hbool_t *dirty); -static herr_t H5O_chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno); +static herr_t H5O_chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno, + uint8_t *image); /* Misc. routines */ static herr_t H5O_add_cont_msg(H5O_cont_msgs_t *cont_msg_info, @@ -99,21 +105,27 @@ 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, - (H5AC_load_func_t)H5O_load, - (H5AC_flush_func_t)H5O_flush, - (H5AC_dest_func_t)H5O_dest, - (H5AC_clear_func_t)H5O_clear, - (H5AC_size_func_t)H5O_size, + "object header prefix", + H5FD_MEM_OHDR, + H5AC__CLASS_SPECULATIVE_LOAD_FLAG, + 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 */ const H5AC_class_t H5AC_OHDR_CHK[1] = {{ H5AC_OHDR_CHK_ID, - (H5AC_load_func_t)H5O_cache_chk_load, - (H5AC_flush_func_t)H5O_cache_chk_flush, - (H5AC_dest_func_t)H5O_cache_chk_dest, - (H5AC_clear_func_t)H5O_cache_chk_clear, - (H5AC_size_func_t)H5O_cache_chk_size, + "object header chunk", + H5FD_MEM_OHDR, + H5AC__CLASS_NO_FLAGS_SET, + H5O_cache_chk_get_load_size, + H5O_cache_chk_deserialize, + H5O_cache_chk_image_len, + H5O_cache_chk_serialize, + H5O_cache_chk_free_icr, }}; /* Declare external the free list for H5O_unknown_t's */ @@ -138,60 +150,69 @@ H5FL_SEQ_DEFINE(H5O_cont_t); /*------------------------------------------------------------------------- - * Function: H5O_load + * Function: H5O_cache_prfx_get_load_size * - * Purpose: Loads an object header from disk. + * Purpose: Compute the size of the data structure on disk. * - * Return: Success: Pointer to the new object header. + * Return: Non-negative on success/Negative on failure * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +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_prfx_get_load_size) + + /* Check arguments */ + HDassert(udata); + HDassert(image_len); + + /* Set the image length size */ + *image_len = H5O_SPEC_READ_SIZE; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_cache_prfx_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_cache_prfx_deserialize + * + * Purpose: Deserializes an object header prefix + first chunk + * + * Return: Success: Pointer to a new object header * Failure: NULL * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 5 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Jul 12 2008 * *------------------------------------------------------------------------- */ -static H5O_t * -H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5O_cache_prfx_deserialize(const void *image, size_t len, void *_udata, + hbool_t *dirty) { - H5O_t *oh = NULL; /* Object header read in */ + H5O_t *oh = NULL; /* Object header info */ H5O_cache_ud_t *udata = (H5O_cache_ud_t *)_udata; /* User data for callback */ - H5WB_t *wb = NULL; /* Wrapped buffer for prefix data */ - uint8_t read_buf[H5O_SPEC_READ_SIZE]; /* Buffer for speculative read */ - const uint8_t *p; /* Pointer into buffer to decode */ - uint8_t *buf; /* Buffer to decode */ - size_t spec_read_size; /* Size of buffer to speculatively read in */ - size_t prefix_size; /* Size of object header prefix */ - size_t buf_size; /* Size of prefix+chunk #0 buffer */ - haddr_t abs_eoa; /* Absolute end of file address */ - haddr_t rel_eoa; /* Relative end of file address */ - H5O_t *ret_value; /* Return value */ + const uint8_t *p; /* Pointer into raw data buffer */ + size_t prefix_size; /* Size of object header prefix */ + H5O_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_load) + FUNC_ENTER_NOAPI_NOINIT(H5O_cache_prfx_deserialize) /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(len > 0); + HDassert(image); HDassert(udata); HDassert(udata->common.f); HDassert(udata->common.cont_msg_info); - /* Make certain we don't speculatively read off the end of the file */ - if(HADDR_UNDEF == (abs_eoa = H5F_get_eoa(f))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, NULL, "unable to determine file size") - - /* Adjust absolute EOA address to relative EOA address */ - rel_eoa = abs_eoa - H5F_get_base_addr(f); - - /* Compute the size of the speculative object header buffer */ - H5_ASSIGN_OVERFLOW(spec_read_size, MIN(rel_eoa - addr, H5O_SPEC_READ_SIZE), /* From: */ hsize_t, /* To: */ size_t); - - /* Attempt to speculatively read both object header prefix and first chunk */ - if(H5F_block_read(f, H5FD_MEM_OHDR, addr, spec_read_size, dxpl_id, read_buf) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header") - p = read_buf; - /* Allocate space for the object header data structure */ if(NULL == (oh = H5FL_CALLOC(H5O_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -200,6 +221,9 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) oh->sizeof_size = H5F_SIZEOF_SIZE(udata->common.f); oh->sizeof_addr = H5F_SIZEOF_ADDR(udata->common.f); + /* Get temporary pointer to serialized header */ + p = (const uint8_t *)image; + /* Check for presence of magic number */ /* (indicates version 2 or later) */ if(!HDmemcmp(p, H5O_HDR_MAGIC, (size_t)H5O_SIZEOF_MAGIC)) { @@ -307,317 +331,283 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) } /* end else */ /* Determine object header prefix length */ - prefix_size = (size_t)(p - (const uint8_t *)read_buf); - HDassert((size_t)prefix_size == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); - - /* Compute the size of the buffer used */ - buf_size = oh->chunk0_size + (size_t)H5O_SIZEOF_HDR(oh); - - /* Check if the speculative read was large enough to parse the first chunk */ - if(spec_read_size < buf_size) { - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(read_buf, sizeof(read_buf)))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, buf_size))) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Copy existing raw data into new buffer */ - HDmemcpy(buf, read_buf, spec_read_size); - - /* Read rest of the raw data */ - if(H5F_block_read(f, H5FD_MEM_OHDR, (addr + spec_read_size), (buf_size - spec_read_size), dxpl_id, (buf + spec_read_size)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header data") + prefix_size = (size_t)(p - (const uint8_t *)image); + HDassert(prefix_size == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + + /* Check if the length is large enough to parse the first chunk also */ + /* (If not, we'll return the object header struct that we have now and + * count on the cache to query it for the correct size and retry with the + * full first chunk available) + */ + if(len >= (oh->chunk0_size + H5O_SIZEOF_HDR(oh))) { + /* Parse the first chunk */ + if(H5O_chunk_deserialize(oh, udata->common.addr, oh->chunk0_size, (const uint8_t *)image, &(udata->common), dirty) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize first object header chunk") } /* end if */ else - buf = read_buf; - - /* Parse the first chunk */ - if(H5O_chunk_deserialize(oh, udata->common.addr, oh->chunk0_size, buf, &(udata->common), &oh->cache_info.is_dirty) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize first object header chunk") + /* Make certain the length was OK on the retry */ + HDassert(!udata->made_attempt); - /* Note that we've loaded the object header from the file */ + /* Note that we've made one attempt at decoding the object header already */ + /* (useful when the length is incorrect and the cache will retry with a larger one) */ udata->made_attempt = TRUE; /* Set return value */ ret_value = oh; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") - /* Release the [possibly partially initialized] object header on errors */ if(!ret_value && oh) if(H5O_free(oh) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header data") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_load() */ +} /* end H5O_cache_prfx_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5O_flush + * Function: H5O_cache_prfx_image_len * - * Purpose: Flushes (and destroys) an object header. + * Purpose: Compute the size of the data structure on disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Aug 5 1997 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Jul 12 2008 * *------------------------------------------------------------------------- */ static herr_t -H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, H5O_t *oh, unsigned UNUSED * flags_ptr) +H5O_cache_prfx_image_len(const void *thing, size_t *image_len) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5O_t *oh = (const H5O_t *)thing; /* The object header */ - FUNC_ENTER_NOAPI_NOINIT(H5O_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cache_prfx_image_len) /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); HDassert(oh); + HDassert(image_len); + + /* Report the object header's prefix+first chunk length */ + if(oh->chunk0_size) + *image_len = H5O_SIZEOF_HDR(oh) + oh->chunk0_size; + else + *image_len = oh->chunk[0].size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_cache_prfx_image_len() */ + + +/*------------------------------------------------------------------------- + * Function: H5O_cache_prfx_serialize + * + * Purpose: Serializes an object header prefix+first chunk + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Jul 12 2008 + * + *------------------------------------------------------------------------- + */ +static herr_t +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) +{ + H5O_t *oh = (H5O_t *)_thing; /* Pointer to the object header */ + uint8_t *p; /* Pointer into raw data buffer */ + herr_t ret_value = SUCCEED; /* Return value */ - /* flush */ - if(oh->cache_info.is_dirty) { - uint8_t *p; /* Pointer to object header prefix buffer */ + FUNC_ENTER_NOAPI_NOINIT(H5O_cache_prfx_serialize) + + /* check arguments */ + HDassert(f); + HDassert(image); + HDassert(oh); + HDassert(flags); #ifdef H5O_DEBUG H5O_assert(oh); #endif /* H5O_DEBUG */ - /* Point to raw data 'image' for first chunk, which has room for the prefix */ - p = oh->chunk[0].image; + /* Get temporary pointer to chunk zero's buffer */ + p = oh->chunk[0].image; - /* Later versions of object header prefix have different format and - * also require that chunk 0 always be updated, since the checksum - * on the entire block of memory needs to be updated if anything is - * modified */ - if(oh->version > H5O_VERSION_1) { - uint64_t chunk0_size; /* Size of chunk 0's data */ - - HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); - chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); + /* Later versions of object header prefix have different format and + * also require that chunk 0 always be updated, since the checksum + * on the entire block of memory needs to be updated if anything is + * modified */ + if(oh->version > H5O_VERSION_1) { + uint64_t chunk0_size; /* Size of chunk 0's data */ - /* Verify magic number */ - HDassert(!HDmemcmp(p, H5O_HDR_MAGIC, H5O_SIZEOF_MAGIC)); - p += H5O_SIZEOF_MAGIC; + HDassert(oh->chunk[0].size >= (size_t)H5O_SIZEOF_HDR(oh)); + chunk0_size = oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh); - /* Version */ - *p++ = oh->version; + /* Verify magic number */ + HDassert(!HDmemcmp(p, H5O_HDR_MAGIC, H5O_SIZEOF_MAGIC)); + p += H5O_SIZEOF_MAGIC; - /* Flags */ - *p++ = oh->flags; + /* Version */ + *p++ = oh->version; - /* Time fields */ - if(oh->flags & H5O_HDR_STORE_TIMES) { - UINT32ENCODE(p, oh->atime); - UINT32ENCODE(p, oh->mtime); - UINT32ENCODE(p, oh->ctime); - UINT32ENCODE(p, oh->btime); - } /* end if */ + /* Flags */ + *p++ = oh->flags; - /* Attribute fields */ - if(oh->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) { - UINT16ENCODE(p, oh->max_compact); - UINT16ENCODE(p, oh->min_dense); - } /* end if */ + /* Time fields */ + if(oh->flags & H5O_HDR_STORE_TIMES) { + UINT32ENCODE(p, oh->atime); + UINT32ENCODE(p, oh->mtime); + UINT32ENCODE(p, oh->ctime); + UINT32ENCODE(p, oh->btime); + } /* end if */ - /* First chunk size */ - switch(oh->flags & H5O_HDR_CHUNK0_SIZE) { - case 0: /* 1 byte size */ - HDassert(chunk0_size < 256); - *p++ = (uint8_t)chunk0_size; - break; - - case 1: /* 2 byte size */ - HDassert(chunk0_size < 65536); - UINT16ENCODE(p, chunk0_size); - break; - - case 2: /* 4 byte size */ - /* use <= 2**32 -1 to stay within 4 bytes integer range */ - HDassert(chunk0_size <= 4294967295UL); - UINT32ENCODE(p, chunk0_size); - break; - - case 3: /* 8 byte size */ - UINT64ENCODE(p, chunk0_size); - break; - - default: - HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "bad size for chunk 0") - } /* end switch */ + /* Attribute fields */ + if(oh->flags & H5O_HDR_ATTR_STORE_PHASE_CHANGE) { + UINT16ENCODE(p, oh->max_compact); + UINT16ENCODE(p, oh->min_dense); } /* end if */ - else { - /* Version */ - *p++ = oh->version; - /* Reserved */ - *p++ = 0; + /* First chunk size */ + switch(oh->flags & H5O_HDR_CHUNK0_SIZE) { + case 0: /* 1 byte size */ + HDassert(chunk0_size < 256); + *p++ = (uint8_t)chunk0_size; + break; - /* Number of messages */ -#ifdef H5O_ENABLE_BAD_MESG_COUNT - if(oh->store_bad_mesg_count) - UINT16ENCODE(p, (oh->nmesgs - 1)) - else -#endif /* H5O_ENABLE_BAD_MESG_COUNT */ - UINT16ENCODE(p, oh->nmesgs); + case 1: /* 2 byte size */ + HDassert(chunk0_size < 65536); + UINT16ENCODE(p, chunk0_size); + break; - /* Link count */ - UINT32ENCODE(p, oh->nlink); + case 2: /* 4 byte size */ + /* use <= 2**32 -1 to stay within 4 bytes integer range */ + HDassert(chunk0_size <= 4294967295UL); + UINT32ENCODE(p, chunk0_size); + break; - /* First chunk size */ - UINT32ENCODE(p, (oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh))); + case 3: /* 8 byte size */ + UINT64ENCODE(p, chunk0_size); + break; - /* Zero to alignment */ - HDmemset(p, 0, (size_t)(H5O_SIZEOF_HDR(oh) - 12)); - p += (size_t)(H5O_SIZEOF_HDR(oh) - 12); - } /* end else */ - HDassert((size_t)(p - oh->chunk[0].image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + default: + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "bad size for chunk 0") + } /* end switch */ + } /* end if */ + else { + /* Version */ + *p++ = oh->version; + + /* Reserved */ + *p++ = 0; + + /* Number of messages */ +#ifdef H5O_ENABLE_BAD_MESG_COUNT + if(oh->store_bad_mesg_count) + UINT16ENCODE(p, (oh->nmesgs - 1)) + else +#endif /* H5O_ENABLE_BAD_MESG_COUNT */ + UINT16ENCODE(p, oh->nmesgs); - /* Serialize messages for this chunk */ - if(H5O_chunk_serialize(f, oh, (unsigned)0) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize first object header chunk") + /* Link count */ + UINT32ENCODE(p, oh->nlink); - /* Write the chunk out */ - HDassert(H5F_addr_defined(oh->chunk[0].addr)); - if(H5F_block_write(f, H5FD_MEM_OHDR, oh->chunk[0].addr, oh->chunk[0].size, dxpl_id, oh->chunk[0].image) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header chunk to disk") + /* First chunk size */ + UINT32ENCODE(p, (oh->chunk[0].size - (size_t)H5O_SIZEOF_HDR(oh))); - /* Mark object header as clean now */ - oh->cache_info.is_dirty = FALSE; - } /* end if */ + /* Zero to alignment */ + HDmemset(p, 0, (size_t)(H5O_SIZEOF_HDR(oh) - 12)); + p += (size_t)(H5O_SIZEOF_HDR(oh) - 12); + } /* end else */ + HDassert((size_t)(p - (uint8_t *)oh->chunk[0].image) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh))); + + /* Serialize messages for this chunk */ + if(H5O_chunk_serialize(f, oh, (unsigned)0, (uint8_t *)image) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize first object header chunk") - /* Destroy the object header, if requested */ - if(destroy) - if(H5O_dest(f, oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") + /* Reset the cache flags for this operation */ + *flags = 0; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_flush() */ +} /* H5O_cache_prfx_serialize() */ /*------------------------------------------------------------------------- - * Function: H5O_dest + * Function: H5O_cache_prfx_free_icr * - * Purpose: Destroys an object header. + * Purpose: Destroy/release an "in core representation" of a data + * structure * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Jan 15 2003 + * koziol@hdfgroup.org + * July 12, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5O_dest(H5F_t UNUSED *f, H5O_t *oh) +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_dest) + FUNC_ENTER_NOAPI_NOINIT(H5O_cache_prfx_free_icr) - /* check args */ + /* Check arguments */ HDassert(oh); HDassert(oh->rc == 0); - /* Verify that node is clean */ - HDassert(oh->cache_info.is_dirty == FALSE); - /* Destroy object header */ if(H5O_free(oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't destroy object header") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dest() */ +} /* H5O_cache_prfx_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5O_clear + * Function: H5O_cache_chk_get_load_size * - * Purpose: Mark a object header in memory as non-dirty. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 20 2003 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5O_clear(H5F_t *f, H5O_t *oh, hbool_t destroy) +H5O_cache_chk_get_load_size(const void *_udata, size_t *image_len) { - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI_NOINIT(H5O_clear) - - /* check args */ - HDassert(oh); - - /* Mark messages as clean */ - for(u = 0; u < oh->nmesgs; u++) - oh->mesg[u].dirty = FALSE; - - /* Mark whole header as clean */ - oh->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5O_dest(f, oh) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header data") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_clear() */ + const H5O_chk_cache_ud_t *udata = (const H5O_chk_cache_ud_t *)_udata; /* User data for callback */ - -/*------------------------------------------------------------------------- - * Function: H5O_size - * - * Purpose: Compute the size in bytes of the specified instance of - * H5O_t on disk, and return it in *len_ptr. On failure, - * the value of *len_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: John Mainzer - * 5/13/04 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O_size(const H5F_t UNUSED *f, const H5O_t *oh, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_size) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cache_chk_get_load_size) - /* check args */ - HDassert(oh); - HDassert(size_ptr); + /* Check arguments */ + HDassert(udata); + HDassert(image_len); - /* Report the object header's prefix+first chunk length */ - if(oh->chunk0_size) - *size_ptr = H5O_SIZEOF_HDR(oh) + oh->chunk0_size; - else - *size_ptr = oh->chunk[0].size; + /* Set the image length size */ + *image_len = udata->size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5O_size() */ +} /* end H5O_cache_chk_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_chk_load + * Function: H5O_cache_chk_deserialize * - * Purpose: Loads an object header continuation chunk from disk. + * Purpose: Deserializes an object header continuation chunk * - * Return: Success: Pointer to the new object header chunk proxy. + * Return: Success: Pointer to a new chunk proxy * Failure: NULL * * Programmer: Quincey Koziol @@ -626,21 +616,19 @@ H5O_size(const H5F_t UNUSED *f, const H5O_t *oh, size_t *size_ptr) * *------------------------------------------------------------------------- */ -static H5O_chunk_proxy_t * -H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5O_cache_chk_deserialize(const void *image, size_t len, void *_udata, + hbool_t *dirty) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk proxy object */ H5O_chk_cache_ud_t *udata = (H5O_chk_cache_ud_t *)_udata; /* User data for callback */ - H5WB_t *wb = NULL; /* Wrapped buffer for prefix data */ - uint8_t chunk_buf[H5O_SPEC_READ_SIZE]; /* Buffer for speculative read */ - uint8_t *buf; /* Buffer to decode */ H5O_chunk_proxy_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_load) + FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_deserialize) /* Check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(len > 0); + HDassert(image); HDassert(udata); HDassert(udata->oh); @@ -648,18 +636,6 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(NULL == (chk_proxy = H5FL_CALLOC(H5O_chunk_proxy_t))) HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed") - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(chunk_buf, sizeof(chunk_buf)))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, udata->size))) - HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read rest of the raw data */ - if(H5F_block_read(f, H5FD_MEM_OHDR, addr, udata->size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header continuation chunk") - /* Check if we are still decoding the object header */ /* (as opposed to bringing a piece of it back from the file) */ if(udata->decoding) { @@ -668,7 +644,7 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HDassert(udata->common.cont_msg_info); /* Parse the chunk */ - if(H5O_chunk_deserialize(udata->oh, udata->common.addr, udata->size, buf, &(udata->common), &chk_proxy->cache_info.is_dirty) < 0) + if(H5O_chunk_deserialize(udata->oh, udata->common.addr, len, (const uint8_t *)image, &(udata->common), dirty) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize object header chunk") /* Set the fields for the chunk proxy */ @@ -686,7 +662,7 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Sanity check that the chunk representation we have in memory is the same * as the one being brought in from disk. */ - HDassert(0 == HDmemcmp(buf, chk_proxy->oh->chunk[chk_proxy->chunkno].image, chk_proxy->oh->chunk[chk_proxy->chunkno].size)); + HDassert(0 == HDmemcmp(image, chk_proxy->oh->chunk[chk_proxy->chunkno].image, chk_proxy->oh->chunk[chk_proxy->chunkno].size)); } /* end else */ /* Increment reference count of object header */ @@ -697,107 +673,96 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) ret_value = chk_proxy; done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") - /* Release the [possibly partially initialized] object header on errors */ if(!ret_value && chk_proxy) if(H5O_chunk_proxy_dest(chk_proxy) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, NULL, "unable to destroy object header chunk proxy") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cache_chk_load() */ +} /* end H5O_cache_chk_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_chk_flush + * Function: H5O_cache_chk_image_len * - * Purpose: Flushes (and destroys) an object header continuation chunk. + * Purpose: Compute the size of the data structure on disk. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * koziol@hdfgroup.org - * Jul 12 2008 + * May 20 2010 * *------------------------------------------------------------------------- */ static herr_t -H5O_cache_chk_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, - H5O_chunk_proxy_t *chk_proxy, unsigned UNUSED * flags_ptr) +H5O_cache_chk_image_len(const void *_thing, size_t *image_len) { - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_flush) - - /* flush */ - if(chk_proxy->cache_info.is_dirty) { - /* Serialize messages for this chunk */ - if(H5O_chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header continuation chunk") + const H5O_chunk_proxy_t *chk_proxy = (const H5O_chunk_proxy_t *)_thing; /* Pointer to the object header chunk proxy */ - /* Write the chunk out */ - HDassert(H5F_addr_defined(chk_proxy->oh->chunk[chk_proxy->chunkno].addr)); - HDassert(H5F_addr_eq(addr, chk_proxy->oh->chunk[chk_proxy->chunkno].addr)); - if(H5F_block_write(f, H5FD_MEM_OHDR, addr, chk_proxy->oh->chunk[chk_proxy->chunkno].size, dxpl_id, chk_proxy->oh->chunk[chk_proxy->chunkno].image) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header continuation chunk to disk") + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cache_chk_image_len) - /* Mark object header as clean now */ - chk_proxy->cache_info.is_dirty = FALSE; - } /* end if */ + /* Check arguments */ + HDassert(chk_proxy); + HDassert(image_len); - /* Destroy the object header, if requested */ - if(destroy) - if(H5O_cache_chk_dest(f, chk_proxy) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header continuation chunk data") + /* Set the image length size */ + *image_len = chk_proxy->oh->chunk[chk_proxy->chunkno].size; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cache_chk_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_cache_chk_image_len() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_chk_dest + * Function: H5O_cache_chk_serialize * - * Purpose: Destroys an object header continuation chunk. + * Purpose: Serializes an object header chunk * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * July 12, 2008 + * koziol@hdfgroup.org + * Jul 12 2008 * *------------------------------------------------------------------------- */ static herr_t -H5O_cache_chk_dest(H5F_t UNUSED *f, H5O_chunk_proxy_t *chk_proxy) +H5O_cache_chk_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) { + 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_NOINIT(H5O_cache_chk_dest) + FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_serialize) - /* Check arguments */ + /* check arguments */ + HDassert(f); + HDassert(image); HDassert(chk_proxy); + HDassert(flags); - /* Verify that node is clean */ - HDassert(chk_proxy->cache_info.is_dirty == FALSE); + /* Serialize messages for this chunk */ + if(H5O_chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno, (uint8_t *)image) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header chunk") - /* Destroy object header chunk proxy */ - if(H5O_chunk_proxy_dest(chk_proxy) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to destroy object header chunk proxy") + /* Reset the cache flags for this operation */ + *flags = 0; done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cache_chk_dest() */ +} /* H5O_cache_chk_serialize() */ /*------------------------------------------------------------------------- - * Function: H5O_cache_chk_clear + * Function: H5O_cache_chk_free_icr * - * Purpose: Mark a object header continuation chunk in memory as non-dirty. + * Purpose: Destroy/release an "in core representation" of a data + * structure * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * * Programmer: Quincey Koziol * koziol@hdfgroup.org @@ -806,62 +771,23 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_cache_chk_clear(H5F_t *f, H5O_chunk_proxy_t *chk_proxy, hbool_t destroy) +H5O_cache_chk_free_icr(void *thing) { - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; + H5O_chunk_proxy_t *chk_proxy = (H5O_chunk_proxy_t *)thing; /* Object header chunk proxy to destroy */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_clear) + FUNC_ENTER_NOAPI_NOINIT(H5O_cache_chk_free_icr) - /* check args */ + /* Check arguments */ HDassert(chk_proxy); - /* Mark messages in chunk as clean */ - for(u = 0; u < chk_proxy->oh->nmesgs; u++) - if(chk_proxy->oh->mesg[u].chunkno == chk_proxy->chunkno) - chk_proxy->oh->mesg[u].dirty = FALSE; - - /* Mark as clean */ - chk_proxy->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5O_cache_chk_dest(f, chk_proxy) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to destroy object header continuation chunk data") + /* Destroy object header chunk proxy */ + if(H5O_chunk_proxy_dest(chk_proxy) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to destroy object header chunk proxy") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_cache_chk_clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5O_cache_chk_size - * - * Purpose: Compute the size in bytes of the specified instance of - * an object header continuation chunk on disk, and return it in - * *len_ptr. On failure, the value of *len_ptr is undefined. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * July 12, 2008 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5O_cache_chk_size(const H5F_t UNUSED *f, const H5O_chunk_proxy_t *chk_proxy, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_cache_chk_size) - - /* check args */ - HDassert(chk_proxy); - HDassert(size_ptr); - - /* Report the object header continuation chunk's length */ - *size_ptr = chk_proxy->oh->chunk[chk_proxy->chunkno].size; - - FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5O_cache_chk_size() */ +} /* H5O_cache_chk_free_icr() */ /*------------------------------------------------------------------------- @@ -1250,7 +1176,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) +H5O_chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno, uint8_t *image) { H5O_mesg_t *curr_msg; /* Pointer to current message being operated on */ unsigned u; /* Local index variable */ @@ -1261,6 +1187,7 @@ H5O_chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) /* Check arguments */ HDassert(f); HDassert(oh); + HDassert(image); /* Encode any dirty messages in this chunk */ for(u = 0, curr_msg = &oh->mesg[0]; u < oh->nmesgs; u++, curr_msg++) @@ -1287,6 +1214,9 @@ H5O_chunk_serialize(const H5F_t *f, H5O_t *oh, unsigned chunkno) UINT32ENCODE(p, metadata_chksum); } /* end if */ + /* Copy the chunk's image into the cache's image */ + HDmemcpy(image, oh->chunk[chunkno].image, oh->chunk[chunkno].size); + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5O_chunk_serialize() */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 439ca0c..edf51f1 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -1386,7 +1386,7 @@ H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) 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(!H5AC_validate_cache_config_ver(config_ptr->version)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown config version.") /* If we ever support multiple versions of H5AC_cache_config_t, we diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 37c2515..9e41646 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -36,12 +36,6 @@ /* Local Macros */ /****************/ -/* Size of stack buffer for serialized tables */ -#define H5SM_TBL_BUF_SIZE 1024 - -/* Size of stack buffer for serialized list indices */ -#define H5SM_LST_BUF_SIZE 1024 - /******************/ /* Local Typedefs */ @@ -53,16 +47,24 @@ /********************/ /* Metadata cache (H5AC) callbacks */ -static H5SM_master_table_t *H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_master_table_t *table); -static herr_t H5SM_table_dest(H5F_t *f, H5SM_master_table_t* table); -static herr_t H5SM_table_clear(H5F_t *f, H5SM_master_table_t *table, hbool_t destroy); -static herr_t H5SM_table_size(const H5F_t *f, const H5SM_master_table_t *table, size_t *size_ptr); -static H5SM_list_t *H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_list_t *list); -static herr_t H5SM_list_dest(H5F_t *f, H5SM_list_t* list); -static herr_t H5SM_list_clear(H5F_t *f, H5SM_list_t *list, hbool_t destroy); -static herr_t H5SM_list_size(const H5F_t *f, const H5SM_list_t UNUSED *list, size_t *size_ptr); + +static herr_t H5SM_table_get_load_size(const void *_udata, size_t *image_len); +static void *H5SM_table_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5SM_table_image_len(const void *thing, size_t *image_len); +static herr_t H5SM_table_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 H5SM_table_free_icr(void *thing); + +static herr_t H5SM_list_get_load_size(const void *_udata, size_t *image_len); +static void *H5SM_list_deserialize(const void *image, size_t len, + void *udata, hbool_t *dirty); +static herr_t H5SM_list_image_len(const void *thing, size_t *image_len); +static herr_t H5SM_list_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 H5SM_list_free_icr(void *thing); /*********************/ @@ -71,20 +73,26 @@ static herr_t H5SM_list_size(const H5F_t *f, const H5SM_list_t UNUSED *list, siz /* H5SM inherits cache-like properties from H5AC */ const H5AC_class_t H5AC_SOHM_TABLE[1] = {{ H5AC_SOHM_TABLE_ID, - (H5AC_load_func_t)H5SM_table_load, - (H5AC_flush_func_t)H5SM_table_flush, - (H5AC_dest_func_t)H5SM_table_dest, - (H5AC_clear_func_t)H5SM_table_clear, - (H5AC_size_func_t)H5SM_table_size, + "shared object header message", + H5FD_MEM_SOHM_TABLE, + H5AC__CLASS_NO_FLAGS_SET, + H5SM_table_get_load_size, + H5SM_table_deserialize, + H5SM_table_image_len, + H5SM_table_serialize, + H5SM_table_free_icr, }}; const H5AC_class_t H5AC_SOHM_LIST[1] = {{ H5AC_SOHM_LIST_ID, - (H5AC_load_func_t)H5SM_list_load, - (H5AC_flush_func_t)H5SM_list_flush, - (H5AC_dest_func_t)H5SM_list_dest, - (H5AC_clear_func_t)H5SM_list_clear, - (H5AC_size_func_t)H5SM_list_size, + "shared object header message", + H5FD_MEM_SOHM_INDEX, + H5AC__CLASS_NO_FLAGS_SET, + H5SM_list_get_load_size, + H5SM_list_deserialize, + H5SM_list_image_len, + H5SM_list_serialize, + H5SM_list_free_icr, }}; @@ -100,68 +108,82 @@ const H5AC_class_t H5AC_SOHM_LIST[1] = {{ /*------------------------------------------------------------------------- - * Function: H5SM_table_load + * Function: H5SM_table_get_load_size * - * Purpose: Loads the master table of Shared Object Header Message - * indexes. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5SM_table_get_load_size(const void *_udata, size_t *image_len) +{ + const H5SM_table_cache_ud_t *udata = (const H5SM_table_cache_ud_t *)_udata; /* User data for callback */ + + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_table_get_load_size) + + /* Check arguments */ + HDassert(udata); + HDassert(image_len); + + /* Set the image length size */ + *image_len = H5SM_TABLE_SIZE(udata->f); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5SM_table_get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: H5SM_table_deserialize + * + * Purpose: Deserialize the data structure from disk. + * + * Return: Success: Pointer to a new shared message master table + * Failure: NULL * * Programmer: James Laird * November 6, 2006 * *------------------------------------------------------------------------- */ -static H5SM_master_table_t * -H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +static void * +H5SM_table_deserialize(const void *image, size_t UNUSED len, void *_udata, + hbool_t UNUSED *dirty) { H5SM_master_table_t *table = NULL; - H5WB_t *wb = NULL; /* Wrapped buffer for table data */ - uint8_t tbl_buf[H5SM_TBL_BUF_SIZE]; /* Buffer for table */ - uint8_t *buf; /* Reading buffer */ + H5SM_table_cache_ud_t *udata = (H5SM_table_cache_ud_t *)_udata; /* User data for callback */ const uint8_t *p; /* Pointer into input buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ size_t x; /* Counter variable for index headers */ H5SM_master_table_t *ret_value; - FUNC_ENTER_NOAPI_NOINIT(H5SM_table_load) + FUNC_ENTER_NOAPI_NOINIT(H5SM_table_deserialize) /* Verify that we're reading version 0 of the table; this is the only * version defined so far. */ - HDassert(f->shared->sohm_vers == HDF5_SHAREDHEADER_VERSION); + HDassert(image); + HDassert(udata); + HDassert(udata->f->shared->sohm_vers == HDF5_SHAREDHEADER_VERSION); /* Allocate space for the master table in memory */ if(NULL == (table = H5FL_CALLOC(H5SM_master_table_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Read number of indexes and version from file superblock */ - table->num_indexes = f->shared->sohm_nindexes; + table->num_indexes = udata->f->shared->sohm_nindexes; + table->table_size = H5SM_TABLE_SIZE(udata->f); - HDassert(addr == f->shared->sohm_addr); - HDassert(addr != HADDR_UNDEF); HDassert(table->num_indexes > 0); - /* Wrap the local buffer for serialized table info */ - if(NULL == (wb = H5WB_wrap(tbl_buf, sizeof(tbl_buf)))) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Compute the size of the SOHM table header on disk. This is the "table" - * itself plus each index within the table - */ - table->table_size = H5SM_TABLE_SIZE(f); - - /* Get a pointer to a buffer that's large enough for serialized table */ - if(NULL == (buf = H5WB_actual(wb, table->table_size))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read header from disk */ - if(H5F_block_read(f, H5FD_MEM_SOHM_TABLE, addr, table->table_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_READERROR, NULL, "can't read SOHM table") - /* Get temporary pointer to serialized table */ - p = buf; + p = (const uint8_t *)image; /* Check magic number */ if(HDmemcmp(p, H5SM_TABLE_MAGIC, (size_t)H5SM_SIZEOF_MAGIC)) @@ -197,23 +219,23 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) UINT16DECODE(p, table->indexes[x].num_messages); /* Address of the actual index */ - H5F_addr_decode(f, &p, &(table->indexes[x].index_addr)); + H5F_addr_decode(udata->f, &p, &(table->indexes[x].index_addr)); /* Address of the index's heap */ - H5F_addr_decode(f, &p, &(table->indexes[x].heap_addr)); + H5F_addr_decode(udata->f, &p, &(table->indexes[x].heap_addr)); /* Compute the size of a list index for this SOHM index */ - table->indexes[x].list_size = H5SM_LIST_SIZE(f, table->indexes[x].list_max); + table->indexes[x].list_size = H5SM_LIST_SIZE(udata->f, table->indexes[x].list_max); } /* end for */ /* Read in checksum */ UINT32DECODE(p, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - (const uint8_t *)buf) == table->table_size); + HDassert((size_t)(p - (const uint8_t *)image) == len); /* Compute checksum on entire header */ - computed_chksum = H5_checksum_metadata(buf, (table->table_size - H5SM_SIZEOF_CHECKSUM), 0); + computed_chksum = H5_checksum_metadata(image, (len - H5SM_SIZEOF_CHECKSUM), 0); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -222,249 +244,227 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) /* Set return value */ ret_value = table; + /* Sanity check */ + HDassert((size_t)((const uint8_t *)p - (const uint8_t *)image) <= len); + done: /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") - if(!ret_value && table) - (void)H5SM_table_dest(f, table); + if(!ret_value && table) + (void)H5SM_table_free(table); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_table_load() */ +} /* end H5SM_table_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5SM_table_flush + * Function: H5SM_table_image_len * - * Purpose: Flushes (and destroys) the table of Shared Object Header - * Message indexes. + * Purpose: Compute the size of the data structure on disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: James Laird - * November 6, 2006 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20 2010 * *------------------------------------------------------------------------- */ static herr_t -H5SM_table_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_master_table_t *table) +H5SM_table_image_len(const void *_thing, size_t *image_len) { - H5WB_t *wb = NULL; /* Wrapped buffer for table data */ - uint8_t tbl_buf[H5SM_TBL_BUF_SIZE]; /* Buffer for table */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5SM_master_table_t *table = (const H5SM_master_table_t *)_thing; - FUNC_ENTER_NOAPI_NOINIT(H5SM_table_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_table_image_len) - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(table); + HDassert(image_len); - if(table->cache_info.is_dirty) { - uint8_t *buf; /* Temporary buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - uint32_t computed_chksum; /* Computed metadata checksum value */ - size_t x; /* Counter variable */ + /* Set the image length size */ + *image_len = table->table_size; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5SM_table_image_len() */ - /* Verify that we're writing version 0 of the table; this is the only - * version defined so far. - */ - HDassert(f->shared->sohm_vers == HDF5_SHAREDHEADER_VERSION); + +/*------------------------------------------------------------------------- + * Function: H5SM_table_serialize + * + * Purpose: Serialize the data structure for writing to disk. + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: James Laird + * November 6, 2006 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5SM_table_serialize(const H5F_t * f, hid_t UNUSED dxlp_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) +{ + H5SM_master_table_t *table = (H5SM_master_table_t *)_thing; + uint8_t *p; /* Pointer into raw data buffer */ + uint32_t computed_chksum; /* Computed metadata checksum value */ + size_t x; /* Counter variable */ - /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(tbl_buf, sizeof(tbl_buf)))) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "can't wrap buffer") + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_table_serialize) - /* Get a pointer to a buffer that's large enough for serialized table */ - if(NULL == (buf = H5WB_actual(wb, table->table_size))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "can't get actual buffer") + /* check arguments */ + HDassert(f); + HDassert(image); + HDassert(table); + HDassert(H5F_addr_defined(addr)); - /* Get temporary pointer to buffer for serialized table */ - p = buf; - /* Encode magic number */ - HDmemcpy(p, H5SM_TABLE_MAGIC, (size_t)H5SM_SIZEOF_MAGIC); - p += H5SM_SIZEOF_MAGIC; + /* Verify that we're writing version 0 of the table; this is the only + * version defined so far. + */ + HDassert(f->shared->sohm_vers == HDF5_SHAREDHEADER_VERSION); - /* Encode each index header */ - for(x = 0; x < table->num_indexes; ++x) { - /* Version for this list. */ - *p++ = H5SM_LIST_VERSION; + /* Get temporary pointer to buffer for serialized table */ + p = (uint8_t *)image; - /* Is message index a list or a B-tree? */ - *p++ = table->indexes[x].index_type; + /* Encode magic number */ + HDmemcpy(p, H5SM_TABLE_MAGIC, (size_t)H5SM_SIZEOF_MAGIC); + p += H5SM_SIZEOF_MAGIC; - /* Type of messages in the index */ - UINT16ENCODE(p, table->indexes[x].mesg_types); + /* Encode each index header */ + for(x = 0; x < table->num_indexes; ++x) { + /* Version for this list. */ + *p++ = H5SM_LIST_VERSION; - /* Minimum size of message to share */ - UINT32ENCODE(p, table->indexes[x].min_mesg_size); + /* Is message index a list or a B-tree? */ + *p++ = table->indexes[x].index_type; - /* List cutoff; fewer than this number and index becomes a list */ - UINT16ENCODE(p, table->indexes[x].list_max); + /* Type of messages in the index */ + UINT16ENCODE(p, table->indexes[x].mesg_types); - /* B-tree cutoff; more than this number and index becomes a B-tree */ - UINT16ENCODE(p, table->indexes[x].btree_min); + /* Minimum size of message to share */ + UINT32ENCODE(p, table->indexes[x].min_mesg_size); - /* Number of messages shared */ - UINT16ENCODE(p, table->indexes[x].num_messages); + /* List cutoff; fewer than this number and index becomes a list */ + UINT16ENCODE(p, table->indexes[x].list_max); - /* Address of the actual index */ - H5F_addr_encode(f, &p, table->indexes[x].index_addr); + /* B-tree cutoff; more than this number and index becomes a B-tree */ + UINT16ENCODE(p, table->indexes[x].btree_min); - /* Address of the index's heap */ - H5F_addr_encode(f, &p, table->indexes[x].heap_addr); - } /* end for */ + /* Number of messages shared */ + UINT16ENCODE(p, table->indexes[x].num_messages); - /* Compute checksum on buffer */ - computed_chksum = H5_checksum_metadata(buf, (table->table_size - H5SM_SIZEOF_CHECKSUM), 0); - UINT32ENCODE(p, computed_chksum); + /* Address of the actual index */ + H5F_addr_encode(f, &p, table->indexes[x].index_addr); - /* Write the table to disk */ - HDassert((size_t)(p - buf) == table->table_size); - if(H5F_block_write(f, H5FD_MEM_SOHM_TABLE, addr, table->table_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to save sohm table to disk") + /* Address of the index's heap */ + H5F_addr_encode(f, &p, table->indexes[x].heap_addr); + } /* end for */ - table->cache_info.is_dirty = FALSE; - } /* end if */ + /* Compute checksum on buffer */ + computed_chksum = H5_checksum_metadata(image, (len - H5SM_SIZEOF_CHECKSUM), 0); + UINT32ENCODE(p, computed_chksum); - if(destroy) - if(H5SM_table_dest(f, table) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFREE, FAIL, "unable to destroy sohm table") + /* Reset the cache flags for this operation (metadata not resize or renamed) */ + *flags = 0; -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") + /* Sanity check */ + HDassert((size_t)(p - (uint8_t *)image) == len); - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_table_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5SM_table_serialize() */ /*------------------------------------------------------------------------- - * Function: H5SM_table_dest + * Function: H5SM_table_free_icr * - * Purpose: Frees memory used by the SOHM table. + * Purpose: Destroy/release an "in core representation" of a data structure * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: James Laird - * November 6, 2006 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * Jun 03, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5SM_table_dest(H5F_t UNUSED *f, H5SM_master_table_t* table) +H5SM_table_free_icr(void *thing) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_table_dest) + FUNC_ENTER_NOAPI_NOINIT(H5SM_table_free_icr) - /* Sanity check */ - HDassert(table); - HDassert(table->indexes); + /* Check arguments */ + HDassert(thing); /* Destroy Shared Object Header Message table */ - if(H5SM_table_free(table) < 0) + if(H5SM_table_free((H5SM_master_table_t *)thing) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message table") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_table_dest() */ +} /* end H5SM_table_free_icr() */ /*------------------------------------------------------------------------- - * Function: H5SM_table_clear + * Function: H5SM_list_get_load_size * - * Purpose: Mark this table as no longer being dirty. + * Purpose: Compute the size of the data structure on disk. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * - * Programmer: James Laird - * November 6, 2006 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 18, 2010 * *------------------------------------------------------------------------- */ static herr_t -H5SM_table_clear(H5F_t *f, H5SM_master_table_t *table, hbool_t destroy) +H5SM_list_get_load_size(const void *_udata, size_t *image_len) { - herr_t ret_value = SUCCEED; /* Return value */ + const H5SM_list_cache_ud_t *udata = (const H5SM_list_cache_ud_t *)_udata; /* User data for callback */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_table_clear) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_list_get_load_size) - /* - * Check arguments. - */ - HDassert(table); + /* Check arguments */ + HDassert(udata); + HDassert(image_len); - /* Reset the dirty flag. */ - table->cache_info.is_dirty = FALSE; - - if(destroy) - if(H5SM_table_dest(f, table) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFREE, FAIL, "unable to delete SOHM master table") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_table_clear() */ - - -/*------------------------------------------------------------------------- - * Function: H5SM_table_size - * - * Purpose: Returns the size of the table encoded on disk. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: James Laird - * November 6, 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5SM_table_size(const H5F_t UNUSED *f, const H5SM_master_table_t *table, size_t *size_ptr) -{ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_table_size) - - /* check arguments */ - HDassert(f); - HDassert(table); - HDassert(size_ptr); - - /* Set size value */ - *size_ptr = table->table_size; + /* Set the image length size */ + *image_len = udata->header->list_size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_table_size() */ +} /* end H5SM_list_get_load_size() */ /*------------------------------------------------------------------------- - * Function: H5SM_list_load + * Function: H5SM_list_deserialize * - * Purpose: Loads a list of SOHM messages. + * Purpose: Deserialize the data structure from disk. * - * Return: Non-negative on success/Negative on failure + * Return: Success: Pointer to a new shared message list + * Failure: NULL * * Programmer: James Laird * November 6, 2006 * *------------------------------------------------------------------------- */ -static H5SM_list_t * -H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) +static void * +H5SM_list_deserialize(const void *image, size_t UNUSED len, void *_udata, + hbool_t UNUSED *dirty) { H5SM_list_t *list; /* The SOHM list being read in */ H5SM_list_cache_ud_t *udata = (H5SM_list_cache_ud_t *)_udata; /* User data for callback */ - H5WB_t *wb = NULL; /* Wrapped buffer for list index data */ - uint8_t lst_buf[H5SM_LST_BUF_SIZE]; /* Buffer for list index */ - uint8_t *buf; /* Reading buffer */ - uint8_t *p; /* Pointer into input buffer */ + const uint8_t *p; /* Pointer into input buffer */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ size_t x; /* Counter variable for messages in list */ H5SM_list_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_list_load) + FUNC_ENTER_NOAPI_NOINIT(H5SM_list_deserialize) /* Sanity check */ HDassert(udata->header); @@ -480,20 +480,8 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) list->header = udata->header; - /* Wrap the local buffer for serialized list index info */ - if(NULL == (wb = H5WB_wrap(lst_buf, sizeof(lst_buf)))) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, NULL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for serialized list index */ - if(NULL == (buf = H5WB_actual(wb, udata->header->list_size))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "can't get actual buffer") - - /* Read list from disk */ - if(H5F_block_read(f, H5FD_MEM_SOHM_INDEX, addr, udata->header->list_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_READERROR, NULL, "can't read SOHM list") - /* Get temporary pointer to serialized list index */ - p = buf; + p = (const uint8_t *)image; /* Check magic number */ if(HDmemcmp(p, H5SM_LIST_MAGIC, (size_t)H5SM_SIZEOF_MAGIC)) @@ -511,10 +499,10 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) UINT32DECODE(p, stored_chksum); /* Sanity check */ - HDassert((size_t)(p - buf) <= udata->header->list_size); + HDassert((size_t)(p - (const uint8_t *)image) <= len); /* Compute checksum on entire header */ - computed_chksum = H5_checksum_metadata(buf, ((size_t)(p - buf) - H5SM_SIZEOF_CHECKSUM), 0); + computed_chksum = H5_checksum_metadata(image, ((size_t)(p - (const uint8_t *)image) - H5SM_SIZEOF_CHECKSUM), 0); /* Verify checksum */ if(stored_chksum != computed_chksum) @@ -529,111 +517,54 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) done: /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CLOSEERROR, NULL, "can't close wrapped buffer") if(!ret_value && list) { if(list->messages) - list->messages = H5FL_ARR_FREE(H5SM_sohm_t, list->messages); + list->messages = (H5SM_sohm_t *)H5FL_ARR_FREE(H5SM_sohm_t, list->messages); list = H5FL_FREE(H5SM_list_t, list); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_list_load() */ +} /* end H5SM_list_deserialize() */ /*------------------------------------------------------------------------- - * Function: H5SM_list_flush + * Function: H5SM_list_image_len * - * Purpose: Flush this list index. + * Purpose: Compute the size of the data structure on disk. * * Return: Non-negative on success/Negative on failure * - * Programmer: James Laird - * November 6, 2006 + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 20 2010 * *------------------------------------------------------------------------- */ static herr_t -H5SM_list_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_list_t *list) +H5SM_list_image_len(const void *_thing, size_t *image_len) { - H5WB_t *wb = NULL; /* Wrapped buffer for list index data */ - uint8_t lst_buf[H5SM_LST_BUF_SIZE]; /* Buffer for list index */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5SM_list_t *list = (const H5SM_list_t *)_thing; - FUNC_ENTER_NOAPI_NOINIT(H5SM_list_flush) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_list_image_len) - /* check arguments */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + /* Check arguments */ HDassert(list); - HDassert(list->header); - - if(list->cache_info.is_dirty) { - uint8_t *buf; /* Temporary buffer */ - uint8_t *p; /* Pointer into raw data buffer */ - uint32_t computed_chksum; /* Computed metadata checksum value */ - size_t mesgs_written; /* Number of messages written to list */ - size_t x; /* Local index variable */ - - /* Wrap the local buffer for serialized list index info */ - if(NULL == (wb = H5WB_wrap(lst_buf, sizeof(lst_buf)))) - HGOTO_ERROR(H5E_SOHM, H5E_CANTINIT, FAIL, "can't wrap buffer") - - /* Get a pointer to a buffer that's large enough for serialized list index */ - if(NULL == (buf = H5WB_actual(wb, list->header->list_size))) - HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, FAIL, "can't get actual buffer") - - /* Get temporary pointer to buffer for serialized list index */ - p = buf; - - /* Encode magic number */ - HDmemcpy(p, H5SM_LIST_MAGIC, (size_t)H5SM_SIZEOF_MAGIC); - p += H5SM_SIZEOF_MAGIC; - - /* Write messages from the messages array to disk */ - mesgs_written = 0; - for(x = 0; x < list->header->list_max && mesgs_written < list->header->num_messages; x++) { - if(list->messages[x].location != H5SM_NO_LOC) { - if(H5SM_message_encode(f, p, &(list->messages[x])) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to write shared message to disk") - - p+=H5SM_SOHM_ENTRY_SIZE(f); - ++mesgs_written; - } /* end if */ - } /* end for */ - HDassert(mesgs_written == list->header->num_messages); - - /* Compute checksum on buffer */ - computed_chksum = H5_checksum_metadata(buf, (size_t)(p - buf), 0); - UINT32ENCODE(p, computed_chksum); - - /* Write the list to disk */ - HDassert((size_t)(p - buf) <= list->header->list_size); - if(H5F_block_write(f, H5FD_MEM_SOHM_INDEX, addr, list->header->list_size, dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to save sohm table to disk") - - list->cache_info.is_dirty = FALSE; - } /* end if */ + HDassert(image_len); - if(destroy) - if(H5SM_list_dest(f, list) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFREE, FAIL, "unable to destroy list") + /* Set the image length size */ + *image_len = list->header->list_size; -done: - /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) - HDONE_ERROR(H5E_SOHM, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_list_flush() */ + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5SM_list_image_len() */ /*------------------------------------------------------------------------- - * Function: H5SM_list_dest + * Function: H5SM_list_serialize * - * Purpose: Frees all memory used by the list. + * Purpose: Serialize the data structure for writing to disk. * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * * Programmer: James Laird * November 6, 2006 @@ -641,86 +572,88 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5SM_list_dest(H5F_t UNUSED *f, H5SM_list_t* list) +H5SM_list_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) { - herr_t ret_value = SUCCEED; /* Return value */ + H5SM_list_t *list = (H5SM_list_t *)_thing; + uint8_t *p; /* Pointer into raw data buffer */ + uint32_t computed_chksum; /* Computed metadata checksum value */ + size_t mesgs_written; /* Number of messages written to list */ + size_t x; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5SM_list_dest) + FUNC_ENTER_NOAPI_NOINIT(H5SM_list_serialize) + /* check arguments */ + HDassert(f); + HDassert(image); HDassert(list); - HDassert(list->messages); + HDassert(list->header); - /* Destroy Shared Object Header Message list */ - if(H5SM_list_free(list) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message list") + /* Get temporary pointer to buffer for serialized list index */ + p = (uint8_t *)image; -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5SM_list_dest() */ + /* Encode magic number */ + HDmemcpy(p, H5SM_LIST_MAGIC, (size_t)H5SM_SIZEOF_MAGIC); + p += H5SM_SIZEOF_MAGIC; - -/*------------------------------------------------------------------------- - * Function: H5SM_list_clear - * - * Purpose: Marks a list as not dirty. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: James Laird - * November 6, 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5SM_list_clear(H5F_t *f, H5SM_list_t *list, hbool_t destroy) -{ - herr_t ret_value = SUCCEED; /* Return value */ + /* Write messages from the messages array to disk */ + mesgs_written = 0; + for(x = 0; x < list->header->list_max && mesgs_written < list->header->num_messages; x++) { + if(list->messages[x].location != H5SM_NO_LOC) { + if(H5SM_message_encode(f, p, &(list->messages[x])) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to write shared message to disk") - FUNC_ENTER_NOAPI_NOINIT(H5SM_list_clear) + p+=H5SM_SOHM_ENTRY_SIZE(f); + ++mesgs_written; + } /* end if */ + } /* end for */ + HDassert(mesgs_written == list->header->num_messages); - /* - * Check arguments. - */ - HDassert(list); + /* Compute checksum on buffer */ + computed_chksum = H5_checksum_metadata(image, (size_t)(p - (uint8_t *)image), 0); + UINT32ENCODE(p, computed_chksum); - /* Reset the dirty flag. */ - list->cache_info.is_dirty = FALSE; + /* Reset the cache flags for this operation (metadata not resize or renamed) */ + *flags = 0; - if(destroy) - if(H5SM_list_dest(f, list) < 0) - HGOTO_ERROR(H5E_SOHM, H5E_CANTFREE, FAIL, "unable to destroy SOHM list") + /* Sanity check */ + HDassert((size_t)(p - (uint8_t *)image) <= len); done: FUNC_LEAVE_NOAPI(ret_value) -} /* end of H5SM_list_clear() */ +} /* end H5SM_list_serialize() */ /*------------------------------------------------------------------------- - * Function: H5SM_list_size + * Function: H5SM_list_free_icr * - * Purpose: Gets the size of a list on disk. + * Purpose: Destroy/release an "in core representation" of a data structure * - * Return: Non-negative on success/Negative on failure + * Return: Success: SUCCEED + * Failure: FAIL * - * Programmer: James Laird - * November 6, 2006 + * Programmer: Mike McGreevy + * mcgreevy@hdfgroup.org + * Jun 03, 2008 * *------------------------------------------------------------------------- */ static herr_t -H5SM_list_size(const H5F_t UNUSED *f, const H5SM_list_t *list, size_t *size_ptr) +H5SM_list_free_icr(void *thing) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_list_size) + herr_t ret_value = SUCCEED; /* Return value */ - /* check arguments */ - HDassert(f); - HDassert(list); - HDassert(list->header); - HDassert(size_ptr); + FUNC_ENTER_NOAPI_NOINIT(H5SM_list_free_icr) - /* Set size value */ - *size_ptr = list->header->list_size; + /* Check arguments */ + HDassert(thing); - FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5SM_list_size() */ + /* Destroy Shared Object Header Message list */ + if(H5SM_list_free((H5SM_list_t *)thing) < 0) + HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message list") +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5SM_list_free_icr() */ diff --git a/test/cache.c b/test/cache.c index 68ff400..0e5f980 100644 --- a/test/cache.c +++ b/test/cache.c @@ -34,9 +34,8 @@ struct flush_cache_test_spec int entry_index; hbool_t insert_flag; unsigned int flags; - hbool_t expected_loaded; - hbool_t expected_cleared; - hbool_t expected_flushed; + hbool_t expected_deserialized; + hbool_t expected_serialized; hbool_t expected_destroyed; }; @@ -50,9 +49,8 @@ struct pe_flush_cache_test_spec int num_pins; int pin_type[MAX_PINS]; int pin_idx[MAX_PINS]; - hbool_t expected_loaded; - hbool_t expected_cleared; - hbool_t expected_flushed; + hbool_t expected_deserialized; + hbool_t expected_serialized; hbool_t expected_destroyed; }; @@ -67,9 +65,8 @@ struct fo_flush_entry_check hbool_t is_dirty; hbool_t is_protected; hbool_t is_pinned; - hbool_t expected_loaded; - hbool_t expected_cleared; - hbool_t expected_flushed; + hbool_t expected_deserialized; + hbool_t expected_serialized; hbool_t expected_destroyed; }; @@ -87,9 +84,8 @@ struct fo_flush_cache_test_spec int pin_idx[MAX_PINS]; int num_flush_ops; struct flush_op flush_ops[MAX_FLUSH_OPS]; - hbool_t expected_loaded; - hbool_t expected_cleared; - hbool_t expected_flushed; + hbool_t expected_deserialized; + hbool_t expected_serialized; hbool_t expected_destroyed; }; @@ -104,19 +100,19 @@ struct move_entry_test_spec /* private function declarations: */ -static void smoke_check_1(void); -static void smoke_check_2(void); -static void smoke_check_3(void); -static void smoke_check_4(void); -static void smoke_check_5(void); -static void smoke_check_6(void); -static void smoke_check_7(void); -static void smoke_check_8(void); -static void smoke_check_9(void); -static void smoke_check_10(void); -static void write_permitted_check(void); -static void check_insert_entry(void); -static void check_flush_cache(void); +static unsigned smoke_check_1(void); +static unsigned smoke_check_2(void); +static unsigned smoke_check_3(void); +static unsigned smoke_check_4(void); +static unsigned smoke_check_5(void); +static unsigned smoke_check_6(void); +static unsigned smoke_check_7(void); +static unsigned smoke_check_8(void); +static unsigned smoke_check_9(void); +static unsigned smoke_check_10(void); +static unsigned write_permitted_check(void); +static unsigned check_insert_entry(void); +static unsigned check_flush_cache(void); static void check_flush_cache__empty_cache(H5F_t * file_ptr); static void check_flush_cache__multi_entry(H5F_t * file_ptr); static void check_flush_cache__multi_entry_test(H5F_t * file_ptr, @@ -137,22 +133,21 @@ static void check_flush_cache__single_entry_test(H5F_t * file_ptr, hbool_t insert_flag, unsigned int flags, unsigned int flush_flags, - hbool_t expected_loaded, - hbool_t expected_cleared, - hbool_t expected_flushed, + hbool_t expected_deserialized, + hbool_t expected_serialized, hbool_t expected_destroyed); static void check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, int test_num, int entry_type, int entry_idx, + hbool_t unprot_dirty_flag, hbool_t mark_dirty, hbool_t pop_mark_dirty_prot, hbool_t pop_mark_dirty_pinned, hbool_t unprotect_unpin, unsigned int flags, unsigned int flush_flags, - hbool_t expected_cleared, - hbool_t expected_flushed, + hbool_t expected_serialized, hbool_t expected_destroyed); static void check_flush_cache__flush_ops(H5F_t * file_ptr); static void check_flush_cache__flush_op_test(H5F_t * file_ptr, @@ -167,36 +162,36 @@ static void check_flush_cache__flush_op_test(H5F_t * file_ptr, int check_size, struct fo_flush_entry_check check[]); static void check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr); -static void check_flush_protected_err(void); -static void check_get_entry_status(void); -static void check_expunge_entry(void); -static void check_multiple_read_protect(void); -static void check_move_entry(void); +static unsigned check_get_entry_status(void); +static unsigned check_expunge_entry(void); +static unsigned check_multiple_read_protect(void); +static unsigned check_move_entry(void); static void check_move_entry__run_test(H5F_t * file_ptr, int test_num, struct move_entry_test_spec * spec_ptr); -static void check_pin_protected_entry(void); -static void check_resize_entry(void); -static void check_evictions_enabled(void); -static void check_destroy_pinned_err(void); -static void check_destroy_protected_err(void); -static void check_duplicate_insert_err(void); -static void check_move_err(void); -static void check_double_pin_err(void); -static void check_double_unpin_err(void); -static void check_pin_entry_errs(void); -static void check_double_protect_err(void); -static void check_double_unprotect_err(void); -static void check_mark_entry_dirty_errs(void); -static void check_expunge_entry_errs(void); -static void check_resize_entry_errs(void); -static void check_unprotect_ro_dirty_err(void); -static void check_protect_ro_rw_err(void); -static void check_check_evictions_enabled_err(void); -static void check_auto_cache_resize(void); -static void check_auto_cache_resize_disable(void); -static void check_auto_cache_resize_epoch_markers(void); -static void check_auto_cache_resize_input_errs(void); -static void check_auto_cache_resize_aux_fcns(void); +static unsigned check_pin_protected_entry(void); +static unsigned check_resize_entry(void); +static unsigned check_evictions_enabled(void); +static unsigned check_flush_protected_err(void); +static unsigned check_destroy_pinned_err(void); +static unsigned check_destroy_protected_err(void); +static unsigned check_duplicate_insert_err(void); +static unsigned check_move_err(void); +static unsigned check_double_pin_err(void); +static unsigned check_double_unpin_err(void); +static unsigned check_pin_entry_errs(void); +static unsigned check_double_protect_err(void); +static unsigned check_double_unprotect_err(void); +static unsigned check_mark_entry_dirty_errs(void); +static unsigned check_expunge_entry_errs(void); +static unsigned check_resize_entry_errs(void); +static unsigned check_unprotect_ro_dirty_err(void); +static unsigned check_protect_ro_rw_err(void); +static unsigned check_check_evictions_enabled_err(void); +static unsigned check_auto_cache_resize(void); +static unsigned check_auto_cache_resize_disable(void); +static unsigned check_auto_cache_resize_epoch_markers(void); +static unsigned check_auto_cache_resize_input_errs(void); +static unsigned check_auto_cache_resize_aux_fcns(void); /**************************************************************************/ @@ -226,7 +221,7 @@ static void check_auto_cache_resize_aux_fcns(void); *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_1(void) { const char * fcn_name = "smoke_check_1"; @@ -235,18 +230,31 @@ smoke_check_1(void) int dirty_destroys = FALSE; hbool_t display_stats = FALSE; int32_t lag = 10; + int32_t max_index = (10 * 1024) - 1; int mile_stone = 1; H5F_t * file_ptr = NULL; TESTING("smoke check #1 -- all clean, ins, dest, ren, 4/2 MB cache"); - if ( skip_long_tests ) { + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - SKIPPED(); + case 1: + max_index = (1 * 1024) - 1; + break; - HDfprintf(stdout, " Long tests disabled.\n"); + case 2: + max_index = (512) - 1; + break; - return; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -268,7 +276,8 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -286,7 +295,8 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_backward(/* file_ptr */ file_ptr, + row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -304,7 +314,8 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -333,7 +344,8 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - col_major_scan_forward(/* file_ptr */ file_ptr, + col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -357,7 +369,8 @@ smoke_check_1(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - col_major_scan_backward(/* file_ptr */ file_ptr, + col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -387,7 +400,8 @@ smoke_check_1(void) fcn_name, failure_mssg); } - return; + + return !pass; } /* smoke_check_1() */ @@ -414,7 +428,7 @@ smoke_check_1(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_2(void) { const char * fcn_name = "smoke_check_2"; @@ -422,19 +436,32 @@ smoke_check_2(void) int dirty_unprotects = TRUE; int dirty_destroys = TRUE; hbool_t display_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; TESTING("smoke check #2 -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache"); - if ( skip_long_tests ) { + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - SKIPPED(); + case 1: + max_index = (1 * 1024) - 1; + break; - HDfprintf(stdout, " Long tests disabled.\n"); + case 2: + max_index = (512) - 1; + break; - return; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -456,7 +483,8 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -474,7 +502,8 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_backward(/* file_ptr */ file_ptr, + row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -492,7 +521,8 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -521,7 +551,8 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - col_major_scan_forward(/* file_ptr */ file_ptr, + col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -545,7 +576,8 @@ smoke_check_2(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - col_major_scan_backward(/* file_ptr */ file_ptr, + col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -575,7 +607,7 @@ smoke_check_2(void) fcn_name, failure_mssg); } - return; + return !pass; } /* smoke_check_2() */ @@ -601,7 +633,7 @@ smoke_check_2(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_3(void) { const char * fcn_name = "smoke_check_3"; @@ -609,19 +641,32 @@ smoke_check_3(void) int dirty_unprotects = FALSE; int dirty_destroys = FALSE; hbool_t display_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; TESTING("smoke check #3 -- all clean, ins, dest, ren, 2/1 KB cache"); - if ( skip_long_tests ) { + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - SKIPPED(); + case 1: + max_index = (1 * 1024) - 1; + break; - HDfprintf(stdout, " Long tests disabled.\n"); + case 2: + max_index = (512) - 1; + break; - return; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -643,7 +688,8 @@ smoke_check_3(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -662,6 +708,7 @@ smoke_check_3(void) fcn_name, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -680,6 +727,7 @@ smoke_check_3(void) fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -709,6 +757,7 @@ smoke_check_3(void) fcn_name, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -733,6 +782,7 @@ smoke_check_3(void) fcn_name, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -762,7 +812,7 @@ smoke_check_3(void) fcn_name, failure_mssg); } - return; + return !pass; } /* smoke_check_3() */ @@ -789,7 +839,7 @@ smoke_check_3(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_4(void) { const char * fcn_name = "smoke_check_4"; @@ -797,19 +847,32 @@ smoke_check_4(void) int dirty_unprotects = TRUE; int dirty_destroys = TRUE; hbool_t display_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; TESTING("smoke check #4 -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache"); - if ( skip_long_tests ) { + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - SKIPPED(); + case 1: + max_index = (1 * 1024) - 1; + break; - HDfprintf(stdout, " Long tests disabled.\n"); + case 2: + max_index = (512) - 1; + break; - return; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -831,7 +894,8 @@ smoke_check_4(void) HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); - row_major_scan_forward(/* file_ptr */ file_ptr, + row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -850,6 +914,7 @@ smoke_check_4(void) fcn_name, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -868,6 +933,7 @@ smoke_check_4(void) fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -897,6 +963,7 @@ smoke_check_4(void) fcn_name, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -921,6 +988,7 @@ smoke_check_4(void) fcn_name, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -950,7 +1018,7 @@ smoke_check_4(void) fcn_name, failure_mssg); } - return; + return !pass; } /* smoke_check_4() */ @@ -977,7 +1045,7 @@ smoke_check_4(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_5(void) { const char * fcn_name = "smoke_check_5"; @@ -1040,18 +1108,25 @@ smoke_check_5(void) TESTING("smoke check #5 -- all clean, ins, prot, unprot, AR cache 1"); - if ( skip_long_tests ) { - - SKIPPED(); - - HDfprintf(stdout, " Long tests disabled.\n"); + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - return; - } + case 1: + max_index = (1 * 1024) - 1; + break; - if ( run_full_test ) { + case 2: + max_index = (512) - 1; + break; - max_index = (10 * 1024) - 1; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -1186,7 +1261,7 @@ smoke_check_5(void) fcn_name, failure_mssg); } - return; + return !pass; } /* smoke_check_5() */ @@ -1213,7 +1288,7 @@ smoke_check_5(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_6(void) { const char * fcn_name = "smoke_check_6"; @@ -1278,18 +1353,25 @@ smoke_check_6(void) pass = TRUE; - if ( skip_long_tests ) { - - SKIPPED(); - - HDfprintf(stdout, " Long tests disabled.\n"); + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - return; - } + case 1: + max_index = (1 * 1024) - 1; + break; - if ( run_full_test ) { + case 2: + max_index = (512) - 1; + break; - max_index = (10 * 1024) - 1; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } if ( show_progress ) /* 1 */ @@ -1422,7 +1504,7 @@ smoke_check_6(void) fcn_name, failure_mssg); } - return; + return !pass; } /* smoke_check_6() */ @@ -1449,7 +1531,7 @@ smoke_check_6(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_7(void) { const char * fcn_name = "smoke_check_7"; @@ -1513,18 +1595,25 @@ smoke_check_7(void) TESTING("smoke check #7 -- all clean, ins, prot, unprot, AR cache 2"); - if ( skip_long_tests ) { - - SKIPPED(); - - HDfprintf(stdout, " Long tests disabled.\n"); + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - return; - } + case 1: + max_index = (1 * 1024) - 1; + break; - if ( run_full_test ) { + case 2: + max_index = (512) - 1; + break; - max_index = (10 * 1024) - 1; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -1659,7 +1748,7 @@ smoke_check_7(void) fcn_name, failure_mssg); } - return; + return !pass; } /* smoke_check_7() */ @@ -1686,7 +1775,7 @@ smoke_check_7(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_8(void) { const char * fcn_name = "smoke_check_8"; @@ -1750,18 +1839,25 @@ smoke_check_8(void) TESTING("smoke check #8 -- ~1/2 dirty, ins, prot, unprot, AR cache 2"); - if ( skip_long_tests ) { - - SKIPPED(); - - HDfprintf(stdout, " Long tests disabled.\n"); + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - return; - } + case 1: + max_index = (1 * 1024) - 1; + break; - if ( run_full_test ) { + case 2: + max_index = (512) - 1; + break; - max_index = (10 * 1024) - 1; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -1896,7 +1992,7 @@ smoke_check_8(void) fcn_name, failure_mssg); } - return; + return !pass; } /* smoke_check_8() */ @@ -1924,7 +2020,7 @@ smoke_check_8(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_9(void) { const char * fcn_name = "smoke_check_9"; @@ -1934,6 +2030,7 @@ smoke_check_9(void) int dirty_destroys = FALSE; hbool_t display_stats = FALSE; hbool_t display_detailed_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; @@ -1941,13 +2038,25 @@ smoke_check_9(void) TESTING("smoke check #9 -- all clean, ins, dest, ren, 4/2 MB, corked"); - if ( skip_long_tests ) { + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - SKIPPED(); + case 1: + max_index = (1 * 1024) - 1; + break; - HDfprintf(stdout, " Long tests disabled.\n"); + case 2: + max_index = (512) - 1; + break; - return; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -1988,6 +2097,7 @@ smoke_check_9(void) fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2023,6 +2133,7 @@ smoke_check_9(void) fcn_name, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2056,6 +2167,7 @@ smoke_check_9(void) fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2115,6 +2227,7 @@ smoke_check_9(void) fcn_name, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2154,6 +2267,7 @@ smoke_check_9(void) fcn_name, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2199,7 +2313,7 @@ smoke_check_9(void) fcn_name, failure_mssg); } - return; + return !pass; } /* smoke_check_9() */ @@ -2227,7 +2341,7 @@ smoke_check_9(void) *------------------------------------------------------------------------- */ -static void +static unsigned smoke_check_10(void) { const char * fcn_name = "smoke_check_10"; @@ -2237,6 +2351,7 @@ smoke_check_10(void) int dirty_destroys = TRUE; hbool_t display_stats = FALSE; hbool_t display_detailed_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; @@ -2244,13 +2359,25 @@ smoke_check_10(void) TESTING("smoke check #10 -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked"); - if ( skip_long_tests ) { + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; - SKIPPED(); + case 1: + max_index = (1 * 1024) - 1; + break; - HDfprintf(stdout, " Long tests disabled.\n"); + case 2: + max_index = (512) - 1; + break; - return; + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; } pass = TRUE; @@ -2274,6 +2401,7 @@ smoke_check_10(void) fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2307,6 +2435,7 @@ smoke_check_10(void) fcn_name, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2340,6 +2469,7 @@ smoke_check_10(void) fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2399,6 +2529,7 @@ smoke_check_10(void) fcn_name, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2453,6 +2584,7 @@ smoke_check_10(void) fcn_name, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2497,7 +2629,7 @@ smoke_check_10(void) fcn_name, failure_mssg); } - return; + return !pass; } /* smoke_check_10() */ @@ -2521,7 +2653,7 @@ smoke_check_10(void) *------------------------------------------------------------------------- */ -static void +static unsigned write_permitted_check(void) { @@ -2530,6 +2662,7 @@ write_permitted_check(void) const char * fcn_name = "write_permitted_check"; hbool_t show_progress = FALSE; hbool_t display_stats = FALSE; + int32_t max_index = (10 * 1024) - 1; int32_t lag = 10; int mile_stone = 1; H5F_t * file_ptr = NULL; @@ -2540,6 +2673,27 @@ write_permitted_check(void) #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + switch ( express_test ) + { + case 0: + max_index = (10 * 1024) - 1; + break; + + case 1: + max_index = (1 * 1024) - 1; + break; + + case 2: + max_index = (512) - 1; + break; + + default: + SKIPPED(); + HDfprintf(stdout, " Long tests disabled.\n"); + return 0; /* <========== note return */ + break; + } + pass = TRUE; if ( show_progress ) /* 1 */ @@ -2560,6 +2714,7 @@ write_permitted_check(void) fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2580,6 +2735,7 @@ write_permitted_check(void) write_permitted = FALSE; row_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2600,6 +2756,7 @@ write_permitted_check(void) write_permitted = TRUE; row_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2629,6 +2786,7 @@ write_permitted_check(void) fcn_name, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2644,6 +2802,7 @@ write_permitted_check(void) write_permitted = FALSE; col_major_scan_backward(/* file_ptr */ file_ptr, + /* max_index */ max_index, /* lag */ lag, /* verbose */ FALSE, /* reset_stats */ TRUE, @@ -2683,7 +2842,7 @@ write_permitted_check(void) #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - return; + return !pass; } /* write_permitted_check() */ @@ -2709,7 +2868,7 @@ write_permitted_check(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_insert_entry(void) { const char * fcn_name = "check_insert_entry"; @@ -2981,7 +3140,7 @@ check_insert_entry(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_insert_entry() */ @@ -3002,7 +3161,7 @@ check_insert_entry(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_flush_cache(void) { const char * fcn_name = "check_flush_cache"; @@ -3066,7 +3225,7 @@ check_flush_cache(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_flush_cache() */ @@ -3113,8 +3272,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, 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 ) { @@ -3125,8 +3283,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, 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 ) { @@ -3137,8 +3294,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, 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 ) { @@ -3150,8 +3306,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, 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 ) { @@ -3213,9 +3368,8 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 100, /* insert_flag = */ FALSE, /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -3224,9 +3378,8 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 75, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -3235,9 +3388,8 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 25, /* insert_flag = */ TRUE, /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -3245,10 +3397,9 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_type = */ PICO_ENTRY_TYPE, /* entry_index = */ 50, /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -3257,9 +3408,8 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 10, /* insert_flag = */ FALSE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -3268,9 +3418,8 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 20, /* insert_flag = */ FALSE, /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -3279,20 +3428,18 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) /* entry_index = */ 30, /* insert_flag = */ TRUE, /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, + /* entry_num = */ 7, /* entry_type = */ MONSTER_ENTRY_TYPE, /* entry_index = */ 40, /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -3310,92 +3457,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } }; @@ -3412,92 +3551,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE } }; @@ -3514,92 +3645,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } }; @@ -3617,92 +3740,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE } }; @@ -3720,92 +3835,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } }; @@ -3823,92 +3930,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE } }; @@ -3927,92 +4026,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE } }; @@ -4033,92 +4124,84 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } }; @@ -4140,144 +4223,136 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct pe_flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 2, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 2, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 3, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 3, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 4, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 4, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 5, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 5, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 6, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 6, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 7, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, 30, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ FALSE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 7, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, 30, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ FALSE } }; @@ -4294,128 +4369,120 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct pe_flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 2, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1}, + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 2, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1}, /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 3, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 3, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, - -1, -1, -1, -1 -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {10, -1, -1, -1 -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, + -1, -1, -1, -1 -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {10, -1, -1, -1 -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 2, - /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {10, 20, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 2, + /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {10, 20, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 3, - /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - MONSTER_ENTRY_TYPE, - -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {10, 20, 30, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 3, + /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + MONSTER_ENTRY_TYPE, + -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {10, 20, 30, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } }; @@ -4432,119 +4499,111 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct pe_flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE } }; @@ -4562,127 +4621,119 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct pe_flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 4, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 4, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 4, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - PICO_ENTRY_TYPE, - -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 4, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + PICO_ENTRY_TYPE, + -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, + /* expected_destroyed = */ TRUE } }; @@ -4701,123 +4752,115 @@ check_flush_cache__multi_entry(H5F_t * file_ptr) struct pe_flush_cache_test_spec spec[8] = { { - /* entry_num = */ 0, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 100, - /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 0, - /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 0, + /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 1, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 75, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 2, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 25, - /* insert_flag = */ TRUE, - /* flags = */ H5C__NO_FLAGS_SET, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 3, - /* entry_type = */ PICO_ENTRY_TYPE, - /* entry_index = */ 50, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 4, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 10, - /* insert_flag = */ FALSE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 5, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 20, - /* insert_flag = */ FALSE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 6, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 30, - /* insert_flag = */ TRUE, - /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE }, { - /* entry_num = */ 7, - /* entry_type = */ MONSTER_ENTRY_TYPE, - /* entry_index = */ 40, - /* insert_flag = */ TRUE, - /* flags = */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* num_pins = */ 1, - /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, - -1, -1, -1, -1, -1, -1, -1}, - /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ TRUE, - /* expected_flushed = */ FALSE, - /* expected_destroyed = */ TRUE + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* num_pins = */ 1, + /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE, + -1, -1, -1, -1, -1, -1, -1}, + /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1}, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, + /* expected_destroyed = */ TRUE } }; @@ -4936,7 +4979,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, flush_flags); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -4954,21 +4997,18 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - if ( ( entry_ptr->loaded != spec[i].expected_loaded ) || - ( entry_ptr->cleared != spec[i].expected_cleared ) || - ( entry_ptr->flushed != spec[i].expected_flushed ) || + if ( ( entry_ptr->deserialized != spec[i].expected_deserialized ) || + ( entry_ptr->serialized != spec[i].expected_serialized ) || ( entry_ptr->destroyed != spec[i].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, - "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->loaded), - (int)(spec[i].expected_loaded), - (int)(entry_ptr->cleared), - (int)(spec[i].expected_cleared), - (int)(entry_ptr->flushed), - (int)(spec[i].expected_flushed), + "deslzd = %d(%d), slzd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->deserialized), + (int)(spec[i].expected_deserialized), + (int)(entry_ptr->serialized), + (int)(spec[i].expected_serialized), (int)(entry_ptr->destroyed), (int)(spec[i].expected_destroyed)); @@ -5013,8 +5053,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, 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 ) { @@ -5042,10 +5081,9 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; i++; } @@ -5173,8 +5211,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - flush_flags); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -5192,21 +5229,18 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - if ( ( entry_ptr->loaded != spec[i].expected_loaded ) || - ( entry_ptr->cleared != spec[i].expected_cleared ) || - ( entry_ptr->flushed != spec[i].expected_flushed ) || + if ( ( entry_ptr->deserialized != spec[i].expected_deserialized ) || + ( entry_ptr->serialized != spec[i].expected_serialized ) || ( entry_ptr->destroyed != spec[i].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, - "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->loaded), - (int)(spec[i].expected_loaded), - (int)(entry_ptr->cleared), - (int)(spec[i].expected_cleared), - (int)(entry_ptr->flushed), - (int)(spec[i].expected_flushed), + "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->deserialized), + (int)(spec[i].expected_deserialized), + (int)(entry_ptr->serialized), + (int)(spec[i].expected_serialized), (int)(entry_ptr->destroyed), (int)(spec[i].expected_destroyed)); @@ -5251,8 +5285,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, 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 ) { @@ -5280,10 +5313,9 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; i++; } @@ -5371,9 +5403,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -5400,9 +5431,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5419,9 +5449,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5481,9 +5510,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -5510,9 +5538,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -5529,9 +5556,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5569,7 +5595,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 4, /* num_pins = */ 0, @@ -5588,9 +5614,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5607,9 +5632,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5649,7 +5673,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 4, /* num_pins = */ 0, @@ -5668,9 +5692,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -5687,9 +5710,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5710,11 +5732,17 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) if ( pass ) /* test #5 & #6 */ { /* Single entry test verifying that the cache can handle the case in - * which the call back function moves the entry for which it has - * been called. + * which the call back function first resizes and then moves the + * entry for which it has been called. * * Run this entry twice, as the first run moves the entry to its * alternate address, and the second moves it back. + * + * 10/8/07 -- JRM + * Added a resize operation to this test to satisfy the new + * requiremnt that any resize of an entry on flush will always + * be accompanied by a resize. Note that as a result, this + * test becomes redundant with later tests. */ int test_num = 5; /* and 6 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; @@ -5722,7 +5750,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; int expected_index_len = 1; - size_t expected_index_size = VARIABLE_ENTRY_SIZE; + size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; struct fo_flush_cache_test_spec spec[1] = { { @@ -5736,11 +5764,11 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, + /* num_flush_ops = */ 2, /* flush_ops = */ /* op_code: type: idx: flag: size: */ - { { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2 }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, @@ -5749,9 +5777,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5768,9 +5795,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5800,7 +5826,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) */ if ( pass ) { - spec[0].flush_ops[0].flag = TRUE; + spec[0].flush_ops[1].flag = TRUE; test_num = 6; check_flush_cache__flush_op_test(file_ptr, @@ -5828,6 +5854,12 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) * * Run this entry twice, as the first run moves the entry to its * alternate address, and the second moves it back. + * + * 10/8/07 -- JRM + * Added a resize operation to this test to satisfy the new + * requiremnt that any resize of an entry on flush will always + * be accompanied by a resize. Note that as a result, this + * test becomes redundant with later tests. */ int test_num = 7; /* and 8 */ unsigned int flush_flags = H5C__NO_FLAGS_SET; @@ -5835,7 +5867,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) int init_expected_index_len = 1; size_t init_expected_index_size = VARIABLE_ENTRY_SIZE; int expected_index_len = 1; - size_t expected_index_size = VARIABLE_ENTRY_SIZE; + size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2; struct fo_flush_cache_test_spec spec[1] = { { @@ -5849,11 +5881,11 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* num_pins = */ 0, /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0}, /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0}, - /* num_flush_ops = */ 1, + /* num_flush_ops = */ 2, /* flush_ops = */ /* op_code: type: idx: flag: size: */ - { { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 }, - { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, + { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2 }, + { FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 }, @@ -5862,9 +5894,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5881,9 +5912,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -5918,7 +5948,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) flush_flags = H5C__FLUSH_INVALIDATE_FLAG; expected_index_len = 0; expected_index_size = 0; - spec[0].flush_ops[0].flag = TRUE; + spec[0].flush_ops[1].flag = TRUE; spec[0].expected_destroyed = TRUE; check_flush_cache__flush_op_test(file_ptr, @@ -5958,7 +5988,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 2, /* num_pins = */ 0, @@ -5977,9 +6007,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -5996,9 +6025,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -6028,7 +6056,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) */ if ( pass ) { - spec[0].flush_ops[0].flag = TRUE; + spec[0].flush_ops[1].flag = TRUE; test_num = 10; check_flush_cache__flush_op_test(file_ptr, @@ -6071,7 +6099,7 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* entry_type = */ VARIABLE_ENTRY_TYPE, /* entry_index = */ 0, /* insert_flag = */ FALSE, - /* flags = */ H5C__NO_FLAGS_SET, + /* flags = */ H5C__DIRTIED_FLAG, /* resize_flag = */ TRUE, /* new_size = */ VARIABLE_ENTRY_SIZE / 2, /* num_pins = */ 0, @@ -6090,9 +6118,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6109,9 +6136,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -6206,9 +6232,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6225,9 +6250,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6240,9 +6264,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6305,9 +6328,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6324,9 +6346,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -6339,9 +6360,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6403,9 +6423,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6422,9 +6441,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6437,9 +6455,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6501,9 +6518,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6520,9 +6536,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -6535,9 +6550,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -6599,9 +6613,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6618,9 +6631,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6633,9 +6645,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6729,9 +6740,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6748,9 +6758,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6763,9 +6772,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -6871,9 +6879,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6900,9 +6907,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_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -6929,9 +6935,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -6958,9 +6963,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_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -6977,9 +6981,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ TRUE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -6992,9 +6995,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ TRUE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -7007,9 +7009,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -7022,9 +7023,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -7090,9 +7090,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7119,9 +7118,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7148,9 +7146,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7177,9 +7174,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_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE }, { @@ -7206,9 +7202,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7235,9 +7230,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -7254,9 +7248,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7269,9 +7262,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7284,9 +7276,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7299,9 +7290,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -7366,9 +7356,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7395,9 +7384,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7424,9 +7412,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7453,9 +7440,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ TRUE }, { @@ -7482,9 +7468,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7511,9 +7496,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -7530,9 +7514,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7545,9 +7528,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7560,9 +7542,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7575,9 +7556,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -7638,9 +7618,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7667,9 +7646,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -7696,9 +7674,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -7715,9 +7692,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -7775,9 +7751,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7804,9 +7779,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -7833,9 +7807,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -7852,9 +7825,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -7982,9 +7954,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8011,9 +7982,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8040,9 +8010,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8069,9 +8038,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8098,9 +8066,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8127,9 +8094,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8156,9 +8122,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8185,9 +8150,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8214,9 +8178,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8243,9 +8206,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -8262,9 +8224,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8277,9 +8238,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8292,9 +8252,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } @@ -8429,9 +8388,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8458,9 +8416,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8487,9 +8444,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8516,9 +8472,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8545,9 +8500,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8574,9 +8528,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8603,9 +8556,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8632,9 +8584,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8661,9 +8612,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8690,9 +8640,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -8709,9 +8658,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8724,9 +8672,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -8739,9 +8686,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ TRUE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } @@ -8801,9 +8747,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8830,9 +8775,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8859,9 +8803,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8888,9 +8831,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE }, { @@ -8917,9 +8859,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ FALSE } }; @@ -8936,9 +8877,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -8999,9 +8939,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9028,9 +8967,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9057,9 +8995,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9086,9 +9023,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE }, { @@ -9115,9 +9051,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_cleared = */ FALSE, - /* expected_flushed = */ TRUE, + /* expected_deserialized = */ TRUE, + /* expected_serialized = */ TRUE, /* expected_destroyed = */ TRUE } }; @@ -9134,9 +9069,8 @@ check_flush_cache__flush_ops(H5F_t * file_ptr) /* is_dirty = */ FALSE, /* is_protected = */ FALSE, /* is_pinned = */ FALSE, - /* expected_loaded = */ FALSE, - /* expected_cleared = */ FALSE, - /* expected_flushed = */ FALSE, + /* expected_deserialized = */ FALSE, + /* expected_serialized = */ FALSE, /* expected_destroyed = */ FALSE } }; @@ -9275,12 +9209,10 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, ( check[i].is_protected != FALSE ) ) || ( ( check[i].is_pinned != TRUE ) && ( check[i].is_pinned != FALSE ) ) || - ( ( check[i].expected_loaded != TRUE ) && - ( check[i].expected_loaded != FALSE ) ) || - ( ( check[i].expected_cleared != TRUE ) && - ( check[i].expected_cleared != FALSE ) ) || - ( ( check[i].expected_flushed != TRUE ) && - ( check[i].expected_flushed != FALSE ) ) || + ( ( check[i].expected_deserialized != TRUE ) && + ( check[i].expected_deserialized != FALSE ) ) || + ( ( check[i].expected_serialized != TRUE ) && + ( check[i].expected_serialized != FALSE ) ) || ( ( check[i].expected_destroyed != TRUE ) && ( check[i].expected_destroyed != FALSE ) ) ) { @@ -9351,8 +9283,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - flush_flags); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -9371,21 +9302,18 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, base_addr = entries[spec[i].entry_type]; entry_ptr = &(base_addr[spec[i].entry_index]); - if ( ( entry_ptr->loaded != spec[i].expected_loaded ) || - ( entry_ptr->cleared != spec[i].expected_cleared ) || - ( entry_ptr->flushed != spec[i].expected_flushed ) || + if ( ( entry_ptr->deserialized != spec[i].expected_deserialized ) || + ( entry_ptr->serialized != spec[i].expected_serialized ) || ( entry_ptr->destroyed != spec[i].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, - "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->loaded), - (int)(spec[i].expected_loaded), - (int)(entry_ptr->cleared), - (int)(spec[i].expected_cleared), - (int)(entry_ptr->flushed), - (int)(spec[i].expected_flushed), + "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->deserialized), + (int)(spec[i].expected_deserialized), + (int)(entry_ptr->serialized), + (int)(spec[i].expected_serialized), (int)(entry_ptr->destroyed), (int)(spec[i].expected_destroyed)); @@ -9432,9 +9360,8 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, ( entry_ptr->header.is_protected != check[i].is_protected ) || ( entry_ptr->is_pinned != check[i].is_pinned ) || ( entry_ptr->header.is_pinned != check[i].is_pinned ) || - ( entry_ptr->loaded != check[i].expected_loaded ) || - ( entry_ptr->cleared != check[i].expected_cleared ) || - ( entry_ptr->flushed != check[i].expected_flushed ) || + ( entry_ptr->deserialized != check[i].expected_deserialized ) || + ( entry_ptr->serialized != check[i].expected_serialized ) || ( entry_ptr->destroyed != check[i].expected_destroyed ) ) { #if 0 /* This is useful debugging code. Lets keep it around for a while. */ @@ -9489,20 +9416,18 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, (int)(entry_ptr->header.is_pinned), (int)(check[i].is_pinned)); } - if ( entry_ptr->loaded != check[i].expected_loaded ) { - HDfprintf(stdout, "entry_ptr->loaded (expected) = %d (%d).\n", - (int)(entry_ptr->loaded), - (int)(check[i].expected_loaded)); + if ( entry_ptr->deserialized != + check[i].expected_deserialized ) { + HDfprintf(stdout, + "entry_ptr->deserialized (expected) = %d (%d).\n", + (int)(entry_ptr->deserialized), + (int)(check[i].expected_deserialized)); } - if ( entry_ptr->cleared != check[i].expected_cleared ) { - HDfprintf(stdout, "entry_ptr->cleared (expected) = %d (%d).\n", - (int)(entry_ptr->cleared), - (int)(check[i].expected_cleared)); - } - if ( entry_ptr->flushed != check[i].expected_flushed ) { - HDfprintf(stdout, "entry_ptr->flushed (expected) = %d (%d).\n", - (int)(entry_ptr->flushed), - (int)(check[i].expected_flushed)); + if ( entry_ptr->serialized != check[i].expected_serialized ) { + HDfprintf(stdout, + "entry_ptr->serialized (expected) = %d (%d).\n", + (int)(entry_ptr->serialized), + (int)(check[i].expected_serialized)); } if ( entry_ptr->destroyed != check[i].expected_destroyed ) { HDfprintf(stdout, "entry_ptr->destroyed (expected) = %d (%d).\n", @@ -9550,8 +9475,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, 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 ) { @@ -9581,10 +9505,9 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, entry_ptr->size = entry_sizes[spec[i].entry_type]; - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; i++; } @@ -9597,10 +9520,9 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, entry_ptr->size = entry_sizes[check[i].entry_type]; - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; i++; } @@ -9625,6 +9547,15 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr, * * Modifications: * + * JRM -- 10/9/07 + * Modified test to accomodate changes in the cache API. + * In particular, since the cache is now reading and writing + * its own entries, the serialize callback is not called on + * entry eviction unless the entry is dirty. + * + * This fact broke some basic assumptions of the test, and + * necessitated a substantial re-write. + * *------------------------------------------------------------------------- */ @@ -9634,13 +9565,13 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* const char * fcn_name = "check_flush_cache__flush_op_eviction_test"; */ H5C_t * cache_ptr = file_ptr->shared->cache; int i; - int num_variable_entries = 8; + int num_variable_entries = 10; int num_monster_entries = 31; int num_large_entries = 0; herr_t result; test_entry_t * entry_ptr; test_entry_t * base_addr; - struct expected_entry_status expected[8 + 31 + 14] = + struct expected_entry_status expected[10 + 31 + 14] = { /* the expected array is used to maintain a table of the expected status of every * entry used in this test. Note that since the function that processes this @@ -9648,60 +9579,62 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * worry about maintaining the status of entries that we haven't used yet. */ /* entry entry in at main */ - /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: */ - { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE }, - { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }, - { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE } + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: */ + { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE }, + { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/4, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { VARIABLE_ENTRY_TYPE, 8, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { VARIABLE_ENTRY_TYPE, 9, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE }, + { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE } }; if ( cache_ptr == NULL ) { @@ -9754,38 +9687,49 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, - (VARIABLE_ENTRY_SIZE / 2), TRUE); + (VARIABLE_ENTRY_SIZE / 4), TRUE); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 0, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, H5C__NO_FLAGS_SET); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, + (VARIABLE_ENTRY_SIZE / 4), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 2, H5C__NO_FLAGS_SET); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, - (VARIABLE_ENTRY_SIZE / 2), TRUE); + (VARIABLE_ENTRY_SIZE / 4), TRUE); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 3, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4); - resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, - (VARIABLE_ENTRY_SIZE / 2), TRUE); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, H5C__DIRTIED_FLAG); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 4, H5C__NO_FLAGS_SET); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5); resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, - (VARIABLE_ENTRY_SIZE / 2), TRUE); + (VARIABLE_ENTRY_SIZE / 4), TRUE); unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 5, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, H5C__NO_FLAGS_SET); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, + (VARIABLE_ENTRY_SIZE / 2), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 6, H5C__DIRTIED_FLAG); protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7); - unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, H5C__NO_FLAGS_SET); + resize_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, + (VARIABLE_ENTRY_SIZE / 2), TRUE); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 7, H5C__DIRTIED_FLAG); + + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8, H5C__NO_FLAGS_SET); - if ( ( cache_ptr->index_len != 8 ) || - ( cache_ptr->index_size != (4 * (VARIABLE_ENTRY_SIZE / 2)) + + protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9); + unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9, H5C__NO_FLAGS_SET); + + if ( ( cache_ptr->index_len != 10 ) || + ( cache_ptr->index_size != (4 * (VARIABLE_ENTRY_SIZE / 4)) + + (2 * (VARIABLE_ENTRY_SIZE / 2)) + (4 * VARIABLE_ENTRY_SIZE) ) ) { pass = FALSE; @@ -9797,33 +9741,35 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* Now set up the pinning relationships: * - * Briefly, (VET, 0) is pinned by (VET, 1), (VET, 2), and (VET, 3) - * (VET, 7) is pinned by (VET, 3), and (VET, 5) + * Briefly, (VET, 0) is pinned by (VET, 1), (VET, 3), and (VET, 5) + * (VET, 9) is pinned by (VET, 5), and (VET, 7) */ create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_TYPE, 0); - create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 2, - VARIABLE_ENTRY_TYPE, 0); create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_TYPE, 0); - create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 3, - VARIABLE_ENTRY_TYPE, 7); create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5, - VARIABLE_ENTRY_TYPE, 7); + VARIABLE_ENTRY_TYPE, 0); + create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 5, + VARIABLE_ENTRY_TYPE, 9); + create_pinned_entry_dependency(file_ptr, VARIABLE_ENTRY_TYPE, 7, + VARIABLE_ENTRY_TYPE, 9); /* Next, set up the flush operations: * * Briefly, (VET, 1) dirties (VET, 0) * resizes (VET, 0) to 3/4 VARIABLE_ENTRY_SIZE * - * (VET, 2) dirties (VET, 0) + * (VET, 3) dirties (VET, 0) * resizes (VET, 0) to VARIABLE_ENTRY_SIZE * moves (VET, 0) to its alternate address * - * (VET, 3) dirties (VET, 0) - * resizes itself to VARIABLE_ENTRY_SIZE + * (VET, 5) dirties (VET, 0) + * resizes itself to VARIABLE_ENTRY_SIZE / 2 + * + * (VET, 7) dirties (VET, 9) * - * (VET, 7) dirties (VET, 6) + * (VET, 9) dirties (VET, 8) */ add_flush_op(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0); @@ -9831,20 +9777,23 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) VARIABLE_ENTRY_TYPE, 0, TRUE, 3 * VARIABLE_ENTRY_SIZE / 4); - add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__DIRTY, + add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0); - add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__RESIZE, + add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, TRUE, VARIABLE_ENTRY_SIZE); - add_flush_op(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__MOVE, + add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__MOVE, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0); - add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__DIRTY, + add_flush_op(VARIABLE_ENTRY_TYPE, 5, FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0); - add_flush_op(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__RESIZE, - VARIABLE_ENTRY_TYPE, 3, TRUE, VARIABLE_ENTRY_SIZE); + add_flush_op(VARIABLE_ENTRY_TYPE, 5, FLUSH_OP__RESIZE, + VARIABLE_ENTRY_TYPE, 5, TRUE, VARIABLE_ENTRY_SIZE / 2); add_flush_op(VARIABLE_ENTRY_TYPE, 7, FLUSH_OP__DIRTY, - VARIABLE_ENTRY_TYPE, 6, FALSE, (size_t)0); + VARIABLE_ENTRY_TYPE, 9, FALSE, (size_t)0); + + add_flush_op(VARIABLE_ENTRY_TYPE, 9, FLUSH_OP__DIRTY, + VARIABLE_ENTRY_TYPE, 8, FALSE, (size_t)0); } if ( pass ) { @@ -9855,25 +9804,31 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * in * entry: cache? size: dirty? pinned? pins: flush operations: * - * (VET, 0) Y 5 KB Y Y - - + * (VET, 0) Y 2.5 KB Y Y - - * - * (VET, 1) Y 10 KB N N 0 dirty (VET, 0), + * (VET, 1) Y 2.5 KB Y N 0 dirty (VET, 0), * resize (VET, 0) to 7.5 KB * - * (VET, 2) Y 10 KB N N 0 dirty (VET, 0) + * (VET, 2) Y 10 KB N N - - + * + * + * (VET, 3) Y 2.5 KB N N 0 dirty (VET, 0) * resize (VET, 0) to 10 KB * move (VET, 0) to its alternate address * - * (VET, 3) Y 5 KB Y N 0, 7 dirty (VET, 0) - * resize (VET, 3) to 10 KB + * (VET, 4) Y 10 KB N N - - + * + * + * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) + * resize (VET, 5) to 5 KB * - * (VET, 4) Y 5 KB Y N - - + * (VET, 6) Y 5 KB Y N - - * - * (VET, 5) Y 5 KB Y N 7 - + * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) * - * (VET, 6) Y 10 KB N N - - + * (VET, 8) Y 10 KB N N - - * - * (VET, 7) Y 10 KB N Y - dirty (VET, 6) + * (VET, 9) Y 10 KB N N - dirty (VET, 8) * * Recall that in this test bed, flush operations are excuted the * first time the associated entry is flushed, and are then @@ -9894,9 +9849,10 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) } /* The cache should now be exactly full */ - if ( ( cache_ptr->index_len != 40 ) || + if ( ( cache_ptr->index_len != 42 ) || ( cache_ptr->index_size != 2 * 1024 * 1024 ) || - ( cache_ptr->index_size != ((4 * VARIABLE_ENTRY_SIZE / 2) + + ( cache_ptr->index_size != ((4 * VARIABLE_ENTRY_SIZE / 4) + + (2 * VARIABLE_ENTRY_SIZE / 2) + (4 * VARIABLE_ENTRY_SIZE) + (31 * MONSTER_ENTRY_SIZE) + (1 * LARGE_ENTRY_SIZE)) ) ) { @@ -9919,7 +9875,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { /* Now load a large entry. This should result in the eviction - * of (VET,1), and the increase in the size of (VET, 0) from .5 + * of (VET,2), and the increase in the size of (VET, 0) from .25 * VARIABLE_ENTRY_SIZE to .75 VARIABLE_ENTRY_SIZE. * * The following table illustrates the intended state of affairs @@ -9930,44 +9886,50 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 7.5 KB Y Y - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) Y 2.5 KB N N - - * - * (VET, 2) Y 10 KB N N 0 dirty (VET, 0) + * (VET, 2) N 10 KB N N - - + * + * (VET, 3) Y 2.5 KB Y N 0 dirty (VET, 0) * resize (VET, 0) to 10 KB * move (VET, 0) to its alternate address * - * (VET, 3) Y 5 KB Y N 0, 7 dirty (VET, 0) - * resize (VET, 3) to 10 KB + * (VET, 4) Y 10 KB N N - - * - * (VET, 4) Y 5 KB Y N - - + * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) + * resize (VET, 5) to 5 KB * - * (VET, 5) Y 5 KB Y N 7 - + * (VET, 6) Y 5 KB Y N - - * - * (VET, 6) Y 10 KB N N - - + * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) * - * (VET, 7) Y 10 KB Y Y - dirty (VET, 6) + * (VET, 8) Y 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ - expected[0].size = 3 * VARIABLE_ENTRY_SIZE / 4; - expected[1].in_cache = FALSE; - expected[1].flushed = TRUE; - expected[1].destroyed = TRUE; + expected[0].size = 3 * VARIABLE_ENTRY_SIZE / 4; + expected[1].is_dirty = FALSE; + expected[1].serialized = TRUE; + expected[2].in_cache = FALSE; + expected[2].destroyed = TRUE; num_large_entries = 2; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 1); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 1, H5C__DIRTIED_FLAG); - if ( ( cache_ptr->index_len != 40 ) || + if ( ( cache_ptr->index_len != 42 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - (VARIABLE_ENTRY_SIZE) + - (VARIABLE_ENTRY_SIZE / 4) + + (VARIABLE_ENTRY_SIZE / 2) + (LARGE_ENTRY_SIZE) ) || - ( cache_ptr->index_size != ((1 * 3 * VARIABLE_ENTRY_SIZE / 4 ) + - (3 * VARIABLE_ENTRY_SIZE / 2 ) + - (3 * VARIABLE_ENTRY_SIZE) + - (31 * MONSTER_ENTRY_SIZE) + + ( cache_ptr->index_size != ((1 * (3 * VARIABLE_ENTRY_SIZE / 4)) + + (3 * VARIABLE_ENTRY_SIZE / 4) + + (2 * VARIABLE_ENTRY_SIZE / 2) + + (3 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + (2 * LARGE_ENTRY_SIZE)) ) ) { pass = FALSE; failure_mssg = "unexpected size/len in flush op eviction test 3."; @@ -9983,8 +9945,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { /* Now load another large entry. This should result in the eviction - * of (VET, 2), the increase in the size of (VET, 0) from .75 - * VARIABLE_ENTRY_SIZE to 1.0 VARIABLE_ENTRY_SIZE, and the moving + * of (VET, 4), the increase in the size of (VET, 0) from .75 + * VARIABLE_ENTRY_SIZE to 1.0 VARIABLE_ENTRY_SIZE, and the renaming * of (VET, 0) to its alternate address. * * The following table shows the expected states of the variable @@ -9995,40 +9957,46 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 10 KB Y Y - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) Y 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) Y 5 KB Y N 0, 7 dirty (VET, 0) - * resize (VET, 3) to 10 KB + * (VET, 3) Y 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - + * + * (VET, 5) Y 2.5 KB Y N 0, 9 dirty (VET, 0) + * resize (VET, 5) to 5 KB * - * (VET, 4) Y 5 KB Y N - - + * (VET, 6) Y 5 KB Y N - - * - * (VET, 5) Y 5 KB Y N 7 - + * (VET, 7) Y 5 KB Y N 9 dirty (VET, 9) * - * (VET, 6) Y 10 KB N N - - + * (VET, 8) Y 10 KB N N - - * - * (VET, 7) Y 10 KB Y Y - dirty (VET, 6) + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ expected[0].size = VARIABLE_ENTRY_SIZE; expected[0].at_main_addr = FALSE; - expected[2].in_cache = FALSE; - expected[2].flushed = TRUE; - expected[2].destroyed = TRUE; + expected[3].is_dirty = FALSE; + expected[3].serialized = TRUE; + expected[4].in_cache = FALSE; + expected[4].destroyed = TRUE; num_large_entries = 3; protect_entry(file_ptr, LARGE_ENTRY_TYPE, 2); unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 2, H5C__DIRTIED_FLAG); - if ( ( cache_ptr->index_len != 40 ) || + if ( ( cache_ptr->index_len != 42 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - (2 * VARIABLE_ENTRY_SIZE) + - (VARIABLE_ENTRY_SIZE / 2) + + (3 * VARIABLE_ENTRY_SIZE / 4) + (2 * LARGE_ENTRY_SIZE) ) || - ( cache_ptr->index_size != ((3 * VARIABLE_ENTRY_SIZE / 2) + + ( cache_ptr->index_size != ((3 * VARIABLE_ENTRY_SIZE / 4) + + (2 * VARIABLE_ENTRY_SIZE / 2) + (3 * VARIABLE_ENTRY_SIZE) + (31 * MONSTER_ENTRY_SIZE) + (3 * LARGE_ENTRY_SIZE)) ) ) { @@ -10046,13 +10014,14 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { - /* load two more large entries. This should result in (VET, 3) being - * flushed, and increasing its size from 1/2 VARIABLE_ENTRY_SIZE to + /* load two more large entries. This should result in (VET, 5) being + * flushed, and increasing its size from 1/4 VARIABLE_ENTRY_SIZE to * VARIABLE_ENTRY_SIZE. * * As a result of this size increase, the cache will have to look - * for another entry to evict. After flushing (VET, 4) and (VET, 5), - * it should evict (VET, 6), yielding the needed memory. + * for another entry to evict. After flushing (VET, 6) and (VET, 7), + * it should evict (VET, 8), yielding the needed memory and dirtying + * (VET, 9). * * The following table shows the expected states of the variable * size entries after the test. @@ -10062,33 +10031,37 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 10 KB Y Y - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) Y 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) Y 10 KB N N 0, 7 - + * (VET, 3) Y 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - * - * (VET, 4) Y 5 KB N N - - + * (VET, 5) Y 5 KB N N 0, 9 - * - * (VET, 5) Y 5 KB N N 7 - + * (VET, 6) Y 5 KB N N - - * - * (VET, 6) N 10 KB N N - - + * (VET, 7) Y 5 KB N N 9 - * - * (VET, 7) Y 10 KB Y Y - dirty (VET, 6) + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ - expected[3].size = VARIABLE_ENTRY_SIZE; - expected[3].is_dirty = FALSE; - expected[3].flushed = TRUE; - expected[4].is_dirty = FALSE; - expected[4].flushed = TRUE; + expected[5].size = VARIABLE_ENTRY_SIZE / 2; expected[5].is_dirty = FALSE; - expected[5].flushed = TRUE; - expected[6].in_cache = FALSE; - expected[6].flushed = TRUE; - expected[6].destroyed = TRUE; + expected[5].serialized = TRUE; + expected[6].is_dirty = FALSE; + expected[6].serialized = TRUE; + expected[7].is_dirty = FALSE; + expected[7].serialized = TRUE; + expected[8].in_cache = FALSE; + expected[8].destroyed = TRUE; + expected[9].is_dirty = TRUE; num_large_entries = 5; @@ -10099,13 +10072,15 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) unprotect_entry(file_ptr, LARGE_ENTRY_TYPE, 4, H5C__DIRTIED_FLAG); /* verify cache size */ - if ( ( cache_ptr->index_len != 41 ) || + if ( ( cache_ptr->index_len != 43 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - (3 * VARIABLE_ENTRY_SIZE) + - (1 * VARIABLE_ENTRY_SIZE ) + /* size increases of (VET, 0) & (VET, 3) */ + (1 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 4) + (4 * LARGE_ENTRY_SIZE) ) || - ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 2) + - (3 * VARIABLE_ENTRY_SIZE) + + ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 2) + + (2 * VARIABLE_ENTRY_SIZE) + (31 * MONSTER_ENTRY_SIZE) + (5 * LARGE_ENTRY_SIZE)) ) ) { @@ -10126,7 +10101,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * cache to bring all the VARIABLE_ENTRY_TYPE entries to the * end of the LRU list. * - * Note that we don't have to worry about (VET, 0) and (VET, 7) + * Note that we don't have to worry about (VET, 0) and (VET, 9) * as they are pinned and thus not in the LRU list to begin with. */ for ( i = 0; i < 31; i++ ) @@ -10142,10 +10117,17 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) } /* verify cache size */ - if ( ( cache_ptr->index_len != 41 ) || + if ( ( cache_ptr->index_len != 43 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - - (2 * VARIABLE_ENTRY_SIZE) + - (4 * LARGE_ENTRY_SIZE) ) ) { + (3 * VARIABLE_ENTRY_SIZE) + + (1 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 4) + + (4 * LARGE_ENTRY_SIZE) ) || + ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 2) + + (2 * VARIABLE_ENTRY_SIZE) + + (31 * MONSTER_ENTRY_SIZE) + + (5 * LARGE_ENTRY_SIZE)) ) ) { pass = FALSE; failure_mssg = "unexpected size/len in flush op eviction test 6."; @@ -10161,7 +10143,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { /* Now load three more large entries. This should result - * in the eviction of (VET, 3), and the unpinning of (VET, 0) + * in the evictions of (VET, 1), (VET, 3), and (VET, 5), and the + * unpinning of (VET, 0) * * The following table shows the expected states of the variable * size entries after the test. @@ -10171,26 +10154,34 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 10 KB Y N - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) N 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) N 10 KB N N - - + * (VET, 3) N 2.5 KB N N - - + * + * (VET, 4) N 10 KB N N - - + * + * (VET, 5) N 5 KB N N - - * - * (VET, 4) Y 5 KB N N - - + * (VET, 6) Y 5 KB N N - - * - * (VET, 5) Y 5 KB N N 7 - + * (VET, 7) Y 5 KB N N 9 - * - * (VET, 6) N 10 KB N N - - + * (VET, 8) N 10 KB N N - - * - * (VET, 7) Y 10 KB Y Y - dirty (VET, 6) + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ expected[0].is_pinned = FALSE; + expected[1].in_cache = FALSE; + expected[1].destroyed = TRUE; expected[3].in_cache = FALSE; expected[3].destroyed = TRUE; + expected[5].in_cache = FALSE; + expected[5].destroyed = TRUE; num_large_entries = 8; @@ -10203,7 +10194,9 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* verify cache size */ if ( ( cache_ptr->index_len != 43 ) || ( cache_ptr->index_size != (2 * 1024 * 1024) - - (3 * VARIABLE_ENTRY_SIZE) + + (4 * VARIABLE_ENTRY_SIZE) + + (1 * VARIABLE_ENTRY_SIZE / 4) + + (3 * VARIABLE_ENTRY_SIZE / 4) + (7 * LARGE_ENTRY_SIZE) ) || ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 2) + (2 * VARIABLE_ENTRY_SIZE) + @@ -10223,7 +10216,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { - /* load another large entry. (VET, 4) should be evicted. + /* load another large entry. (VET, 6) should be evicted. * * The following table shows the expected states of the variable * size entries after the test. @@ -10233,25 +10226,29 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 10 KB Y N - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) N 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) N 10 KB N N - - + * (VET, 3) N 2.5 KB N N - - * - * (VET, 4) N 5 KB N N - - + * (VET, 4) N 10 KB N N - - * - * (VET, 5) Y 5 KB N N 7 - + * (VET, 5) N 5 KB N N - - + * + * (VET, 6) N 5 KB N N - - * - * (VET, 6) N 10 KB N N - - + * (VET, 7) Y 5 KB N N 9 - * - * (VET, 7) Y 10 KB Y Y - dirty (VET, 6) + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) Y 10 KB N Y - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ - expected[4].in_cache = FALSE; - expected[4].destroyed = TRUE; + expected[6].in_cache = FALSE; + expected[6].destroyed = TRUE; num_large_entries = 9; @@ -10287,7 +10284,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* Load another large entry. * - * (VET, 5) should be evicted, and (VET, 7) should be unpinned. + * (VET, 7) should be evicted, and (VET, 9) should be unpinned. * * The following table shows the expected states of the variable * size entries after the test. @@ -10297,26 +10294,30 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) Y 10 KB Y N - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) N 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) N 10 KB N N - - + * (VET, 3) N 2.5 KB N N - - * - * (VET, 4) N 5 KB N N - - + * (VET, 4) N 10 KB N N - - * * (VET, 5) N 5 KB N N - - * - * (VET, 6) N 10 KB N N - - + * (VET, 6) N 5 KB N N - - + * + * (VET, 7) N 5 KB N N - - + * + * (VET, 8) N 10 KB N N - - * - * (VET, 7) Y 10 KB Y N - dirty (VET, 6) + * (VET, 9) Y 10 KB Y N - dirty (VET, 8) * * Start by updating the expected table for the expected changes in entry status: */ - expected[5].in_cache = FALSE; - expected[5].destroyed = TRUE; - expected[7].is_pinned = FALSE; + expected[7].in_cache = FALSE; + expected[7].destroyed = TRUE; + expected[9].is_pinned = FALSE; num_large_entries = 10; @@ -10389,20 +10390,66 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { - /* load two more large entries. + /* load two more large entries. Things get a bit complicated here, + * so I'll go through the operation step by step. + * + * Initially, the cache has 4 KB of empty space, so the first entry + * (LET, 10) is loaded via calls to H5C_protect() H5C_unprotect() + * without causing any evictions. + * + * However, this is not the case for the call of H5C_protect() on + * (LET, 11). + * + * Before inserting (LET, 11), H5C_protect(LET, 11) must try to + * free up at least 4 KB of space. To do this, it starts scanning + * up the LRU list to find entries to evict. + * + * (VET, 0) is at the bottom of the LRU list, and thus is the first + * entry considered. However, it is dirty, so it is moved to the + * top of the LRU list, flushed to disk, and marked clean. + * + * (VET, 9) is the next entry on the bottom of the LRU list. It is + * dirty too, so the cache moves it to the top of the LRU list, + * and calls its serialize callback function to construct an on + * disk image of the entry. + * + * However, this serialize function needs to modify (VET, 8), which + * is currently not in cache. Thus it calls H5C_protect(VET, 8) + * to gain access to it. H5C_protect(VET, 8) loads (VET, 8), and + * then attempts to evict entries to make space for it. (VET, 9) + * has already been moved to the head of the LRU list, so the next + * entries on the LRU are (MET, 0) thru (MET, 30) and (LET, 0) thru + * (LET, 10) -- all of which are dirty, and are therefore flushed + * and moved to the head of the LRU list. + * + * The next entry on the bottom of the LRU list is (VET, 0), which + * is clean, and is therefore evicted to make space for (VET, 8). + * This space is sufficient, so H5C_protect(VET, 8) inserts + * (VET, 8) into the cache's index, marks it as protected, and + * returns to the serialize function for (VET, 9). + * + * When the serialize function for (VET, 9) is done with (VET, 8), it + * calls H5C_unprotect(VET, 8), which markes (VET, 8) as dirty and + * unprotected, and places it at the head of the LRU. + * + * The serialize function for (VET, 9) then returns, and (VET, 9) is + * is written to disk, and marked clean. + * + * At this point, the cache is still full (since (VET, 8) took the + * space created by the eviction of (VET, 0)). Thus + * H5C_protect(LET, 11) continues to look for space. While + * (MET, 0) was the next item on the LRU list when it called the + * serialize function for (VET, 9), the function notices that the + * LRU has been modified, and restarts its search for candidates + * for eviction at the bottom of the LRU. * - * (VET, 0) should be flushed, but not evicted initially since it is dirty. + * (VET, 0) is now at the bottom of the LRU, and is clean. Thus + * it is evicted. This makes sufficient space for (LET, 11), so + * H5C_protect(LET, 11) inserts it into the cache, marks it as + * protected, and returns. * - * (VET, 7) should be evicted, but (VET, 7) has an eviction operation that - * dirties (VET, 6). Since (VET, 6) is not in the cache, it will be loaded. - * Since this results in no net increase in free space, the cache will - * continue to attempt to create free space. - * - * The cache will then flush all the monster and large entries, but since they - * are all dirty, they will not be evicted. - * - * Finally, it will reach (VET, 0) again, and evict it on the second pass. - * This finally makes the necessary space. + * H5C_unprotect(VET, 11) marks (VET, 11) as unprotected, and then + * returns as well. * * The following table shows the expected states of the variable * size entries after the test. @@ -10412,44 +10459,49 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) N 10 KB N N - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) N 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) N 10 KB N N - - + * (VET, 3) N 2.5 KB N N - - * - * (VET, 4) N 5 KB N N - - + * (VET, 4) N 10 KB N N - - * * (VET, 5) N 5 KB N N - - * - * (VET, 6) Y 10 KB Y N - - + * (VET, 6) N 5 KB N N - - * - * (VET, 7) N 10 KB N N - - + * (VET, 7) N 5 KB N N - - * - * Start by updating the expected table for the expected changes in entry status: + * (VET, 8) Y 10 KB Y N - - + * + * (VET, 9) N 10 KB N N - - * - * Note that we reset the loaded, cleared, flushed, and destroyed fields of - * (VET,6) so we can track what is happening. + * Start by updating the expected table for the expected changes in + * entry status: + * + * Note that we reset the loaded, flushed, and destroyed + * fields of (VET,8) so we can track what is happening. */ base_addr = entries[VARIABLE_ENTRY_TYPE]; - entry_ptr = &(base_addr[6]); - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr = &(base_addr[8]); + entry_ptr->deserialized = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->destroyed = FALSE; expected[0].in_cache = FALSE; expected[0].is_dirty = FALSE; - expected[0].flushed = TRUE; + expected[0].serialized = TRUE; expected[0].destroyed = TRUE; - expected[6].in_cache = TRUE; - expected[6].is_dirty = TRUE; - expected[6].loaded = TRUE; - expected[6].flushed = FALSE; - expected[6].destroyed = FALSE; - expected[7].in_cache = FALSE; - expected[7].flushed = TRUE; - expected[7].destroyed = TRUE; + expected[8].in_cache = TRUE; + expected[8].is_dirty = TRUE; + expected[8].deserialized = TRUE; + expected[8].serialized = FALSE; + expected[8].destroyed = FALSE; + expected[9].in_cache = FALSE; + expected[9].is_dirty = FALSE; + expected[9].serialized = TRUE; + expected[9].destroyed = TRUE; num_large_entries = 12; @@ -10460,8 +10512,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) i < num_variable_entries + num_monster_entries + num_large_entries - 1; i++ ) { - expected[i].is_dirty = FALSE; - expected[i].flushed = TRUE; + expected[i].is_dirty = FALSE; + expected[i].serialized = TRUE; } for ( i = 10; i < 12; i++ ) @@ -10540,10 +10592,11 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) /* Load two more large entries. * - * Since (VET, 6) is dirty, at first this will just cause (VET, 6) to be flushed. + * Since (VET, 8) is dirty, at first this will just cause (VET, 8) + * to be flushed. * - * But all other entries in the cache are dirty, so the cache will flush them all, - * and then evict (VET, 6) on the second pass. + * But all other entries in the cache are dirty, so the cache will + * flush them all, and then evict (VET, 8) on the second pass. * * The following table shows the expected states of the variable * size entries after the test. @@ -10553,27 +10606,32 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) * * (VET, 0) N 10 KB N N - - * - * (VET, 1) N 10 KB N N - - + * (VET, 1) N 2.5 KB N N - - * * (VET, 2) N 10 KB N N - - * - * (VET, 3) N 10 KB N N - - + * (VET, 3) N 2.5 KB N N - - * - * (VET, 4) N 5 KB N N - - + * (VET, 4) N 10 KB N N - - * * (VET, 5) N 5 KB N N - - * - * (VET, 6) N 10 KB N N - - + * (VET, 6) N 5 KB N N - - * - * (VET, 7) N 10 KB N N - - + * (VET, 7) N 5 KB N N - - * - * Start by updating the expected table for the expected changes in entry status: + * (VET, 8) N 10 KB N N - - + * + * (VET, 9) N 10 KB N N - - + * + * Start by updating the expected table for the expected changes in + * entry status: */ - expected[6].in_cache = FALSE; - expected[6].is_dirty = FALSE; - expected[6].flushed = TRUE; - expected[6].destroyed = TRUE; + expected[8].in_cache = FALSE; + expected[8].is_dirty = FALSE; + expected[8].serialized = TRUE; + expected[8].destroyed = TRUE; num_large_entries = 14; @@ -10584,8 +10642,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) i < num_variable_entries + num_monster_entries + num_large_entries - 1; i++ ) { - expected[i].is_dirty = FALSE; - expected[i].flushed = TRUE; + expected[i].is_dirty = FALSE; + expected[i].serialized = TRUE; } for ( i = 12; i < 14; i++ ) @@ -10621,8 +10679,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, 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 ) { @@ -10652,18 +10709,18 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr) if ( ( cache_ptr->insertions[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->pinned_insertions[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->clears[VARIABLE_ENTRY_TYPE] != 0 ) || - ( cache_ptr->flushes[VARIABLE_ENTRY_TYPE] != 14 ) || - ( cache_ptr->evictions[VARIABLE_ENTRY_TYPE] != 9 ) || + ( cache_ptr->flushes[VARIABLE_ENTRY_TYPE] != 19 ) || + ( cache_ptr->evictions[VARIABLE_ENTRY_TYPE] != 11 ) || ( cache_ptr->moves[VARIABLE_ENTRY_TYPE] != 1 ) || ( cache_ptr->entry_flush_moves[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->cache_flush_moves[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->pins[VARIABLE_ENTRY_TYPE] != 2 ) || ( cache_ptr->unpins[VARIABLE_ENTRY_TYPE] != 2 ) || - ( cache_ptr->dirty_pins[VARIABLE_ENTRY_TYPE] != 0 ) || + ( cache_ptr->dirty_pins[VARIABLE_ENTRY_TYPE] != 2 ) || ( cache_ptr->pinned_flushes[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->pinned_clears[VARIABLE_ENTRY_TYPE] != 0 ) || ( cache_ptr->size_increases[VARIABLE_ENTRY_TYPE] != 3 ) || - ( cache_ptr->size_decreases[VARIABLE_ENTRY_TYPE] != 4 ) || + ( cache_ptr->size_decreases[VARIABLE_ENTRY_TYPE] != 6 ) || ( cache_ptr->entry_flush_size_changes[VARIABLE_ENTRY_TYPE] != 1 ) || ( cache_ptr->cache_flush_size_changes[VARIABLE_ENTRY_TYPE] != 0 ) ) { @@ -10778,17 +10835,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 1, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 1, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10796,17 +10852,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 2, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 2, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -10814,17 +10869,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 3, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 3, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10832,17 +10886,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 4, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 4, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10850,17 +10903,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 5, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 5, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -10868,17 +10920,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 6, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 6, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -10886,17 +10937,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 7, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 7, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10904,17 +10954,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 8, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 8, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10922,18 +10971,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 9, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 9, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -10941,18 +10989,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 10, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 10, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -10960,18 +11007,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 11, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 11, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10979,18 +11025,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 12, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 12, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -10998,18 +11043,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 13, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 13, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11017,18 +11061,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 14, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 14, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11036,19 +11079,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 15, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 15, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11056,19 +11098,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 16, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 16, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11076,17 +11117,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 17, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 17, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11094,17 +11134,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 18, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 18, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11112,17 +11151,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 19, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 19, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11130,17 +11168,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 20, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 20, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11148,17 +11185,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 21, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 21, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11166,17 +11202,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 22, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 22, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11184,17 +11219,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 23, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 23, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11202,17 +11236,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 24, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 24, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11220,18 +11253,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 25, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 25, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11239,18 +11271,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 26, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 26, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11258,18 +11289,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 27, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 27, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11277,18 +11307,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 28, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 28, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11296,18 +11325,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 29, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 29, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11315,18 +11343,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 30, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 30, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11334,19 +11361,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 31, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 31, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11354,19 +11380,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 32, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ FALSE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + /* file_ptr */ file_ptr, + /* test_num */ 32, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ TRUE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* expected_deserialized */ TRUE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11374,17 +11399,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 33, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 33, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11392,17 +11416,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 34, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 34, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11410,17 +11433,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 35, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 35, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11428,17 +11450,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 36, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 36, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11446,17 +11467,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 37, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 37, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11464,17 +11484,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 38, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 38, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11482,17 +11501,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 39, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 39, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11500,17 +11518,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 40, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 40, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11518,18 +11535,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 41, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 41, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11537,18 +11553,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 42, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 42, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11556,18 +11571,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 43, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 43, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11575,18 +11589,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 44, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 44, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11594,18 +11607,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 45, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 45, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11613,18 +11625,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 46, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 46, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11632,19 +11643,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 47, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 47, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11652,19 +11662,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 48, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 48, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11672,17 +11681,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 49, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 49, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11690,17 +11698,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 50, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__NO_FLAGS_SET, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 50, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11708,17 +11715,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 51, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 51, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11726,17 +11732,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 52, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 52, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11744,17 +11749,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 53, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 53, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11762,17 +11766,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 54, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 54, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11780,17 +11783,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 55, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 55, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11798,17 +11800,16 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 56, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 56, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ FALSE ); } @@ -11816,18 +11817,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 57, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 57, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11835,18 +11835,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 58, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 58, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11854,18 +11853,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 59, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 59, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11873,18 +11871,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 60, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ FALSE + /* file_ptr */ file_ptr, + /* test_num */ 60, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ FALSE ); } @@ -11892,18 +11889,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 61, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 61, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11911,18 +11907,17 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 62, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | - H5C__FLUSH_INVALIDATE_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ FALSE, - /* expected_flushed */ TRUE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 62, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ TRUE, + /* expected_destroyed */ TRUE ); } @@ -11930,19 +11925,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 63, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 63, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11950,19 +11944,18 @@ check_flush_cache__single_entry(H5F_t * file_ptr) check_flush_cache__single_entry_test ( - /* file_ptr */ file_ptr, - /* test_num */ 64, - /* entry_type */ PICO_ENTRY_TYPE, - /* entry_idx */ 0, - /* insert_flag */ TRUE, - /* flags */ H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_MARKED_ENTRIES_FLAG, - /* expected_loaded */ FALSE, - /* expected_cleared */ TRUE, - /* expected_flushed */ FALSE, - /* expected_destroyed */ TRUE + /* file_ptr */ file_ptr, + /* test_num */ 64, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_deserialized */ FALSE, + /* expected_serialized */ FALSE, + /* expected_destroyed */ TRUE ); } @@ -11990,14 +11983,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_cleared, 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_cleared is set to TRUE if we expect - * the entry to be flushed, 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. * @@ -12035,277 +12027,277 @@ check_flush_cache__single_entry(H5F_t * file_ptr) int test_num; int entry_type; int entry_idx; + hbool_t dirty_flag; hbool_t mark_dirty; hbool_t pop_mark_dirty_prot; hbool_t pop_mark_dirty_pinned; hbool_t unprotect_unpin; unsigned int flags; unsigned int flush_flags; - hbool_t expected_cleared; - hbool_t expected_flushed; + hbool_t expected_serialized; hbool_t expected_destroyed; } spec[256] = - /* pop pop - * ent mark mark - * test entry -ry mark dirty dirty unprot flush expect expect expect - * num type idx dirty prot pinned unpin flags flags clear flush destroy + /* pop pop + * ent unprot mark mark + * test entry -ry dirty mark dirty dirty unprot flush expect expect + * num type idx flag dirty prot pinned unpin flags flags srlzd destroy */ - { { 1, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 2, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 3, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 4, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 5, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 6, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 7, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 8, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 9, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 10, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 11, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 12, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 13, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 14, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 15, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 16, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 17, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 18, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 19, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 20, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 21, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 22, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 23, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 24, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 25, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 26, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 27, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 28, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 29, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 30, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 31, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 32, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 33, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 34, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE, FALSE }, - { 35, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 36, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 37, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 38, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 39, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 40, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 41, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 42, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 43, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 44, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 45, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 46, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 47, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 48, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 49, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 50, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 51, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 52, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 53, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 54, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 55, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 56, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 57, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 58, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 59, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 60, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 61, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 62, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 63, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 64, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, TRUE, FALSE }, - { 65, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 66, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 67, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 68, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 69, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 70, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 71, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 72, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 73, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 74, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 75, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 76, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 77, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 78, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 79, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 80, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 81, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 82, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 83, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 84, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 85, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 86, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 87, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 88, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 89, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 90, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 91, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 92, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 93, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 94, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 95, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 96, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 97, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 98, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 99, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 100, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 101, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 102, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 103, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 104, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 105, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 106, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 107, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 108, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE }, - { 109, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 110, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 111, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 112, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 113, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 114, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 115, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 116, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 117, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 118, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 119, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 120, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 121, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 122, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 123, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 124, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 125, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 126, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 127, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 128, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE }, - { 129, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 130, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 131, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 132, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 133, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 134, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 135, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 136, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 137, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 138, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 139, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 140, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 141, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 142, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 143, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 144, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 145, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 146, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 147, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 148, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 149, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 150, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 151, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 152, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 153, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 154, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 155, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 156, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 157, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 158, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 159, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 160, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 161, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 162, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 163, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 164, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 165, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 166, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 167, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 168, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 169, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 170, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 171, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 172, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 173, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 174, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 175, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 176, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 177, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 178, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 179, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 180, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 181, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 182, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 183, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 184, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 185, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 186, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 187, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 188, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 189, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 190, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 191, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 192, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 193, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 194, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 195, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 196, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 197, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 198, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 199, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 200, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 201, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 202, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 203, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 204, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 205, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 206, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 207, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 208, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 209, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 210, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 211, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 212, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 213, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 214, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 215, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 216, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 217, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 218, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 219, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 220, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 221, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 222, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 223, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 224, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 225, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 226, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 227, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 228, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 229, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 230, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 231, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 232, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 233, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 234, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 235, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 236, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE }, - { 237, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 238, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 239, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 240, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 241, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 242, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 243, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 244, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 245, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 246, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 247, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 248, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 249, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 250, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 251, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 252, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 253, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 254, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 255, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE }, - { 256, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, H5C__DIRTIED_FLAG | H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE } }; + { { 1, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 2, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 3, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 4, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 5, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 6, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 7, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 8, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 9, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 10, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 11, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 12, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 13, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 14, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 15, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 16, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 17, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 18, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 19, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 20, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 21, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 22, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 23, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 24, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 25, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 26, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 27, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 28, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 29, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 30, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 31, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 32, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 33, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 34, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, FALSE, FALSE }, + { 35, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 36, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 37, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 38, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 39, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 40, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 41, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 42, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 43, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 44, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 45, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 46, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 47, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 48, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 49, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 50, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 51, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 52, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 53, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 54, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 55, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 56, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 57, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 58, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 59, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 60, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 61, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 62, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 63, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 64, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__NO_FLAGS_SET, TRUE, FALSE }, + { 65, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 66, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 67, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 68, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 69, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 70, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 71, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 72, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 73, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 74, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 75, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 76, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 77, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 78, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 79, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 80, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 81, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 82, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 83, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 84, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 85, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 86, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 87, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 88, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 89, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 90, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 91, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 92, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 93, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 94, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 95, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 96, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 97, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 98, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 99, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 100, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 101, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 102, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 103, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 104, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 105, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 106, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 107, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 108, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE }, + { 109, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 110, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 111, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 112, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 113, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 114, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 115, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 116, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 117, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 118, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 119, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 120, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 121, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 122, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 123, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 124, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 125, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 126, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 127, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 128, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG, TRUE, FALSE }, + { 129, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 130, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 131, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 132, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 133, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 134, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 135, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 136, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 137, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 138, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 139, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 140, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 141, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 142, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 143, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 144, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 145, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 146, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 147, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 148, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 149, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 150, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 151, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 152, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 153, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 154, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 155, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 156, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 157, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 158, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 159, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 160, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 161, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 162, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 163, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 164, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 165, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 166, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 167, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 168, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 169, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 170, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 171, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 172, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 173, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 174, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 175, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 176, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 177, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 178, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 179, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 180, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 181, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 182, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 183, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 184, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 185, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 186, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 187, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 188, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 189, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 190, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 191, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 192, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 193, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 194, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 195, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 196, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 197, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 198, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 199, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 200, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 201, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 202, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 203, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 204, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 205, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 206, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 207, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 208, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 209, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 210, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 211, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 212, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 213, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 214, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 215, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 216, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 217, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 218, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 219, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 220, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 221, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 222, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 223, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 224, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__NO_FLAGS_SET, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 225, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 226, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 227, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 228, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 229, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 230, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 231, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 232, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 233, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 234, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 235, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 236, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 237, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 238, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 239, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 240, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 241, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 242, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 243, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 244, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 245, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 246, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 247, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 248, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 249, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 250, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 251, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 252, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 253, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 254, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 255, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE }, + { 256, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C__SET_FLUSH_MARKER_FLAG, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE } }; i = 0; while ( ( pass ) && ( i < 256 ) ) @@ -12316,14 +12308,14 @@ check_flush_cache__single_entry(H5F_t * file_ptr) /* test_num */ spec[i].test_num, /* entry_type */ spec[i].entry_type, /* entry_idx */ spec[i].entry_idx, + /* dirty_flag */ spec[i].dirty_flag, /* mark_dirty */ spec[i].mark_dirty, /* pop_mark_dirty_prot */ spec[i].pop_mark_dirty_prot, /* pop_mark_dirty_pinned */ spec[i].pop_mark_dirty_pinned, /* unprotect_unpin */ spec[i].unprotect_unpin, /* flags */ spec[i].flags, /* flush_flags */ spec[i].flush_flags, - /* expected_cleared */ spec[i].expected_cleared, - /* expected_flushed */ spec[i].expected_flushed, + /* expected_serialized */ spec[i].expected_serialized, /* expected_destroyed */ spec[i].expected_destroyed ); i++; @@ -12358,9 +12350,8 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, hbool_t insert_flag, unsigned int flags, unsigned int flush_flags, - hbool_t expected_loaded, - hbool_t expected_cleared, - hbool_t expected_flushed, + hbool_t expected_deserialized, + hbool_t expected_serialized, hbool_t expected_destroyed) { /* const char * fcn_name = "check_flush_cache__single_entry_test"; */ @@ -12416,7 +12407,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, flush_flags); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -12426,21 +12417,17 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, flush_flags, test_num); failure_mssg = msg; } - else if ( ( entry_ptr->loaded != expected_loaded ) || - ( entry_ptr->cleared != expected_cleared ) || - ( entry_ptr->flushed != expected_flushed ) || + else if ( ( entry_ptr->deserialized != expected_deserialized ) || + ( entry_ptr->serialized != expected_serialized ) || ( entry_ptr->destroyed != expected_destroyed ) ) { - #if 0 /* This is useful debugging code -- lets keep it for a while */ HDfprintf(stdout, - "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->loaded), - (int)expected_loaded, - (int)(entry_ptr->cleared), - (int)expected_cleared, - (int)(entry_ptr->flushed), - (int)expected_flushed, + "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->deserialized), + (int)expected_deserialized, + (int)(entry_ptr->serialized), + (int)expected_serialized, (int)(entry_ptr->destroyed), (int)expected_destroyed); #endif @@ -12479,8 +12466,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, 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 ) { @@ -12501,10 +12487,9 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr, } else { - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; } } @@ -12541,20 +12526,20 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, int test_num, int entry_type, int entry_idx, + hbool_t unprot_dirty_flag, hbool_t mark_dirty, hbool_t pop_mark_dirty_prot, hbool_t pop_mark_dirty_pinned, hbool_t unprotect_unpin, unsigned int flags, unsigned int flush_flags, - hbool_t expected_cleared, - hbool_t expected_flushed, + hbool_t expected_serialized, hbool_t expected_destroyed) { /* const char *fcn_name = "check_flush_cache__pinned_single_entry_test"; */ H5C_t * cache_ptr = file_ptr->shared->cache; static char msg[128]; - hbool_t expected_loaded = TRUE; + hbool_t expected_deserialized = TRUE; herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -12598,7 +12583,9 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, mark_entry_dirty(entry_type, entry_idx); } - unprotect_entry(file_ptr, entry_type, entry_idx, (flags | H5C__PIN_ENTRY_FLAG)); + unprotect_entry(file_ptr, entry_type, entry_idx, + (unprot_dirty_flag ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | + (flags | H5C__PIN_ENTRY_FLAG)); if ( mark_dirty ) { @@ -12613,8 +12600,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - flush_flags); + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, flush_flags); if ( result < 0 ) { @@ -12624,19 +12610,16 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, flush_flags, test_num); failure_mssg = msg; } - else if ( ( entry_ptr->loaded != expected_loaded ) || - ( entry_ptr->cleared != expected_cleared ) || - ( entry_ptr->flushed != expected_flushed ) || + else if ( ( entry_ptr->deserialized != expected_deserialized ) || + ( entry_ptr->serialized != expected_serialized ) || ( entry_ptr->destroyed != expected_destroyed ) ) { #if 0 /* this is useful debugging code -- keep it around */ HDfprintf(stdout, - "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", - (int)(entry_ptr->loaded), - (int)expected_loaded, - (int)(entry_ptr->cleared), - (int)expected_cleared, - (int)(entry_ptr->flushed), - (int)expected_flushed, + "desrlzd = %d(%d), srlzd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->deserialized), + (int)expected_deserialized, + (int)(entry_ptr->serialized), + (int)expected_serialized, (int)(entry_ptr->destroyed), (int)expected_destroyed); #endif @@ -12680,7 +12663,8 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, protect_entry(file_ptr, entry_type, entry_idx); unprotect_entry(file_ptr, entry_type, entry_idx, - (flags & H5C__DIRTIED_FLAG) | H5C__UNPIN_ENTRY_FLAG); + (unprot_dirty_flag ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | + H5C__UNPIN_ENTRY_FLAG); } else { @@ -12691,8 +12675,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, if ( pass ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, 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 ) { @@ -12713,10 +12696,9 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, } else { - entry_ptr->loaded = FALSE; - entry_ptr->cleared = FALSE; - entry_ptr->flushed = FALSE; - entry_ptr->destroyed = FALSE; + entry_ptr->deserialized = FALSE; + entry_ptr->serialized = FALSE; + entry_ptr->destroyed = FALSE; } } @@ -12740,7 +12722,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr, *------------------------------------------------------------------------- */ -static void +static unsigned check_get_entry_status(void) { const char * fcn_name = "check_get_entry_status"; @@ -12919,7 +12901,7 @@ check_get_entry_status(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_get_entry_status() */ @@ -12936,12 +12918,11 @@ check_get_entry_status(void) * * Modifications: * - * None. * *------------------------------------------------------------------------- */ -static void +static unsigned check_expunge_entry(void) { const char * fcn_name = "check_expunge_entry"; @@ -12994,9 +12975,8 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 1."); failure_mssg = msg; - } else if ( ( entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -13032,9 +13012,8 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 2."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -13045,7 +13024,7 @@ check_expunge_entry(void) } /* Expunge the entry and then verify that it is no longer in the cache. - * Also verify that the entry was loaded, cleared, and destroyed, but + * Also verify that the entry was loaded and destroyed, but * not flushed. */ expunge_entry(file_ptr, 0, 0); @@ -13072,9 +13051,8 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 3."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( ! entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -13114,9 +13092,8 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 4."); failure_mssg = msg; - } else if ( ( entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -13153,9 +13130,8 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 5."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -13166,7 +13142,7 @@ check_expunge_entry(void) } /* Expunge the entry and then verify that it is no longer in the cache. - * Also verify that the entry was loaded, cleared and destroyed, but not + * Also verify that the entry was loaded and destroyed, but not * flushed. */ expunge_entry(file_ptr, 0, 1); @@ -13194,9 +13170,8 @@ check_expunge_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 6."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( ! entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -13219,7 +13194,7 @@ check_expunge_entry(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_expunge_entry() */ @@ -13241,7 +13216,7 @@ check_expunge_entry(void) * *------------------------------------------------------------------------- */ -static void +static unsigned check_multiple_read_protect(void) { const char * fcn_name = "check_multiple_read_protect()"; @@ -13640,7 +13615,7 @@ check_multiple_read_protect(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_multiple_read_protect() */ @@ -13662,7 +13637,7 @@ check_multiple_read_protect(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_move_entry(void) { const char * fcn_name = "check_move_entry"; @@ -13706,13 +13681,13 @@ check_move_entry(void) * * At present, we should do the following tests: * - * 1) move a clean, unprotected, unpinned entry. + * 1) Move a clean, unprotected, unpinned entry. * - * 2) move a dirty, unprotected, unpinned entry. + * 2) Move a dirty, unprotected, unpinned entry. * - * 3) move a clean, unprotected, pinned entry. + * 3) Move a clean, unprotected, pinned entry. * - * 4) move a dirty, unprotected, pinned entry. + * 4) Move a dirty, unprotected, pinned entry. * * In all cases, the entry should have moved to its * new location, and have been marked dirty if it wasn't @@ -13753,7 +13728,7 @@ check_move_entry(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_move_entry() */ @@ -13926,7 +13901,7 @@ check_move_entry__run_test(H5F_t * file_ptr, *------------------------------------------------------------------------- */ -static void +static unsigned check_pin_protected_entry(void) { const char * fcn_name = "check_pin_protected_entry"; @@ -13996,7 +13971,7 @@ check_pin_protected_entry(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_pin_protected_entry() */ @@ -14015,7 +13990,7 @@ check_pin_protected_entry(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_resize_entry(void) { const char * fcn_name = "check_resize_entry"; @@ -14130,9 +14105,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 1."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14154,9 +14128,9 @@ check_resize_entry(void) } else { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14210,9 +14184,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 2."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14236,9 +14209,9 @@ check_resize_entry(void) } else { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14292,9 +14265,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 3."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14356,9 +14328,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 4."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14416,9 +14387,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 5."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14452,9 +14422,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 6."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( ! entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -14558,9 +14527,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 7."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14582,9 +14550,9 @@ check_resize_entry(void) } else { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14640,9 +14608,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 8."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14666,9 +14633,9 @@ check_resize_entry(void) } else { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[LARGE_ENTRY_TYPE]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result < 0 ) { @@ -14722,9 +14689,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 9."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14788,9 +14754,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 10."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14848,9 +14813,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 11."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( entry_ptr->destroyed ) ) { pass = FALSE; @@ -14884,9 +14848,8 @@ check_resize_entry(void) HDsnprintf(msg, (size_t)128, "Unexpected status 12."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( ! entry_ptr->cleared ) || - ( entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -14947,7 +14910,7 @@ check_resize_entry(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_resize_entry() */ @@ -14965,12 +14928,11 @@ check_resize_entry(void) * * Modifications: * - * None. * *------------------------------------------------------------------------- */ -static void +static unsigned check_evictions_enabled(void) { const char * fcn_name = "check_evictions_enabled"; @@ -15164,9 +15126,8 @@ check_evictions_enabled(void) HDsnprintf(msg, (size_t)128, "Unexpected status 1."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( ! entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15227,9 +15188,8 @@ check_evictions_enabled(void) HDsnprintf(msg, (size_t)128, "Unexpected status 2."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( ! entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15431,9 +15391,8 @@ check_evictions_enabled(void) HDsnprintf(msg, (size_t)128, "Unexpected status 3."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( ! entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15467,9 +15426,8 @@ check_evictions_enabled(void) HDsnprintf(msg, (size_t)128, "Unexpected status 4."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( ! entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15595,9 +15553,8 @@ check_evictions_enabled(void) HDsnprintf(msg, (size_t)128, "Unexpected status 5."); failure_mssg = msg; - } else if ( ( ! entry_ptr->loaded ) || - ( entry_ptr->cleared ) || - ( ! entry_ptr->flushed ) || + } else if ( ( ! entry_ptr->deserialized ) || + ( entry_ptr->serialized ) || ( ! entry_ptr->destroyed ) ) { pass = FALSE; @@ -15645,7 +15602,7 @@ check_evictions_enabled(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_evictions_enabled() */ @@ -15666,7 +15623,7 @@ check_evictions_enabled(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_flush_protected_err(void) { const char * fcn_name = "check_flush_protected_err"; @@ -15690,8 +15647,7 @@ check_flush_protected_err(void) protect_entry(file_ptr, 0, 0); - if ( H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, 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"; @@ -15700,8 +15656,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, 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"; @@ -15721,7 +15676,7 @@ check_flush_protected_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_flush_protected_err() */ @@ -15740,12 +15695,13 @@ check_flush_protected_err(void) * * Modifications: * + * *------------------------------------------------------------------------- */ extern H5C_t * saved_cache; -static void +static unsigned check_destroy_pinned_err(void) { const char * fcn_name = "check_destroy_pinned_err()"; @@ -15770,7 +15726,7 @@ check_destroy_pinned_err(void) protect_entry(file_ptr, 0, 0); unprotect_entry(file_ptr, 0, 0, H5C__PIN_ENTRY_FLAG); - if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT) >= 0 ) { + if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) >= 0 ) { pass = FALSE; failure_mssg = "destroy succeeded on cache with pinned entry.\n"; @@ -15779,7 +15735,7 @@ check_destroy_pinned_err(void) unpin_entry(0, 0); - if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT) < 0 ) { + if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { pass = FALSE; failure_mssg = "destroy failed after unpin.\n"; @@ -15812,7 +15768,7 @@ check_destroy_pinned_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_destroy_pinned_err() */ @@ -15833,7 +15789,7 @@ check_destroy_pinned_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_destroy_protected_err(void) { const char * fcn_name = "check_destroy_protected_err"; @@ -15857,7 +15813,7 @@ check_destroy_protected_err(void) protect_entry(file_ptr, 0, 0); - if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT) >= 0 ) { + if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) >= 0 ) { pass = FALSE; failure_mssg = "destroy succeeded on cache with protected entry.\n"; @@ -15866,7 +15822,7 @@ check_destroy_protected_err(void) unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG); - if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT) < 0 ) { + if ( H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) { pass = FALSE; failure_mssg = "destroy failed after unprotect.\n"; @@ -15898,7 +15854,7 @@ check_destroy_protected_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_destroy_protected_err() */ @@ -15919,7 +15875,7 @@ check_destroy_protected_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_duplicate_insert_err(void) { const char * fcn_name = "check_duplicate_insert_err"; @@ -15951,8 +15907,9 @@ check_duplicate_insert_err(void) base_addr = entries[0]; entry_ptr = &(base_addr[0]); - result = H5C_insert_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET); + result = H5C_insert_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__NO_FLAGS_SET); if ( result >= 0 ) { @@ -15976,7 +15933,7 @@ check_duplicate_insert_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_duplicate_insert_err() */ @@ -15997,7 +15954,7 @@ check_duplicate_insert_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_move_err(void) { const char * fcn_name = "check_move_err()"; @@ -16071,7 +16028,7 @@ check_move_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_move_err() */ @@ -16094,7 +16051,7 @@ check_move_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_double_pin_err(void) { const char * fcn_name = "check_double_pin_err()"; @@ -16130,9 +16087,9 @@ check_double_pin_err(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__PIN_ENTRY_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__PIN_ENTRY_FLAG); if ( result > 0 ) { @@ -16159,7 +16116,7 @@ check_double_pin_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_double_pin_err() */ @@ -16182,7 +16139,7 @@ check_double_pin_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_double_unpin_err(void) { const char * fcn_name = "check_double_unpin_err()"; @@ -16216,9 +16173,9 @@ check_double_unpin_err(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__UNPIN_ENTRY_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__UNPIN_ENTRY_FLAG); if ( result > 0 ) { @@ -16258,7 +16215,7 @@ check_double_unpin_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_double_unpin_err() */ @@ -16281,7 +16238,7 @@ check_double_unpin_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_pin_entry_errs(void) { const char * fcn_name = "check_pin_entry_errs()"; @@ -16369,7 +16326,7 @@ check_pin_entry_errs(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_pin_entry_errs() */ @@ -16388,7 +16345,7 @@ check_pin_entry_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_double_protect_err(void) { const char * fcn_name = "check_double_protect_err()"; @@ -16419,8 +16376,9 @@ check_double_protect_err(void) if ( pass ) { - cache_entry_ptr = H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, NULL, H5C__NO_FLAGS_SET); + cache_entry_ptr = H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + &entry_ptr->addr, H5C__NO_FLAGS_SET); if ( cache_entry_ptr != NULL ) { @@ -16447,7 +16405,7 @@ check_double_protect_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_double_protect_err() */ @@ -16466,7 +16424,7 @@ check_double_protect_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_double_unprotect_err(void) { const char * fcn_name = "check_double_unprotect_err()"; @@ -16499,9 +16457,9 @@ check_double_unprotect_err(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__NO_FLAGS_SET); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__NO_FLAGS_SET); if ( result > 0 ) { @@ -16524,7 +16482,7 @@ check_double_unprotect_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_double_unprotect_err() */ @@ -16546,7 +16504,7 @@ check_double_unprotect_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_mark_entry_dirty_errs(void) { const char * fcn_name = "check_mark_entry_dirty_errs()"; @@ -16604,7 +16562,7 @@ check_mark_entry_dirty_errs(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_mark_entry_dirty_errs() */ @@ -16627,7 +16585,7 @@ check_mark_entry_dirty_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_expunge_entry_errs(void) { const char * fcn_name = "check_expunge_entry_errs()"; @@ -16666,8 +16624,8 @@ check_expunge_entry_errs(void) if ( pass ) { - result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr); + result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr); if ( result > 0 ) { @@ -16684,8 +16642,8 @@ check_expunge_entry_errs(void) if ( pass ) { - result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr); + result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr); if ( result > 0 ) { @@ -16702,8 +16660,8 @@ check_expunge_entry_errs(void) if ( pass ) { - result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr); + result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr); if ( result < 0 ) { @@ -16728,7 +16686,7 @@ check_expunge_entry_errs(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_expunge_entry_errs() */ @@ -16747,7 +16705,7 @@ check_expunge_entry_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_resize_entry_errs(void) { const char * fcn_name = "check_resize_entry_errs()"; @@ -16830,7 +16788,7 @@ check_resize_entry_errs(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_resize_entry_errs() */ @@ -16849,7 +16807,7 @@ check_resize_entry_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_unprotect_ro_dirty_err(void) { const char * fcn_name = "check_unprotect_ro_dirty_err()"; @@ -16880,9 +16838,9 @@ check_unprotect_ro_dirty_err(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result >= 0 ) { @@ -16924,9 +16882,9 @@ check_unprotect_ro_dirty_err(void) if ( pass ) { - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, (void *)entry_ptr, - H5C__DIRTIED_FLAG); + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + (void *)entry_ptr, H5C__DIRTIED_FLAG); if ( result > 0 ) { @@ -16956,7 +16914,7 @@ check_unprotect_ro_dirty_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_unprotect_ro_dirty_err() */ @@ -16979,7 +16937,7 @@ check_unprotect_ro_dirty_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_protect_ro_rw_err(void) { const char * fcn_name = "check_protect_ro_rw_err()"; @@ -17011,8 +16969,9 @@ check_protect_ro_rw_err(void) if ( pass ) { - thing_ptr = H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[0]), entry_ptr->addr, NULL, H5C__NO_FLAGS_SET); + thing_ptr = H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[0]), entry_ptr->addr, + &entry_ptr->addr, H5C__NO_FLAGS_SET); if ( thing_ptr != NULL ) { @@ -17039,7 +16998,7 @@ check_protect_ro_rw_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_protect_ro_rw_err() */ @@ -17062,7 +17021,7 @@ check_protect_ro_rw_err(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_check_evictions_enabled_err(void) { const char * fcn_name = "check_evictions_enabled_err()"; @@ -17178,7 +17137,7 @@ check_check_evictions_enabled_err(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_evictions_enabled_err() */ @@ -17221,7 +17180,7 @@ static void test_rpt_fcn(UNUSED H5C_t * cache_ptr, rpt_status = status; } -static void +static unsigned check_auto_cache_resize(void) { const char * fcn_name = "check_auto_cache_resize()"; @@ -20313,10 +20272,6 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - if ( pass ) { - - takedown_cache(file_ptr, FALSE, FALSE); - } /* now test the flash cache size increment code. At least at present, * there should be no interaction between the regular auto-resize @@ -20329,28 +20284,22 @@ check_auto_cache_resize(void) * code increases the cache size when and as expected. */ - if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - - /* allocate a cache, enable the flash cache size increase code, and - * then force the flash size increase code through all its operational - * modes. Verify that all performs as expected. + /* Place the cache in a known state via a flush-destroy on the cache + * to clear out all entries, and then a reset on all the entries. + * Then configure the cache for the flash cache size increase tests, + * and force the flash size increase code through all its operational + * modes. Verify that all perform as expected. */ if ( pass ) { - reset_entries(); + flush_cache(file_ptr, TRUE, FALSE, FALSE); - file_ptr = setup_cache((size_t)(2 * 1024), - (size_t)(1 * 1024)); - cache_ptr = file_ptr->shared->cache; + reset_entries(); } if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* now repeat the above tests using the add space flash cache size - * increment algorithm. - */ - if ( pass ) { auto_size_ctl.version = H5C__CURR_AUTO_SIZE_CTL_VER; @@ -21400,7 +21349,7 @@ check_auto_cache_resize(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_auto_cache_resize() */ @@ -21425,7 +21374,7 @@ check_auto_cache_resize(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_auto_cache_resize_disable(void) { const char * fcn_name = "check_auto_cache_resize_disable()"; @@ -24108,7 +24057,7 @@ check_auto_cache_resize_disable(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_auto_cache_resize_disable() */ @@ -24129,7 +24078,7 @@ check_auto_cache_resize_disable(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_auto_cache_resize_epoch_markers(void) { const char * fcn_name = "check_auto_cache_resize_epoch_markers()"; @@ -24813,7 +24762,7 @@ check_auto_cache_resize_epoch_markers(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_auto_cache_resize_epoch_markers() */ @@ -24867,7 +24816,7 @@ check_auto_cache_resize_epoch_markers(void) ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \ ( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) ) -static void +static unsigned check_auto_cache_resize_input_errs(void) { const char * fcn_name = "check_auto_cache_resize_input_errs()"; @@ -27249,7 +27198,7 @@ check_auto_cache_resize_input_errs(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_auto_cache_resize_input_errs() */ @@ -27275,7 +27224,7 @@ check_auto_cache_resize_input_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_auto_cache_resize_aux_fcns(void) { const char * fcn_name = "check_auto_cache_resize_aux_fcns()"; @@ -27828,7 +27777,7 @@ check_auto_cache_resize_aux_fcns(void) fcn_name, failure_mssg); } - return; + return !pass; } /* check_auto_cache_resize_aux_fcns() */ @@ -27853,9 +27802,21 @@ check_auto_cache_resize_aux_fcns(void) int main(void) { + const char *envval = NULL; + unsigned nerrs = 0; + H5open(); - skip_long_tests = FALSE; + express_test = GetTestExpress(); + + if ( express_test >= 3 ) { + + skip_long_tests = TRUE; + + } else { + + skip_long_tests = FALSE; + } #ifdef NDEBUG run_full_test = TRUE; @@ -27866,52 +27827,56 @@ main(void) #if 0 run_full_test = TRUE; #endif - -#if 1 - smoke_check_1(); - smoke_check_2(); - smoke_check_3(); - smoke_check_4(); - smoke_check_5(); - smoke_check_6(); - smoke_check_7(); - smoke_check_8(); - smoke_check_9(); - smoke_check_10(); -#endif - - write_permitted_check(); - check_insert_entry(); - check_flush_cache(); - check_get_entry_status(); - check_expunge_entry(); - check_multiple_read_protect(); - check_move_entry(); - check_pin_protected_entry(); - check_resize_entry(); - check_evictions_enabled(); - check_flush_protected_err(); - check_destroy_pinned_err(); - check_destroy_protected_err(); - check_duplicate_insert_err(); - check_move_err(); - check_double_pin_err(); - check_double_unpin_err(); - check_pin_entry_errs(); - check_double_protect_err(); - check_double_unprotect_err(); - check_mark_entry_dirty_errs(); - check_expunge_entry_errs(); - check_resize_entry_errs(); - check_unprotect_ro_dirty_err(); - check_protect_ro_rw_err(); - check_check_evictions_enabled_err(); - check_auto_cache_resize(); - check_auto_cache_resize_disable(); - check_auto_cache_resize_epoch_markers(); - check_auto_cache_resize_input_errs(); - check_auto_cache_resize_aux_fcns(); - - return(0); + printf("=========================================\n"); + printf("Internal cache tests\n"); + printf(" express_test = %d\n", express_test); + printf(" skip_long_tests = %d\n", (int)skip_long_tests); + printf("=========================================\n"); + + nerrs += smoke_check_1(); + nerrs += smoke_check_2(); + nerrs += smoke_check_3(); + nerrs += smoke_check_4(); + nerrs += smoke_check_5(); + nerrs += smoke_check_6(); + nerrs += smoke_check_7(); + nerrs += smoke_check_8(); + nerrs += smoke_check_9(); + nerrs += smoke_check_10(); + nerrs += write_permitted_check(); + + nerrs += check_insert_entry(); + nerrs += check_flush_cache(); + nerrs += check_get_entry_status(); + nerrs += check_expunge_entry(); + nerrs += check_multiple_read_protect(); + nerrs += check_move_entry(); + nerrs += check_pin_protected_entry(); + nerrs += check_resize_entry(); + nerrs += check_evictions_enabled(); + nerrs += check_flush_protected_err(); + nerrs += check_destroy_pinned_err(); + nerrs += check_destroy_protected_err(); + nerrs += check_duplicate_insert_err(); + nerrs += check_move_err(); + nerrs += check_double_pin_err(); + nerrs += check_double_unpin_err(); + nerrs += check_pin_entry_errs(); + nerrs += check_double_protect_err(); + nerrs += check_double_unprotect_err(); + nerrs += check_mark_entry_dirty_errs(); + nerrs += check_expunge_entry_errs(); + nerrs += check_resize_entry_errs(); + nerrs += check_unprotect_ro_dirty_err(); + nerrs += check_protect_ro_rw_err(); + nerrs += check_check_evictions_enabled_err(); + nerrs += check_auto_cache_resize(); + nerrs += check_auto_cache_resize_disable(); + nerrs += check_auto_cache_resize_epoch_markers(); + nerrs += check_auto_cache_resize_input_errs(); + nerrs += check_auto_cache_resize_aux_fcns(); + + return( nerrs > 0 ); } /* main() */ + diff --git a/test/cache_api.c b/test/cache_api.c index cc66fae..dfbe12d 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -34,15 +34,15 @@ extern const char *FILENAME[]; /* private function declarations: */ -static void check_fapl_mdc_api_calls(void); +static unsigned check_fapl_mdc_api_calls(void); -static void check_file_mdc_api_calls(void); +static unsigned check_file_mdc_api_calls(void); -static void mdc_api_call_smoke_check(int express_test); +static unsigned mdc_api_call_smoke_check(void); -static void check_fapl_mdc_api_errs(void); +static unsigned check_fapl_mdc_api_errs(void); -static void check_file_mdc_api_errs(void); +static unsigned check_file_mdc_api_errs(void); /**************************************************************************/ @@ -72,7 +72,7 @@ static void check_file_mdc_api_errs(void); *------------------------------------------------------------------------- */ -static void +static unsigned check_fapl_mdc_api_calls(void) { const char * fcn_name = "check_fapl_mdc_api_calls()"; @@ -492,6 +492,8 @@ check_fapl_mdc_api_calls(void) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); + return !pass; + } /* check_fapl_mdc_api_calls() */ @@ -519,7 +521,7 @@ check_fapl_mdc_api_calls(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_file_mdc_api_calls(void) { const char * fcn_name = "check_file_mdc_api_calls()"; @@ -834,6 +836,8 @@ check_file_mdc_api_calls(void) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); + return !pass; + } /* check_file_mdc_api_calls() */ @@ -860,8 +864,8 @@ check_file_mdc_api_calls(void) #define NUM_DSETS 6 #define NUM_RANDOM_ACCESSES 200000 -static void -mdc_api_call_smoke_check(int express_test) +static unsigned +mdc_api_call_smoke_check(void) { const char * fcn_name = "mdc_api_call_smoke_check()"; char filename[512]; @@ -989,13 +993,13 @@ mdc_api_call_smoke_check(int express_test) TESTING("MDC API smoke check"); - if ( express_test > 0 ) { + if ( skip_long_tests > 0 ) { SKIPPED(); HDfprintf(stdout, " Long tests disabled.\n"); - return; + return 0; } pass = TRUE; @@ -1117,7 +1121,8 @@ mdc_api_call_smoke_check(int express_test) sprintf(dset_name, "/dset%03d", i); dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE, - dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT); + dataspace_id, H5P_DEFAULT, + properties, H5P_DEFAULT); if ( dataset_ids[i] < 0 ) { @@ -1623,6 +1628,8 @@ mdc_api_call_smoke_check(int express_test) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); + return !pass; + } /* mdc_api_call_smoke_check() */ @@ -3007,7 +3014,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = *------------------------------------------------------------------------- */ -static void +static unsigned check_fapl_mdc_api_errs(void) { const char * fcn_name = "check_fapl_mdc_api_errs()"; @@ -3057,7 +3064,7 @@ check_fapl_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( ( pass ) && - ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0 ) || + ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0) || ( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) { pass = FALSE; @@ -3159,6 +3166,8 @@ check_fapl_mdc_api_errs(void) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); + return !pass; + } /* check_fapl_mdc_api_errs() */ @@ -3178,7 +3187,7 @@ check_fapl_mdc_api_errs(void) *------------------------------------------------------------------------- */ -static void +static unsigned check_file_mdc_api_errs(void) { const char * fcn_name = "check_file_mdc_api_errs()"; @@ -3496,6 +3505,8 @@ check_file_mdc_api_errs(void) HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); + return !pass; + } /* check_file_mdc_api_errs() */ @@ -3519,28 +3530,44 @@ check_file_mdc_api_errs(void) int main(void) { - int express_test; + unsigned nerrs = 0; H5open(); express_test = GetTestExpress(); + if ( express_test >= 3 ) { + + skip_long_tests = TRUE; + + } else { + + skip_long_tests = FALSE; + } + + printf("===================================\n"); + printf("Cache API tests\n"); + printf(" express_test = %d\n", express_test); + printf(" skip_long_tests = %d\n", (int)skip_long_tests); + printf("===================================\n"); + + #if 1 - check_fapl_mdc_api_calls(); + nerrs += check_fapl_mdc_api_calls(); #endif #if 1 - check_file_mdc_api_calls(); + nerrs += check_file_mdc_api_calls(); #endif #if 1 - mdc_api_call_smoke_check(express_test); + nerrs += mdc_api_call_smoke_check(); #endif #if 1 - check_fapl_mdc_api_errs(); + nerrs += check_fapl_mdc_api_errs(); #endif #if 1 - check_file_mdc_api_errs(); + nerrs += check_file_mdc_api_errs(); #endif - return(0); + return( nerrs > 0 ); } /* main() */ diff --git a/test/cache_common.c b/test/cache_common.c index ee3aa5d..206d3c0 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -14,7 +14,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Programmer: John Mainzer - * 10/27/05 + * 9/13/07 * * This file contains common code for tests of the cache * implemented in H5C.c @@ -23,6 +23,7 @@ #include "H5ACprivate.h" #include "H5Iprivate.h" #include "H5MFprivate.h" +#include "H5MMprivate.h" #include "cache_common.h" @@ -62,6 +63,8 @@ hbool_t run_full_test = TRUE; hbool_t try_core_file_driver = FALSE; hbool_t core_file_driver_failed = FALSE; const char *failure_mssg = NULL; +int failures = 0; +int express_test = 0; test_entry_t pico_entries[NUM_PICO_ENTRIES]; test_entry_t nano_entries[NUM_NANO_ENTRIES]; @@ -74,76 +77,105 @@ 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_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t small_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t large_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest); - - -static herr_t pico_dest(H5F_t * f, void * thing); -static herr_t nano_dest(H5F_t * f, void * thing); -static herr_t micro_dest(H5F_t * f, void * thing); -static herr_t tiny_dest(H5F_t * f, void * thing); -static herr_t small_dest(H5F_t * f, void * thing); -static herr_t medium_dest(H5F_t * f, void * thing); -static herr_t large_dest(H5F_t * f, void * thing); -static herr_t huge_dest(H5F_t * f, void * thing); -static herr_t monster_dest(H5F_t * f, void * thing); -static herr_t variable_dest(H5F_t * f, void * thing); - - -static herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -static herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); - - -static void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); - - -static herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr); -static herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr); - -test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] = +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); +static herr_t micro_image_len(void *thing, size_t *image_len_ptr); +static herr_t tiny_image_len(void *thing, size_t *image_len_ptr); +static herr_t small_image_len(void *thing, size_t *image_len_ptr); +static herr_t medium_image_len(void *thing, size_t *image_len_ptr); +static herr_t large_image_len(void *thing, size_t *image_len_ptr); +static herr_t huge_image_len(void *thing, size_t *image_len_ptr); +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); +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); +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); +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); +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); +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); +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); +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); +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); +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); + + +/* 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, @@ -213,7 +245,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", @@ -234,98 +266,116 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = { { PICO_ENTRY_TYPE, - (H5C_load_func_t)pico_load, - (H5C_flush_func_t)pico_flush, - (H5C_dest_func_t)pico_dest, - (H5C_clear_func_t)pico_clear, - (H5C_size_func_t)pico_size + "pico_entry", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)pico_get_load_size, + (H5C_deserialize_func_t)pico_deserialize, + (H5C_image_len_func_t)pico_image_len, + (H5C_serialize_func_t)pico_serialize, + (H5C_free_icr_func_t)pico_free_icr, }, { NANO_ENTRY_TYPE, - (H5C_load_func_t)nano_load, - (H5C_flush_func_t)nano_flush, - (H5C_dest_func_t)nano_dest, - (H5C_clear_func_t)nano_clear, - (H5C_size_func_t)nano_size + "nano_entry", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)nano_get_load_size, + (H5C_deserialize_func_t)nano_deserialize, + (H5C_image_len_func_t)nano_image_len, + (H5C_serialize_func_t)nano_serialize, + (H5C_free_icr_func_t)nano_free_icr, }, { MICRO_ENTRY_TYPE, - (H5C_load_func_t)micro_load, - (H5C_flush_func_t)micro_flush, - (H5C_dest_func_t)micro_dest, - (H5C_clear_func_t)micro_clear, - (H5C_size_func_t)micro_size + "micro_entry", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)micro_get_load_size, + (H5C_deserialize_func_t)micro_deserialize, + (H5C_image_len_func_t)micro_image_len, + (H5C_serialize_func_t)micro_serialize, + (H5C_free_icr_func_t)micro_free_icr, }, { TINY_ENTRY_TYPE, - (H5C_load_func_t)tiny_load, - (H5C_flush_func_t)tiny_flush, - (H5C_dest_func_t)tiny_dest, - (H5C_clear_func_t)tiny_clear, - (H5C_size_func_t)tiny_size + "tiny_entry", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)tiny_get_load_size, + (H5C_deserialize_func_t)tiny_deserialize, + (H5C_image_len_func_t)tiny_image_len, + (H5C_serialize_func_t)tiny_serialize, + (H5C_free_icr_func_t)tiny_free_icr, }, { SMALL_ENTRY_TYPE, - (H5C_load_func_t)small_load, - (H5C_flush_func_t)small_flush, - (H5C_dest_func_t)small_dest, - (H5C_clear_func_t)small_clear, - (H5C_size_func_t)small_size + "small_entry", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)small_get_load_size, + (H5C_deserialize_func_t)small_deserialize, + (H5C_image_len_func_t)small_image_len, + (H5C_serialize_func_t)small_serialize, + (H5C_free_icr_func_t)small_free_icr, }, { MEDIUM_ENTRY_TYPE, - (H5C_load_func_t)medium_load, - (H5C_flush_func_t)medium_flush, - (H5C_dest_func_t)medium_dest, - (H5C_clear_func_t)medium_clear, - (H5C_size_func_t)medium_size + "medium_entry", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)medium_get_load_size, + (H5C_deserialize_func_t)medium_deserialize, + (H5C_image_len_func_t)medium_image_len, + (H5C_serialize_func_t)medium_serialize, + (H5C_free_icr_func_t)medium_free_icr, }, { LARGE_ENTRY_TYPE, - (H5C_load_func_t)large_load, - (H5C_flush_func_t)large_flush, - (H5C_dest_func_t)large_dest, - (H5C_clear_func_t)large_clear, - (H5C_size_func_t)large_size + "large_entry", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)large_get_load_size, + (H5C_deserialize_func_t)large_deserialize, + (H5C_image_len_func_t)large_image_len, + (H5C_serialize_func_t)large_serialize, + (H5C_free_icr_func_t)large_free_icr, }, { HUGE_ENTRY_TYPE, - (H5C_load_func_t)huge_load, - (H5C_flush_func_t)huge_flush, - (H5C_dest_func_t)huge_dest, - (H5C_clear_func_t)huge_clear, - (H5C_size_func_t)huge_size + "huge_entry", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)huge_get_load_size, + (H5C_deserialize_func_t)huge_deserialize, + (H5C_image_len_func_t)huge_image_len, + (H5C_serialize_func_t)huge_serialize, + (H5C_free_icr_func_t)huge_free_icr, }, { MONSTER_ENTRY_TYPE, - (H5C_load_func_t)monster_load, - (H5C_flush_func_t)monster_flush, - (H5C_dest_func_t)monster_dest, - (H5C_clear_func_t)monster_clear, - (H5C_size_func_t)monster_size + "monster_entry", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)monster_get_load_size, + (H5C_deserialize_func_t)monster_deserialize, + (H5C_image_len_func_t)monster_image_len, + (H5C_serialize_func_t)monster_serialize, + (H5C_free_icr_func_t)monster_free_icr, }, { VARIABLE_ENTRY_TYPE, - (H5C_load_func_t)variable_load, - (H5C_flush_func_t)variable_flush, - (H5C_dest_func_t)variable_dest, - (H5C_clear_func_t)variable_clear, - (H5C_size_func_t)variable_size + "variable_entry", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)variable_get_load_size, + (H5C_deserialize_func_t)variable_deserialize, + (H5C_image_len_func_t)variable_image_len, + (H5C_serialize_func_t)variable_serialize, + (H5C_free_icr_func_t)variable_free_icr, } }; -static herr_t clear(H5F_t * f, void * thing, hbool_t dest); -static herr_t destroy(H5F_t * f, void * thing); -static herr_t flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned UNUSED * flags_ptr); -static void * load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -static herr_t size(H5F_t * f, void * thing, size_t * size_ptr); -static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, - struct flush_op *op_ptr, unsigned *flags_ptr); - - - - /* address translation funtions: */ @@ -344,8 +394,8 @@ static void execute_flush_op(H5F_t *file_ptr, struct 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; @@ -404,52 +454,8 @@ addr_to_type_and_index(haddr_t addr, } /* addr_to_type_and_index() */ - -#if 0 /* This function has never been used, but we may want it - * some time. Lets keep it for now. - */ -/*------------------------------------------------------------------------- - * Function: type_and_index_to_addr - * - * Purpose: Given a type and index of an entry, compute the associated - * addr and return that value. - * - * Return: computed addr - * - * Programmer: John Mainzer - * 6/10/04 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -haddr_t -type_and_index_to_addr(int32_t type, - int32_t idx) -{ - haddr_t addr; - - HDassert( ( type >= 0 ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); - HDassert( ( idx >= 0 ) && ( idx <= max_indices[type] ) ); - addr = base_addrs[type] + (((haddr_t)idx) * entry_sizes[type]); - - HDassert( addr == (entries[type])[idx].addr ); - - if ( (entries[type])[idx].at_main_addr ) { - - HDassert( addr == (entries[type])[idx].main_addr ); - - } else { - - HDassert( addr == (entries[type])[idx].alt_addr ); - } - - return(addr); - -} /* type_and_index_to_addr() */ - -#endif +/* Call back functions: */ /*------------------------------------------------------------------------- @@ -473,9 +479,9 @@ type_and_index_to_addr(int32_t type, */ 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 ); @@ -487,694 +493,748 @@ check_write_permitted(const H5F_t UNUSED * f, /*------------------------------------------------------------------------- - * Function: clear & friends + * Function: get_load_size & friends * - * Purpose: clear the entry. The helper functions verify that the - * correct version of clear is being called, and then call - * clear proper. + * Purpose: Query the image size for loading an entry. The helper + * functions funnel into get_load_size proper. * * Return: SUCCEED * - * Programmer: John Mainzer - * 6/10/04 + * Programmer: Quincey Koziol + * 5/18/10 * *------------------------------------------------------------------------- */ - -herr_t -clear(H5F_t * f, - void * thing, - hbool_t dest) +static herr_t +get_load_size(const void *udata, size_t *image_length, int32_t entry_type) { - test_entry_t * entry_ptr; - test_entry_t * base_addr; - - HDassert( thing ); - - entry_ptr = (test_entry_t *)thing; - base_addr = entries[entry_ptr->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->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] ) ); - - entry_ptr->header.is_dirty = FALSE; - entry_ptr->is_dirty = FALSE; + test_entry_t *entry; + test_entry_t *base_addr; + haddr_t addr = *(const haddr_t *)udata; + int32_t type; + int32_t idx; - entry_ptr->cleared = TRUE; + addr_to_type_and_index(addr, &type, &idx); - if ( dest ) { + base_addr = entries[type]; + entry = &(base_addr[idx]); - destroy(f, thing); + 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_length = entry->size; return(SUCCEED); +} /* get_load_size() */ -} /* clear() */ - -herr_t -pico_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +pico_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, PICO_ENTRY_TYPE); } -herr_t -nano_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +nano_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, NANO_ENTRY_TYPE); } -herr_t -micro_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +micro_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, MICRO_ENTRY_TYPE); } -herr_t -tiny_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +tiny_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, TINY_ENTRY_TYPE); } -herr_t -small_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +small_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, SMALL_ENTRY_TYPE); } -herr_t -medium_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +medium_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, MEDIUM_ENTRY_TYPE); } -herr_t -large_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +large_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, LARGE_ENTRY_TYPE); } -herr_t -huge_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +huge_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, HUGE_ENTRY_TYPE); } -herr_t -monster_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +monster_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, MONSTER_ENTRY_TYPE); } -herr_t -variable_clear(H5F_t * f, void * thing, hbool_t dest) +static herr_t +variable_get_load_size(const void *udata, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE ); - return(clear(f, thing, dest)); + return get_load_size(udata, image_length, VARIABLE_ENTRY_TYPE); } - /*------------------------------------------------------------------------- - * Function: dest & friends + * Function: deserialize & friends * - * Purpose: Destroy the entry. The helper functions verify that the - * correct version of dest is being called, and then call - * dest proper. + * Purpose: deserialize the entry. The helper functions verify that the + * correct version of deserialize is being called, and then call + * deserialize proper. * - * Return: SUCCEED + * Return: void * (pointer to the in core representation of the entry) * * Programmer: John Mainzer - * 6/10/04 + * 9/20/07 * *------------------------------------------------------------------------- */ - -herr_t -destroy(H5F_t UNUSED * f, - void * thing) +static void * +deserialize(const void *image, size_t len, void *udata, hbool_t *dirty, + int32_t entry_type) { - int i; - test_entry_t * entry_ptr; - test_entry_t * base_addr; - test_entry_t * pinned_entry_ptr; - test_entry_t * pinned_base_addr; - - HDassert( thing ); - - entry_ptr = (test_entry_t *)thing; - base_addr = entries[entry_ptr->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] ) ); - - HDassert( !(entry_ptr->is_dirty) ); - HDassert( !(entry_ptr->header.is_dirty) ); - - if ( entry_ptr->num_pins > 0 ) { - - for ( i = 0; i < entry_ptr->num_pins; i++ ) - { - pinned_base_addr = entries[entry_ptr->pin_type[i]]; - pinned_entry_ptr = &(pinned_base_addr[entry_ptr->pin_idx[i]]); - - 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_entry_ptr->pinning_ref_count--; - - if ( pinned_entry_ptr->pinning_ref_count <= 0 ) { - - unpin_entry(pinned_entry_ptr->type, - pinned_entry_ptr->index); - } - - entry_ptr->pin_type[i] = -1; - entry_ptr->pin_idx[i] = -1; - } - entry_ptr->num_pins = 0; - } - - entry_ptr->destroyed = TRUE; - entry_ptr->cache_ptr = NULL; + test_entry_t *entry; + test_entry_t *base_addr; + haddr_t addr = *(haddr_t *)udata; + int32_t type; + int32_t idx; - return(SUCCEED); + addr_to_type_and_index(addr, &type, &idx); -} /* dest() */ + base_addr = entries[type]; + 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 != 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 = 0x%x\n", + (int)(*((const char *)image))); + HDfprintf(stdout, "expected *image = 0x%x\n", + (int)(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 = 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)); + } /* 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() */ -herr_t -pico_dest(H5F_t * f, void * thing) +void * +pico_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, PICO_ENTRY_TYPE); } -herr_t -nano_dest(H5F_t * f, void * thing) +void * +nano_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, NANO_ENTRY_TYPE); } -herr_t -micro_dest(H5F_t * f, void * thing) +void * +micro_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, MICRO_ENTRY_TYPE); } -herr_t -tiny_dest(H5F_t * f, void * thing) +void * +tiny_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, TINY_ENTRY_TYPE); } -herr_t -small_dest(H5F_t * f, void * thing) +void * +small_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, SMALL_ENTRY_TYPE); } -herr_t -medium_dest(H5F_t * f, void * thing) +void * +medium_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, MEDIUM_ENTRY_TYPE); } -herr_t -large_dest(H5F_t * f, void * thing) +void * +large_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, LARGE_ENTRY_TYPE); } -herr_t -huge_dest(H5F_t * f, void * thing) +void * +huge_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, HUGE_ENTRY_TYPE); } -herr_t -monster_dest(H5F_t * f, void * thing) +void * +monster_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, MONSTER_ENTRY_TYPE); } -herr_t -variable_dest(H5F_t * f, void * thing) +void * +variable_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) { - HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE ); - return(destroy(f, thing)); + return deserialize(image, len, udata, dirty, VARIABLE_ENTRY_TYPE); } /*------------------------------------------------------------------------- - * Function: flush & friends + * Function: image_len & friends * - * Purpose: flush the entry and mark it as clean. The helper functions - * verify that the correct version of flush is being called, - * and then call flush proper. + * Purpose: Return the real (and possibly reduced) length of the image. + * The helper functions verify that the correct version of + * deserialize is being called, and then call deserialize + * proper. * * Return: SUCCEED * * Programmer: John Mainzer - * 6/10/04 + * 9/19/07 * *------------------------------------------------------------------------- */ - herr_t -flush(H5F_t *f, - hid_t UNUSED dxpl_id, - hbool_t dest, - haddr_t -#ifdef NDEBUG - UNUSED -#endif /* NDEBUG */ - addr, - void *thing, - unsigned * flags_ptr) +image_len(void *thing, size_t *image_length, int32_t entry_type) { - int i; - test_entry_t * entry_ptr; - test_entry_t * base_addr; - - HDassert( thing ); - - entry_ptr = (test_entry_t *)thing; - base_addr = entries[entry_ptr->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->header.addr == entry_ptr->addr ); - HDassert( entry_ptr->addr == addr ); - HDassert( entry_ptr->header.size == entry_ptr->size ); - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || - ( entry_ptr->size == entry_sizes[entry_ptr->type] ) ); - HDassert( entry_ptr->header.is_dirty == entry_ptr->is_dirty ); - HDassert( entry_ptr->cache_ptr != NULL ); - HDassert( entry_ptr->cache_ptr->magic == H5C__H5C_T_MAGIC ); - 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++ ) - { - execute_flush_op(f, - entry_ptr, - &((entry_ptr->flush_ops)[i]), - flags_ptr); - } - entry_ptr->num_flush_ops = 0; - entry_ptr->flush_op_self_resize_in_progress = FALSE; - } + test_entry_t *entry; + test_entry_t *base_addr; + int32_t type; + int32_t idx; - entry_ptr->flushed = TRUE; + HDassert(thing); + HDassert(image_length); - if ( ( ! write_permitted ) && ( entry_ptr->is_dirty ) ) { + entry = (test_entry_t *)thing; - pass = FALSE; - failure_mssg = "called flush when write_permitted is FALSE."; - } + HDassert(entry->self == entry); - if ( entry_ptr->is_dirty ) { + type = entry->type; + idx = entry->index; - (entry_ptr->writes)++; - entry_ptr->is_dirty = FALSE; - entry_ptr->header.is_dirty = FALSE; - } + HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); + HDassert(type == entry_type); + HDassert((idx >= 0) && (idx <= max_indices[type])); - if ( dest ) { + base_addr = entries[type]; + HDassert(entry == &(base_addr[idx])); - destroy(f, thing); + if(type != VARIABLE_ENTRY_TYPE) + HDassert(entry->size == entry_sizes[type]); + else { + HDassert(entry->size <= entry_sizes[type]); + HDassert(entry->size > 0); + } /* end else */ - } + *image_length = entry->size; return(SUCCEED); - -} /* flush() */ +} /* image_len() */ herr_t -pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +pico_image_len(void *thing, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, PICO_ENTRY_TYPE); } herr_t -nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +nano_image_len(void *thing, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, NANO_ENTRY_TYPE); } herr_t -micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +micro_image_len(void *thing, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, MICRO_ENTRY_TYPE); } herr_t -tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +tiny_image_len(void *thing, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, TINY_ENTRY_TYPE); } herr_t -small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +small_image_len(void *thing, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, SMALL_ENTRY_TYPE); } herr_t -medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +medium_image_len(void *thing, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, MEDIUM_ENTRY_TYPE); } herr_t -large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +large_image_len(void *thing, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, LARGE_ENTRY_TYPE); } herr_t -huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +huge_image_len(void *thing, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, HUGE_ENTRY_TYPE); } herr_t -monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +monster_image_len(void *thing, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, MONSTER_ENTRY_TYPE); } herr_t -variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, - void *thing, unsigned * flags_ptr) +variable_image_len(void *thing, size_t *image_length) { - HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE ); - return(flush(f, dxpl_id, dest, addr, thing, flags_ptr)); + return image_len(thing, image_length, VARIABLE_ENTRY_TYPE); } - /*------------------------------------------------------------------------- - * Function: load & friends + * Function: serialize & friends * - * Purpose: "load" the requested entry and mark it as clean. The - * helper functions verify that the correct version of load - * is being called, and then call load proper. + * Purpose: Serialize the supplied entry. For now this consistes of + * loading the type and index of the entry into the first + * three bytes of the image (if it is long enough -- if not + * just load the low order byte of the index into the first + * byte of the image). * - * Return: SUCCEED + * The helper functions verify that the correct version of + * serialize is being called, and then call serialize + * proper. + * + * Return: SUCCEED if successful, FAIL otherwise. * * Programmer: John Mainzer - * 6/10/04 + * 9/19/07 * *------------------------------------------------------------------------- */ - -void * -load(H5F_t UNUSED *f, - hid_t UNUSED dxpl_id, - haddr_t addr, - void UNUSED *udata) +herr_t +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) { + 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; + int32_t i; + herr_t ret_val = SUCCEED; - addr_to_type_and_index(addr, &type, &idx); + HDassert(image); + HDassert(thing); + HDassert(flags); + + *flags = 0; + + HDassert(new_addr); + HDassert(new_len); + HDassert(new_image); + + entry = (test_entry_t *)thing; + + HDassert(entry->self == entry); + HDassert(entry->addr == addr); + HDassert(entry->size == len); + + /* shouldn't serialize the entry unless it is dirty */ + HDassert(entry->is_dirty); + + type = entry->type; + idx = entry->index; + + HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); + HDassert(type == entry_type); + HDassert((idx >= 0) && (idx <= max_indices[type])); base_addr = entries[type]; - entry_ptr = &(base_addr[idx]); - HDassert( entry_ptr->type == type ); - 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 ); -#if 1 /* JRM */ - if ( ! ( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || - ( entry_ptr->size == entry_sizes[type] ) ) ) { - - HDfprintf(stdout, "entry type/index/size = %d/%d/%ld\n", - (int)(entry_ptr->type), - (int)(entry_ptr->index), - (long)(entry_ptr->size)); - } -#endif /* JRM */ - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || - ( entry_ptr->size == entry_sizes[type] ) ); + HDassert(entry == &(base_addr[idx])); + HDassert(entry->num_flush_ops >= 0); + HDassert(entry->num_flush_ops < MAX_FLUSH_OPS); - entry_ptr->loaded = TRUE; + if(entry->num_flush_ops > 0) { + for(i = 0; i < entry->num_flush_ops; i++ ) { + HDassert(entry->file_ptr); - entry_ptr->header.is_dirty = FALSE; - entry_ptr->is_dirty = 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; - (entry_ptr->reads)++; + /* 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) & H5C__SERIALIZE_RESIZED_FLAG) != 0)) { + /* re-allocate *image, and place the new pointer in + * *new_image. + */ + image = H5MM_xfree(image); - return(entry_ptr); + HDassert(entry->type == VARIABLE_ENTRY_TYPE); + HDassert(entry->size > 0); + HDassert(entry->size <= VARIABLE_ENTRY_SIZE); -} /* load() */ + if(NULL == (image = H5MM_malloc((size_t)(entry->size)))) { + ret_val = FAIL; + pass = FALSE; + 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, 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->is_dirty = FALSE; -void * -pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) + /* since the entry is about to be written to disk, we can mark it + * as initialized. + */ + if(entry->at_main_addr) + entry->written_to_main_addr = TRUE; + else + entry->written_to_alt_addr = TRUE; + + /* do book keeping */ + (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, void *thing, unsigned *flags, + haddr_t *new_addr, size_t *new_len, void **new_image) { - return(load(f, dxpl_id, addr, udata)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, PICO_ENTRY_TYPE); } -void * -nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +nano_serialize(const H5F_t UNUSED *f, hid_t UNUSED 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) { - return(load(f, dxpl_id, addr, udata)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, NANO_ENTRY_TYPE); } -void * -micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +micro_serialize(const H5F_t UNUSED *f, hid_t UNUSED 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) { - return(load(f, dxpl_id, addr, udata)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, MICRO_ENTRY_TYPE); } -void * -tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +tiny_serialize(const H5F_t UNUSED *f, hid_t UNUSED 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) { - return(load(f, dxpl_id, addr, udata)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, TINY_ENTRY_TYPE); } -void * -small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +small_serialize(const H5F_t UNUSED *f, hid_t UNUSED 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) { - return(load(f, dxpl_id, addr, udata)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, SMALL_ENTRY_TYPE); } -void * -medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +medium_serialize(const H5F_t UNUSED *f, hid_t UNUSED 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) { - return(load(f, dxpl_id, addr, udata)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, MEDIUM_ENTRY_TYPE); } -void * -large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +large_serialize(const H5F_t UNUSED *f, hid_t UNUSED 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) { - return(load(f, dxpl_id, addr, udata)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, LARGE_ENTRY_TYPE); } -void * -huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +huge_serialize(const H5F_t UNUSED *f, hid_t UNUSED 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) { - return(load(f, dxpl_id, addr, udata)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, HUGE_ENTRY_TYPE); } -void * -monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +monster_serialize(const H5F_t UNUSED *f, hid_t UNUSED 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) { - return(load(f, dxpl_id, addr, udata)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, MONSTER_ENTRY_TYPE); } -void * -variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) +herr_t +variable_serialize(const H5F_t UNUSED *f, hid_t UNUSED 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) { - return(load(f, dxpl_id, addr, udata)); + return serialize(addr, len, image, thing, flags, + new_addr, new_len, new_image, VARIABLE_ENTRY_TYPE); } /*------------------------------------------------------------------------- - * Function: size & friends + * Function: free_icr & friends + * + * Purpose: Nominally, this callback is supposed to free the + * in core representation of the entry. * - * Purpose: Get the size of the specified entry. The helper functions - * verify that the correct version of size is being called, - * and then call size proper. + * In the context of this test bed, we use it to do + * do all the processing we used to do on a destroy. + * In particular, we use it to release all the pins + * that this entry may have on other entries. + * + * The helper functions verify that the correct version of + * serialize is being called, and then call free_icr + * proper. * * Return: SUCCEED * * Programmer: John Mainzer - * 6/10/04 + * 9/19/07 * *------------------------------------------------------------------------- */ - herr_t -size(H5F_t UNUSED * f, - void * thing, - size_t * size_ptr) +free_icr(test_entry_t *entry, int32_t entry_type) { - test_entry_t * entry_ptr; - test_entry_t * base_addr; - - HDassert( size_ptr ); - HDassert( thing ); - - entry_ptr = (test_entry_t *)thing; - base_addr = entries[entry_ptr->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->header.addr == entry_ptr->addr ); - HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || \ - ( entry_ptr->size == entry_sizes[entry_ptr->type] ) ); + test_entry_t *base_addr; - *size_ptr = entry_ptr->size; + HDassert(entry); + + base_addr = entries[entry->type]; + + 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])); + + if(entry->num_pins > 0) { + int i; + + for(i = 0; i < entry->num_pins; i++) { + test_entry_t *pinned_entry; + test_entry_t *pinned_base_addr; + + pinned_base_addr = entries[entry->pin_type[i]]; + pinned_entry = &(pinned_base_addr[entry->pin_idx[i]]); + + 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); + + pinned_entry->pinning_ref_count--; + + if(pinned_entry->pinning_ref_count <= 0) { + HDassert(pinned_entry->file_ptr); + + unpin_entry(pinned_entry->type, pinned_entry->index); + } /* end if */ + + entry->pin_type[i] = -1; + entry->pin_idx[i] = -1; + } /* end if */ + entry->num_pins = 0; + } /* end if */ + + entry->destroyed = TRUE; + entry->cache_ptr = NULL; return(SUCCEED); - -} /* size() */ +} /* free_icr() */ herr_t -pico_size(H5F_t * f, void * thing, size_t * size_ptr) +pico_free_icr(void *thing) { - HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return free_icr((test_entry_t *)thing, PICO_ENTRY_TYPE); } herr_t -nano_size(H5F_t * f, void * thing, size_t * size_ptr) +nano_free_icr(void *thing) { - HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return free_icr((test_entry_t *)thing, NANO_ENTRY_TYPE); } herr_t -micro_size(H5F_t * f, void * thing, size_t * size_ptr) +micro_free_icr(void *thing) { - HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return free_icr((test_entry_t *)thing, MICRO_ENTRY_TYPE); } herr_t -tiny_size(H5F_t * f, void * thing, size_t * size_ptr) +tiny_free_icr(void *thing) { - HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return free_icr((test_entry_t *)thing, TINY_ENTRY_TYPE); } herr_t -small_size(H5F_t * f, void * thing, size_t * size_ptr) +small_free_icr(void *thing) { - HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return free_icr((test_entry_t *)thing, SMALL_ENTRY_TYPE); } herr_t -medium_size(H5F_t * f, void * thing, size_t * size_ptr) +medium_free_icr(void *thing) { - HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return free_icr((test_entry_t *)thing, MEDIUM_ENTRY_TYPE); } herr_t -large_size(H5F_t * f, void * thing, size_t * size_ptr) +large_free_icr(void *thing) { - HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return free_icr((test_entry_t *)thing, LARGE_ENTRY_TYPE); } herr_t -huge_size(H5F_t * f, void * thing, size_t * size_ptr) +huge_free_icr(void *thing) { - HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return free_icr((test_entry_t *)thing, HUGE_ENTRY_TYPE); } herr_t -monster_size(H5F_t * f, void * thing, size_t * size_ptr) +monster_free_icr(void *thing) { - HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return free_icr((test_entry_t *)thing, MONSTER_ENTRY_TYPE); } herr_t -variable_size(H5F_t * f, void * thing, size_t * size_ptr) +variable_free_icr(void *thing) { - HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE ); - return(size(f, thing, size_ptr)); + return free_icr((test_entry_t *)thing, VARIABLE_ENTRY_TYPE); } - /**************************************************************************/ /**************************************************************************/ @@ -1474,17 +1534,10 @@ execute_flush_op(H5F_t * file_ptr, HDassert( op_ptr->size <= VARIABLE_ENTRY_SIZE ); entry_ptr->size = op_ptr->size; - (*flags_ptr) |= H5C_CALLBACK__SIZE_CHANGED_FLAG; - entry_ptr->flush_op_self_resize_in_progress = TRUE; - /* if the entry is in the process of being destroyed, - * set the header size to match the entry size so as - * to avoid a spurious failure in the destroy callback. - */ - if ( entry_ptr->header.destroy_in_progress ) { + (*flags_ptr) |= H5C__SERIALIZE_RESIZED_FLAG; - entry_ptr->header.size = entry_ptr->size; - } + entry_ptr->flush_op_self_resize_in_progress = TRUE; } else { @@ -1496,8 +1549,29 @@ execute_flush_op(H5F_t * file_ptr, break; case FLUSH_OP__MOVE: - move_entry(cache_ptr, op_ptr->type, op_ptr->idx, - op_ptr->flag); + 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); + (*flags_ptr) |= H5C__SERIALIZE_MOVED_FLAG; + + 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; + } /* end if */ + else { + HDassert(entry_ptr->addr == entry_ptr->main_addr); + entry_ptr->addr = entry_ptr->alt_addr; + entry_ptr->at_main_addr = FALSE; + } /* end else */ + } /* end if */ + else + move_entry(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag); break; default: @@ -1617,6 +1691,8 @@ reset_entries(void) base_addr[j].self = &(base_addr[j]); base_addr[j].cache_ptr = NULL; + base_addr[j].written_to_main_addr = FALSE; + base_addr[j].written_to_alt_addr = FALSE; base_addr[j].addr = addr; base_addr[j].at_main_addr = TRUE; base_addr[j].main_addr = addr; @@ -1624,8 +1700,8 @@ reset_entries(void) base_addr[j].size = entry_size; base_addr[j].type = i; base_addr[j].index = j; - base_addr[j].reads = 0; - base_addr[j].writes = 0; + base_addr[j].serializes = 0; + base_addr[j].deserializes = 0; base_addr[j].is_dirty = FALSE; base_addr[j].is_protected = FALSE; base_addr[j].is_read_only = FALSE; @@ -1651,9 +1727,8 @@ reset_entries(void) } base_addr[j].flush_op_self_resize_in_progress = FALSE; - base_addr[j].loaded = FALSE; - base_addr[j].cleared = FALSE; - base_addr[j].flushed = FALSE; + base_addr[j].deserialized = FALSE; + base_addr[j].serialized = FALSE; base_addr[j].destroyed = FALSE; addr += (haddr_t)entry_size; @@ -2027,23 +2102,20 @@ verify_entry_status(H5C_t * cache_ptr, if ( pass ) { - if ( ( entry_ptr->loaded != expected[i].loaded ) || - ( entry_ptr->cleared != expected[i].cleared ) || - ( entry_ptr->flushed != expected[i].flushed ) || + if ( ( entry_ptr->deserialized != expected[i].deserialized ) || + ( entry_ptr->serialized != expected[i].serialized ) || ( entry_ptr->destroyed != expected[i].destroyed ) ) { pass = FALSE; sprintf(msg, - "%d entry (%d,%d) loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", + "%d entry (%d,%d) deserialized = %d(%d), serialized = %d(%d), dest = %d(%d)\n", tag, (int)expected[i].entry_type, (int)expected[i].entry_index, - (int)(entry_ptr->loaded), - (int)(expected[i].loaded), - (int)(entry_ptr->cleared), - (int)(expected[i].cleared), - (int)(entry_ptr->flushed), - (int)(expected[i].flushed), + (int)(entry_ptr->deserialized), + (int)(expected[i].deserialized), + (int)(entry_ptr->serialized), + (int)(expected[i].serialized), (int)(entry_ptr->destroyed), (int)(expected[i].destroyed)); failure_mssg = msg; @@ -2117,20 +2189,37 @@ verify_unprotected(void) } /* verify_unprotected() */ -/*------------------------------------------------------------------------- - * Function: setup_cache() +/***************************************************************************** * - * Purpose: Allocate a cache of the desired size and configure it for - * use in the test bed. Return a pointer to the new cache - * structure. + * Function: setup_cache() * - * Return: Pointer to new cache, or NULL on failure. + * Purpose: Open an HDF file. This will allocate an instance and + * initialize an associated instance of H5C_t. However, + * we want to test an instance of H5C_t, so allocate and + * initialize one with the file ID returned by the call to + * H5Fcreate(). Return a pointer to this instance of H5C_t. * - * Programmer: John Mainzer - * 6/11/04 + * Observe that we open a HDF file because the cache now + * writes directly to file, and we need the file I/O facilities + * associated with the file. * - *------------------------------------------------------------------------- - */ + * To avoid tripping on error check code, must allocate enough + * space in the file to hold all the test entries and their + * alternates. This is a little sticky, as the addresses of + * all the test entries are determined at compile time. + * + * Deal with this by choosing BASE_ADDR large enough that + * the base address of the allocate space will be less than + * or equal to BASE_ADDR, and then requesting an extra BASE_ADDR + * bytes, so we don't have to wory about exceeding the allocation. + * + * Return: Success: Ptr to H5C_t + * + * Failure: NULL + * + * Programmer: JRM -- 9/13/07 + * + *****************************************************************************/ H5F_t * setup_cache(size_t max_cache_size, @@ -2379,7 +2468,6 @@ setup_cache(size_t max_cache_size, if ( pass ) { H5C_stats__reset(cache_ptr); - ret_val = file_ptr; } @@ -2394,8 +2482,11 @@ setup_cache(size_t max_cache_size, /*------------------------------------------------------------------------- * Function: takedown_cache() * - * Purpose: Flush the specified cache and disable it. If requested, - * dump stats first. If pass is FALSE, do nothing. + * Purpose: Flush the specified cache and destroy it. If requested, + * dump stats first. Then close and delete the associate + * file. + * + * If pass is FALSE, do nothing. * * Return: void * @@ -2422,7 +2513,7 @@ takedown_cache(H5F_t * file_ptr, flush_cache(file_ptr, TRUE, FALSE, FALSE); - H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT); + H5C_dest(file_ptr, H5P_DATASET_XFER_DEFAULT); if ( saved_cache != NULL ) { @@ -2526,8 +2617,8 @@ expunge_entry(H5F_t * file_ptr, HDassert( ! ( entry_ptr->header.is_pinned ) ); HDassert( ! ( entry_ptr->is_pinned ) ); - result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr); + result = H5C_expunge_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[type]), entry_ptr->addr); if ( result < 0 ) { @@ -2575,12 +2666,12 @@ flush_cache(H5F_t * file_ptr, if ( destroy_entries ) { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG); } else { - result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, + result = H5C_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT, H5C__NO_FLAGS_SET); } } @@ -2648,8 +2739,8 @@ insert_entry(H5F_t * file_ptr, entry_ptr->is_dirty = TRUE; - result = H5C_insert_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags); + result = H5C_insert_entry(file_ptr, H5P_DATASET_XFER_DEFAULT, + &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( entry_ptr->header.is_protected ) || @@ -2678,6 +2769,7 @@ insert_entry(H5F_t * file_ptr, } HDassert( entry_ptr->cache_ptr == NULL ); + entry_ptr->file_ptr = file_ptr; entry_ptr->cache_ptr = cache_ptr; if ( insert_pinned ) { @@ -2865,6 +2957,64 @@ move_entry(H5C_t * cache_ptr, /*------------------------------------------------------------------------- + * Function: pin_protected_entry() + * + * Purpose: Pin the specified protected entry. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 5/17/06 + * + *------------------------------------------------------------------------- + */ +void +pin_protected_entry(H5F_t *file_ptr, int32_t type, int32_t idx) +{ + herr_t result; + test_entry_t * base_addr; + test_entry_t * entry_ptr; + + 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])); + + 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); + + 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)) { + pass = FALSE; + failure_mssg = "error in H5C_pin_protected_entry()."; + } /* end if */ + + entry_ptr->is_pinned = TRUE; + HDassert(((entry_ptr->header).type)->id == type); + } /* end if */ + +} /* pin_protected_entry() */ + + +/*------------------------------------------------------------------------- * Function: protect_entry() * * Purpose: Protect the entry indicated by the type and index. @@ -2905,8 +3055,8 @@ protect_entry(H5F_t * file_ptr, HDassert( entry_ptr == entry_ptr->self ); HDassert( !(entry_ptr->is_protected) ); - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, NULL, H5C__NO_FLAGS_SET); + 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); if ( ( cache_entry_ptr != (void *)entry_ptr ) || ( !(entry_ptr->header.is_protected) ) || @@ -2945,6 +3095,7 @@ protect_entry(H5F_t * file_ptr, ( entry_ptr->cache_ptr == cache_ptr ) ); entry_ptr->cache_ptr = cache_ptr; + entry_ptr->file_ptr = file_ptr; entry_ptr->is_protected = TRUE; } @@ -3001,8 +3152,8 @@ protect_entry_ro(H5F_t * file_ptr, ( ( entry_ptr->is_read_only ) && ( entry_ptr->ro_ref_count > 0 ) ) ); - cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, - &(types[type]), entry_ptr->addr, NULL, H5C__READ_ONLY_FLAG); + 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); if ( ( cache_entry_ptr != (void *)entry_ptr ) || ( !(entry_ptr->header.is_protected) ) || @@ -3021,6 +3172,7 @@ protect_entry_ro(H5F_t * file_ptr, ( entry_ptr->cache_ptr == cache_ptr ) ); entry_ptr->cache_ptr = cache_ptr; + entry_ptr->file_ptr = file_ptr; entry_ptr->is_protected = TRUE; entry_ptr->is_read_only = TRUE; entry_ptr->ro_ref_count++; @@ -3145,7 +3297,7 @@ unprotect_entry(H5F_t * file_ptr, if(flags & H5C__DIRTIED_FLAG) entry_ptr->is_dirty = TRUE; - result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, H5P_DATASET_XFER_DEFAULT, + result = H5C_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[type]), entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || @@ -3227,6 +3379,7 @@ unprotect_entry(H5F_t * file_ptr, void row_major_scan_forward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -3244,6 +3397,7 @@ row_major_scan_forward(H5F_t * file_ptr, H5C_t * cache_ptr; int32_t type = 0; int32_t idx; + int32_t local_max_index; if ( verbose ) HDfprintf(stdout, "%s(): entering.\n", fcn_name); @@ -3266,206 +3420,239 @@ row_major_scan_forward(H5F_t * file_ptr, { idx = -lag; - while ( ( pass ) && ( idx <= (max_indices[type] + lag) ) ) + local_max_index = MIN(max_index, max_indices[type]); + + 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) <= max_indices[type] ) && - ( ((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, "(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) <= max_indices[type] ) && - ( ( (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, "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) <= max_indices[type] ) && - ( ( (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, "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); } + /* (don't decrement tmp_idx) */ + if ( ( pass ) && ( do_moves ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { - if ( ( pass ) && ( do_moves ) && ( (idx + lag - 2) >= 0 ) && - ( (idx + lag - 2) <= max_indices[type] ) && - ( ( (idx + lag - 2) % 3 ) == 0 ) ) { + if ( verbose ) + HDfprintf(stdout, "4(r, %d, %d, %d) ", + 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) % 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, "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) <= max_indices[type] ) && - ( ( (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, "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) < max_indices[type] ) && - ( (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, "(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) < max_indices[type] ) && - ( (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, "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) < max_indices[type] ) && - ( (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, "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) < max_indices[type] ) && - ( (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, "(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) < max_indices[type] ) && - ( (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, "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) < max_indices[type] ) && - ( (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, "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 ) */ - if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { + if ( ( pass ) && ( idx >= 0 ) && ( idx <= local_max_index ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, idx); + HDfprintf(stdout, "13(p, %d, %d) ", type, idx); protect_entry(file_ptr, type, idx); } - if ( ( pass ) && ( (idx - lag + 2) >= 0 ) && - ( (idx - lag + 2) <= max_indices[type] ) && - ( ( (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, "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) <= max_indices[type] ) && - ( ( (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, "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) <= max_indices[type] ) ) { + 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 */ - unprotect_entry(file_ptr, type, idx - lag, H5C__NO_FLAGS_SET); + + if ( verbose ) + HDfprintf(stdout, "16(u, %d, %d) ", type, tmp_idx); + + 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 ) { - unprotect_entry(file_ptr, type, idx - lag, H5C__NO_FLAGS_SET); + if ( verbose ) + HDfprintf(stdout, "17(u, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, H5C__NO_FLAGS_SET); } else { - unprotect_entry(file_ptr, type, idx - lag, + if ( verbose ) + HDfprintf(stdout, "18(u, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } break; - case 2: /* we just did an insrt */ - unprotect_entry(file_ptr, type, idx - lag, H5C__DELETED_FLAG); + case 2: /* we just did an insert */ + + if ( verbose ) + HDfprintf(stdout, "19(u-del, %d, %d) ", type, tmp_idx); + + 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 ) { - unprotect_entry(file_ptr, type, idx - lag, H5C__DELETED_FLAG); + if ( verbose ) + HDfprintf(stdout, "20(u-del, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, H5C__DELETED_FLAG); } else { - unprotect_entry(file_ptr, type, idx - lag, + if ( verbose ) + HDfprintf(stdout, "21(u-del, %d, %d) ", type, tmp_idx); + + unprotect_entry(file_ptr, type, tmp_idx, (dirty_destroys ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET) | H5C__DELETED_FLAG); } @@ -3479,13 +3666,14 @@ row_major_scan_forward(H5F_t * file_ptr, } else { - if ( ( pass ) && ( (idx - lag) >= 0 ) && - ( ( idx - lag) <= max_indices[type] ) ) { + tmp_idx = idx - lag; + if ( ( pass ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) ) { if ( verbose ) - HDfprintf(stdout, "(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)); } } @@ -3631,6 +3819,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr, void row_major_scan_backward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -3648,6 +3837,7 @@ row_major_scan_backward(H5F_t * file_ptr, H5C_t * cache_ptr; int32_t type = NUMBER_OF_ENTRY_TYPES - 1; int32_t idx; + int32_t local_max_index; if ( verbose ) HDfprintf(stdout, "%s(): Entering.\n", fcn_name); @@ -3667,142 +3857,152 @@ row_major_scan_backward(H5F_t * file_ptr, while ( ( pass ) && ( type >= 0 ) ) { - idx = max_indices[type] + lag; + local_max_index = MIN(max_index, max_indices[type]); + + idx = local_max_index + lag; while ( ( pass ) && ( idx >= -lag ) ) { - if ( ( pass ) && ( do_inserts ) && ( (idx - lag) >= 0 ) && - ( (idx - lag) <= max_indices[type] ) && - ( ((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) % 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) % 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); } + /* (don't increment tmp_idx) */ + if ( ( pass ) && ( do_moves ) && ( tmp_idx >= 0 ) && + ( tmp_idx <= local_max_index ) && + ( ( tmp_idx % 3 ) == 0 ) ) { - if ( ( pass ) && ( do_moves ) && ( (idx - lag + 2) >= 0 ) && - ( (idx - lag + 2) <= max_indices[type] ) && - ( ( (idx - lag + 2) % 3 ) == 0 ) ) { + if ( verbose ) + HDfprintf(stdout, "(r, %d, %d, %d) ", + 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) % 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) % 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) % 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) % 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) % 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) % 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) % 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) % 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 ) HDfprintf(stdout, "(p, %d, %d) ", type, idx); @@ -3810,34 +4010,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) % 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) % 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 ) { @@ -3866,7 +4067,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; @@ -3878,7 +4079,7 @@ 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 ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); @@ -4029,6 +4230,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr, void col_major_scan_forward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -4041,14 +4243,19 @@ col_major_scan_forward(H5F_t * file_ptr, H5C_t * cache_ptr; int32_t type = 0; int32_t idx; + int32_t local_max_index[NUMBER_OF_ENTRY_TYPES]; if ( verbose ) 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 ); if ( reset_stats ) { @@ -4066,7 +4273,7 @@ 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)) ) ) { @@ -4076,7 +4283,9 @@ 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] ) ) { if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, idx); @@ -4085,7 +4294,7 @@ 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 ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); @@ -4199,7 +4408,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr, } if ( ( pass ) && ( i >= 0 ) && - ( i <= max_indices[type] ) ) { + ( i <= local_max_index ) ) { if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); @@ -4247,6 +4456,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr, void col_major_scan_backward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -4260,16 +4470,21 @@ col_major_scan_backward(H5F_t * file_ptr, int mile_stone = 1; int32_t type; int32_t idx; + int32_t local_max_index[NUMBER_OF_ENTRY_TYPES]; if ( verbose ) 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 ); if ( reset_stats ) { @@ -4278,7 +4493,7 @@ 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 */ HDfprintf(stdout, "%s: point %d.\n", fcn_name, mile_stone++); @@ -4291,7 +4506,7 @@ 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)) ) ) { @@ -4301,7 +4516,9 @@ 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] ) ) { if ( verbose ) HDfprintf(stdout, "(p, %d, %d) ", type, idx); @@ -4310,7 +4527,7 @@ 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 ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); @@ -4496,7 +4713,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; @@ -4630,7 +4846,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; @@ -4761,7 +4976,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; diff --git a/test/cache_common.h b/test/cache_common.h index d1c07e2..1a59f22 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -195,10 +195,32 @@ typedef struct test_entry_t struct test_entry_t * self; /* pointer to this entry -- used for * sanity checking. */ + H5F_t * file_ptr; /* pointer to the file in which the + * entry resides, or NULL if the entry + * is not in a file. + */ H5C_t * cache_ptr; /* pointer to the cache in which * the entry resides, or NULL if the * entry is not in cache. */ + hbool_t written_to_main_addr; + /* Flag indicating whether an image + * of the entry has been written to + * its main address. Since we no + * longer have a flush callback, we + * set this field to true whenever the + * entry is serialized while at its + * main address. + */ + hbool_t written_to_alt_addr; + /* Flag indicating whether an image + * of the entry has been written to + * its alternate address. Since we no + * longer have a flush callback, we + * set this field to true whenever the + * entry is serialized while at its + * alternate address. + */ haddr_t addr; /* where the cache thinks this entry * is located */ @@ -220,11 +242,11 @@ typedef struct test_entry_t */ int32_t index; /* index in its entry array */ - int32_t reads; /* number of times this entry has - * been loaded. + int32_t serializes; /* number of times this entry has + * been serialized. */ - int32_t writes; /* number of times this entry has - * been written + int32_t deserializes; /* number of times this entry has + * been deserialized */ hbool_t is_dirty; /* entry has been modified since * last write @@ -283,13 +305,10 @@ typedef struct test_entry_t * checking code that would otherwise * cause a false test failure. */ - hbool_t loaded; /* entry has been loaded since the - * last time it was reset. + hbool_t deserialized; /* entry has been deserialized since + * the last time it was reset. */ - hbool_t cleared; /* entry has been cleared since the - * last time it was reset. - */ - hbool_t flushed; /* entry has been flushed since the + hbool_t serialized; /* entry has been serialized since the * last time it was reset. */ hbool_t destroyed; /* entry has been destroyed since the @@ -367,40 +386,42 @@ if ( ( (cache_ptr) == NULL ) || \ } \ } + /* Macros used in H5AC level tests */ #define CACHE_CONFIGS_EQUAL(a, b, cmp_set_init, cmp_init_size) \ - ( ( (a).version == (b).version ) && \ - ( (a).rpt_fcn_enabled == (b).rpt_fcn_enabled ) && \ - ( (a).open_trace_file == (b).open_trace_file ) && \ - ( (a).close_trace_file == (b).close_trace_file ) && \ - ( ( (a).open_trace_file == FALSE ) || \ - ( strcmp((a).trace_file_name, (b).trace_file_name) == 0 ) ) && \ - ( (a).evictions_enabled == (b).evictions_enabled ) && \ - ( ( ! cmp_set_init ) || \ - ( (a).set_initial_size == (b).set_initial_size ) ) && \ - ( ( ! cmp_init_size ) || \ - ( (a).initial_size == (b).initial_size ) ) && \ - ( (a).min_clean_fraction == (b).min_clean_fraction ) && \ - ( (a).max_size == (b).max_size ) && \ - ( (a).min_size == (b).min_size ) && \ - ( (a).epoch_length == (b).epoch_length ) && \ - ( (a).incr_mode == (b).incr_mode ) && \ - ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \ - ( (a).increment == (b).increment ) && \ - ( (a).apply_max_increment == (b).apply_max_increment ) && \ - ( (a).max_increment == (b).max_increment ) && \ - ( (a).flash_incr_mode == (b).flash_incr_mode ) && \ - ( (a).flash_multiple == (b).flash_multiple ) && \ - ( (a).flash_threshold == (b).flash_threshold ) && \ - ( (a).decr_mode == (b).decr_mode ) && \ - ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \ - ( (a).decrement == (b).decrement ) && \ - ( (a).apply_max_decrement == (b).apply_max_decrement ) && \ - ( (a).max_decrement == (b).max_decrement ) && \ - ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \ - ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \ - ( (a).empty_reserve == (b).empty_reserve ) ) +( ( (a).version == (b).version ) && \ + ( (a).rpt_fcn_enabled == (b).rpt_fcn_enabled ) && \ + ( (a).open_trace_file == (b).open_trace_file ) && \ + ( (a).close_trace_file == (b).close_trace_file ) && \ + ( ( (a).open_trace_file == FALSE ) || \ + ( strcmp((a).trace_file_name, (b).trace_file_name) == 0 ) ) && \ + ( (a).evictions_enabled == (b).evictions_enabled ) && \ + ( ( ! cmp_set_init ) || \ + ( (a).set_initial_size == (b).set_initial_size ) ) && \ + ( ( ! cmp_init_size ) || \ + ( (a).initial_size == (b).initial_size ) ) && \ + ( DBL_REL_EQUAL((a).min_clean_fraction, (b).min_clean_fraction, 0.00001 ) ) && \ + ( (a).max_size == (b).max_size ) && \ + ( (a).min_size == (b).min_size ) && \ + ( (a).epoch_length == (b).epoch_length ) && \ + ( (a).incr_mode == (b).incr_mode ) && \ + ( DBL_REL_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).increment, (b).increment, 0.00001 ) ) && \ + ( (a).apply_max_increment == (b).apply_max_increment ) && \ + ( (a).max_increment == (b).max_increment ) && \ + ( (a).flash_incr_mode == (b).flash_incr_mode ) && \ + ( DBL_REL_EQUAL((a).flash_multiple, (b).flash_multiple, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).flash_threshold, (b).flash_threshold, 0.00001 ) ) && \ + ( (a).decr_mode == (b).decr_mode ) && \ + ( DBL_REL_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).decrement, (b).decrement, 0.00001 ) ) && \ + ( (a).apply_max_decrement == (b).apply_max_decrement ) && \ + ( (a).max_decrement == (b).max_decrement ) && \ + ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \ + ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \ + ( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) ) + #define RESIZE_CONFIGS_ARE_EQUAL(a, b, compare_init) \ ( ( (a).version == (b).version ) && \ @@ -409,26 +430,26 @@ if ( ( (cache_ptr) == NULL ) || \ ( (a).set_initial_size == (b).set_initial_size ) ) && \ ( ( ! compare_init ) || \ ( (a).initial_size == (b).initial_size ) ) && \ - ( (a).min_clean_fraction == (b).min_clean_fraction ) && \ + ( DBL_REL_EQUAL((a).min_clean_fraction, (b).min_clean_fraction, 0.00001 ) ) && \ ( (a).max_size == (b).max_size ) && \ ( (a).min_size == (b).min_size ) && \ ( (a).epoch_length == (b).epoch_length ) && \ ( (a).incr_mode == (b).incr_mode ) && \ - ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \ - ( (a).increment == (b).increment ) && \ + ( DBL_REL_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).increment, (b).increment, 0.00001 ) ) && \ ( (a).apply_max_increment == (b).apply_max_increment ) && \ ( (a).max_increment == (b).max_increment ) && \ ( (a).flash_incr_mode == (b).flash_incr_mode ) && \ - ( (a).flash_multiple == (b).flash_multiple ) && \ - ( (a).flash_threshold == (b).flash_threshold ) && \ + ( DBL_REL_EQUAL((a).flash_multiple, (b).flash_multiple, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).flash_threshold, (b).flash_threshold, 0.00001 ) ) && \ ( (a).decr_mode == (b).decr_mode ) && \ - ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \ - ( (a).decrement == (b).decrement ) && \ + ( DBL_REL_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold, 0.00001 ) ) && \ + ( DBL_REL_EQUAL((a).decrement, (b).decrement, 0.00001 ) ) && \ ( (a).apply_max_decrement == (b).apply_max_decrement ) && \ ( (a).max_decrement == (b).max_decrement ) && \ ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \ ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \ - ( (a).empty_reserve == (b).empty_reserve ) ) + ( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) ) #define XLATE_EXT_TO_INT_MDC_CONFIG(i, e) \ @@ -454,9 +475,6 @@ if ( ( (cache_ptr) == NULL ) || \ (i).flash_threshold = (e).flash_threshold; \ (i).decr_mode = (e).decr_mode; \ (i).upper_hr_threshold = (e).upper_hr_threshold; \ - (i).flash_incr_mode = (e).flash_incr_mode; \ - (i).flash_multiple = (e).flash_multiple; \ - (i).flash_threshold = (e).flash_threshold; \ (i).decrement = (e).decrement; \ (i).apply_max_decrement = (e).apply_max_decrement; \ (i).max_decrement = (e).max_decrement; \ @@ -465,6 +483,7 @@ if ( ( (cache_ptr) == NULL ) || \ (i).empty_reserve = (e).empty_reserve; \ } + /* misc type definitions */ @@ -478,9 +497,8 @@ struct expected_entry_status hbool_t is_dirty; hbool_t is_protected; hbool_t is_pinned; - hbool_t loaded; - hbool_t cleared; - hbool_t flushed; + hbool_t deserialized; + hbool_t serialized; hbool_t destroyed; }; @@ -489,13 +507,14 @@ struct expected_entry_status /* global variable externs: */ -extern const char *FILENAME[]; - +extern haddr_t saved_actual_base_addr; extern hbool_t write_permitted; extern hbool_t pass; /* set to false on error */ extern hbool_t skip_long_tests; extern hbool_t run_full_test; extern const char *failure_mssg; +extern int express_test; +extern int failures; extern test_entry_t pico_entries[NUM_PICO_ENTRIES]; extern test_entry_t nano_entries[NUM_NANO_ENTRIES]; @@ -568,6 +587,10 @@ void move_entry(H5C_t * cache_ptr, int32_t idx, hbool_t main_addr); +void pin_protected_entry(H5F_t * file_ptr, + int32_t type, + int32_t idx); + void protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx); @@ -586,6 +609,11 @@ void create_pinned_entry_dependency(H5F_t * file_ptr, int pinned_type, int pinned_idx); +void execute_flush_op(H5F_t * file_ptr, + struct test_entry_t * entry_ptr, + struct flush_op * op_ptr, + unsigned * flags_ptr); + void reset_entries(void); void resize_entry(H5F_t * file_ptr, @@ -597,6 +625,7 @@ void resize_entry(H5F_t * file_ptr, H5F_t *setup_cache(size_t max_cache_size, size_t min_clean_size); void row_major_scan_forward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -619,6 +648,7 @@ void hl_row_major_scan_forward(H5F_t * file_ptr, hbool_t do_inserts); void row_major_scan_backward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -641,6 +671,7 @@ void hl_row_major_scan_backward(H5F_t * file_ptr, hbool_t do_inserts); void col_major_scan_forward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, @@ -659,6 +690,7 @@ void hl_col_major_scan_forward(H5F_t * file_ptr, int dirty_unprotects); void col_major_scan_backward(H5F_t * file_ptr, + int32_t max_index, int32_t lag, hbool_t verbose, hbool_t reset_stats, 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 03ac97a..97d11a2 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -20,37 +20,38 @@ #include "h5test.h" #include "testpar.h" -#include "H5Iprivate.h" -#include "H5ACprivate.h" - -#define H5C_PACKAGE /*suppress error about including H5Cpkg */ - -#include "H5Cpkg.h" #define H5AC_PACKAGE /*suppress error about including H5ACpkg */ +#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 H5F_PACKAGE /*suppress error about including H5Fpkg */ -#include "H5Fpkg.h" +#define BASE_ADDR (haddr_t)1024 int nerrors = 0; int failures = 0; hbool_t verbose = TRUE; /* used to control error messages */ -#if 0 -/* 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] const char *FILENAME[NFILENAME]={"CacheTestDummy", NULL}; char filenames[NFILENAME][PATH_MAX]; hid_t fapl; /* file access property list */ +haddr_t max_addr = 0; /* used to store the end of + * the address space used by + * the data array (see below). + */ +hbool_t callbacks_verbose = FALSE; /* flag used to control whether + * the callback functions are in + * verbose mode. + */ int world_mpi_size = -1; @@ -66,8 +67,6 @@ MPI_Comm file_mpi_comm = MPI_COMM_NULL; * to check the validity of the statistics maintained by H5C.c */ -long datum_clears = 0; -long datum_pinned_clears = 0; long datum_destroys = 0; long datum_flushes = 0; long datum_pinned_flushes = 0; @@ -307,13 +306,29 @@ hbool_t serve_write_request(struct mssg_t * mssg_ptr); /* call back functions & related data structures */ -herr_t clear_datum(H5F_t * f, void * thing, hbool_t dest); -herr_t destroy_datum(H5F_t UNUSED * f, void * thing); -herr_t flush_datum(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, haddr_t addr, - void *thing); -void * load_datum(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, - void UNUSED *udata); -herr_t size_datum(H5F_t UNUSED * f, void * thing, size_t * size_ptr); +static herr_t datum_get_load_size(const void * udata_ptr, + size_t *image_len_ptr); + +static void * datum_deserialize(const void * image_ptr, + size_t len, + void * udata_ptr, + hbool_t * dirty_ptr); + +static herr_t datum_image_len(void *thing, + size_t *image_len_ptr); + +static herr_t datum_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 datum_free_icr(void * thing); #define DATUM_ENTRY_TYPE H5AC_TEST_ID @@ -323,11 +338,14 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = { { DATUM_ENTRY_TYPE, - (H5C_load_func_t)load_datum, - (H5C_flush_func_t)flush_datum, - (H5C_dest_func_t)destroy_datum, - (H5C_clear_func_t)clear_datum, - (H5C_size_func_t)size_datum + "datum", + H5FD_MEM_DEFAULT, + H5AC__CLASS_NO_FLAGS_SET, + (H5C_get_load_size_func_t)datum_get_load_size, + (H5C_deserialize_func_t)datum_deserialize, + (H5C_image_len_func_t)datum_image_len, + (H5C_serialize_func_t)datum_serialize, + (H5C_free_icr_func_t)datum_free_icr, } }; @@ -401,9 +419,8 @@ void print_stats(void) { HDfprintf(stdout, - "%d: datum clears / pinned clears / destroys = %ld / %ld / %ld\n", - world_mpi_rank, datum_clears, datum_pinned_clears, - datum_destroys ); + "%d: destroys = %ld\n", + world_mpi_rank, datum_destroys ); HDfprintf(stdout, "%d: datum flushes / pinned flushes / loads = %ld / %ld / %ld\n", world_mpi_rank, datum_flushes, datum_pinned_flushes, @@ -436,8 +453,6 @@ print_stats(void) void reset_stats(void) { - datum_clears = 0; - datum_pinned_clears = 0; datum_destroys = 0; datum_flushes = 0; datum_pinned_flushes = 0; @@ -699,7 +714,7 @@ init_data(void) 1974, 3194, 5168, 8362, 13539}; int i; int j = 0; - haddr_t addr = 0; + haddr_t addr = BASE_ADDR; /* this must hold so moves don't change entry size. */ HDassert( (NUM_DATA_ENTRIES / 2) % 20 == 0 ); @@ -726,6 +741,9 @@ init_data(void) j = (j + 1) % num_addr_offsets; } + /* save the end of the address space used by the data array */ + max_addr = addr; + return; } /* init_data() */ @@ -1633,102 +1651,255 @@ serve_write_request(struct mssg_t * mssg_ptr) /*------------------------------------------------------------------------- - * Function: clear_datum + * Function: datum_get_load_size * - * Purpose: Mark the datum as clean and destroy it if requested. - * Do not write it to the server, or increment the version. + * Purpose: Query the image size for an entry before deserializing it * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer - * 12/29/05 + * Programmer: Quincey Koziol + * 5/18/10 + * + *------------------------------------------------------------------------- + */ +static herr_t +datum_get_load_size(const void * udata_ptr, + size_t *image_len_ptr) +{ + const char * fcn_name = "datum_get_load_size()"; + haddr_t addr = *(haddr_t *)udata_ptr; + int idx; + struct datum * entry_ptr; + + HDassert( udata_ptr ); + HDassert( image_len_ptr ); + + idx = addr_to_datum_index(addr); + + HDassert( idx >= 0 ); + HDassert( idx < NUM_DATA_ENTRIES ); + HDassert( idx < virt_num_data_entries ); + + entry_ptr = &(data[idx]); + + HDassert( addr == entry_ptr->base_addr ); + HDassert( ! entry_ptr->global_pinned ); + HDassert( ! entry_ptr->local_pinned ); + + if ( callbacks_verbose ) { + + HDfprintf(stdout, + "%d: get_load_size() idx = %d, addr = %ld, len = %d.\n", + world_mpi_rank, idx, (long)addr, (int)entry_ptr->local_len); + fflush(stdout); + } + + /* Set image length size */ + *image_len_ptr = entry_ptr->local_len; + + return(SUCCEED); +} /* get_load_size() */ + + +/*------------------------------------------------------------------------- + * Function: datum_deserialize + * + * Purpose: deserialize the entry. + * + * Return: void * (pointer to the in core representation of the entry) + * + * Programmer: John Mainzer + * 9/20/07 * * Modifications: * - * JRM -- 7/11/06 - * Modified code to support the local_len field of datum. - * This field allow us to track the cache's value for the - * length of the entry, while retaining the original - * value for communications with the server. + * None * *------------------------------------------------------------------------- */ -herr_t -clear_datum(H5F_t * f, - void * thing, - hbool_t dest) +void * +datum_deserialize(const void * image_ptr, + UNUSED size_t len, + void * udata_ptr, + hbool_t * dirty_ptr) { + const char * fcn_name = "load_datum()"; + haddr_t addr = *(haddr_t *)udata_ptr; + hbool_t success = TRUE; int idx; - struct datum * entry_ptr; - - HDassert( thing ); + struct datum * entry_ptr = NULL; + struct mssg_t mssg; - entry_ptr = (struct datum *)thing; + HDassert( image_ptr != NULL ); - idx = addr_to_datum_index(entry_ptr->base_addr); + idx = addr_to_datum_index(addr); HDassert( idx >= 0 ); HDassert( idx < NUM_DATA_ENTRIES ); HDassert( idx < virt_num_data_entries ); - HDassert( &(data[idx]) == entry_ptr ); - HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); - HDassert( ( entry_ptr->header.size == entry_ptr->len ) || - ( entry_ptr->header.size == entry_ptr->local_len ) ); + entry_ptr = &(data[idx]); - entry_ptr->header.is_dirty = FALSE; - entry_ptr->dirty = FALSE; + HDassert( addr == entry_ptr->base_addr ); + HDassert( ! entry_ptr->global_pinned ); + HDassert( ! entry_ptr->local_pinned ); - if ( dest ) { + if ( callbacks_verbose ) { - destroy_datum(f, thing); + HDfprintf(stdout, + "%d: deserialize() idx = %d, addr = %ld, len = %d, is_dirty = %d.\n", + world_mpi_rank, idx, (long)addr, (int)len, + (int)(entry_ptr->header.is_dirty)); + fflush(stdout); + } + /* compose the read message */ + mssg.req = READ_REQ_CODE; + mssg.src = world_mpi_rank; + mssg.dest = world_server_mpi_rank; + mssg.mssg_num = -1; /* set by send function */ + mssg.base_addr = entry_ptr->base_addr; + mssg.len = entry_ptr->len; + mssg.ver = 0; /* bogus -- should be corrected by server */ + mssg.magic = MSSG_MAGIC; + + if ( ! send_mssg(&mssg, FALSE) ) { + + nerrors++; + success = FALSE; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", + world_mpi_rank, fcn_name); + } } - datum_clears++; + if ( success ) { - if ( entry_ptr->header.is_pinned ) { + if ( ! recv_mssg(&mssg, READ_REQ_REPLY_CODE) ) { - datum_pinned_clears++; - HDassert( entry_ptr->global_pinned || entry_ptr->local_pinned ); + nerrors++; + success = FALSE; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", + world_mpi_rank, fcn_name); + } + } } - return(SUCCEED); + if ( success ) { -} /* clear_datum() */ + if ( ( mssg.req != READ_REQ_REPLY_CODE ) || + ( mssg.src != world_server_mpi_rank ) || + ( mssg.dest != world_mpi_rank ) || + ( mssg.base_addr != entry_ptr->base_addr ) || + ( mssg.len != entry_ptr->len ) || + ( mssg.ver < entry_ptr->ver ) || + ( mssg.magic != MSSG_MAGIC ) ) { + nerrors++; + success = FALSE; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n", + world_mpi_rank, fcn_name); + } +#if 0 /* This has been useful debugging code -- keep it for now. */ + if ( mssg.req != READ_REQ_REPLY_CODE ) { + + HDfprintf(stdout, "%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n", + world_mpi_rank, fcn_name); + HDfprintf(stdout, "%d:%s: mssg.req = %d.\n", + world_mpi_rank, fcn_name, (int)(mssg.req)); + } + + if ( mssg.src != world_server_mpi_rank ) { + + HDfprintf(stdout, "%d:%s: mssg.src != world_server_mpi_rank.\n", + world_mpi_rank, fcn_name); + } + + if ( mssg.dest != world_mpi_rank ) { + + HDfprintf(stdout, "%d:%s: mssg.dest != world_mpi_rank.\n", + world_mpi_rank, fcn_name); + } + + if ( mssg.base_addr != entry_ptr->base_addr ) { + + HDfprintf(stdout, + "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n", + world_mpi_rank, fcn_name); + HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n", + world_mpi_rank, fcn_name, mssg.base_addr); + HDfprintf(stdout, "%d:%s: entry_ptr->base_addr = %a.\n", + world_mpi_rank, fcn_name, entry_ptr->base_addr); + } + + if ( mssg.len != entry_ptr->len ) { + + HDfprintf(stdout, "%d:%s: mssg.len != entry_ptr->len.\n", + world_mpi_rank, fcn_name); + HDfprintf(stdout, "%d:%s: mssg.len = %a.\n", + world_mpi_rank, fcn_name, mssg.len); + } + + if ( mssg.ver < entry_ptr->ver ) { + + HDfprintf(stdout, "%d:%s: mssg.ver < entry_ptr->ver.\n", + world_mpi_rank, fcn_name); + } + + if ( mssg.magic != MSSG_MAGIC ) { + + HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n", + world_mpi_rank, fcn_name); + } +#endif /* JRM */ + } else { + + entry_ptr->ver = mssg.ver; + entry_ptr->dirty = FALSE; + *dirty_ptr = FALSE; + } + } + + if ( ! success ) { + + entry_ptr = NULL; + + } + + datum_loads++; + + return(entry_ptr); + +} /* deserialize() */ + + /*------------------------------------------------------------------------- - * Function: destroy_datum() + * Function: datum_image_len * - * Purpose: Destroy the entry. At present, this means do nothing other - * than verify that the entry is clean. In particular, do not - * write it to the server process. + * Purpose: Return the real (and possibly reduced) length of the image. + * The helper functions verify that the correct version of + * deserialize is being called, and then call deserialize + * proper. * - * Return: SUCCEED + * Return: SUCCEED * - * Programmer: John Mainzer - * 12/29/05 - * - * Modifications: - * - * JRM -- 7/11/06 - * Modified code to support the local_len field of datum. - * This field allow us to track the cache's value for the - * length of the entry, while retaining the original - * value for communications with the server. + * Programmer: John Mainzer + * 9/19/07 * *------------------------------------------------------------------------- */ herr_t -destroy_datum(H5F_t UNUSED * f, - void * thing) +datum_image_len(void *thing, size_t *image_len) { int idx; struct datum * entry_ptr; HDassert( thing ); + HDassert( image_len ); entry_ptr = (struct datum *)thing; @@ -1738,65 +1909,70 @@ destroy_datum(H5F_t UNUSED * f, HDassert( idx < NUM_DATA_ENTRIES ); HDassert( idx < virt_num_data_entries ); HDassert( &(data[idx]) == entry_ptr ); + HDassert( entry_ptr->local_len > 0 ); + HDassert( entry_ptr->local_len <= entry_ptr->len ); - HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); - HDassert( ( entry_ptr->header.size == entry_ptr->len ) || - ( entry_ptr->header.size == entry_ptr->local_len ) ); + if(callbacks_verbose) { + HDfprintf(stdout, + "%d: image_len() idx = %d, addr = %ld, len = %d.\n", + world_mpi_rank, idx, (long)(entry_ptr->base_addr), + (int)(entry_ptr->local_len)); + fflush(stdout); + } - HDassert( !(entry_ptr->dirty) ); - HDassert( !(entry_ptr->header.is_dirty) ); - HDassert( !(entry_ptr->global_pinned) ); - HDassert( !(entry_ptr->local_pinned) ); - HDassert( !(entry_ptr->header.is_pinned) ); + HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); - datum_destroys++; + *image_len = entry_ptr->local_len; return(SUCCEED); +} /* datum_image_len() */ -} /* destroy_datum() */ - + /*------------------------------------------------------------------------- - * Function: flush_datum + * Function: datum_serialize * - * Purpose: Flush the entry to the server process and mark it as clean. - * Then destroy the entry if requested. + * Purpose: Serialize the supplied entry. * - * Return: SUCCEED if successful, and FAIL otherwise. + * Return: SUCCEED if successful, FAIL otherwise. * - * Programmer: John Mainzer - * 12/29/05 + * Programmer: John Mainzer + * 10/30/07 * * Modifications: * - * JRM -- 5/9/06 - * Added code to receive the write request ack messages - * from the server. This is part of a speculative fix to - * a bug spotted on Cobalt. If it doesn't fix the problem, - * it will narrow down the possibilities. - * - * JRM -- 7/11/06 - * Modified code to support the local_len field of datum. - * This field allow us to track the cache's value for the - * length of the entry, while retaining the original - * value for communications with the server. + * None. * *------------------------------------------------------------------------- */ herr_t -flush_datum(H5F_t *f, - hid_t UNUSED dxpl_id, - hbool_t dest, - haddr_t UNUSED addr, - void *thing) +datum_serialize(const H5F_t UNUSED *f, + hid_t UNUSED dxpl_id, + haddr_t UNUSED addr, + size_t UNUSED len, + void * image_ptr, + void * thing, + unsigned * flags_ptr, + haddr_t * new_addr_ptr, + size_t * new_len_ptr, + void ** new_image_ptr_ptr) { - const char * fcn_name = "flush_datum()"; + + const char * fcn_name = "datum_serialize()"; herr_t ret_value = SUCCEED; int idx; struct datum * entry_ptr; struct mssg_t mssg; HDassert( thing ); + HDassert( image_ptr ); + HDassert( flags_ptr ); + + *flags_ptr = 0; + + HDassert( new_addr_ptr ); + HDassert( new_len_ptr ); + HDassert( new_image_ptr_ptr ); entry_ptr = (struct datum *)thing; @@ -1807,6 +1983,14 @@ flush_datum(H5F_t *f, HDassert( idx < virt_num_data_entries ); HDassert( &(data[idx]) == entry_ptr ); + if ( callbacks_verbose ) { + + HDfprintf(stdout, + "%d: serialize() idx = %d, addr = %ld, len = %d.\n", + world_mpi_rank, idx, (long)addr, (int)len); + fflush(stdout); + } + HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); HDassert( ( entry_ptr->header.size == entry_ptr->len ) || ( entry_ptr->header.size == entry_ptr->local_len ) ); @@ -1821,76 +2005,68 @@ flush_datum(H5F_t *f, world_mpi_rank, fcn_name); } - if ( ret_value == SUCCEED ) { + if ( ret_value == SUCCEED ) { - if ( entry_ptr->header.is_dirty ) { + if ( entry_ptr->header.is_dirty ) { - /* compose the message */ - mssg.req = WRITE_REQ_CODE; - mssg.src = world_mpi_rank; - mssg.dest = world_server_mpi_rank; - mssg.mssg_num = -1; /* set by send function */ - mssg.base_addr = entry_ptr->base_addr; - mssg.len = entry_ptr->len; - mssg.ver = entry_ptr->ver; - mssg.magic = MSSG_MAGIC; + /* compose the message */ + mssg.req = WRITE_REQ_CODE; + mssg.src = world_mpi_rank; + mssg.dest = world_server_mpi_rank; + mssg.mssg_num = -1; /* set by send function */ + mssg.base_addr = entry_ptr->base_addr; + mssg.len = entry_ptr->len; + mssg.ver = entry_ptr->ver; + mssg.magic = MSSG_MAGIC; - if ( ! send_mssg(&mssg, FALSE) ) { + if ( ! send_mssg(&mssg, FALSE) ) { - nerrors++; - ret_value = FAIL; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, fcn_name); + nerrors++; + ret_value = FAIL; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", + world_mpi_rank, fcn_name); + } + } + else + { + entry_ptr->header.is_dirty = FALSE; + entry_ptr->dirty = FALSE; } - } - else - { - entry_ptr->header.is_dirty = FALSE; - entry_ptr->dirty = FALSE; } } - } #if DO_WRITE_REQ_ACK - if ( ( ret_value == SUCCEED ) && ( entry_ptr->header.is_dirty ) ) { + if ( ( ret_value == SUCCEED ) && ( entry_ptr->header.is_dirty ) ) { - if ( ! recv_mssg(&mssg, WRITE_REQ_ACK_CODE) ) { + if ( ! recv_mssg(&mssg, WRITE_REQ_ACK_CODE) ) { - nerrors++; - ret_value = FAIL; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); - } - } else if ( ( mssg.req != WRITE_REQ_ACK_CODE ) || - ( mssg.src != world_server_mpi_rank ) || - ( mssg.dest != world_mpi_rank ) || - ( mssg.base_addr != entry_ptr->base_addr ) || - ( mssg.len != entry_ptr->len ) || - ( mssg.ver != entry_ptr->ver ) || - ( mssg.magic != MSSG_MAGIC ) ) { + nerrors++; + ret_value = FAIL; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", + world_mpi_rank, fcn_name); + } + } else if ( ( mssg.req != WRITE_REQ_ACK_CODE ) || + ( mssg.src != world_server_mpi_rank ) || + ( mssg.dest != world_mpi_rank ) || + ( mssg.base_addr != entry_ptr->base_addr ) || + ( mssg.len != entry_ptr->len ) || + ( mssg.ver != entry_ptr->ver ) || + ( mssg.magic != MSSG_MAGIC ) ) { - nerrors++; - ret_value = FAIL; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", - world_mpi_rank, fcn_name); + nerrors++; + ret_value = FAIL; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: Bad data in write req ack.\n", + world_mpi_rank, fcn_name); + } } } - } #endif /* DO_WRITE_REQ_ACK */ - if ( ret_value == SUCCEED ) { - - if ( dest ) { - - ret_value = destroy_datum(f, thing); - } - } - datum_flushes++; if ( entry_ptr->header.is_pinned ) { @@ -1901,203 +2077,37 @@ flush_datum(H5F_t *f, return(ret_value); -} /* flush_datum() */ +} /* datum_serialize() */ + /*------------------------------------------------------------------------- - * Function: load_datum + * Function: datum_free_icr * - * Purpose: Read the requested entry from the server and mark it as - * clean. + * Purpose: Nominally, this callback is supposed to free the + * in core representation of the entry. * - * Return: SUCCEED if successful, FAIL otherwise. + * In the context of this test bed, we use it to do + * do all the processing we used to do on a destroy. * - * Programmer: John Mainzer - * 12/29/05 + * Return: SUCCEED * - * Modifications: - * - *------------------------------------------------------------------------- - */ - -void * -load_datum(H5F_t UNUSED *f, - hid_t UNUSED dxpl_id, - haddr_t addr, - void UNUSED *udata) -{ - const char * fcn_name = "load_datum()"; - hbool_t success = TRUE; - int idx; - struct datum * entry_ptr = NULL; - struct mssg_t mssg; - - idx = addr_to_datum_index(addr); - - HDassert( idx >= 0 ); - HDassert( idx < NUM_DATA_ENTRIES ); - HDassert( idx < virt_num_data_entries ); - - entry_ptr = &(data[idx]); - - HDassert( addr == entry_ptr->base_addr ); - HDassert( ! entry_ptr->global_pinned ); - HDassert( ! entry_ptr->local_pinned ); - - /* compose the read message */ - mssg.req = READ_REQ_CODE; - mssg.src = world_mpi_rank; - mssg.dest = world_server_mpi_rank; - mssg.mssg_num = -1; /* set by send function */ - mssg.base_addr = entry_ptr->base_addr; - mssg.len = entry_ptr->len; - mssg.ver = 0; /* bogus -- should be corrected by server */ - mssg.magic = MSSG_MAGIC; - - if ( ! send_mssg(&mssg, FALSE) ) { - - nerrors++; - success = FALSE; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: send_mssg() failed.\n", - world_mpi_rank, fcn_name); - } - } - - if ( success ) { - - if ( ! recv_mssg(&mssg, READ_REQ_REPLY_CODE) ) { - - nerrors++; - success = FALSE; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: recv_mssg() failed.\n", - world_mpi_rank, fcn_name); - } - } - } - - if ( success ) { - - if ( ( mssg.req != READ_REQ_REPLY_CODE ) || - ( mssg.src != world_server_mpi_rank ) || - ( mssg.dest != world_mpi_rank ) || - ( mssg.base_addr != entry_ptr->base_addr ) || - ( mssg.len != entry_ptr->len ) || - ( mssg.ver < entry_ptr->ver ) || - ( mssg.magic != MSSG_MAGIC ) ) { - - nerrors++; - success = FALSE; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: Bad data in read req reply.\n", - world_mpi_rank, fcn_name); - } -#if 0 /* This has been useful debugging code -- keep it for now. */ - if ( mssg.req != READ_REQ_REPLY_CODE ) { - - HDfprintf(stdout, "%d:%s: mssg.req != READ_REQ_REPLY_CODE.\n", - world_mpi_rank, fcn_name); - HDfprintf(stdout, "%d:%s: mssg.req = %d.\n", - world_mpi_rank, fcn_name, (int)(mssg.req)); - } - - if ( mssg.src != world_server_mpi_rank ) { - - HDfprintf(stdout, "%d:%s: mssg.src != world_server_mpi_rank.\n", - world_mpi_rank, fcn_name); - } - - if ( mssg.dest != world_mpi_rank ) { - - HDfprintf(stdout, "%d:%s: mssg.dest != world_mpi_rank.\n", - world_mpi_rank, fcn_name); - } - - if ( mssg.base_addr != entry_ptr->base_addr ) { - - HDfprintf(stdout, - "%d:%s: mssg.base_addr != entry_ptr->base_addr.\n", - world_mpi_rank, fcn_name); - HDfprintf(stdout, "%d:%s: mssg.base_addr = %a.\n", - world_mpi_rank, fcn_name, mssg.base_addr); - HDfprintf(stdout, "%d:%s: entry_ptr->base_addr = %a.\n", - world_mpi_rank, fcn_name, entry_ptr->base_addr); - } - - if ( mssg.len != entry_ptr->len ) { - - HDfprintf(stdout, "%d:%s: mssg.len != entry_ptr->len.\n", - world_mpi_rank, fcn_name); - HDfprintf(stdout, "%d:%s: mssg.len = %a.\n", - world_mpi_rank, fcn_name, mssg.len); - } - - if ( mssg.ver < entry_ptr->ver ) { - - HDfprintf(stdout, "%d:%s: mssg.ver < entry_ptr->ver.\n", - world_mpi_rank, fcn_name); - } - - if ( mssg.magic != MSSG_MAGIC ) { - - HDfprintf(stdout, "%d:%s: mssg.magic != MSSG_MAGIC.\n", - world_mpi_rank, fcn_name); - } -#endif /* JRM */ - } else { - - entry_ptr->ver = mssg.ver; - entry_ptr->header.is_dirty = FALSE; - entry_ptr->dirty = FALSE; - } - } - - if ( ! success ) { - - entry_ptr = NULL; - - } - - datum_loads++; - - return(entry_ptr); - -} /* load_datum() */ - -/*------------------------------------------------------------------------- - * Function: size_datum - * - * Purpose: Get the size of the specified entry. Just look at the - * local copy, as size can't change. - * - * Return: SUCCEED - * - * Programmer: John Mainzer - * 6/10/04 + * Programmer: John Mainzer + * 9/19/07 * * Modifications: * - * JRM -- 7/11/06 - * Modified function to return the local_len field instead - * of the len field. These two fields usually contain the - * same value, but if the size of an entry is changed, we - * store the altered size in local_len without changing - * len. Note that local_len must be positive, and may - * not exceed len. + * None. * *------------------------------------------------------------------------- */ herr_t -size_datum(H5F_t UNUSED * f, - void * thing, - size_t * size_ptr) +datum_free_icr(void * thing) { int idx; struct datum * entry_ptr; HDassert( thing ); - HDassert( size_ptr ); entry_ptr = (struct datum *)thing; @@ -2107,16 +2117,29 @@ size_datum(H5F_t UNUSED * f, HDassert( idx < NUM_DATA_ENTRIES ); HDassert( idx < virt_num_data_entries ); HDassert( &(data[idx]) == entry_ptr ); - HDassert( entry_ptr->local_len > 0 ); - HDassert( entry_ptr->local_len <= entry_ptr->len ); + + if ( callbacks_verbose ) { + + HDfprintf(stdout, + "%d: free_icr() idx = %d, dirty = %d.\n", + world_mpi_rank, idx, (int)(entry_ptr->dirty)); + fflush(stdout); + } HDassert( entry_ptr->header.addr == entry_ptr->base_addr ); + HDassert( ( entry_ptr->header.size == entry_ptr->len ) || + ( entry_ptr->header.size == entry_ptr->local_len ) ); + + HDassert( !(entry_ptr->header.is_dirty) ); + HDassert( !(entry_ptr->global_pinned) ); + HDassert( !(entry_ptr->local_pinned) ); + HDassert( !(entry_ptr->header.is_pinned) ); - *size_ptr = entry_ptr->local_len; + datum_destroys++; return(SUCCEED); -} /* size_datum() */ +} /* datum_free_icr() */ /*****************************************************************************/ @@ -2161,7 +2184,7 @@ expunge_entry(H5F_t * file_ptr, HDassert( !(entry_ptr->global_pinned) ); HDassert( !(entry_ptr->local_pinned) ); - entry_ptr->dirty = TRUE; + entry_ptr->dirty = FALSE; if ( nerrors == 0 ) { @@ -2678,9 +2701,9 @@ lock_entry(H5F_t * file_ptr, HDassert( ! (entry_ptr->locked) ); - cache_entry_ptr = (H5C_cache_entry_t *)H5AC_protect(file_ptr, -1, &(types[0]), - entry_ptr->base_addr, - NULL, H5AC_WRITE); + 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); if ( ( cache_entry_ptr != (void *)(&(entry_ptr->header)) ) || ( entry_ptr->header.type != &(types[0]) ) || @@ -3125,6 +3148,7 @@ setup_cache_for_test(hid_t * fid_ptr, H5AC_cache_config_t config; H5F_t * file_ptr = NULL; H5C_t * cache_ptr = NULL; + haddr_t actual_base_addr; HDassert ( fid_ptr != NULL ); HDassert ( file_ptr_ptr != NULL ); @@ -3224,128 +3248,40 @@ setup_cache_for_test(hid_t * fid_ptr, #endif /* DO_SYNC_AFTER_WRITE */ - return(success); - -} /* setup_cache_for_test() */ - - -/***************************************************************************** - * - * 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)) ) ) { + if ( success ) { /* allocate space for test entries */ - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: can't get new property list object.\n", - world_mpi_rank, fcn_name); - } - } + actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5P_DEFAULT, + (hsize_t)(max_addr + BASE_ADDR)); - /* 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 ) ) { + if ( actual_base_addr == HADDR_UNDEF ) { - nerrors++; - if ( verbose ) { - HDfprintf(stdout, - "%d:%s: can't insert metadata cache dxpl property 1.\n", - world_mpi_rank, fcn_name); - } - } + success = FALSE; + nerrors++; - /* 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 ) ) { + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5MF_alloc() failed.\n", + world_mpi_rank, fcn_name); + } - nerrors++; - if ( verbose ) { - HDfprintf(stdout, - "%d:%s: can't insert metadata cache dxpl property 2.\n", - world_mpi_rank, fcn_name); - } - } + } else if ( actual_base_addr > BASE_ADDR ) { - /* 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 ) ) { + /* If this happens, must increase BASE_ADDR so that the + * actual_base_addr is <= BASE_ADDR. This should only happen + * if the size of the superblock is increase. + */ + success = FALSE; + nerrors++; - nerrors++; - if ( verbose ) { - HDfprintf(stdout, "%d:%s: unable to set value.\n", world_mpi_rank, - fcn_name); + if ( verbose ) { + HDfprintf(stdout, "%d:%s: actual_base_addr > BASE_ADDR.\n", + world_mpi_rank, fcn_name); + } } } return(success); -} /* setup_noblock_dxpl_id() */ -#endif +} /* setup_cache_for_test() */ /***************************************************************************** @@ -3981,15 +3917,10 @@ smoke_check_1(void) } } - /* verify that all instance of datum are back where the started - * and are clean. - */ + /* verify that all instance of datum are back where the started. */ for ( i = 0; i < NUM_DATA_ENTRIES; i++ ) - { HDassert( data_index[i] == i ); - HDassert( ! (data[i].dirty) ); - } /* compose the done message */ mssg.req = DONE_REQ_CODE; @@ -4195,15 +4126,10 @@ smoke_check_2(void) } } - /* verify that all instance of datum are back where the started - * and are clean. - */ + /* verify that all instance of datum are back where the started. */ for ( i = 0; i < NUM_DATA_ENTRIES; i++ ) - { HDassert( data_index[i] == i ); - HDassert( ! (data[i].dirty) ); - } /* compose the done message */ mssg.req = DONE_REQ_CODE; @@ -4510,15 +4436,10 @@ smoke_check_3(void) } } - /* verify that all instances of datum are back where the started - * and are clean. - */ + /* verify that all instances of datum are back where the started. */ for ( i = 0; i < NUM_DATA_ENTRIES; i++ ) - { HDassert( data_index[i] == i ); - HDassert( ! (data[i].dirty) ); - } /* compose the done message */ mssg.req = DONE_REQ_CODE; @@ -4821,15 +4742,10 @@ smoke_check_4(void) } } - /* verify that all instance of datum are back where the started - * and are clean. - */ + /* verify that all instance of datum are back where the started. */ for ( i = 0; i < NUM_DATA_ENTRIES; i++ ) - { HDassert( data_index[i] == i ); - HDassert( ! (data[i].dirty) ); - } /* compose the done message */ mssg.req = DONE_REQ_CODE; @@ -5019,15 +4935,10 @@ smoke_check_5(void) } } - /* verify that all instance of datum are back where the started - * and are clean. - */ + /* verify that all instance of datum are back where the started. */ for ( i = 0; i < NUM_DATA_ENTRIES; i++ ) - { HDassert( data_index[i] == i ); - HDassert( ! (data[i].dirty) ); - } /* compose the done message */ mssg.req = DONE_REQ_CODE; @@ -5120,6 +5031,10 @@ smoke_check_5(void) * Updated for H5AC_expunge_entry() and * H5AC_resize_entry(). * + * JRM -- 2/14/08 + * Updated for changes in H5AC_set_cache_auto_resize_config + * to support the new flash cache size increment code. + * *****************************************************************************/ hbool_t @@ -5132,29 +5047,29 @@ trace_file_check(void) const char * fcn_name = "trace_file_check()"; const char * expected_output[] = { - "### HDF5 metadata cache trace file version 1 ###\n", - "H5AC_set_cache_auto_resize_config 1 0 1 0 \"t_cache_trace.txt\" 1 0 1048576 0.500000 16777216 1048576 50000 1 0.900000 2.000000 1 1.000000 0.250000 1 4194304 3 0.999000 0.900000 1 1048576 3 1 0.100000 262144 0\n", - "H5AC_insert_entry 0x0 15 0x0 2 0\n", - "H5AC_insert_entry 0x2 15 0x0 2 0\n", - "H5AC_insert_entry 0x4 15 0x0 4 0\n", - "H5AC_insert_entry 0x8 15 0x0 6 0\n", - "H5AC_protect 0 15 H5AC_WRITE 2 1\n", - "H5AC_mark_entry_dirty 0 0\n", - "H5AC_unprotect 0 15 0 0 0\n", - "H5AC_protect 2 15 H5AC_WRITE 2 1\n", - "H5AC_pin_protected_entry 2 0\n", - "H5AC_unprotect 2 15 0 0 0\n", - "H5AC_unpin_entry 2 0\n", - "H5AC_expunge_entry 2 15 0\n", - "H5AC_protect 4 15 H5AC_WRITE 4 1\n", - "H5AC_pin_protected_entry 4 0\n", - "H5AC_unprotect 4 15 0 0 0\n", - "H5AC_mark_entry_dirty 0x4 0 0 0\n", - "H5AC_resize_entry 0x4 2 0\n", - "H5AC_resize_entry 0x4 4 0\n", - "H5AC_unpin_entry 4 0\n", - "H5AC_move_entry 0 8a65 15 0\n", - "H5AC_move_entry 8a65 0 15 0\n", + "### HDF5 metadata cache trace file version 2 ###\n", + "H5AC_set_cache_auto_resize_config 1 0 1 0 \"t_cache_trace.txt\" 1 0 1048576 0.500000 16777216 1048576 50000 1 0.900000 2.000000 1 4194304 1 1.000000 0.250000 3 0.999000 0.900000 1 1048576 3 1 0.100000 262144 0\n", + "H5AC_insert_entry 0x400 2 0x0 2 0\n", + "H5AC_insert_entry 0x402 2 0x0 2 0\n", + "H5AC_insert_entry 0x404 4 0x0 4 0\n", + "H5AC_insert_entry 0x408 6 0x0 6 0\n", + "H5AC_protect 0x400 2 H5AC_WRITE 2 1\n", + "H5AC_mark_entry_dirty 0x400 0\n", + "H5AC_unprotect 0x400 16 2 0 0\n", + "H5AC_protect 0x402 2 H5AC_WRITE 2 1\n", + "H5AC_pin_protected_entry 0x402 0\n", + "H5AC_unprotect 0x402 16 2 0 0\n", + "H5AC_unpin_entry 0x402 0\n", + "H5AC_expunge_entry 0x402 16 0\n", + "H5AC_protect 0x404 4 H5AC_WRITE 4 1\n", + "H5AC_pin_protected_entry 0x404 0\n", + "H5AC_unprotect 0x404 16 4 0 0\n", + "H5AC_mark_entry_dirty 0x404 0\n", + "H5AC_resize_entry 0x404 2 0\n", + "H5AC_resize_entry 0x404 4 0\n", + "H5AC_unpin_entry 0x404 0\n", + "H5AC_move_entry 0x400 0x8e65 16 0\n", + "H5AC_move_entry 0x8e65 0x400 16 0\n", "H5AC_flush 0x0 0\n", NULL }; @@ -5315,15 +5230,10 @@ trace_file_check(void) } } - /* verify that all instance of datum are back where the started - * and are clean. - */ + /* verify that all instance of datum are back where the started. */ for ( i = 0; i < NUM_DATA_ENTRIES; i++ ) - { HDassert( data_index[i] == i ); - HDassert( ! (data[i].dirty) ); - } /* compose the done message */ mssg.req = DONE_REQ_CODE; |