mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-17 16:10:24 +08:00
[svn-r18460] Description:
Fold metadata journaling changes into the trunk: mostly tweaky small stuff, also removed the H5F_t* field 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
This commit is contained in:
parent
9a359c8224
commit
49cd4a1f3a
@ -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 */
|
||||
|
||||
|
182
src/H5AC.c
182
src/H5AC.c
@ -395,7 +395,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;
|
||||
@ -619,40 +618,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 */
|
||||
@ -661,13 +660,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 */
|
||||
@ -829,12 +828,12 @@ H5AC_expunge_entry(H5F_t *f,
|
||||
haddr_t addr,
|
||||
unsigned flags)
|
||||
{
|
||||
herr_t result;
|
||||
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 */
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(H5AC_expunge_entry, FAIL)
|
||||
|
||||
@ -850,7 +849,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.
|
||||
@ -859,7 +857,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));
|
||||
}
|
||||
@ -925,6 +923,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id)
|
||||
FUNC_ENTER_NOAPI(H5AC_flush, FAIL)
|
||||
|
||||
HDassert(f);
|
||||
HDassert(f->shared);
|
||||
HDassert(f->shared->cache);
|
||||
|
||||
#if H5AC__TRACE_FILE_ENABLED
|
||||
@ -1057,9 +1056,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
|
||||
@ -1133,6 +1129,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
|
||||
FUNC_ENTER_NOAPI(H5AC_set, FAIL)
|
||||
|
||||
HDassert(f);
|
||||
HDassert(f->shared);
|
||||
HDassert(f->shared->cache);
|
||||
HDassert(type);
|
||||
HDassert(type->flush);
|
||||
@ -1155,7 +1152,7 @@ H5AC_set(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_set 0x%lx %d 0x%x",
|
||||
@ -1357,8 +1354,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 */
|
||||
|
||||
@ -1371,7 +1368,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 */
|
||||
@ -1397,10 +1394,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
|
||||
@ -1466,10 +1459,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));
|
||||
@ -1559,11 +1552,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:
|
||||
@ -1656,9 +1649,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
|
||||
@ -1740,7 +1730,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;
|
||||
@ -1758,7 +1748,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);
|
||||
@ -1898,7 +1888,7 @@ done:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5AC_unpin_entry(void * thing)
|
||||
H5AC_unpin_entry(void *thing)
|
||||
{
|
||||
#if H5AC__TRACE_FILE_ENABLED
|
||||
char trace[128] = "";
|
||||
@ -1917,7 +1907,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 */
|
||||
|
||||
@ -2014,10 +2004,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
|
||||
@ -2082,7 +2068,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 dirtied;
|
||||
size_t new_size = 0;
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
@ -2095,10 +2080,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);
|
||||
@ -2116,10 +2103,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));
|
||||
|
||||
@ -2304,6 +2291,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 */
|
||||
@ -2429,9 +2417,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;
|
||||
@ -2478,7 +2466,6 @@ done:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5AC_get_cache_size(H5AC_t * cache_ptr,
|
||||
size_t * max_size_ptr,
|
||||
@ -2526,29 +2513,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() */
|
||||
|
||||
|
||||
@ -2629,7 +2605,6 @@ done:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr,
|
||||
H5AC_cache_config_t *config_ptr)
|
||||
@ -2842,15 +2817,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)
|
||||
|
||||
@ -3038,7 +3011,6 @@ done:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t
|
||||
H5AC_open_trace_file(H5AC_t * cache_ptr,
|
||||
const char * trace_file_name)
|
||||
@ -3119,7 +3091,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 ) {
|
||||
|
||||
@ -3181,7 +3153,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 );
|
||||
@ -3420,11 +3392,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)
|
||||
@ -3456,32 +3427,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() */
|
||||
|
||||
|
||||
@ -3631,7 +3598,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 );
|
||||
|
||||
@ -4060,7 +4027,6 @@ done:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
static herr_t
|
||||
H5AC_log_renamed_entry(const H5F_t *f,
|
||||
@ -4068,12 +4034,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)
|
||||
|
||||
@ -4310,7 +4276,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 );
|
||||
@ -4345,8 +4311,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;
|
||||
|
||||
@ -4441,7 +4406,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 );
|
||||
@ -4517,8 +4482,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.")
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
@ -146,7 +142,7 @@ typedef H5C_clear_func_t H5AC_clear_func_t;
|
||||
typedef H5C_notify_func_t H5AC_notify_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
|
||||
@ -165,7 +161,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;
|
||||
|
||||
|
||||
/*===----------------------------------------------------------------------===
|
||||
@ -216,7 +212,7 @@ extern hid_t H5AC_ind_dxpl_id;
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
#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, \
|
||||
@ -226,7 +222,7 @@ extern hid_t H5AC_ind_dxpl_id;
|
||||
/* size_t initial_size = */ ( 2 * 1024 * 1024), \
|
||||
/* double min_clean_fraction = */ 0.3, \
|
||||
/* size_t max_size = */ (32 * 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, \
|
||||
@ -237,7 +233,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, \
|
||||
@ -324,7 +320,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);
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -51,8 +51,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 */
|
||||
|
98
src/H5Cpkg.h
98
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.
|
||||
*
|
||||
*
|
||||
@ -285,7 +288,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
|
||||
@ -496,16 +499,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
|
||||
@ -622,23 +625,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
|
||||
@ -646,9 +649,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
|
||||
@ -671,13 +674,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.
|
||||
*
|
||||
@ -716,14 +719,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
|
||||
@ -966,10 +969,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;
|
||||
@ -1022,7 +1023,6 @@ struct H5C_t
|
||||
/***************************** Macro Definitions ****************************/
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
*
|
||||
* We maintain doubly linked lists of instances of H5C_cache_entry_t for a
|
||||
@ -1449,7 +1449,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.
|
||||
*
|
||||
* MAM -- 1/15/09
|
||||
|
144
src/H5Cprivate.h
144
src/H5Cprivate.h
@ -30,7 +30,7 @@
|
||||
#ifndef _H5Cprivate_H
|
||||
#define _H5Cprivate_H
|
||||
|
||||
#include "H5Cpublic.h" /*public prototypes */
|
||||
#include "H5Cpublic.h" /* public prototypes */
|
||||
|
||||
/* Private headers needed by this header */
|
||||
#include "H5private.h" /* Generic Functions */
|
||||
@ -228,7 +228,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.
|
||||
@ -368,7 +368,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
|
||||
@ -526,32 +526,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;
|
||||
hbool_t free_file_space_on_destroy;
|
||||
|
||||
/* fields supporting the 'flush dependency' feature: */
|
||||
@ -689,55 +689,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:
|
||||
@ -853,8 +853,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
|
||||
@ -912,9 +912,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;
|
||||
@ -1003,13 +1004,12 @@ typedef struct H5C_auto_size_ctl_t
|
||||
#define H5C__FREE_FILE_SPACE_FLAG 0x0800
|
||||
#define H5C__TAKE_OWNERSHIP_FLAG 0x1000
|
||||
|
||||
|
||||
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);
|
||||
|
||||
@ -1040,8 +1040,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);
|
||||
@ -1081,12 +1080,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,
|
||||
|
@ -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
|
||||
|
@ -136,7 +136,6 @@ H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth)
|
||||
HDassert(root_oloc);
|
||||
root_ent.type = H5G_NOTHING_CACHED;
|
||||
root_ent.header = root_oloc->addr;
|
||||
root_ent.file = f;
|
||||
|
||||
/* Display root group symbol table entry info */
|
||||
H5G_ent_debug(&root_ent, stream, indent + 3, MAX(0, fwidth - 3), NULL);
|
||||
|
@ -107,9 +107,6 @@ H5G_ent_decode(const H5F_t *f, const uint8_t **pp, H5G_entry_t *ent)
|
||||
HDassert(pp);
|
||||
HDassert(ent);
|
||||
|
||||
/* Set the entry's file pointer */
|
||||
ent->file = f;
|
||||
|
||||
/* decode header */
|
||||
H5F_DECODE_LENGTH(f, *pp, ent->name_off);
|
||||
H5F_addr_decode(f, pp, &(ent->header));
|
||||
@ -400,9 +397,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() */
|
||||
@ -423,7 +417,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;
|
||||
|
@ -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 */
|
||||
@ -51,6 +52,7 @@ typedef struct H5G_node_key_t {
|
||||
size_t offset; /*offset into heap for name */
|
||||
} H5G_node_key_t;
|
||||
|
||||
|
||||
/* Private macros */
|
||||
|
||||
#define H5G_NODE_SIZEOF_HDR(F) (H5_SIZEOF_MAGIC + 4)
|
||||
|
12
src/H5Gpkg.h
12
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 "H5FLprivate.h" /* Free Lists */
|
||||
#include "H5HFprivate.h" /* Fractal heaps */
|
||||
@ -108,7 +107,6 @@ 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 */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -118,10 +116,10 @@ struct H5G_entry_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 */
|
||||
unsigned nsyms; /*number of symbols */
|
||||
H5G_entry_t *entry; /*array of symbol table entries */
|
||||
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;
|
||||
|
||||
/*
|
||||
@ -434,7 +432,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);
|
||||
|
@ -160,7 +160,6 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root)
|
||||
f->shared->sblock->root_ent->type = H5G_NOTHING_CACHED; /* We will cache the stab later */
|
||||
f->shared->sblock->root_ent->name_off = 0; /* No name (yet) */
|
||||
f->shared->sblock->root_ent->header = root_loc.oloc->addr;
|
||||
f->shared->sblock->root_ent->file = root_loc.oloc->file;
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
else {
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -34,7 +34,7 @@
|
||||
/* Headers */
|
||||
/***********/
|
||||
#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 "H5Fprivate.h" /* Files */
|
||||
|
@ -32,7 +32,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 */
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user