diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-03-25 22:13:33 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-03-25 22:13:33 (GMT) |
commit | 75e9366971cb67844d0878acaa6cafce7e74b3eb (patch) | |
tree | 7e6253017050e4389a5b18cfbab36706a840ad6c /src | |
parent | f2865f4fe83e46921f9e48241893b3798f502a90 (diff) | |
download | hdf5-75e9366971cb67844d0878acaa6cafce7e74b3eb.zip hdf5-75e9366971cb67844d0878acaa6cafce7e74b3eb.tar.gz hdf5-75e9366971cb67844d0878acaa6cafce7e74b3eb.tar.bz2 |
[svn-r18459] Description:
Further convergence of the metadata journaling changes toward the trunk.
Lots of little things in the cache code, remove the H5F_t * from the H5G_entry_t
struct.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src')
-rw-r--r-- | src/H5A.c | 2 | ||||
-rw-r--r-- | src/H5AC.c | 184 | ||||
-rw-r--r-- | src/H5ACpkg.h | 3 | ||||
-rw-r--r-- | src/H5ACprivate.h | 20 | ||||
-rw-r--r-- | src/H5ACpublic.h | 14 | ||||
-rw-r--r-- | src/H5B.c | 3 | ||||
-rw-r--r-- | src/H5Bcache.c | 1 | ||||
-rw-r--r-- | src/H5Bpkg.h | 5 | ||||
-rw-r--r-- | src/H5C.c | 953 | ||||
-rw-r--r-- | src/H5Cpkg.h | 98 | ||||
-rw-r--r-- | src/H5Cprivate.h | 146 | ||||
-rw-r--r-- | src/H5Cpublic.h | 4 | ||||
-rw-r--r-- | src/H5Gent.c | 7 | ||||
-rw-r--r-- | src/H5Gnode.c | 5 | ||||
-rw-r--r-- | src/H5Gpkg.h | 4 | ||||
-rw-r--r-- | src/H5I.c | 2 | ||||
-rw-r--r-- | src/H5Opkg.h | 2 | ||||
-rw-r--r-- | src/H5Otest.c | 1 | ||||
-rw-r--r-- | src/H5R.c | 2 | ||||
-rw-r--r-- | src/H5Sall.c | 1 | ||||
-rw-r--r-- | src/H5Snone.c | 1 | ||||
-rw-r--r-- | src/H5T.c | 2 | ||||
-rw-r--r-- | src/H5Tcommit.c | 2 | ||||
-rw-r--r-- | src/H5Tdeprec.c | 2 |
24 files changed, 696 insertions, 768 deletions
@@ -29,11 +29,11 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ -#include "H5Opkg.h" /* Object headers */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ #include "H5Sprivate.h" /* Dataspace functions */ #include "H5SMprivate.h" /* Shared Object Header Messages */ @@ -393,7 +393,6 @@ H5AC_term_interface(void) H5AC_dxpl_id=(-1); H5AC_noblock_dxpl_id=(-1); H5AC_ind_dxpl_id=(-1); - #endif /* H5_HAVE_PARALLEL */ /* Reset interface initialization flag */ H5_interface_initialize_g = 0; @@ -608,40 +607,40 @@ H5AC_create(const H5F_t *f, if ( aux_ptr->mpi_rank == 0 ) { f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, - H5AC__DEFAULT_MIN_CLEAN_SIZE, - (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, - H5AC_check_if_write_permitted, - TRUE, - H5AC_log_flushed_entry, - (void *)aux_ptr); + H5AC__DEFAULT_MIN_CLEAN_SIZE, + (H5AC_NTYPES - 1), + (const char **)H5AC_entry_type_names, + H5AC_check_if_write_permitted, + TRUE, + H5AC_log_flushed_entry, + (void *)aux_ptr); } else { f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, - H5AC__DEFAULT_MIN_CLEAN_SIZE, - (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, - NULL, - FALSE, + H5AC__DEFAULT_MIN_CLEAN_SIZE, + (H5AC_NTYPES - 1), + (const char **)H5AC_entry_type_names, + NULL, + FALSE, #if 0 /* this is useful debugging code -- keep it for a while */ /* JRM */ - H5AC_log_flushed_entry_dummy, + H5AC_log_flushed_entry_dummy, #else /* JRM */ - NULL, + NULL, #endif /* JRM */ - (void *)aux_ptr); + (void *)aux_ptr); } } else { f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, - H5AC__DEFAULT_MIN_CLEAN_SIZE, - (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, - H5AC_check_if_write_permitted, - TRUE, - NULL, - NULL); + H5AC__DEFAULT_MIN_CLEAN_SIZE, + (H5AC_NTYPES - 1), + (const char **)H5AC_entry_type_names, + H5AC_check_if_write_permitted, + TRUE, + NULL, + NULL); } } else { #endif /* H5_HAVE_PARALLEL */ @@ -650,13 +649,13 @@ H5AC_create(const H5F_t *f, * -- JRM */ f->shared->cache = H5C_create(H5AC__DEFAULT_MAX_CACHE_SIZE, - H5AC__DEFAULT_MIN_CLEAN_SIZE, - (H5AC_NTYPES - 1), - (const char **)H5AC_entry_type_names, - H5AC_check_if_write_permitted, - TRUE, - NULL, - NULL); + H5AC__DEFAULT_MIN_CLEAN_SIZE, + (H5AC_NTYPES - 1), + (const char **)H5AC_entry_type_names, + H5AC_check_if_write_permitted, + TRUE, + NULL, + NULL); #ifdef H5_HAVE_PARALLEL } #endif /* H5_HAVE_PARALLEL */ @@ -822,12 +821,12 @@ H5AC_expunge_entry(H5F_t *f, const H5AC_class_t *type, haddr_t addr) { - herr_t result; - herr_t ret_value=SUCCEED; /* Return value */ + herr_t result; #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_expunge_entry, FAIL) @@ -843,7 +842,6 @@ H5AC_expunge_entry(H5F_t *f, { H5AC_t * cache_ptr = f->shared->cache; - /* For the expunge entry call, only the addr, and type id are really * necessary in the trace file. Write the return value to catch occult * errors. @@ -852,7 +850,7 @@ H5AC_expunge_entry(H5F_t *f, ( H5C_get_trace_file_ptr(cache_ptr, &trace_file_ptr) >= 0 ) && ( trace_file_ptr != NULL ) ) { - sprintf(trace, "H5AC_expunge_entry %lx %d", + sprintf(trace, "H5AC_expunge_entry 0x%lx %d", (unsigned long)addr, (int)(type->id)); } @@ -978,6 +976,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags) FUNC_ENTER_NOAPI(H5AC_flush, FAIL) HDassert(f); + HDassert(f->shared); HDassert(f->shared->cache); #if H5AC__TRACE_FILE_ENABLED @@ -987,7 +986,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags) if ( ( f != NULL ) && ( f->shared != NULL ) && ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && + ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && ( trace_file_ptr != NULL ) ) { sprintf(trace, "H5AC_flush 0x%x", flags); @@ -1176,9 +1175,6 @@ done: * exist on disk yet, but it must have an address and disk * space reserved. * - * If H5AC_DEBUG is defined then this function checks - * that the object being inserted isn't a protected object. - * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -1251,6 +1247,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * FUNC_ENTER_NOAPI(H5AC_set, FAIL) HDassert(f); + HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); HDassert(type->flush); @@ -1269,7 +1266,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * if ( ( f != NULL ) && ( f->shared != NULL ) && ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && + ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && ( trace_file_ptr != NULL ) ) { sprintf(trace, "H5AC_set 0x%lx %d 0x%x", @@ -1469,8 +1466,8 @@ H5AC_mark_pinned_or_protected_entry_dirty(void *thing) * occult errors. */ if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && - (NULL != trace_file_ptr)) - sprintf(trace, "%s %lx", FUNC, + (NULL != trace_file_ptr)) + sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); #endif /* H5AC__TRACE_FILE_ENABLED */ @@ -1483,7 +1480,7 @@ H5AC_mark_pinned_or_protected_entry_dirty(void *thing) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); if((!entry_ptr->is_dirty) && (!entry_ptr->is_protected) && - (entry_ptr->is_pinned) && (NULL != cache_ptr->aux_ptr)) { + (entry_ptr->is_pinned) && (NULL != cache_ptr->aux_ptr)) { if(H5AC_log_dirtied_entry(entry_ptr, entry_ptr->addr, FALSE, 0) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, "can't log dirtied entry") } /* end if */ @@ -1509,10 +1506,6 @@ done: * Purpose: Use this function to notify the cache that an object's * file address changed. * - * If H5AC_DEBUG is defined then this function checks - * that the old and new addresses don't correspond to the - * address of a protected object. - * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -1578,10 +1571,10 @@ H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_ad if ( ( f != NULL ) && ( f->shared != NULL ) && ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && + ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && ( trace_file_ptr != NULL ) ) { - sprintf(trace, "H5AC_rename %lx %lx %d", + sprintf(trace, "H5AC_rename 0x%lx 0x%lx %d", (unsigned long)old_addr, (unsigned long)new_addr, (int)(type->id)); @@ -1669,11 +1662,11 @@ H5AC_pin_protected_entry(void *thing) */ if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && (NULL != trace_file_ptr)) - sprintf(trace, "%s %lx", FUNC, + sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); #endif /* H5AC__TRACE_FILE_ENABLED */ - if(H5C_pin_protected_entry(thing) < 0 ) + if(H5C_pin_protected_entry(thing) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTPIN, FAIL, "can't pin entry") done: @@ -1715,9 +1708,6 @@ done: * The caller must call H5AC_unprotect() when finished with * the pointer. * - * If H5AC_DEBUG is defined then we check that the - * requested object isn't already protected. - * * Return: Success: Ptr to the object. * * Failure: NULL @@ -1799,7 +1789,7 @@ H5AC_protect(H5F_t *f, if ( ( f != NULL ) && ( f->shared != NULL ) && ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && + ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && ( trace_file_ptr != NULL ) ) { char * rw_string; @@ -1817,7 +1807,7 @@ H5AC_protect(H5F_t *f, rw_string = "???"; } - sprintf(trace, "H5AC_protect %lx %d %s", + sprintf(trace, "H5AC_protect 0x%lx %d %s", (unsigned long)addr, (int)(type->id), rw_string); @@ -1957,7 +1947,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5AC_unpin_entry(void * thing) +H5AC_unpin_entry(void *thing) { #if H5AC__TRACE_FILE_ENABLED char trace[128] = ""; @@ -1976,7 +1966,7 @@ H5AC_unpin_entry(void * thing) */ if((H5C_get_trace_file_ptr_from_entry(thing, &trace_file_ptr) >= 0) && (NULL != trace_file_ptr)) - sprintf(trace, "%s %lx", FUNC, + sprintf(trace, "%s 0x%lx", FUNC, (unsigned long)(((H5C_cache_entry_t *)thing)->addr)); #endif /* H5AC__TRACE_FILE_ENABLED */ @@ -2023,10 +2013,6 @@ done: * If the DELETED flag is set, then this object has been deleted * from the file and should not be returned to the cache. * - * If H5AC_DEBUG is defined then this function fails - * if the TYPE and ADDR arguments are not what was used when the - * object was protected or if the object was never protected. - * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -2091,7 +2077,6 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned flags) { herr_t result; - herr_t ret_value=SUCCEED; /* Return value */ hbool_t size_changed = FALSE; hbool_t dirtied; size_t new_size = 0; @@ -2104,10 +2089,12 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, unsigned trace_flags = 0; FILE * trace_file_ptr = NULL; #endif /* H5AC__TRACE_FILE_ENABLED */ + herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_unprotect, FAIL) HDassert(f); + HDassert(f->shared); HDassert(f->shared->cache); HDassert(type); HDassert(type->clear); @@ -2125,10 +2112,10 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, if ( ( f != NULL ) && ( f->shared != NULL ) && ( f->shared->cache != NULL ) && - ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0 ) && + ( H5C_get_trace_file_ptr(f->shared->cache, &trace_file_ptr) >= 0) && ( trace_file_ptr != NULL ) ) { - sprintf(trace, "H5AC_unprotect %lx %d", + sprintf(trace, "H5AC_unprotect 0x%lx %d", (unsigned long)addr, (int)(type->id)); @@ -2310,6 +2297,7 @@ H5AC_stats(const H5F_t *f) FUNC_ENTER_NOAPI(H5AC_stats, FAIL) HDassert(f); + HDassert(f->shared); HDassert(f->shared->cache); /* at present, this can't fail */ @@ -2435,9 +2423,9 @@ H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr, config_ptr->max_increment = internal_config.max_increment; config_ptr->decr_mode = internal_config.decr_mode; config_ptr->upper_hr_threshold = internal_config.upper_hr_threshold; - config_ptr->flash_incr_mode = internal_config.flash_incr_mode; - config_ptr->flash_multiple = internal_config.flash_multiple; - config_ptr->flash_threshold = internal_config.flash_threshold; + config_ptr->flash_incr_mode = internal_config.flash_incr_mode; + config_ptr->flash_multiple = internal_config.flash_multiple; + config_ptr->flash_threshold = internal_config.flash_threshold; config_ptr->decrement = internal_config.decrement; config_ptr->apply_max_decrement = internal_config.apply_max_decrement; config_ptr->max_decrement = internal_config.max_decrement; @@ -2484,7 +2472,6 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5AC_get_cache_size(H5AC_t * cache_ptr, size_t * max_size_ptr, @@ -2532,29 +2519,18 @@ done: * *------------------------------------------------------------------------- */ - herr_t -H5AC_get_cache_hit_rate(H5AC_t * cache_ptr, - double * hit_rate_ptr) - +H5AC_get_cache_hit_rate(H5AC_t * cache_ptr, double * hit_rate_ptr) { - herr_t result; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_get_cache_hit_rate, FAIL) - result = H5C_get_cache_hit_rate((H5C_t *)cache_ptr, hit_rate_ptr); - - if ( result < 0 ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "H5C_get_cache_hit_rate() failed.") - } + if(H5C_get_cache_hit_rate((H5C_t *)cache_ptr, hit_rate_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_hit_rate() failed.") done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_get_cache_hit_rate() */ @@ -2635,7 +2611,6 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr) @@ -2848,15 +2823,13 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5AC_validate_config(H5AC_cache_config_t * config_ptr) - { herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ - size_t name_len; + int name_len; H5C_auto_size_ctl_t internal_config; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_validate_config, FAIL) @@ -3044,7 +3017,6 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5AC_open_trace_file(H5AC_t * cache_ptr, const char * trace_file_name) @@ -3125,7 +3097,7 @@ H5AC_open_trace_file(H5AC_t * cache_ptr, HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "trace file open failed.") } - HDfprintf(file_ptr, "### HDF5 metadata cache trace file version 1 ###\n"); + HDfprintf(file_ptr, "### HDF5 metadata cache trace file ###\n"); if ( H5C_set_trace_file_ptr(cache_ptr, file_ptr) < 0 ) { @@ -3187,7 +3159,7 @@ H5AC_broadcast_clean_list(H5AC_t * cache_ptr) HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - aux_ptr = cache_ptr->aux_ptr; + aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); HDassert( aux_ptr != NULL ); HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); @@ -3426,11 +3398,10 @@ done: * * Updated function for flash cache increment fields. * - * JRM -- 1/2/08 + * JRM -- 1/2/08 * *------------------------------------------------------------------------- */ - herr_t H5AC_ext_config_2_int_config(H5AC_cache_config_t * ext_conf_ptr, H5C_auto_size_ctl_t * int_conf_ptr) @@ -3461,32 +3432,28 @@ H5AC_ext_config_2_int_config(H5AC_cache_config_t * ext_conf_ptr, int_conf_ptr->min_clean_fraction = ext_conf_ptr->min_clean_fraction; int_conf_ptr->max_size = ext_conf_ptr->max_size; int_conf_ptr->min_size = ext_conf_ptr->min_size; - int_conf_ptr->epoch_length = - (int64_t)(ext_conf_ptr->epoch_length); + int_conf_ptr->epoch_length = (int64_t)(ext_conf_ptr->epoch_length); int_conf_ptr->incr_mode = ext_conf_ptr->incr_mode; int_conf_ptr->lower_hr_threshold = ext_conf_ptr->lower_hr_threshold; int_conf_ptr->increment = ext_conf_ptr->increment; int_conf_ptr->apply_max_increment = ext_conf_ptr->apply_max_increment; int_conf_ptr->max_increment = ext_conf_ptr->max_increment; - int_conf_ptr->flash_incr_mode = ext_conf_ptr->flash_incr_mode; - int_conf_ptr->flash_multiple = ext_conf_ptr->flash_multiple; - int_conf_ptr->flash_threshold = ext_conf_ptr->flash_threshold; + int_conf_ptr->flash_incr_mode = ext_conf_ptr->flash_incr_mode; + int_conf_ptr->flash_multiple = ext_conf_ptr->flash_multiple; + int_conf_ptr->flash_threshold = ext_conf_ptr->flash_threshold; int_conf_ptr->decr_mode = ext_conf_ptr->decr_mode; int_conf_ptr->upper_hr_threshold = ext_conf_ptr->upper_hr_threshold; int_conf_ptr->decrement = ext_conf_ptr->decrement; int_conf_ptr->apply_max_decrement = ext_conf_ptr->apply_max_decrement; int_conf_ptr->max_decrement = ext_conf_ptr->max_decrement; - int_conf_ptr->epochs_before_eviction = - (int32_t)(ext_conf_ptr->epochs_before_eviction); + int_conf_ptr->epochs_before_eviction = (int32_t)(ext_conf_ptr->epochs_before_eviction); int_conf_ptr->apply_empty_reserve = ext_conf_ptr->apply_empty_reserve; int_conf_ptr->empty_reserve = ext_conf_ptr->empty_reserve; done: - FUNC_LEAVE_NOAPI(ret_value) - } /* H5AC_ext_config_2_int_config() */ @@ -3636,7 +3603,7 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr, FUNC_ENTER_NOAPI(H5AC_log_dirtied_entry, FAIL) - HDassert( entry_ptr != NULL ); + HDassert( entry_ptr ); HDassert( entry_ptr->addr == addr ); HDassert( entry_ptr->is_dirty == FALSE ); @@ -4065,7 +4032,6 @@ done: * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL static herr_t H5AC_log_renamed_entry(const H5F_t *f, @@ -4073,12 +4039,12 @@ H5AC_log_renamed_entry(const H5F_t *f, haddr_t new_addr) { H5AC_t * cache_ptr; - herr_t ret_value = SUCCEED; /* Return value */ hbool_t entry_in_cache; hbool_t entry_dirty; size_t entry_size; H5AC_aux_t * aux_ptr = NULL; H5AC_slist_entry_t * slist_entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_log_renamed_entry, FAIL) @@ -4315,7 +4281,7 @@ H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f, HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - aux_ptr = cache_ptr->aux_ptr; + aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); HDassert( aux_ptr != NULL ); HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); @@ -4350,8 +4316,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, - cache_ptr); + result = H5C_flush_to_min_clean(f, dxpl_id, H5AC_noblock_dxpl_id); aux_ptr->write_permitted = FALSE; @@ -4446,7 +4411,7 @@ H5AC_receive_and_apply_clean_list(H5F_t * f, HDassert( cache_ptr != NULL ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - aux_ptr = cache_ptr->aux_ptr; + aux_ptr = (H5AC_aux_t *)(cache_ptr->aux_ptr); HDassert( aux_ptr != NULL ); HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC ); @@ -4522,8 +4487,7 @@ 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, - cache_ptr, (int32_t)num_entries, - &(haddr_buf_ptr[0])) < 0 ) { + (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/H5ACpkg.h b/src/H5ACpkg.h index 5f226ed..911aceb 100644 --- a/src/H5ACpkg.h +++ b/src/H5ACpkg.h @@ -25,6 +25,7 @@ * The one exception to this rule is testpar/t_cache.c. The * test code is easier to write if it can look at H5AC_aux_t. * Indeed, this is the main reason why this file was created. + * */ #ifndef H5AC_PACKAGE @@ -35,7 +36,7 @@ #define _H5ACpkg_H /* Get package's private header */ -#include "H5ACprivate.h" +#include "H5ACprivate.h" /* Metadata cache */ /* Get needed headers */ diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 4f6e4e1..cacec91 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -22,10 +22,6 @@ * Purpose: Constants and typedefs available to the rest of the * library. * - * Modifications: JRM - 6/4/04 - * Complete re-write for a new caching algorithm - * located in H5C.c - * *------------------------------------------------------------------------- */ @@ -36,8 +32,8 @@ /* Pivate headers needed by this header */ #include "H5private.h" /* Generic Functions */ +#include "H5Cprivate.h" /* Cache */ #include "H5Fprivate.h" /* File access */ -#include "H5Cprivate.h" /* cache */ #ifdef H5_METADATA_TRACE_FILE #define H5AC__TRACE_FILE_ENABLED 1 @@ -128,7 +124,7 @@ 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; -typedef H5C_class_t H5AC_class_t; +typedef H5C_class_t H5AC_class_t; /* The H5AC_NSLOTS #define is now obsolete, as the metadata cache no longer @@ -147,7 +143,7 @@ typedef H5C_class_t H5AC_class_t; #define H5AC_NSLOTS 10330 /* The library "likes" this number... */ -typedef H5C_cache_entry_t H5AC_info_t; +typedef H5C_cache_entry_t H5AC_info_t; /*===----------------------------------------------------------------------=== @@ -197,17 +193,17 @@ extern hid_t H5AC_ind_dxpl_id; #define H5AC__DEFAULT_CACHE_CONFIG \ { \ - /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER, \ + /* int version = */ H5AC__CURR_CACHE_CONFIG_VERSION, \ /* hbool_t rpt_fcn_enabled = */ FALSE, \ /* hbool_t open_trace_file = */ FALSE, \ /* hbool_t close_trace_file = */ FALSE, \ /* char trace_file_name[] = */ "", \ /* hbool_t evictions_enabled = */ TRUE, \ /* hbool_t set_initial_size = */ TRUE, \ - /* size_t initial_size = */ ( 1 * 1024 * 1024), \ + /* size_t initial_size = */ (1 * 1024 * 1024), \ /* double min_clean_fraction = */ 0.5, \ /* size_t max_size = */ (16 * 1024 * 1024), \ - /* size_t min_size = */ ( 1 * 1024 * 1024), \ + /* size_t min_size = */ (1 * 1024 * 1024), \ /* long int epoch_length = */ 50000, \ /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, \ /* double lower_hr_threshold = */ 0.9, \ @@ -218,7 +214,7 @@ extern hid_t H5AC_ind_dxpl_id; /* flash_incr_mode = */ H5C_flash_incr__add_space, \ /* double flash_multiple = */ 1.0, \ /* double flash_threshold = */ 0.25, \ - /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,\ + /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, \ /* double upper_hr_threshold = */ 0.999, \ /* double decrement = */ 0.9, \ /* hbool_t apply_max_decrement = */ TRUE, \ @@ -266,7 +262,7 @@ extern hid_t H5AC_ind_dxpl_id; H5_DLL herr_t H5AC_init(void); H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5AC_get_entry_status(const H5F_t * f, haddr_t addr, +H5_DLL herr_t H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned * status_ptr); H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags); diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index 3c62fbf..02941b6 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -36,8 +36,6 @@ extern "C" { #endif -#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024 - /**************************************************************************** * * structure H5AC_cache_config_t @@ -240,8 +238,8 @@ extern "C" { * stay within max_size. * * With a little thought, it should be obvious that the above flash - * cache size increase algorithm is not sufficient for all circumstances -- - * for example, suppose the user round robins through + * cache size increase algorithm is not sufficient for all circumstances + * -- for example, suppose the user round robins through * (1/flash_threshold) +1 groups, adding one data set to each on each * pass. Then all will increase in size at about the same time, requiring * the max cache size to at least double to maintain acceptable @@ -257,13 +255,12 @@ extern "C" { * flash_incr_mode section. This field is ignored unless flash_incr_mode * is H5C_flash_incr__add_space. * - * flash_threshold: Double containing the factor by which current max cache size - * is multiplied to obtain the size threshold for the add_space flash + * flash_threshold: Double containing the factor by which current max cache + * size is multiplied to obtain the size threshold for the add_space flash * increment algorithm. The field is ignored unless flash_incr_mode is * H5C_flash_incr__add_space. * * - * * Cache size decrease control fields: * * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose @@ -383,7 +380,8 @@ extern "C" { * ****************************************************************************/ -#define H5AC__CURR_CACHE_CONFIG_VERSION 1 +#define H5AC__CURR_CACHE_CONFIG_VERSION 1 +#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024 typedef struct H5AC_cache_config_t { @@ -105,7 +105,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5Bpkg.h" /* B-link trees */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ @@ -1641,7 +1640,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree node") done: - if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5C__DELETED_FLAG) < 0) + if(bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__DELETED_FLAG) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node in cache") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Bcache.c b/src/H5Bcache.c index f6a228a..f3351f3 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -35,7 +35,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5Bpkg.h" /* B-link trees */ #include "H5Eprivate.h" /* Error handling */ diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index 7645fc5..ed343fb 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -32,6 +32,7 @@ #include "H5Bprivate.h" /* Other private headers needed by this file */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5FLprivate.h" /* Free Lists */ #include "H5RCprivate.h" /* Reference counted objects */ @@ -47,8 +48,8 @@ /* The B-tree node as stored in memory... */ typedef struct H5B_t { - H5AC_info_t cache_info; /* Information for H5AC cache functions */ - /* _must_ be first field in structure */ + H5AC_info_t cache_info; /* Information for H5AC cache functions */ + /* _must_ be first field in structure */ H5RC_t *rc_shared; /*ref-counted shared info */ unsigned level; /*node level */ unsigned nchildren; /*number of child pointers */ @@ -95,7 +95,7 @@ * **************************************************************************/ -#define H5C_PACKAGE /*suppress error about including H5Cpkg */ +#define H5C_PACKAGE /*suppress error about including H5Cpkg */ #define H5F_PACKAGE /*suppress error about including H5Fpkg */ @@ -111,7 +111,7 @@ #include "H5Pprivate.h" /* Property lists */ #include "H5SLprivate.h" /* Skip lists */ - + /* * Private file-scope variables. */ @@ -119,22 +119,21 @@ /* Declare a free list to manage the H5C_t struct */ H5FL_DEFINE_STATIC(H5C_t); + /* * Private file-scope function declarations: */ -static herr_t H5C__auto_adjust_cache_size(H5C_t * cache_ptr, - H5F_t * f, +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); -static herr_t H5C__autoadjust__ageout(H5C_t * cache_ptr, +static herr_t H5C__autoadjust__ageout(H5F_t * f, double hit_rate, enum H5C_resize_status * status_ptr, size_t * new_max_cache_size_ptr, - H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, hbool_t write_permitted, @@ -145,7 +144,6 @@ 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, - H5C_t * cache_ptr, hbool_t write_permitted, hbool_t * first_flush_ptr); @@ -159,20 +157,18 @@ 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(H5F_t * f, +static herr_t H5C_flush_single_entry(const H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, const H5C_class_t * type_ptr, haddr_t addr, unsigned flags, hbool_t * first_flush_ptr, hbool_t del_entry_from_slist_on_destroy); -static herr_t H5C_flush_invalidate_cache(H5F_t * f, +static herr_t H5C_flush_invalidate_cache(const H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, unsigned flags); static void * H5C_load_entry(H5F_t * f, @@ -186,7 +182,6 @@ static void * H5C_load_entry(H5F_t * f, static herr_t H5C_make_space_in_cache(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, size_t space_needed, hbool_t write_permitted, hbool_t * first_flush_ptr); @@ -441,7 +436,6 @@ H5C_create(size_t max_cache_size, HDassert( HDstrlen(( type_name_table_ptr)[i]) > 0 ); } - if ( NULL == (cache_ptr = H5FL_CALLOC(H5C_t)) ) { HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, \ @@ -467,6 +461,7 @@ H5C_create(size_t max_cache_size, cache_ptr->aux_ptr = aux_ptr; cache_ptr->max_type_id = max_type_id; + cache_ptr->type_name_table_ptr = type_name_table_ptr; cache_ptr->max_cache_size = max_cache_size; @@ -543,10 +538,9 @@ H5C_create(size_t max_cache_size, (cache_ptr->resize_ctl).apply_max_increment = TRUE; (cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT; - (cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off; - (cache_ptr->resize_ctl).flash_multiple = 1.0; - (cache_ptr->resize_ctl).flash_threshold = 0.25; - + (cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off; + (cache_ptr->resize_ctl).flash_multiple = 1.0; + (cache_ptr->resize_ctl).flash_threshold = 0.25; (cache_ptr->resize_ctl).decr_mode = H5C_decr__off; (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD; @@ -568,8 +562,8 @@ H5C_create(size_t max_cache_size, { (cache_ptr->epoch_marker_active)[i] = FALSE; #ifndef NDEBUG - ((cache_ptr->epoch_markers)[i]).magic = - H5C__H5C_CACHE_ENTRY_T_MAGIC; + ((cache_ptr->epoch_markers)[i]).magic = + H5C__H5C_CACHE_ENTRY_T_MAGIC; #endif /* NDEBUG */ ((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i; ((cache_ptr->epoch_markers)[i]).size = (size_t)0; @@ -657,7 +651,7 @@ done: * H5C_t in output. * * JRM 12/31/07 - * Updated function to handle flash size increases. + * Updated function to handle flash size increases. * *------------------------------------------------------------------------- */ @@ -709,19 +703,19 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDassert( old_max_cache_size < new_max_cache_size ); HDfprintf(stdout, - "%sflash cache resize(%d) -- size threshold = %Zu.\n", - cache_ptr->prefix, - (int)((cache_ptr->resize_ctl).flash_incr_mode), - cache_ptr->flash_size_increase_threshold); + "%sflash cache resize(%d) -- size threshold = %Zu.\n", + cache_ptr->prefix, + (int)((cache_ptr->resize_ctl).flash_incr_mode), + cache_ptr->flash_size_increase_threshold); HDfprintf(stdout, - "%s cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", - cache_ptr->prefix, - old_max_cache_size, - old_min_clean_size, - new_max_cache_size, - new_min_clean_size); - break; + "%s cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", + cache_ptr->prefix, + old_max_cache_size, + old_min_clean_size, + new_max_cache_size, + new_min_clean_size); + break; case decrease: HDassert( old_max_cache_size > new_max_cache_size ); @@ -971,11 +965,11 @@ H5C_expunge_entry(H5F_t * f, const H5C_class_t * type, haddr_t addr) { - H5C_t * cache_ptr; + H5C_t * cache_ptr; herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ 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) @@ -1030,11 +1024,9 @@ H5C_expunge_entry(H5F_t * f, result = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, entry_ptr->type, entry_ptr->addr, - H5C__FLUSH_INVALIDATE_FLAG | - H5C__FLUSH_CLEAR_ONLY_FLAG, + H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, &first_flush, TRUE); @@ -1157,10 +1149,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 primary_dxpl_id, hid_t secondary_dxpl_id, unsigned flags) { H5C_t * cache_ptr = f->shared->cache; herr_t status; @@ -1187,7 +1176,7 @@ H5C_flush_cache(H5F_t * f, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->skip_file_checks || f ); + HDassert( cache_ptr->skip_file_checks || f); HDassert( cache_ptr->slist_ptr ); ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); @@ -1211,7 +1200,6 @@ H5C_flush_cache(H5F_t * f, status = H5C_flush_invalidate_cache(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, flags); if ( status < 0 ) { @@ -1239,27 +1227,27 @@ H5C_flush_cache(H5F_t * f, flushed_entries_last_pass = FALSE; node_ptr = H5SL_first(cache_ptr->slist_ptr); - if ( node_ptr != NULL ) { + if ( node_ptr != NULL ) { - next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); if ( next_entry_ptr == NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "next_entry_ptr == NULL 1 ?!?!"); + "next_entry_ptr == NULL 1 ?!?!"); } #ifndef NDEBUG HDassert( next_entry_ptr->magic == - H5C__H5C_CACHE_ENTRY_T_MAGIC ); + H5C__H5C_CACHE_ENTRY_T_MAGIC ); #endif /* NDEBUG */ - HDassert( next_entry_ptr->is_dirty ); + HDassert( next_entry_ptr->is_dirty ); HDassert( next_entry_ptr->in_slist ); - } else { + } else { - next_entry_ptr = NULL; + next_entry_ptr = NULL; - } + } HDassert( node_ptr != NULL ); @@ -1307,7 +1295,7 @@ H5C_flush_cache(H5F_t * f, while ( node_ptr != NULL ) { - entry_ptr = next_entry_ptr; + entry_ptr = next_entry_ptr; /* With the advent of the fractal heap, it is possible * that the flush callback will dirty and/or resize @@ -1332,10 +1320,10 @@ H5C_flush_cache(H5F_t * f, * of this while loop. * * If an entry has merely been marked clean and removed from - * the s-list, we simply break out of the scan. - * - * If the entry has been evicted, we flag an error and - * exit. + * the s-list, we simply break out of the scan. + * + * If the entry has been evicted, we flag an error and + * exit. */ #ifndef NDEBUG if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) { @@ -1343,39 +1331,41 @@ H5C_flush_cache(H5F_t * f, HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "entry_ptr->magic invalid ?!?!"); - } else + } else #endif /* NDEBUG */ if ( ( ! entry_ptr->is_dirty ) || - ( ! entry_ptr->in_slist ) ) { + ( ! entry_ptr->in_slist ) ) { - /* the s-list has been modified out from under us. - * set node_ptr to NULL and break out of the loop. - */ - node_ptr = NULL; - break; - } + /* the s-list has been modified out from under us. + * set node_ptr to NULL and break out of the loop. + */ + node_ptr = NULL; + break; + } /* increment node pointer now, before we delete its target * from the slist. */ node_ptr = H5SL_next(node_ptr); - if ( node_ptr != NULL ) { - next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + if ( node_ptr != NULL ) { + + next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + + if ( next_entry_ptr == NULL ) { - if ( next_entry_ptr == NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "next_entry_ptr == NULL 2 ?!?!"); - } + } #ifndef NDEBUG HDassert( next_entry_ptr->magic == - H5C__H5C_CACHE_ENTRY_T_MAGIC ); + H5C__H5C_CACHE_ENTRY_T_MAGIC ); #endif /* NDEBUG */ HDassert( next_entry_ptr->is_dirty ); HDassert( next_entry_ptr->in_slist ); - } else { - next_entry_ptr = NULL; - } + } else { + next_entry_ptr = NULL; + } HDassert( entry_ptr != NULL ); HDassert( entry_ptr->in_slist ); @@ -1393,24 +1383,24 @@ H5C_flush_cache(H5F_t * f, protected_entries++; } else if ( entry_ptr->is_pinned ) { - /* Test to see if we are can flush the entry now. - * If we can, go ahead and flush. Note that we + + /* Test to see if we are can flush the entry now. + * If we can, go ahead and flush. Note that we * aren't trying to do a destroy here, so that * is not an issue. - */ + */ if ( TRUE ) { /* When we get to multithreaded cache, * we will need either locking code, - * and/or a test to see if the entry - * is in flushable condition here. + * and/or a test to see if the entry + * is in flushable condition here. */ #if H5C_DO_SANITY_CHECKS flushed_entries_count++; - flushed_entries_size += entry_ptr->size; + flushed_entries_size += entry_ptr->size; #endif /* H5C_DO_SANITY_CHECKS */ status = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, NULL, entry_ptr->addr, flags, @@ -1418,8 +1408,8 @@ H5C_flush_cache(H5F_t * f, FALSE); if ( status < 0 ) { - /* This shouldn't happen -- if it does, we are - * toast so just scream and die. + /* This shouldn't happen -- if it does, we + * are toast so just scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ "dirty pinned entry flush failed.") @@ -1434,7 +1424,6 @@ H5C_flush_cache(H5F_t * f, status = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, NULL, entry_ptr->addr, flags, @@ -1491,7 +1480,7 @@ H5C_flush_cache(H5F_t * f, } #endif /* H5C_DO_SANITY_CHECKS */ - } + } done: @@ -1557,11 +1546,10 @@ done: herr_t H5C_flush_to_min_clean(H5F_t * f, hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - H5C_t * cache_ptr) + hid_t secondary_dxpl_id) { + H5C_t * cache_ptr; herr_t result; - herr_t ret_value = SUCCEED; hbool_t first_flush = TRUE; hbool_t write_permitted; #if 0 /* modified code -- commented out for now */ @@ -1572,9 +1560,15 @@ H5C_flush_to_min_clean(H5F_t * f, haddr_t * flushed_entries_list = NULL; H5C_cache_entry_t * entry_ptr = NULL; #endif /* JRM */ + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5C_flush_to_min_clean, FAIL) + HDassert( f ); + HDassert( f->shared ); + + cache_ptr = f->shared->cache; + HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); @@ -1604,7 +1598,6 @@ H5C_flush_to_min_clean(H5F_t * f, result = H5C_make_space_in_cache(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, (size_t)0, write_permitted, &first_flush); @@ -1681,15 +1674,6 @@ H5C_flush_to_min_clean(H5F_t * f, entry_ptr = entry_ptr->aux_prev; } - if ( ( flushed_entries_count > cache_ptr->slist_len) || - ( flushed_entries_size < space_needed ) ) { - HDfprintf(stdout, "flushed_entries_count = %d <= %d = slist_size\n", - (int)flushed_entries_count, (int)(cache_ptr->slist_size)); - HDfprintf(stdout, - "flushed_entries_size = %d < %d = space_needed.\n", - (int)flushed_entries_size, (int)space_needed); - } - HDassert( flushed_entries_count <= cache_ptr->slist_len ); HDassert( flushed_entries_size >= space_needed ); @@ -1750,7 +1734,6 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5C_get_cache_auto_resize_config(const H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr) @@ -1801,7 +1784,6 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5C_get_cache_size(H5C_t * cache_ptr, size_t * max_size_ptr, @@ -1865,7 +1847,6 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5C_get_cache_hit_rate(H5C_t * cache_ptr, double * hit_rate_ptr) @@ -1932,7 +1913,6 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, @@ -1942,7 +1922,7 @@ H5C_get_entry_status(const H5F_t *f, hbool_t * is_protected_ptr, hbool_t * is_pinned_ptr) { - H5C_t * cache_ptr; + H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr = NULL; herr_t ret_value = SUCCEED; /* Return value */ @@ -1958,7 +1938,7 @@ H5C_get_entry_status(const H5F_t *f, HDassert( H5F_addr_defined(addr) ); HDassert( in_cache_ptr != NULL ); - /* this test duplicates tow of the above asserts, but we need an + /* this test duplicates two of the above asserts, but we need an * invocation of HGOTO_ERROR to keep the compiler happy. */ if ( ( cache_ptr == NULL ) || ( cache_ptr->magic != H5C__H5C_T_MAGIC ) ) { @@ -2010,23 +1990,22 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_evictions_enabled() * - * Purpose: Copy the current value of cache_ptr->evictions_enabled into - * *evictions_enabled_ptr. + * Purpose: Copy the current value of cache_ptr->evictions_enabled into + * *evictions_enabled_ptr. * * Return: SUCCEED on success, and FAIL on failure. * * Programmer: John Mainzer - * 7/27/07 + * 7/27/07 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ - herr_t -H5C_get_evictions_enabled(const H5C_t * cache_ptr, +H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t * evictions_enabled_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2041,7 +2020,7 @@ H5C_get_evictions_enabled(const H5C_t * cache_ptr, if ( evictions_enabled_ptr == NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Bad evictions_enabled_ptr on entry.") + "Bad evictions_enabled_ptr on entry.") } *evictions_enabled_ptr = cache_ptr->evictions_enabled; @@ -2074,7 +2053,6 @@ H5C_get_trace_file_ptr(const H5C_t *cache_ptr, FILE **trace_file_ptr_ptr) { FUNC_ENTER_NOAPI_NOFUNC(H5C_get_trace_file_ptr) - /* Sanity checks */ HDassert(cache_ptr); HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); HDassert(trace_file_ptr_ptr); @@ -2111,7 +2089,6 @@ H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr, HDassert(entry_ptr); HDassert(entry_ptr->cache_ptr); - /* Go get the trace file pointer for the cache */ H5C_get_trace_file_ptr(entry_ptr->cache_ptr, trace_file_ptr_ptr); FUNC_LEAVE_NOAPI(SUCCEED) @@ -2198,7 +2175,6 @@ 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, @@ -2208,16 +2184,15 @@ H5C_insert_entry(H5F_t * f, void * thing, unsigned int flags) { - /* const char * fcn_name = "H5C_insert_entry()"; */ H5C_t * cache_ptr; herr_t result; - herr_t ret_value = SUCCEED; /* Return value */ hbool_t first_flush = TRUE; hbool_t insert_pinned; hbool_t set_flush_marker; hbool_t write_permitted = TRUE; H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * test_entry_ptr; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_insert_entry, FAIL) @@ -2258,8 +2233,8 @@ H5C_insert_entry(H5F_t * f, entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; #endif /* NDEBUG */ entry_ptr->cache_ptr = cache_ptr; - entry_ptr->addr = addr; - entry_ptr->type = type; + entry_ptr->addr = addr; + entry_ptr->type = type; /* newly inserted entries are assumed to be dirty */ entry_ptr->is_dirty = TRUE; @@ -2309,7 +2284,7 @@ H5C_insert_entry(H5F_t * f, if ( ( cache_ptr->evictions_enabled ) && ( (cache_ptr->index_size + entry_ptr->size) > - cache_ptr->max_cache_size ) ) { + cache_ptr->max_cache_size ) ) { size_t space_needed; @@ -2368,7 +2343,6 @@ H5C_insert_entry(H5F_t * f, result = H5C_make_space_in_cache(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, space_needed, write_permitted, &first_flush); @@ -2500,17 +2474,15 @@ 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, - H5C_t * cache_ptr, int32_t ce_array_len, haddr_t * ce_array_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + H5C_t * cache_ptr; hbool_t first_flush = TRUE; int entries_cleared; int entries_examined; @@ -2525,9 +2497,13 @@ H5C_mark_entries_as_clean(H5F_t * f, #endif /* H5C_DO_SANITY_CHECKS */ H5C_cache_entry_t * clear_ptr = NULL; H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_mark_entries_as_clean, FAIL) + HDassert( f ); + HDassert( f->shared ); + cache_ptr = f->shared->cache; HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); @@ -2610,7 +2586,6 @@ H5C_mark_entries_as_clean(H5F_t * f, if ( H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, entry_ptr->type, addr, H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -2670,7 +2645,6 @@ H5C_mark_entries_as_clean(H5F_t * f, if ( H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, clear_ptr->type, clear_ptr->addr, H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -2708,7 +2682,6 @@ H5C_mark_entries_as_clean(H5F_t * f, if ( H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, clear_ptr->type, clear_ptr->addr, H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -2787,7 +2760,7 @@ H5C_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, size_t new_size) { H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; - size_t size_increase; + size_t size_increase; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_mark_pinned_entry_dirty, FAIL) @@ -2826,7 +2799,7 @@ H5C_mark_pinned_entry_dirty(void *thing, hbool_t size_changed, size_t new_size) } } - /* update the protected entry list */ + /* update the pinned entry list */ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pel_len), \ (cache_ptr->pel_size), \ (entry_ptr->size), (new_size)); @@ -2923,8 +2896,8 @@ H5C_mark_pinned_or_protected_entry_dirty(void *thing) } else { - HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ - "Entry is neither pinned nor protected??") + HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ + "Entry is neither pinned nor protected??") } done: @@ -2962,7 +2935,7 @@ done: * Updated function to support renaming of pinned entries. * * JRM -- 8/24/06 - * Updated function to refrain from alterning the index, the + * Updated function to refrain from altering the index, the * replacement policy data structures, and skip list when * the function is called within the flush callback for the * target entry and the target entry is being destroyed. @@ -2972,20 +2945,19 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5C_rename_entry(H5C_t * cache_ptr, const H5C_class_t * type, haddr_t old_addr, haddr_t new_addr) { - herr_t ret_value = SUCCEED; /* Return value */ - hbool_t was_dirty; + hbool_t was_dirty; H5C_cache_entry_t * entry_ptr = NULL; H5C_cache_entry_t * test_entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - hbool_t removed_entry_from_slist = FALSE; + hbool_t removed_entry_from_slist = FALSE; #endif /* H5C_DO_SANITY_CHECKS */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_rename_entry, FAIL) @@ -3150,7 +3122,7 @@ H5C_resize_pinned_entry(void *thing, size_t new_size) { H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr = (H5C_cache_entry_t *)thing; - size_t size_increase; + size_t size_increase; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_resize_pinned_entry, FAIL) @@ -3185,13 +3157,8 @@ H5C_resize_pinned_entry(void *thing, size_t new_size) size_increase = new_size - entry_ptr->size; - if ( size_increase >= - cache_ptr->flash_size_increase_threshold ) { - - - if(H5C__flash_increase_cache_size(cache_ptr, - entry_ptr->size, - new_size) < 0) + if(size_increase >= cache_ptr->flash_size_increase_threshold) { + if(H5C__flash_increase_cache_size(cache_ptr, entry_ptr->size, new_size) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "flash cache increase failed") } } @@ -3322,9 +3289,9 @@ done: * make space in the cache. * * JRM -- 11/12/04 - * Added code to call to H5C_make_space_in_cache() after the - * call to H5C__auto_adjust_cache_size() if that function - * sets the size_decreased flag is TRUE. + * Added code to call to H5C_make_space_in_cache() + * after the call to H5C__auto_adjust_cache_size() if that + * function sets the size_decreased flag is TRUE. * * JRM -- 4/25/05 * The size_decreased flag can also be set to TRUE in @@ -3365,7 +3332,6 @@ done: * *------------------------------------------------------------------------- */ - void * H5C_protect(H5F_t * f, hid_t primary_dxpl_id, @@ -3376,8 +3342,7 @@ H5C_protect(H5F_t * f, void * udata2, unsigned flags) { - /* const char * fcn_name = "H5C_protect()"; */ - H5C_t * cache_ptr; + H5C_t * cache_ptr; hbool_t hit; hbool_t first_flush; hbool_t have_write_permitted = FALSE; @@ -3393,7 +3358,9 @@ H5C_protect(H5F_t * f, /* check args */ HDassert( f ); HDassert( f->shared ); + cache_ptr = f->shared->cache; + HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); @@ -3422,9 +3389,11 @@ H5C_protect(H5F_t * f, if ( entry_ptr != NULL ) { hit = TRUE; - thing = (void *)entry_ptr; + thing = (void *)entry_ptr; - } else { /* must try to load the entry from disk. */ + } else { + + /* must try to load the entry from disk. */ hit = FALSE; @@ -3438,28 +3407,28 @@ H5C_protect(H5F_t * f, entry_ptr = (H5C_cache_entry_t *)thing; - /* If the entry is very large, and we are configured to allow it, - * we may wish to perform a flash cache size increase. - */ + /* If the entry is very large, and we are configured to allow it, + * we may wish to perform a flash cache size increase. + */ if ( ( cache_ptr->flash_size_increase_possible ) && ( entry_ptr->size > cache_ptr->flash_size_increase_threshold ) ) { result = H5C__flash_increase_cache_size(cache_ptr, 0, - entry_ptr->size); + entry_ptr->size); if ( result < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, \ "H5C__flash_increase_cache_size failed.") - } + } } - /* try to free up some space if necessary and if evictions are - * permitted + /* try to free up some space if necessary and if + * evictions are permitted */ - if ( ( cache_ptr->evictions_enabled ) && - ( (cache_ptr->index_size + entry_ptr->size) > - cache_ptr->max_cache_size ) ) { + if ( ( cache_ptr->evictions_enabled ) && + ( (cache_ptr->index_size + entry_ptr->size) > + cache_ptr->max_cache_size ) ) { size_t space_needed; @@ -3515,18 +3484,22 @@ H5C_protect(H5F_t * f, * * Second, when writes are not permitted it is also possible * for the cache to grow without bound. + * + * Third, the user may choose to disable evictions -- causing + * the cache to grow without bound until evictions are + * re-enabled. * * Finally, we usually don't check to see if the cache is * oversized at the end of an unprotect. As a result, it is * possible to have a vastly oversized cache with no protected * entries as long as all the protects preceed the unprotects. * - * Since items 1 and 2 are not changing any time soon, I see - * no point in worrying about the third. + * Since items 1, 2, and 3 are not changing any time soon, I + * see no point in worrying about the fourth. */ result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, cache_ptr, + secondary_dxpl_id, space_needed, write_permitted, &first_flush); @@ -3596,7 +3569,7 @@ H5C_protect(H5F_t * f, ret_value = thing; if ( ( cache_ptr->evictions_enabled ) && - ( ( cache_ptr->size_decreased ) || + ( ( cache_ptr->size_decreased ) || ( ( cache_ptr->resize_enabled ) && ( cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length ) ) ) ) { @@ -3634,8 +3607,7 @@ H5C_protect(H5F_t * f, ( cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length ) ) { - result = H5C__auto_adjust_cache_size(cache_ptr, - f, + result = H5C__auto_adjust_cache_size(f, primary_dxpl_id, secondary_dxpl_id, write_permitted, @@ -3660,7 +3632,7 @@ H5C_protect(H5F_t * f, cache_ptr->cache_full = TRUE; result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, cache_ptr, + secondary_dxpl_id, (size_t)0, write_permitted, &first_flush); @@ -3678,7 +3650,6 @@ done: #if H5C_DO_EXTREME_SANITY_CHECKS if ( H5C_validate_lru_list(cache_ptr) < 0 ) { - HDassert(0); HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, \ "LRU sanity check failed.\n"); } @@ -3757,12 +3728,11 @@ done: * in cache size. * * JRM -- 12/31/07 - * Added code supporting the new flash cache size increase - * code. + * Added code supporting the new flash cache size increase + * code. * *------------------------------------------------------------------------- */ - herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, H5C_auto_size_ctl_t *config_ptr) @@ -3895,7 +3865,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, if ( config_ptr->max_size == config_ptr->min_size ) { cache_ptr->size_increase_possible = FALSE; - cache_ptr->flash_size_increase_possible = FALSE; + cache_ptr->flash_size_increase_possible = FALSE; cache_ptr->size_decrease_possible = FALSE; } @@ -4003,7 +3973,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, { case H5C_flash_incr__off: cache_ptr->flash_size_increase_possible = FALSE; - break; + break; case H5C_flash_incr__add_space: cache_ptr->flash_size_increase_possible = TRUE; @@ -4014,9 +3984,9 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, break; default: /* should be unreachable */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Unknown flash_incr_mode?!?!?.") - break; + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "Unknown flash_incr_mode?!?!?.") + break; } } @@ -4030,21 +4000,20 @@ done: /*------------------------------------------------------------------------- * Function: H5C_set_evictions_enabled() * - * Purpose: Set cache_ptr->evictions_enabled to the value of the - * evictions enabled parameter. + * Purpose: Set cache_ptr->evictions_enabled to the value of the + * evictions enabled parameter. * * Return: SUCCEED on success, and FAIL on failure. * * Programmer: John Mainzer - * 7/27/07 + * 7/27/07 * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ - herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled) @@ -4061,7 +4030,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, if ( ( evictions_enabled != TRUE ) && ( evictions_enabled != FALSE ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Bad evictions_enabled on entry.") + "Bad evictions_enabled on entry.") } /* There is no fundamental reason why we should not permit @@ -4075,7 +4044,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, ( cache_ptr->resize_ctl.decr_mode != H5C_decr__off ) ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "Can't disable evictions when auto resize enabled.") + "Can't disable evictions when auto resize enabled.") } cache_ptr->evictions_enabled = evictions_enabled; @@ -4469,11 +4438,11 @@ H5C_stats(H5C_t * cache_ptr, hit_rate); HDfprintf(stdout, - "%s Total write / read (max) protects = %ld / %ld (%d)\n", + "%s Total write / read (max) protects = %ld / %ld (%ld)\n", cache_ptr->prefix, (long)total_write_protects, (long)total_read_protects, - max_read_protects); + (long)max_read_protects); HDfprintf(stdout, "%s Total clears / flushes / evictions = %ld / %ld / %ld\n", @@ -4786,10 +4755,10 @@ H5C_stats__reset(H5C_t UNUSED * cache_ptr) *------------------------------------------------------------------------- */ herr_t -H5C_unpin_entry(void *thing) +H5C_unpin_entry(void *_entry_ptr) { H5C_t *cache_ptr; - H5C_cache_entry_t *entry_ptr = (H5C_cache_entry_t *)thing; + H5C_cache_entry_t *entry_ptr = (H5C_cache_entry_t *)_entry_ptr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_unpin_entry, FAIL) @@ -4912,7 +4881,7 @@ done: * ro_ref_count parameters. * * JRM -- 12/31/07 - * Modified funtion to support flash cache resizes. + * Modified funtion to support flash cache resizes. * *------------------------------------------------------------------------- */ @@ -4926,8 +4895,7 @@ H5C_unprotect(H5F_t * f, unsigned int flags, size_t new_size) { - /* const char * fcn_name = "H5C_unprotect()"; */ - H5C_t * cache_ptr; + H5C_t * cache_ptr; hbool_t deleted; hbool_t dirtied; hbool_t set_flush_marker; @@ -4937,11 +4905,11 @@ H5C_unprotect(H5F_t * f, #ifdef H5_HAVE_PARALLEL hbool_t clear_entry = FALSE; #endif /* H5_HAVE_PARALLEL */ - herr_t ret_value = SUCCEED; /* Return value */ herr_t result; - size_t size_increase = 0; + size_t size_increase = 0; H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * test_entry_ptr; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5C_unprotect, FAIL) @@ -5109,7 +5077,7 @@ H5C_unprotect(H5F_t * f, if ( result < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ - "H5C__flash_increase_cache_size failed.") + "H5C__flash_increase_cache_size failed.") } } } @@ -5223,11 +5191,9 @@ H5C_unprotect(H5F_t * f, if ( H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, type, addr, - (H5C__FLUSH_CLEAR_ONLY_FLAG | - H5C__FLUSH_INVALIDATE_FLAG), + (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_INVALIDATE_FLAG), &dummy_first_flush, TRUE) < 0 ) { @@ -5262,7 +5228,6 @@ H5C_unprotect(H5F_t * f, if ( H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, type, addr, H5C__FLUSH_CLEAR_ONLY_FLAG, @@ -5310,7 +5275,7 @@ done: * * Added validation for the flash increment fields. * - * JRM -- 12/31/07 + * JRM -- 12/31/07 * *------------------------------------------------------------------------- */ @@ -5412,7 +5377,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, ( config_ptr->apply_max_increment != FALSE ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "apply_max_increment must be either TRUE or FALSE"); + "apply_max_increment must be either TRUE or FALSE"); } /* no need to check max_increment, as it is a size_t, @@ -5422,11 +5387,11 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, switch ( config_ptr->flash_incr_mode ) { - case H5C_flash_incr__off: + case H5C_flash_incr__off: /* nothing to do here */ - break; + break; - case H5C_flash_incr__add_space: + case H5C_flash_incr__add_space: if ( ( config_ptr->flash_multiple < 0.1 ) || ( config_ptr->flash_multiple > 10.0 ) ) { @@ -5438,15 +5403,15 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, ( config_ptr->flash_threshold > 1.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "flash_threshold must be in the range [0.1, 1.0]"); + "flash_threshold must be in the range [0.1, 1.0]"); } - break; + break; - default: + default: HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ - "Invalid flash_incr_mode"); - break; - } + "Invalid flash_incr_mode"); + break; + } } /* H5C_RESIZE_CFG__VALIDATE_INCREMENT */ @@ -5587,20 +5552,18 @@ done: * H5C_auto_size_ctl_t structure. * * JRM -- 1/5/08 - * Added support for flash cache size increases. + * Added support for flash cache size increases. * *------------------------------------------------------------------------- */ - static herr_t -H5C__auto_adjust_cache_size(H5C_t * cache_ptr, - H5F_t * f, +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) { - herr_t ret_value = SUCCEED; /* Return value */ + H5C_t * cache_ptr = f->shared->cache; herr_t result; hbool_t inserted_epoch_marker = FALSE; size_t new_max_cache_size = 0; @@ -5609,9 +5572,11 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, size_t old_min_clean_size = 0; double hit_rate; enum H5C_resize_status status = in_spec; /* will change if needed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5C__auto_adjust_cache_size) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->cache_accesses >= @@ -5796,11 +5761,10 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, } else { - result = H5C__autoadjust__ageout(cache_ptr, + result = H5C__autoadjust__ageout(f, hit_rate, &status, &new_max_cache_size, - f, primary_dxpl_id, secondary_dxpl_id, write_permitted, @@ -5873,14 +5837,15 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, cache_ptr->size_decreased = TRUE; } - /* update flash cache size increase fields as appropriate */ - if ( cache_ptr->flash_size_increase_possible ) { + /* update flash cache size increase fields as appropriate */ + if ( cache_ptr->flash_size_increase_possible ) { switch ( (cache_ptr->resize_ctl).flash_incr_mode ) { case H5C_flash_incr__off: + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "flash_size_increase_possible but H5C_flash_incr__off?!") + "flash_size_increase_possible but H5C_flash_incr__off?!") break; case H5C_flash_incr__add_space: @@ -5888,7 +5853,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, (size_t) (((double)(cache_ptr->max_cache_size)) * ((cache_ptr->resize_ctl).flash_threshold)); - break; + break; default: /* should be unreachable */ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ @@ -5948,24 +5913,24 @@ done: * *------------------------------------------------------------------------- */ - static herr_t -H5C__autoadjust__ageout(H5C_t * cache_ptr, +H5C__autoadjust__ageout(H5F_t * f, double hit_rate, enum H5C_resize_status * status_ptr, size_t * new_max_cache_size_ptr, - H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, hbool_t write_permitted, hbool_t * first_flush_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + H5C_t * cache_ptr = f->shared->cache; herr_t result; size_t test_size; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5C__autoadjust__ageout) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( ( status_ptr ) && ( *status_ptr == in_spec ) ); @@ -5997,21 +5962,9 @@ H5C__autoadjust__ageout(H5C_t * cache_ptr, if ( cache_ptr->max_cache_size > (cache_ptr->resize_ctl).min_size ){ /* evict aged out cache entries if appropriate... */ - result = H5C__autoadjust__ageout__evict_aged_out_entries - ( - f, - primary_dxpl_id, - secondary_dxpl_id, - cache_ptr, - write_permitted, - first_flush_ptr - ); - - if ( result != SUCCEED ) { - - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "error flushing aged out entries.") - } + if(H5C__autoadjust__ageout__evict_aged_out_entries(f, primary_dxpl_id, + secondary_dxpl_id, write_permitted, first_flush_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "error flushing aged out entries.") /* ... and then reduce cache size if appropriate */ if ( cache_ptr->index_size < cache_ptr->max_cache_size ) { @@ -6231,26 +6184,26 @@ done: * *------------------------------------------------------------------------- */ - static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, hbool_t write_permitted, hbool_t * first_flush_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + H5C_t * cache_ptr = f->shared->cache; herr_t result; size_t eviction_size_limit; size_t bytes_evicted = 0; - hbool_t prev_is_dirty = FALSE; + hbool_t prev_is_dirty = FALSE; H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * next_ptr; H5C_cache_entry_t * prev_ptr; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5C__autoadjust__ageout__evict_aged_out_entries) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -6292,7 +6245,6 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, result = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, entry_ptr->type, entry_ptr->addr, H5C__NO_FLAGS_SET, @@ -6305,7 +6257,6 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, result = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, entry_ptr->type, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, @@ -6323,24 +6274,24 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, #ifndef NDEBUG if ( prev_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) { - /* something horrible has happened to *prev_ptr -- - * scream and die. - */ - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "*prev_ptr corrupt") + /* something horrible has happened to *prev_ptr -- + * scream and die. + */ + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "*prev_ptr corrupt") } else #endif /* NDEBUG */ if ( ( prev_ptr->is_dirty != prev_is_dirty ) - || - ( prev_ptr->next != next_ptr ) - || - ( prev_ptr->is_protected ) - || - ( prev_ptr->is_pinned ) ) { + || + ( prev_ptr->next != next_ptr ) + || + ( prev_ptr->is_protected ) + || + ( prev_ptr->is_pinned ) ) { /* something has happened to the LRU -- start over - * from the tail. + * from the tail. */ entry_ptr = cache_ptr->LRU_tail_ptr; @@ -6349,11 +6300,11 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, entry_ptr = prev_ptr; } - } else { + } else { - entry_ptr = NULL; + entry_ptr = NULL; - } + } } /* end while */ /* for now at least, don't bother to maintain the minimum clean size, @@ -6404,7 +6355,6 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, result = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, entry_ptr->type, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, @@ -6701,12 +6651,13 @@ done: } /* H5C__autoadjust__ageout__remove_excess_markers() */ + /*------------------------------------------------------------------------- * - * Function: H5C__flash_increase_cache_size + * Function: H5C__flash_increase_cache_size * - * Purpose: If there is not at least new_entry_size - old_entry_size - * bytes of free space in the cache and the current + * Purpose: If there is not at least new_entry_size - old_entry_size + * bytes of free space in the cache and the current * max_cache_size is less than (cache_ptr->resize_ctl).max_size, * perform a flash increase in the cache size and then reset * the full cache hit rate statistics, and exit. @@ -6717,27 +6668,26 @@ done: * * Modifications: * - * None. + * None. * *------------------------------------------------------------------------- */ - static herr_t H5C__flash_increase_cache_size(H5C_t * cache_ptr, size_t old_entry_size, size_t new_entry_size) { - /* const char * fcn_name = "H5C__flash_increase_cache_size()";*/ - herr_t ret_value = SUCCEED; /* Return value */ - size_t new_max_cache_size = 0; - size_t old_max_cache_size = 0; - size_t new_min_clean_size = 0; - size_t old_min_clean_size = 0; - size_t space_needed; - enum H5C_resize_status status = flash_increase; /* may change */ - double hit_rate; + size_t new_max_cache_size = 0; + size_t old_max_cache_size = 0; + size_t new_min_clean_size = 0; + size_t old_min_clean_size = 0; + size_t space_needed; + enum H5C_resize_status status = flash_increase; /* may change */ + double hit_rate; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5C__flash_increase_cache_size) + HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->flash_size_increase_possible ); @@ -6753,7 +6703,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, space_needed = new_entry_size - old_entry_size; if ( ( (cache_ptr->index_size + space_needed) > - cache_ptr->max_cache_size ) && + cache_ptr->max_cache_size ) && ( cache_ptr->max_cache_size < (cache_ptr->resize_ctl).max_size ) ) { /* we have work to do */ @@ -6766,15 +6716,16 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, break; case H5C_flash_incr__add_space: - if ( cache_ptr->index_size < cache_ptr->max_cache_size ) { + if ( cache_ptr->index_size < cache_ptr->max_cache_size ) { - HDassert( (cache_ptr->max_cache_size - cache_ptr->index_size) - < space_needed ); - space_needed -= cache_ptr->max_cache_size - cache_ptr->index_size; - } - space_needed = - (size_t)(((double)space_needed) * - (cache_ptr->resize_ctl).flash_multiple); + HDassert( (cache_ptr->max_cache_size - cache_ptr->index_size) + < space_needed ); + space_needed -= cache_ptr->max_cache_size - + cache_ptr->index_size; + } + space_needed = + (size_t)(((double)space_needed) * + (cache_ptr->resize_ctl).flash_multiple); new_max_cache_size = cache_ptr->max_cache_size + space_needed; @@ -6788,7 +6739,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, if ( new_max_cache_size > (cache_ptr->resize_ctl).max_size ) { - new_max_cache_size = (cache_ptr->resize_ctl).max_size; + new_max_cache_size = (cache_ptr->resize_ctl).max_size; } HDassert( new_max_cache_size > cache_ptr->max_cache_size ); @@ -6812,7 +6763,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, { case H5C_flash_incr__off: HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "flash_size_increase_possible but H5C_flash_incr__off?!") + "flash_size_increase_possible but H5C_flash_incr__off?!") break; case H5C_flash_incr__add_space: @@ -6829,15 +6780,15 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, } /* note that we don't cycle the epoch markers. We can - * argue either way as to whether we should, but for now - * we don't. - */ + * argue either way as to whether we should, but for now + * we don't. + */ if ( (cache_ptr->resize_ctl).rpt_fcn != NULL ) { - /* get the hit rate for the reporting function. Should still - * be good as we havent reset the hit rate statistics. - */ + /* get the hit rate for the reporting function. Should still + * be good as we havent reset the hit rate statistics. + */ if ( H5C_get_cache_hit_rate(cache_ptr, &hit_rate) != SUCCEED ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get hit rate.") @@ -6926,19 +6877,18 @@ done: * but one can argue that I should just scream and die if I * ever detect the condidtion. * - * -- JRM 10/13/07 + * -- JRM 10/13/07 * *------------------------------------------------------------------------- */ -herr_t -H5C_flush_invalidate_cache(H5F_t * f, +static herr_t +H5C_flush_invalidate_cache(const H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, unsigned flags) { + H5C_t * cache_ptr = f->shared->cache; herr_t status; - herr_t ret_value = SUCCEED; hbool_t done = FALSE; hbool_t first_flush = TRUE; hbool_t first_pass = TRUE; @@ -6958,9 +6908,11 @@ H5C_flush_invalidate_cache(H5F_t * f, size_t actual_slist_size = 0; size_t initial_slist_size = 0; #endif /* H5C_DO_SANITY_CHECKS */ + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5C_flush_invalidate_cache, FAIL) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); @@ -7032,16 +6984,17 @@ H5C_flush_invalidate_cache(H5F_t * f, if ( cache_ptr->slist_len == 0 ) { node_ptr = NULL; + next_entry_ptr = NULL; HDassert( cache_ptr->slist_size == 0 ); } else { node_ptr = H5SL_first(cache_ptr->slist_ptr); - if ( node_ptr == NULL ) { - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "slist_len != 0 && node_ptr == NULL"); - } + if ( node_ptr == NULL ) { + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ + "slist_len != 0 && node_ptr == NULL"); + } next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); @@ -7050,12 +7003,13 @@ H5C_flush_invalidate_cache(H5F_t * f, "next_entry_ptr == NULL 1 ?!?!"); } #ifndef NDEBUG - HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); + HDassert( next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); #endif /* NDEBUG */ HDassert( next_entry_ptr->is_dirty ); HDassert( next_entry_ptr->in_slist ); } + #if H5C_DO_SANITY_CHECKS /* Depending on circumstances, H5C_flush_single_entry() will * remove dirty entries from the slist as it flushes them. @@ -7112,62 +7066,62 @@ H5C_flush_invalidate_cache(H5F_t * f, * of this while loop. * * If an entry has merely been marked clean and removed from - * the s-list, we simply break out of the scan. - * - * If the entry has been evicted, we flag an error and - * exit. - */ + * the s-list, we simply break out of the scan. + * + * If the entry has been evicted, we flag an error and + * exit. + */ #ifndef NDEBUG - if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) { + if ( entry_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "entry_ptr->magic is invalid ?!?!"); - } else + } else #endif /* NDEBUG */ if ( ( ! entry_ptr->is_dirty ) || ( ! entry_ptr->in_slist ) ) { - /* the s-list has been modified out from under us. + /* the s-list has been modified out from under us. * break out of the loop. - */ - break; - } + */ + break; + } /* increment node pointer now, before we delete its target * from the slist. */ - node_ptr = H5SL_next(node_ptr); + if ( node_ptr != NULL ) { - next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + next_entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - if ( next_entry_ptr == NULL ) { + if ( next_entry_ptr == NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "next_entry_ptr == NULL 2 ?!?!"); - } + } #ifndef NDEBUG - HDassert( next_entry_ptr->magic == - H5C__H5C_CACHE_ENTRY_T_MAGIC ); + HDassert( next_entry_ptr->magic == + H5C__H5C_CACHE_ENTRY_T_MAGIC ); #endif /* NDEBUG */ HDassert( next_entry_ptr->is_dirty ); HDassert( next_entry_ptr->in_slist ); } else { - next_entry_ptr = NULL; - } + next_entry_ptr = NULL; + } - /* Note that we now remove nodes from the slist as we flush - * the associated entries, instead of leaving them there - * until we are done, and then destroying all nodes in + /* Note that we now remove nodes from the slist as we flush + * the associated entries, instead of leaving them there + * until we are done, and then destroying all nodes in * the slist. * * While this optimization used to be easy, with the possibility - * of new entries being added to the slist in the midst of the - * flush, we must keep the slist in cannonical form at all - * times. + * of new entries being added to the slist in the midst of the + * flush, we must keep the slist in cannonical form at all + * times. */ HDassert( entry_ptr != NULL ); @@ -7211,7 +7165,6 @@ H5C_flush_invalidate_cache(H5F_t * f, status = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, NULL, entry_ptr->addr, H5C__NO_FLAGS_SET, @@ -7232,11 +7185,9 @@ H5C_flush_invalidate_cache(H5F_t * f, status = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, NULL, entry_ptr->addr, - (cooked_flags | - H5C__FLUSH_INVALIDATE_FLAG), + (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG), &first_flush, TRUE); if ( status < 0 ) { @@ -7249,17 +7200,18 @@ H5C_flush_invalidate_cache(H5F_t * f, "dirty entry flush destroy failed.") } } + } /* end while loop scanning skip list */ #if H5C_DO_SANITY_CHECKS /* It is possible that entries were added to the slist during * the scan, either before or after scan pointer. The following * asserts take this into account. - * - * Don't bother with the sanity checks if node_ptr != NULL, as - * in this case we broke out of the loop because it got changed - * out from under us. - */ + * + * Don't bother with the sanity checks if node_ptr != NULL, as + * in this case we broke out of the loop because it got changed + * out from under us. + */ if ( node_ptr == NULL ) { @@ -7288,12 +7240,14 @@ H5C_flush_invalidate_cache(H5F_t * f, while ( next_entry_ptr != NULL ) { entry_ptr = next_entry_ptr; - +#ifndef NDEBUG + HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); +#endif /* NDEBUG */ next_entry_ptr = entry_ptr->ht_next; #ifndef NDEBUG HDassert ( ( next_entry_ptr == NULL ) || - ( next_entry_ptr->magic == - H5C__H5C_CACHE_ENTRY_T_MAGIC ) ); + ( next_entry_ptr->magic == + H5C__H5C_CACHE_ENTRY_T_MAGIC ) ); #endif /* NDEBUG */ if ( entry_ptr->is_protected ) { @@ -7311,11 +7265,9 @@ H5C_flush_invalidate_cache(H5F_t * f, status = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, NULL, entry_ptr->addr, - (cooked_flags | - H5C__FLUSH_INVALIDATE_FLAG), + (cooked_flags | H5C__FLUSH_INVALIDATE_FLAG), &first_flush, TRUE); if ( status < 0 ) { @@ -7347,16 +7299,16 @@ H5C_flush_invalidate_cache(H5F_t * f, * die. */ #ifndef NDEBUG - if ( ( next_entry_ptr != NULL ) && + if ( ( next_entry_ptr != NULL ) && ( next_entry_ptr->magic != - H5C__H5C_CACHE_ENTRY_T_MAGIC ) ) { + H5C__H5C_CACHE_ENTRY_T_MAGIC ) ) { - /* Something horrible has happened to + /* Something horrible has happened to * *next_entry_ptr -- scream and die. */ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "next_entry_ptr->magic is invalid?!?!?.") - } + "next_entry_ptr->magic is invalid?!?!?.") + } #endif /* NDEBUG */ } /* end while loop scanning hash table bin */ } /* end for loop scanning hash table */ @@ -7402,8 +7354,8 @@ H5C_flush_invalidate_cache(H5F_t * f, HDassert( cache_ptr->LRU_list_len == 0 ); HDassert( cache_ptr->LRU_list_size == 0 ); } - } /* main while loop */ + } /* main while loop */ HDassert( protected_entries <= cache_ptr->pl_len ); @@ -7516,28 +7468,28 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C_flush_single_entry(H5F_t * f, +H5C_flush_single_entry(const H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, 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; hbool_t destroy; hbool_t clear_only; hbool_t was_dirty; - herr_t ret_value = SUCCEED; /* Return value */ herr_t status; int type_id; unsigned flush_flags = H5C_CALLBACK__NO_FLAGS_SET; - H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5C_flush_single_entry) - + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); @@ -7580,8 +7532,8 @@ H5C_flush_single_entry(H5F_t * f, */ else { HDfprintf(stdout, - "H5C_flush_single_entry(): non-existant entry. addr = %a\n", - addr); + "H5C_flush_single_entry(): non-existant entry. addr = %a\n", + addr); HDfflush(stdout); } #endif @@ -7696,38 +7648,56 @@ H5C_flush_single_entry(H5F_t * f, if ( destroy ) { /* AKA eviction */ #if 0 /* JRM */ - /* This test code may come in handy -- lets keep it for a while */ + /* This test code may come in handy -- lets keep it for a while. + * + * Note that it will cause spurious errors in the serial case + * unless we are maintaining the clean and dirty LRU lists. + */ { if ( entry_ptr->is_dirty ) { if ( cache_ptr->dLRU_head_ptr == NULL ) - HDfprintf(stdout,"cache_ptr->dLRU_head_ptr == NULL.\n"); + HDfprintf(stdout, + "%s: cache_ptr->dLRU_head_ptr == NULL.\n", + FUNC); if ( cache_ptr->dLRU_tail_ptr == NULL ) - HDfprintf(stdout,"cache_ptr->dLRU_tail_ptr == NULL.\n"); + HDfprintf(stdout, + "%s: cache_ptr->dLRU_tail_ptr == NULL.\n", + FUNC); if ( cache_ptr->dLRU_list_len <= 0 ) - HDfprintf(stdout,"cache_ptr->dLRU_list_len <= 0.\n"); + HDfprintf(stdout, + "%s: cache_ptr->dLRU_list_len <= 0.\n", + FUNC); if ( cache_ptr->dLRU_list_size <= 0 ) - HDfprintf(stdout,"cache_ptr->dLRU_list_size <= 0.\n"); + HDfprintf(stdout, + "%s: cache_ptr->dLRU_list_size <= 0.\n", + FUNC); if ( cache_ptr->dLRU_list_size < entry_ptr->size ) HDfprintf(stdout, - "cache_ptr->dLRU_list_size < entry_ptr->size.\n"); + "%s: cache_ptr->dLRU_list_size < entry_ptr->size.\n", + FUNC); if ( ( (cache_ptr->dLRU_list_size) == entry_ptr->size ) && ( ! ( (cache_ptr->dLRU_list_len) == 1 ) ) ) HDfprintf(stdout, - "dLRU_list_size == size && dLRU_list_len != 1\n"); + "%s: dLRU_list_size == size && dLRU_list_len != 1\n", + FUNC); if ( ( entry_ptr->aux_prev == NULL ) && ( cache_ptr->dLRU_head_ptr != entry_ptr ) ) - HDfprintf(stdout, "entry_ptr->aux_prev == NULL && dLRU_head_ptr != entry_ptr\n"); + HDfprintf(stdout, + "%s: entry_ptr->aux_prev == NULL && dLRU_head_ptr != entry_ptr\n", + FUNC); if ( ( entry_ptr->aux_next == NULL ) && ( cache_ptr->dLRU_tail_ptr != entry_ptr ) ) - HDfprintf(stdout, "entry_ptr->aux_next == NULL && dLRU_tail_ptr != entry_ptr\n"); + HDfprintf(stdout, + "%s: entry_ptr->aux_next == NULL && dLRU_tail_ptr != entry_ptr\n", + FUNC); if ( ( cache_ptr->dLRU_list_len == 1 ) && ( ! ( ( cache_ptr->dLRU_head_ptr == entry_ptr ) && @@ -7739,40 +7709,52 @@ H5C_flush_single_entry(H5F_t * f, ) ) { - HDfprintf(stdout, "single entry dlru sanity check fails\n"); + HDfprintf(stdout, + "%s: single entry dlru sanity check fails\n", + FUNC); } } else { if ( cache_ptr->cLRU_head_ptr == NULL ) - HDfprintf(stdout,"cache_ptr->cLRU_head_ptr == NULL.\n"); + HDfprintf(stdout, + "%s: cache_ptr->cLRU_head_ptr == NULL.\n", + FUNC); if ( cache_ptr->cLRU_tail_ptr == NULL ) - HDfprintf(stdout,"cache_ptr->cLRU_tail_ptr == NULL.\n"); + HDfprintf(stdout, + "%s: cache_ptr->cLRU_tail_ptr == NULL.\n", + FUNC); if ( cache_ptr->cLRU_list_len <= 0 ) - HDfprintf(stdout,"cache_ptr->cLRU_list_len <= 0.\n"); + HDfprintf(stdout, + "%s: cache_ptr->cLRU_list_len <= 0.\n", + FUNC); if ( cache_ptr->cLRU_list_size <= 0 ) - HDfprintf(stdout,"cache_ptr->cLRU_list_size <= 0.\n"); + HDfprintf(stdout, + "%s: cache_ptr->cLRU_list_size <= 0.\n", + FUNC); if ( cache_ptr->cLRU_list_size < entry_ptr->size ) HDfprintf(stdout, - "cache_ptr->cLRU_list_size < entry_ptr->size.\n"); + "%s: cache_ptr->cLRU_list_size < entry_ptr->size.\n", + FUNC); if ( ( (cache_ptr->cLRU_list_size) == entry_ptr->size ) && ( ! ( (cache_ptr->cLRU_list_len) == 1 ) ) ) HDfprintf(stdout, - "cLRU_list_size == size && cLRU_list_len != 1\n"); + "%s: cLRU_list_size == size && cLRU_list_len != 1\n", + FUNC); if ( ( entry_ptr->aux_prev == NULL ) && ( cache_ptr->cLRU_head_ptr != entry_ptr ) ) - HDfprintf(stdout, "entry_ptr->aux_prev == NULL && cLRU_head_ptr != entry_ptr\n"); + HDfprintf(stdout, "%s: entry_ptr->aux_prev == NULL && cLRU_head_ptr != entry_ptr\n", FUNC); if ( ( entry_ptr->aux_next == NULL ) && ( cache_ptr->cLRU_tail_ptr != entry_ptr ) ) - HDfprintf(stdout, "entry_ptr->aux_next == NULL && cLRU_tail_ptr != entry_ptr\n"); + HDfprintf(stdout, "%s: entry_ptr->aux_next == NULL && cLRU_tail_ptr != entry_ptr\n", FUNC); if ( ( cache_ptr->cLRU_list_len == 1 ) && ( ! ( ( cache_ptr->cLRU_head_ptr == entry_ptr ) && @@ -7784,7 +7766,9 @@ H5C_flush_single_entry(H5F_t * f, ) ) { - HDfprintf(stdout, "single entry clru sanity check fails\n"); + HDfprintf(stdout, + "%s: single entry clru sanity check fails\n", + FUNC); } } } @@ -8042,7 +8026,6 @@ done: * *------------------------------------------------------------------------- */ - static void * H5C_load_entry(H5F_t * f, hid_t dxpl_id, @@ -8057,11 +8040,14 @@ H5C_load_entry(H5F_t * f, #endif /* NDEBUG */ { void * thing = NULL; - void * ret_value = NULL; H5C_cache_entry_t * entry_ptr = NULL; + void * ret_value = NULL; FUNC_ENTER_NOAPI_NOINIT(H5C_load_entry) + HDassert( f ); + HDassert( f->shared ); + HDassert( f->shared->cache ); HDassert( skip_file_checks || f ); HDassert( type ); HDassert( type->load ); @@ -8101,21 +8087,21 @@ H5C_load_entry(H5F_t * f, HDassert( ( entry_ptr->is_dirty == FALSE ) || ( type->id == 5 ) ); #ifndef NDEBUG - entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; + entry_ptr->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC; #endif /* NDEBUG */ - entry_ptr->cache_ptr = f->shared->cache; - entry_ptr->addr = addr; - entry_ptr->type = type; - entry_ptr->is_protected = FALSE; - entry_ptr->is_read_only = FALSE; - entry_ptr->ro_ref_count = 0; - entry_ptr->in_slist = FALSE; - entry_ptr->flush_marker = FALSE; + entry_ptr->cache_ptr = f->shared->cache; + entry_ptr->addr = addr; + entry_ptr->type = type; + entry_ptr->is_protected = FALSE; + entry_ptr->is_read_only = FALSE; + entry_ptr->ro_ref_count = 0; + entry_ptr->in_slist = FALSE; + entry_ptr->flush_marker = FALSE; #ifdef H5_HAVE_PARALLEL - entry_ptr->clear_on_unprotect = FALSE; + entry_ptr->clear_on_unprotect = FALSE; #endif /* H5_HAVE_PARALLEL */ - entry_ptr->flush_in_progress = FALSE; - entry_ptr->destroy_in_progress = FALSE; + entry_ptr->flush_in_progress = FALSE; + entry_ptr->destroy_in_progress = FALSE; if ( (type->size)(f, thing, &(entry_ptr->size)) < 0 ) { @@ -8125,14 +8111,14 @@ H5C_load_entry(H5F_t * f, HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); - entry_ptr->ht_next = NULL; - entry_ptr->ht_prev = NULL; + entry_ptr->ht_next = NULL; + entry_ptr->ht_prev = NULL; - entry_ptr->next = NULL; - entry_ptr->prev = NULL; + entry_ptr->next = NULL; + entry_ptr->prev = NULL; - entry_ptr->aux_next = NULL; - entry_ptr->aux_prev = NULL; + entry_ptr->aux_next = NULL; + entry_ptr->aux_prev = NULL; H5C__RESET_CACHE_ENTRY_STATS(entry_ptr); @@ -8218,31 +8204,31 @@ done: * *------------------------------------------------------------------------- */ - static herr_t H5C_make_space_in_cache(H5F_t * f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, - H5C_t * cache_ptr, size_t space_needed, hbool_t write_permitted, hbool_t * first_flush_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + H5C_t * cache_ptr = f->shared->cache; herr_t result; int32_t entries_examined = 0; int32_t initial_list_len; #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS size_t empty_space; #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - hbool_t prev_is_dirty = FALSE; + hbool_t prev_is_dirty = FALSE; hbool_t entry_is_epoch_maker = FALSE; H5C_cache_entry_t * entry_ptr; - H5C_cache_entry_t * next_ptr; H5C_cache_entry_t * prev_ptr; + H5C_cache_entry_t * next_ptr; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5C_make_space_in_cache) + HDassert( f ); HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( first_flush_ptr != NULL ); @@ -8267,13 +8253,13 @@ H5C_make_space_in_cache(H5F_t * f, HDassert( ! (entry_ptr->is_read_only) ); HDassert( (entry_ptr->ro_ref_count) == 0 ); - next_ptr = entry_ptr->next; - prev_ptr = entry_ptr->prev; + next_ptr = entry_ptr->next; + prev_ptr = entry_ptr->prev; if ( prev_ptr != NULL ) { - prev_is_dirty = prev_ptr->is_dirty; - } + prev_is_dirty = prev_ptr->is_dirty; + } if ( (entry_ptr->type)->id != H5C__EPOCH_MARKER_TYPE ) { @@ -8284,7 +8270,6 @@ H5C_make_space_in_cache(H5F_t * f, result = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, entry_ptr->type, entry_ptr->addr, H5C__NO_FLAGS_SET, @@ -8295,7 +8280,6 @@ H5C_make_space_in_cache(H5F_t * f, result = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, entry_ptr->type, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, @@ -8307,7 +8291,7 @@ H5C_make_space_in_cache(H5F_t * f, /* Skip epoch markers. Set result to SUCCEED to avoid * triggering the error code below. */ - entry_is_epoch_maker = TRUE; + entry_is_epoch_maker = TRUE; result = SUCCEED; } @@ -8317,50 +8301,53 @@ H5C_make_space_in_cache(H5F_t * f, "unable to flush entry") } - if ( prev_ptr != NULL ) { + if ( prev_ptr != NULL ) { #ifndef NDEBUG - if ( prev_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) { + if ( prev_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC ) { - /* something horrible has happened to *prev_ptr -- - * scream and die. - */ + /* something horrible has happened to *prev_ptr -- + * scream and die. + */ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "*prev_ptr corrupt 1") + "*prev_ptr corrupt 1") } #endif /* NDEBUG */ if ( entry_is_epoch_maker ) { - entry_ptr = prev_ptr; + /* epoch markers don't get flushed, so the sanity checks + * on normal entries will fail -- thus just set entry_ptr + * to prev_ptr and go on. + */ + entry_ptr = prev_ptr; } else if ( ( prev_ptr->is_dirty != prev_is_dirty ) - || - ( prev_ptr->next != next_ptr ) - || - ( prev_ptr->is_protected ) - || - ( prev_ptr->is_pinned ) ) { - - /* something has happened to the LRU -- start over - * from the tail. - */ - - entry_ptr = cache_ptr->LRU_tail_ptr; + || + ( prev_ptr->next != next_ptr ) + || + ( prev_ptr->is_protected ) + || + ( prev_ptr->is_pinned ) ) { + + /* something has happened to the LRU -- start over + * from the tail. + */ + entry_ptr = cache_ptr->LRU_tail_ptr; - } else { + } else { - entry_ptr = prev_ptr; + entry_ptr = prev_ptr; - } - } else { + } + } else { - entry_ptr = NULL; + entry_ptr = NULL; - } + } - entries_examined++; + entries_examined++; - } + } #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS @@ -8393,15 +8380,14 @@ H5C_make_space_in_cache(H5F_t * f, next_ptr = entry_ptr->aux_next; - if ( prev_ptr != NULL ) { + if ( prev_ptr != NULL ) { - HDassert( prev_ptr->is_dirty ); - } + HDassert( prev_ptr->is_dirty ); + } result = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, entry_ptr->type, entry_ptr->addr, H5C__NO_FLAGS_SET, @@ -8414,66 +8400,66 @@ H5C_make_space_in_cache(H5F_t * f, "unable to flush entry") } - if ( prev_ptr != NULL ) { + if ( prev_ptr != NULL ) { #ifndef NDEBUG - if (prev_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC) { + if (prev_ptr->magic != H5C__H5C_CACHE_ENTRY_T_MAGIC) { - /* something horrible has happened to *prev_ptr -- - * scream and die. - */ + /* something horrible has happened to *prev_ptr -- + * scream and die. + */ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ - "*prev_ptr corrupt 2") + "*prev_ptr corrupt 2") - } else + } else #endif /* #ifndef NDEBUG */ if ( ( ! ( prev_ptr->is_dirty ) ) - || - ( prev_ptr->aux_next != next_ptr ) - || - ( prev_ptr->is_protected ) - || - ( prev_ptr->is_pinned ) ) { - - /* something has happened to the dirty LRU -- start over - * from the tail. - */ + || + ( prev_ptr->aux_next != next_ptr ) + || + ( prev_ptr->is_protected ) + || + ( prev_ptr->is_pinned ) ) { + + /* something has happened to the dirty LRU -- start over + * from the tail. + */ #if 0 /* This debuging code may be useful in the future -- keep it for now. */ - if ( ! ( prev_ptr->is_dirty ) ) { - HDfprintf(stdout, "%s: ! prev_ptr->is_dirty\n", - fcn_name); - } - if ( prev_ptr->aux_next != next_ptr ) { - HDfprintf(stdout, "%s: prev_ptr->next != next_ptr\n", - fcn_name); - } - if ( prev_ptr->is_protected ) { - HDfprintf(stdout, "%s: prev_ptr->is_protected\n", - fcn_name); - } - if ( prev_ptr->is_pinned ) { - HDfprintf(stdout, "%s:prev_ptr->is_pinned\n", - fcn_name); - } - - HDfprintf(stdout, "%s: re-starting scan of dirty list\n", - fcn_name); + if ( ! ( prev_ptr->is_dirty ) ) { + HDfprintf(stdout, "%s: ! prev_ptr->is_dirty\n", + FUNC); + } + if ( prev_ptr->aux_next != next_ptr ) { + HDfprintf(stdout, "%s: prev_ptr->next != next_ptr\n", + FUNC); + } + if ( prev_ptr->is_protected ) { + HDfprintf(stdout, "%s: prev_ptr->is_protected\n", + FUNC); + } + if ( prev_ptr->is_pinned ) { + HDfprintf(stdout, "%s:prev_ptr->is_pinned\n", + FUNC); + } + + HDfprintf(stdout, "%s: re-starting scan of dirty list\n", + FUNC); #endif /* JRM */ - entry_ptr = cache_ptr->dLRU_tail_ptr; + entry_ptr = cache_ptr->dLRU_tail_ptr; - } else { + } else { - entry_ptr = prev_ptr; + entry_ptr = prev_ptr; - } - } else { + } + } else { - entry_ptr = NULL; + entry_ptr = NULL; - } + } - entries_examined++; + entries_examined++; } #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ @@ -8505,7 +8491,6 @@ H5C_make_space_in_cache(H5F_t * f, result = H5C_flush_single_entry(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, entry_ptr->type, entry_ptr->addr, H5C__FLUSH_INVALIDATE_FLAG, @@ -8572,13 +8557,11 @@ H5C_validate_lru_list(H5C_t * cache_ptr) ( cache_ptr->LRU_head_ptr != cache_ptr->LRU_tail_ptr ) ) { - HDfprintf(stdout,"H5C_validate_lru_list: Check 1 failed.\n"); HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed") } if ( ( cache_ptr->LRU_list_len < 0 ) || ( cache_ptr->LRU_list_size < 0 ) ) { - HDfprintf(stdout,"H5C_validate_lru_list: Check 2 failed.\n"); HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed") } @@ -8592,7 +8575,6 @@ H5C_validate_lru_list(H5C_t * cache_ptr) ) ) { - HDfprintf(stdout,"H5C_validate_lru_list: Check 3 failed.\n"); HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed") } @@ -8608,7 +8590,6 @@ H5C_validate_lru_list(H5C_t * cache_ptr) ) ) { - HDfprintf(stdout,"H5C_validate_lru_list: Check 4 failed.\n"); HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed") } @@ -8620,7 +8601,6 @@ H5C_validate_lru_list(H5C_t * cache_ptr) ( ( entry_ptr->prev == NULL ) || ( entry_ptr->prev->next != entry_ptr ) ) ) { - HDfprintf(stdout,"H5C_validate_lru_list: Check 5 failed.\n"); HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed") } @@ -8628,7 +8608,6 @@ H5C_validate_lru_list(H5C_t * cache_ptr) ( ( entry_ptr->next == NULL ) || ( entry_ptr->next->prev != entry_ptr ) ) ) { - HDfprintf(stdout,"H5C_validate_lru_list: Check 6 failed.\n"); HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed") } @@ -8640,7 +8619,6 @@ H5C_validate_lru_list(H5C_t * cache_ptr) if ( ( cache_ptr->LRU_list_len != len ) || ( cache_ptr->LRU_list_size != size ) ) { - HDfprintf(stdout,"H5C_validate_lru_list: Check 7 failed.\n"); HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed") } @@ -8705,9 +8683,6 @@ H5C_verify_not_in_index(H5C_t * cache_ptr, { if ( scan_ptr == entry_ptr ) { - HDfprintf(stdout, - "H5C_verify_not_in_index: entry in index (%d/%d)\n", - i, depth); HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "Entry already in index.") } diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 5d23117..27aba6a 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -17,7 +17,7 @@ * Programmer: John Mainzer -- 10/12/04 * * Purpose: This file contains declarations which are normally visible - * only within the H5C package (just H5C.c at present). + * only within the H5C package. * * Source files outside the H5C package should include * H5Cprivate.h instead. @@ -50,6 +50,8 @@ * #define is used to set an upper limit on the number of passes. * The current value was obtained via personal communication with * Quincey. I have applied a fudge factor of 2. + * + * -- JRM */ #define H5C__MAX_PASSES_ON_FLUSH 4 @@ -94,10 +96,11 @@ * * JRM - 9/26/05 * - * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. This - * field is used to validate pointers to instances of H5C_t. + * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. + * This field is used to validate pointers to instances of + * H5C_t. * - * flush_in_progress: Boolean flag indicating whether a flush is in + * flush_in_progress: Boolean flag indicating whether a flush is in * progress. * * trace_file_ptr: File pointer pointing to the trace file, which is used @@ -106,7 +109,7 @@ * no trace file should be recorded. * * Since much of the code supporting the parallel metadata - * cache is in H5AC, we don't write the trace file from + * cache is in H5AC, we don't write the trace file from * H5C. Instead, H5AC reads the trace_file_ptr as needed. * * When we get to using H5C in other places, we may add @@ -123,9 +126,9 @@ * indexed by the ids. * * type_name_table_ptr: Pointer to an array of pointer to char of length - * max_type_id + 1. The strings pointed to by the entries - * in the array are the names of the entry types associated - * with the indexing type IDs. + * max_type_id + 1. The strings pointed to by the entries + * in the array are the names of the entry types associated + * with the indexing type IDs. * * max_cache_size: Nominal maximum number of bytes that may be stored in the * cache. This value should be viewed as a soft limit, as the @@ -179,10 +182,10 @@ * writes. The following field is used to implement this. * * evictions_enabled: Boolean flag that is initialized to TRUE. When - * this flag is set to FALSE, the metadata cache will not + * this flag is set to FALSE, the metadata cache will not * attempt to evict entries to make space for newly protected * entries, and instead the will grow without limit. - * + * * Needless to say, this feature must be used with care. * * @@ -253,7 +256,7 @@ * following two fields have been added. They are only compiled in when * H5C_DO_SANITY_CHECKS is TRUE. * - * slist_len_increase: Number of entries that have been added to the + * slist_len_increase: Number of entries that have been added to the * slist since the last time this field was set to zero. * * slist_size_increase: Total size of all entries that have been added @@ -464,16 +467,16 @@ * we receive a new configuration. * * flash_size_increase_possible: Depending on the configuration data given - * in the resize_ctl field, it may or may not be possible - * for a flash size increase to occur. We set this flag - * whenever we receive a new configuration so as to avoid - * repeated calculations. + * in the resize_ctl field, it may or may not be possible + * for a flash size increase to occur. We set this flag + * whenever we receive a new configuration so as to avoid + * repeated calculations. * * flash_size_increase_threshold: If a flash cache size increase is possible, - * this field is used to store the minimum size of a new entry - * or size increase needed to trigger a flash cache size - * increase. Note that this field must be updated whenever - * the size of the cache is changed. + * this field is used to store the minimum size of a new entry + * or size increase needed to trigger a flash cache size + * increase. Note that this field must be updated whenever + * the size of the cache is changed. * * size_decrease_possible: Depending on the configuration data given * in the resize_ctl field, it may or may not be possible @@ -590,23 +593,23 @@ * equal to the array index has not been in cache when * requested in the current epoch. * - * write_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry with - * type id equal to the array index has been write protected - * in the current epoch. + * write_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The + * cells are used to record the number of times an entry with + * type id equal to the array index has been write protected + * in the current epoch. * * Observe that (hits + misses) = (write_protects + read_protects). * - * read_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been read protected in the - * current epoch. + * read_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The + * cells are used to record the number of times an entry with + * type id equal to the array index has been read protected in + * the current epoch. * * Observe that (hits + misses) = (write_protects + read_protects). * - * max_read_protects: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to maximum number of simultaneous read - * protects on any entry with type id equal to the array index + * max_read_protects: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. + * The cells are used to maximum number of simultaneous read + * protects on any entry with type id equal to the array index * in the current epoch. * * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells @@ -614,9 +617,9 @@ * id equal to the array index has been inserted into the * cache in the current epoch. * - * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has been inserted + * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * The cells are used to record the number of times an entry + * with type id equal to the array index has been inserted * pinned into the cache in the current epoch. * * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells @@ -639,13 +642,13 @@ * id equal to the array index has been renamed in the current * epoch. * - * entry_flush_renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry + * entry_flush_renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * The cells are used to record the number of times an entry * with type id equal to the array index has been renamed * during its flush callback in the current epoch. * - * cache_flush_renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry + * cache_flush_renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. + * The cells are used to record the number of times an entry * with type id equal to the array index has been renamed * during a cache flush in the current epoch. * @@ -684,14 +687,14 @@ * with type id equal to the array index has decreased in * size in the current epoch. * - * entry_flush_size_changes: Array of int64 of length - * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record - * the number of times an entry with type id equal to the + * entry_flush_size_changes: Array of int64 of length + * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record + * the number of times an entry with type id equal to the * array index has changed size while in its flush callback. * - * cache_flush_size_changes: Array of int64 of length - * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record - * the number of times an entry with type id equal to the + * cache_flush_size_changes: Array of int64 of length + * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record + * the number of times an entry with type id equal to the * array index has changed size during a cache flush * * total_ht_insertions: Number of times entries have been inserted into the @@ -909,10 +912,8 @@ struct H5C_t int64_t pinned_clears[H5C__MAX_NUM_TYPE_IDS + 1]; int64_t size_increases[H5C__MAX_NUM_TYPE_IDS + 1]; int64_t size_decreases[H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t entry_flush_size_changes - [H5C__MAX_NUM_TYPE_IDS + 1]; - int64_t cache_flush_size_changes - [H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t entry_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1]; + int64_t cache_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1]; int64_t total_ht_insertions; int64_t total_ht_deletions; @@ -956,7 +957,6 @@ struct H5C_t /***************************** Macro Definitions ****************************/ /****************************************************************************/ - /**************************************************************************** * * We maintain doubly linked lists of instances of H5C_cache_entry_t for a @@ -1383,7 +1383,7 @@ if ( ( (entry_ptr) == NULL ) || \ * More pinned entry stats related updates. * * JRM -- 3/31/07 - * Updated H5C__UPDATE_STATS_FOR_PROTECT() to keep stats on + * Updated H5C__UPDATE_STATS_FOR_PROTECT() to keep stats on * read and write protects. * ***********************************************************************/ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 4e8b601..2c2de6d 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -30,7 +30,7 @@ #ifndef _H5Cprivate_H #define _H5Cprivate_H -#include "H5Cpublic.h" /*public prototypes */ +#include "H5Cpublic.h" /* public prototypes */ /* Pivate headers needed by this header */ #include "H5private.h" /* Generic Functions */ @@ -202,7 +202,7 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * * JRM - 4/26/04 * - * magic: Unsigned 32 bit integer that must always be set to + * magic: Unsigned 32 bit integer that must always be set to * H5C__H5C_CACHE_ENTRY_T_MAGIC when the entry is valid. * The field must be set to H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC * just before the entry is freed. @@ -342,7 +342,7 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, * * flush_marker: Boolean flag indicating that the entry is to be flushed * the next time H5C_flush_cache() is called with the - * H5AC__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when + * H5C__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when * the entry is flushed for whatever reason. * * clear_on_unprotect: Boolean flag used only in PHDF5. When H5C is used @@ -464,32 +464,32 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr, ****************************************************************************/ #ifndef NDEBUG -#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A -#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef +#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A +#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef #endif /* NDEBUG */ typedef struct H5C_cache_entry_t { #ifndef NDEBUG - uint32_t magic; + uint32_t magic; #endif /* NDEBUG */ - H5C_t * cache_ptr; - haddr_t addr; - size_t size; - const H5C_class_t * type; - hbool_t is_dirty; - hbool_t dirtied; - hbool_t is_protected; - hbool_t is_read_only; - int ro_ref_count; - hbool_t is_pinned; - hbool_t in_slist; - hbool_t flush_marker; + H5C_t * cache_ptr; + haddr_t addr; + size_t size; + const H5C_class_t * type; + hbool_t is_dirty; + hbool_t dirtied; + hbool_t is_protected; + hbool_t is_read_only; + int ro_ref_count; + hbool_t is_pinned; + hbool_t in_slist; + hbool_t flush_marker; #ifdef H5_HAVE_PARALLEL - hbool_t clear_on_unprotect; + hbool_t clear_on_unprotect; #endif /* H5_HAVE_PARALLEL */ - hbool_t flush_in_progress; - hbool_t destroy_in_progress; + hbool_t flush_in_progress; + hbool_t destroy_in_progress; /* fields supporting the hash table: */ @@ -618,55 +618,55 @@ typedef struct H5C_cache_entry_t * cache size can be increased in a single re-size. * * flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated - * type whose value indicates whether and by what algorithm we should - * make flash increases in the size of the cache to accomodate insertion - * of large entries and large increases in the size of a single entry. + * type whose value indicates whether and by what algorithm we should + * make flash increases in the size of the cache to accomodate insertion + * of large entries and large increases in the size of a single entry. * - * The addition of the flash increment mode was occasioned by performance - * problems that appear when a local heap is increased to a size in excess - * of the current cache size. While the existing re-size code dealt with - * this eventually, performance was very bad for the remainder of the - * epoch. + * The addition of the flash increment mode was occasioned by performance + * problems that appear when a local heap is increased to a size in excess + * of the current cache size. While the existing re-size code dealt with + * this eventually, performance was very bad for the remainder of the + * epoch. * - * At present, there are two possible values for the flash_incr_mode: + * At present, there are two possible values for the flash_incr_mode: * - * H5C_flash_incr__off: Don't perform flash increases in the size of - * the cache. + * H5C_flash_incr__off: Don't perform flash increases in the size of + * the cache. * - * H5C_flash_incr__add_space: Let x be either the size of a newly - * newly inserted entry, or the number of bytes by which the - * size of an existing entry has been increased. + * H5C_flash_incr__add_space: Let x be either the size of a newly + * newly inserted entry, or the number of bytes by which the + * size of an existing entry has been increased. * - * If - * x > flash_threshold * current max cache size, + * If + * x > flash_threshold * current max cache size, * - * increase the current maximum cache size by x * flash_multiple - * less any free space in the cache, and start a new epoch. For - * now at least, pay no attention to the maximum increment. + * increase the current maximum cache size by x * flash_multiple + * less any free space in the cache, and start a new epoch. For + * now at least, pay no attention to the maximum increment. * * - * With a little thought, it should be obvious that the above flash - * cache size increase algorithm is not sufficient for all circumstances -- - * for example, suppose the user round robins through - * (1/flash_threshold) +1 groups, adding one data set to each on each - * pass. Then all will increase in size at about the same time, requiring - * the max cache size to at least double to maintain acceptable + * With a little thought, it should be obvious that the above flash + * cache size increase algorithm is not sufficient for all + * circumstances -- for example, suppose the user round robins through + * (1/flash_threshold) +1 groups, adding one data set to each on each + * pass. Then all will increase in size at about the same time, requiring + * the max cache size to at least double to maintain acceptable * performance, however the above flash increment algorithm will not be - * triggered. + * triggered. * - * Hopefully, the add space algorithm detailed above will be sufficient - * for the performance problems encountered to date. However, we should - * expect to revisit the issue. + * Hopefully, the add space algorithm detailed above will be sufficient + * for the performance problems encountered to date. However, we should + * expect to revisit the issue. * * flash_multiple: Double containing the multiple described above in the - * H5C_flash_incr__add_space section of the discussion of the - * flash_incr_mode section. This field is ignored unless flash_incr_mode - * is H5C_flash_incr__add_space. + * H5C_flash_incr__add_space section of the discussion of the + * flash_incr_mode section. This field is ignored unless flash_incr_mode + * is H5C_flash_incr__add_space. * - * flash_threshold: Double containing the factor by which current max cache size - * is multiplied to obtain the size threshold for the add_space flash - * increment algorithm. The field is ignored unless flash_incr_mode is - * H5C_flash_incr__add_space. + * flash_threshold: Double containing the factor by which current max cache + * size is multiplied to obtain the size threshold for the add_space + * flash increment algorithm. The field is ignored unless + * flash_incr_mode is H5C_flash_incr__add_space. * * * Cache size decrease control fields: @@ -782,8 +782,8 @@ typedef struct H5C_cache_entry_t #define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5 #define H5C__DEF_AR_INCREMENT 2.0 #define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024)) -#define H5C__DEF_AR_FLASH_MULTIPLE 1.0 -#define H5C__DEV_AR_FLASH_THRESHOLD 0.25 +#define H5C__DEF_AR_FLASH_MULTIPLE 1.0 +#define H5C__DEV_AR_FLASH_THRESHOLD 0.25 #define H5C__DEF_AR_DECREMENT 0.9 #define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024)) #define H5C__DEF_AR_EPCHS_B4_EVICT 3 @@ -841,9 +841,10 @@ typedef struct H5C_auto_size_ctl_t hbool_t apply_max_increment; size_t max_increment; - enum H5C_cache_flash_incr_mode flash_incr_mode; - double flash_multiple; - double flash_threshold; + enum H5C_cache_flash_incr_mode flash_incr_mode; + double flash_multiple; + double flash_threshold; + /* size decrease control fields: */ enum H5C_cache_decr_mode decr_mode; @@ -924,13 +925,12 @@ typedef struct H5C_auto_size_ctl_t #define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0200 #define H5C__READ_ONLY_FLAG 0x0400 - H5_DLL H5C_t * H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, - const char * (* type_name_table_ptr), + const char * (* type_name_table_ptr), H5C_write_permitted_func_t check_write_permitted, - hbool_t write_permitted, + hbool_t write_permitted, H5C_log_flush_func_t log_flush, void * aux_ptr); @@ -962,8 +962,7 @@ H5_DLL herr_t H5C_flush_cache(H5F_t * f, H5_DLL herr_t H5C_flush_to_min_clean(H5F_t * f, hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, - H5C_t * cache_ptr); + hid_t secondary_dxpl_id); H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr); @@ -983,7 +982,7 @@ H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, hbool_t * in_cache_ptr, hbool_t * is_dirty_ptr, hbool_t * is_protected_ptr, - hbool_t * is_pinned_ptr); + hbool_t * is_pinned_ptr); H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t * cache_ptr, hbool_t * evictions_enabled_ptr); @@ -1001,12 +1000,11 @@ H5_DLL herr_t H5C_insert_entry(H5F_t * f, 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, - H5C_t * cache_ptr, - int32_t ce_array_len, - haddr_t * ce_array_ptr); +H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, + int32_t ce_array_len, + haddr_t *ce_array_ptr); H5_DLL herr_t H5C_mark_pinned_entry_dirty(void * thing, hbool_t size_changed, diff --git a/src/H5Cpublic.h b/src/H5Cpublic.h index 0a3742b..39ebbe3 100644 --- a/src/H5Cpublic.h +++ b/src/H5Cpublic.h @@ -43,8 +43,8 @@ enum H5C_cache_incr_mode enum H5C_cache_flash_incr_mode { - H5C_flash_incr__off, - H5C_flash_incr__add_space + H5C_flash_incr__off, + H5C_flash_incr__add_space }; enum H5C_cache_decr_mode diff --git a/src/H5Gent.c b/src/H5Gent.c index b7d22e8..21023ee 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -122,8 +122,6 @@ H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent) HDassert(pp); HDassert(ent); - ent->file = f; - /* decode header */ H5F_DECODE_LENGTH(f, *pp, ent->name_off); H5F_addr_decode(f, pp, &(ent->header)); @@ -424,9 +422,6 @@ H5G_ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, HGOTO_ERROR(H5E_SYM, H5E_BADVALUE, FAIL, "unrecognized link type") } /* end switch */ - /* Set the file for the entry */ - ent->file = f; - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5G_ent_convert() */ @@ -447,7 +442,7 @@ done: */ herr_t H5G_ent_debug(const H5G_entry_t *ent, FILE *stream, int indent, int fwidth, - H5HL_t *heap) + const H5HL_t *heap) { const char *lval = NULL; int nested_indent, nested_fwidth; diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 97af021..97f18b8 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -32,6 +32,7 @@ /* Packages needed by this file... */ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FLprivate.h" /* Free Lists */ @@ -58,8 +59,8 @@ typedef struct H5G_node_key_t { * table or group. */ typedef struct H5G_node_t { - H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */ - /* first field in structure */ + H5AC_info_t cache_info; /* Information for H5AC cache functions, _must_ be */ + /* first field in structure */ unsigned nsyms; /*number of symbols */ H5G_entry_t *entry; /*array of symbol table entries */ } H5G_node_t; diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 328e6dc..9bd4f34 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -32,7 +32,6 @@ #include "H5Gprivate.h" /* Other private headers needed by this file */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5B2private.h" /* v2 B-trees */ #include "H5HFprivate.h" /* Fractal heaps */ #include "H5HLprivate.h" /* Local Heaps */ @@ -106,7 +105,6 @@ typedef struct H5G_entry_t { H5G_cache_t cache; /*cached data from object header */ size_t name_off; /*offset of name within name heap */ haddr_t header; /*file address of object header */ - H5F_t *file; /*file to which this obj hdr belongs */ } H5G_entry_t; /* @@ -407,7 +405,7 @@ H5_DLL herr_t H5G_ent_encode_vec(const H5F_t *f, uint8_t **pp, H5_DLL herr_t H5G_ent_convert(H5F_t *f, hid_t dxpl_id, H5HL_t *heap, const char *name, const H5O_link_t *lnk, H5G_entry_t *ent); H5_DLL herr_t H5G_ent_debug(const H5G_entry_t *ent, FILE * stream, int indent, - int fwidth, H5HL_t *heap); + int fwidth, const H5HL_t *heap); /* Functions that understand symbol table nodes */ H5_DLL herr_t H5G_node_init(H5F_t *f); @@ -42,7 +42,7 @@ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Ipkg.h" /* IDs */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index f245023..b28ec50 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -24,7 +24,7 @@ #include "H5Oprivate.h" /* Object headers */ /* Other private headers needed by this file */ -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5FLprivate.h" /* Free Lists */ /* Object header macros */ diff --git a/src/H5Otest.c b/src/H5Otest.c index f6e4ba6..ac39c11 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -33,6 +33,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Opkg.h" /* Object headers */ @@ -20,7 +20,7 @@ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ diff --git a/src/H5Sall.c b/src/H5Sall.c index 07043f2..115d5d35 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -832,6 +832,7 @@ H5Sselect_all(hid_t spaceid) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(H5Sselect_all, FAIL) + H5TRACE1("e", "i", spaceid); /* Check args */ if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) diff --git a/src/H5Snone.c b/src/H5Snone.c index 50e685a..23fd1de 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -782,6 +782,7 @@ H5Sselect_none(hid_t spaceid) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(H5Sselect_none, FAIL) + H5TRACE1("e", "i", spaceid); /* Check args */ if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) @@ -27,7 +27,7 @@ #include "H5private.h" /*generic functions */ -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Dprivate.h" /*datasets (for H5Tcopy) */ #include "H5Eprivate.h" /*error handling */ #include "H5Fprivate.h" /* Files */ diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 1e52325..35aa8c2 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -25,7 +25,7 @@ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5FOprivate.h" /* File objects */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 56ca889..8b56fce 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -41,7 +41,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ +#include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5FOprivate.h" /* File objects */ #include "H5Iprivate.h" /* IDs */ |