From 7568dcaf151bfaa7d529ec69c57a814682bf69c1 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 6 Jan 2017 07:51:40 -0800 Subject: Add "image up to date" flag / parameter to metadata cache entry status calls. --- src/H5AC.c | 5 +++- src/H5ACmpio.c | 2 +- src/H5ACprivate.h | 1 + src/H5Cprivate.h | 3 ++- src/H5Cquery.c | 5 +++- test/cache.c | 71 ++++++++++++++++++++++++++++--------------------------- testpar/t_cache.c | 2 +- 7 files changed, 49 insertions(+), 40 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index 6449584..2b7c871 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -834,6 +834,7 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) hbool_t is_corked; hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */ hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */ + hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -842,7 +843,7 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.") if(H5C_get_entry_status(f, addr, NULL, &in_cache, &is_dirty, - &is_protected, &is_pinned, &is_corked, &is_flush_dep_parent, &is_flush_dep_child) < 0) + &is_protected, &is_pinned, &is_corked, &is_flush_dep_parent, &is_flush_dep_child, &image_is_up_to_date) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed.") if(in_cache) { @@ -859,6 +860,8 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status) *status |= H5AC_ES__IS_FLUSH_DEP_PARENT; if(is_flush_dep_child) *status |= H5AC_ES__IS_FLUSH_DEP_CHILD; + if(image_is_up_to_date) + *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE; } /* end if */ else *status = 0; diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index 570783a..44ffd9d 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -1071,7 +1071,7 @@ H5AC__log_moved_entry(const H5F_t *f, haddr_t old_addr, haddr_t new_addr) /* get entry status, size, etc here */ if(H5C_get_entry_status(f, old_addr, &entry_size, &entry_in_cache, - &entry_dirty, NULL, NULL, NULL, NULL, NULL) < 0) + &entry_dirty, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't get entry status.") if(!entry_in_cache) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "entry not in cache.") diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 96f23cb..fa7407a 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -354,6 +354,7 @@ H5_DLLVAR hid_t H5AC_rawdata_dxpl_id; #define H5AC_ES__IS_FLUSH_DEP_PARENT 0x0010 #define H5AC_ES__IS_FLUSH_DEP_CHILD 0x0020 #define H5AC_ES__IS_CORKED 0x0040 +#define H5AC_ES__IMAGE_IS_UP_TO_DATE 0x0080 /* external function declarations: */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 3b9634f..9d8f0d4 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -1761,7 +1761,8 @@ H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr); H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr, size_t *size_ptr, hbool_t *in_cache_ptr, hbool_t *is_dirty_ptr, hbool_t *is_protected_ptr, hbool_t *is_pinned_ptr, hbool_t *is_corked_ptr, - hbool_t *is_flush_dep_parent_ptr, hbool_t *is_flush_dep_child_ptr); + hbool_t *is_flush_dep_parent_ptr, hbool_t *is_flush_dep_child_ptr, + hbool_t *image_up_to_date_ptr); H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictions_enabled_ptr); H5_DLL void * H5C_get_aux_ptr(const H5C_t *cache_ptr); H5_DLL FILE *H5C_get_trace_file_ptr(const H5C_t *cache_ptr); diff --git a/src/H5Cquery.c b/src/H5Cquery.c index be0d4fa..f5409f7 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -231,7 +231,8 @@ H5C_get_entry_status(const H5F_t *f, hbool_t * is_pinned_ptr, hbool_t * is_corked_ptr, hbool_t * is_flush_dep_parent_ptr, - hbool_t * is_flush_dep_child_ptr) + hbool_t * is_flush_dep_child_ptr, + hbool_t * image_up_to_date_ptr) { H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr = NULL; @@ -280,6 +281,8 @@ H5C_get_entry_status(const H5F_t *f, *is_flush_dep_parent_ptr = (entry_ptr->flush_dep_nchildren > 0); if(is_flush_dep_child_ptr != NULL) *is_flush_dep_child_ptr = (entry_ptr->flush_dep_nparents > 0); + if(image_up_to_date_ptr != NULL ) + *image_up_to_date_ptr = entry_ptr->image_up_to_date; } /* end else */ done: diff --git a/test/cache.c b/test/cache.c index 8f4935b..2209d8f 100644 --- a/test/cache.c +++ b/test/cache.c @@ -2886,7 +2886,7 @@ check_insert_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -12781,7 +12781,7 @@ check_get_entry_status(void) */ result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, - &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -12809,7 +12809,7 @@ check_get_entry_status(void) if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, - &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -12835,7 +12835,7 @@ check_get_entry_status(void) if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, - &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -12861,7 +12861,7 @@ check_get_entry_status(void) if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, - &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -12887,7 +12887,7 @@ check_get_entry_status(void) if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, - &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -12913,7 +12913,7 @@ check_get_entry_status(void) if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, - &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -13001,7 +13001,7 @@ check_expunge_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -13042,7 +13042,7 @@ check_expunge_entry(void) if(pass) { result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, - &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -13085,7 +13085,7 @@ check_expunge_entry(void) */ result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, - &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -13126,7 +13126,7 @@ check_expunge_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -13168,7 +13168,7 @@ check_expunge_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -13212,7 +13212,7 @@ check_expunge_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -14199,7 +14199,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -14277,7 +14277,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -14362,7 +14362,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -14430,7 +14430,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -14490,7 +14490,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -14530,7 +14530,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -14644,7 +14644,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -14724,7 +14724,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -14809,7 +14809,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -14879,7 +14879,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -14939,7 +14939,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &reported_entry_size, &in_cache, &is_dirty, &is_protected, &is_pinned, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -14979,7 +14979,7 @@ check_resize_entry(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, &entry_size, &in_cache, &is_dirty, &is_protected, - &is_pinned, NULL, NULL, NULL); + &is_pinned, NULL, NULL, NULL, NULL); if(result < 0) { @@ -15275,7 +15275,7 @@ check_evictions_enabled(void) result = H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, NULL, NULL, NULL, - NULL, NULL, NULL); + NULL, NULL, NULL, NULL); if(result < 0) { @@ -15341,7 +15341,7 @@ check_evictions_enabled(void) entry_ptr = &(base_addr[1]); result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); if(result < 0) { @@ -15560,7 +15560,7 @@ check_evictions_enabled(void) entry_ptr = &(base_addr[2]); result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); if(result < 0) { @@ -15595,7 +15595,7 @@ check_evictions_enabled(void) entry_ptr = &(base_addr[3]); result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); if(result < 0) { @@ -15729,7 +15729,7 @@ check_evictions_enabled(void) entry_ptr = &(base_addr[4]); result = H5C_get_entry_status(file_ptr, entry_ptr->addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); if(result < 0) { @@ -28877,7 +28877,7 @@ check_flush_deps(void) /* Check the parent's entry status */ entry_ptr = &(base_addr[1]); if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, - NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child) < 0) + NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || is_flush_dep_parent || is_flush_dep_child) CACHE_ERROR("invalid entry status") @@ -28885,7 +28885,7 @@ check_flush_deps(void) /* Check the child's entry status */ entry_ptr = &(base_addr[0]); if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, - NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child) < 0) + NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || is_flush_dep_parent || is_flush_dep_child) CACHE_ERROR("invalid entry status") @@ -28896,7 +28896,7 @@ check_flush_deps(void) /* Check the parent's entry status */ entry_ptr = &(base_addr[1]); if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, - NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child) < 0) + NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || !is_flush_dep_parent || is_flush_dep_child) CACHE_ERROR("invalid entry status") @@ -28904,7 +28904,7 @@ check_flush_deps(void) /* Check the child's entry status */ entry_ptr = &(base_addr[0]); if(H5C_get_entry_status(file_ptr, entry_ptr->addr, NULL, &in_cache, - NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child) < 0) + NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child, NULL) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || is_flush_dep_parent || !is_flush_dep_child) CACHE_ERROR("invalid entry status") @@ -35867,7 +35867,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr) int i; herr_t result; - if(pass) + if(pass) { if(cache_ptr == NULL) { pass = FALSE; @@ -35893,6 +35893,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr) */ cache_ptr->min_clean_size = 0; } /* end else */ + } /* end if */ if(pass) /* first fill the cache with monster entryies via insertion */ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 94a6e7c..2c164a2 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -3054,7 +3054,7 @@ expunge_entry(H5F_t * file_ptr, HDassert( ! ((entry_ptr->header).is_dirty) ); result = H5C_get_entry_status(file_ptr, entry_ptr->base_addr, - NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL, NULL); if ( result < 0 ) { -- cgit v0.12