diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2014-01-31 23:15:13 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2014-01-31 23:15:13 (GMT) |
commit | 6a2fbff85be6168186a6c49498d7bb4e53f10b8f (patch) | |
tree | 15022a1cb33b6d97fde575aadd9849170ff5a7f2 /test | |
parent | 768ddffaa3be008e94d81daf577da1c5255484c2 (diff) | |
download | hdf5-DECTRIS_20131231.zip hdf5-DECTRIS_20131231.tar.gz hdf5-DECTRIS_20131231.tar.bz2 |
[svn-r24675] 1) Add cork status to H5AC/H5C_get_entry_status().DECTRIS_20131231
2) Skip dirty corked entries when doing auto ageout entries in the cache.
Tested on koala, jam, platypus, ostrich.
PENDING: code review and more cache related tests.
Diffstat (limited to 'test')
-rw-r--r-- | test/cache.c | 80 | ||||
-rw-r--r-- | test/cache_common.c | 39 | ||||
-rw-r--r-- | test/cache_common.h | 2 |
3 files changed, 84 insertions, 37 deletions
diff --git a/test/cache.c b/test/cache.c index 5654f6e..e08fcb5 100644 --- a/test/cache.c +++ b/test/cache.c @@ -193,7 +193,7 @@ static unsigned check_resize_entry_errs(void); static unsigned check_unprotect_ro_dirty_err(void); static unsigned check_protect_ro_rw_err(void); static unsigned check_check_evictions_enabled_err(void); -static unsigned check_auto_cache_resize(void); +static unsigned check_auto_cache_resize(hbool_t cork_ageout); static unsigned check_auto_cache_resize_disable(void); static unsigned check_auto_cache_resize_epoch_markers(void); static unsigned check_auto_cache_resize_input_errs(void); @@ -2750,7 +2750,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); + &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13440,7 +13440,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); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13468,7 +13468,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); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13494,7 +13494,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); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13520,7 +13520,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); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13546,7 +13546,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); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13572,7 +13572,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); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13662,7 +13662,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); + &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13704,7 +13704,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); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13748,7 +13748,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); + &in_cache, &is_dirty, &is_protected, &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13790,7 +13790,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); + &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13833,7 +13833,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); + &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -13878,7 +13878,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); + &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -14832,7 +14832,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); if ( result < 0 ) { @@ -14912,7 +14912,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); if ( result < 0 ) { @@ -14999,7 +14999,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); if ( result < 0 ) { @@ -15068,7 +15068,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); if ( result < 0 ) { @@ -15129,7 +15129,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); if ( result < 0 ) { @@ -15170,7 +15170,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); + &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -15285,7 +15285,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); if ( result < 0 ) { @@ -15367,7 +15367,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); if ( result < 0 ) { @@ -15454,7 +15454,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); if ( result < 0 ) { @@ -15525,7 +15525,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); if ( result < 0 ) { @@ -15586,7 +15586,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); if ( result < 0 ) { @@ -15627,7 +15627,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); + &is_pinned, NULL, NULL, NULL); if ( result < 0 ) { @@ -15925,7 +15925,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); if ( result < 0 ) { @@ -15992,7 +15992,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, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL); if ( result < 0 ) { @@ -16212,7 +16212,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, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL); if ( result < 0 ) { @@ -16248,7 +16248,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, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL); if ( result < 0 ) { @@ -16383,7 +16383,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, &in_cache, NULL, NULL, NULL, NULL, NULL, NULL); if ( result < 0 ) { @@ -18025,7 +18025,7 @@ static void test_rpt_fcn(UNUSED H5C_t * cache_ptr, } static unsigned -check_auto_cache_resize(void) +check_auto_cache_resize(hbool_t cork_ageout) { const char * fcn_name = "check_auto_cache_resize()"; hbool_t show_progress = FALSE; @@ -19016,6 +19016,8 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + if(cork_ageout) + cork_entry_type(file_ptr, MEDIUM_ENTRY_TYPE); /* fill the cache with 1024 byte entries -- nothing should happen * for three epochs while the markers are inserted into the cache * @@ -19359,6 +19361,9 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + if(cork_ageout) + uncork_entry_type(file_ptr, MEDIUM_ENTRY_TYPE); + /* repeat the above test, but with max_decrement enabled to see * if that features works as it should. Note that this will change @@ -29527,7 +29532,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, &is_flush_dep_parent, &is_flush_dep_child) < 0) + NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || is_flush_dep_parent || is_flush_dep_child) CACHE_ERROR("invalid entry status") @@ -29535,7 +29540,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, &is_flush_dep_parent, &is_flush_dep_child) < 0) + NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || is_flush_dep_parent || is_flush_dep_child) CACHE_ERROR("invalid entry status") @@ -29546,7 +29551,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, &is_flush_dep_parent, &is_flush_dep_child) < 0) + NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || !is_flush_dep_parent || is_flush_dep_child) CACHE_ERROR("invalid entry status") @@ -29554,7 +29559,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, &is_flush_dep_parent, &is_flush_dep_child) < 0) + NULL, NULL, NULL, NULL, &is_flush_dep_parent, &is_flush_dep_child) < 0) CACHE_ERROR("H5C_get_entry_status() failed") if(!in_cache || is_flush_dep_parent || !is_flush_dep_child) CACHE_ERROR("invalid entry status") @@ -34978,7 +34983,8 @@ main(void) nerrs += check_unprotect_ro_dirty_err(); nerrs += check_protect_ro_rw_err(); nerrs += check_check_evictions_enabled_err(); - nerrs += check_auto_cache_resize(); + nerrs += check_auto_cache_resize(FALSE); + nerrs += check_auto_cache_resize(TRUE); nerrs += check_auto_cache_resize_disable(); nerrs += check_auto_cache_resize_epoch_markers(); nerrs += check_auto_cache_resize_input_errs(); diff --git a/test/cache_common.c b/test/cache_common.c index f9013d3..a801286 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -3032,6 +3032,45 @@ cork_entry_type(H5F_t * file_ptr, int32_t type) /*------------------------------------------------------------------------- + * Function: uncork_entry_type() + * + * Purpose: To "uncork" an object: + * --insert the base address of an entry type into + * the cache's list of corked object addresses + * + * Return: void + * + * Programmer: Vailin Choi; Jan 2014 + * + *------------------------------------------------------------------------- + */ +void +uncork_entry_type(H5F_t * file_ptr, int32_t type) +{ + H5C_t * cache_ptr; + haddr_t baddrs; + herr_t result; + + if(pass) { + cache_ptr = file_ptr->shared->cache; + + HDassert( cache_ptr ); + HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); + + baddrs = base_addrs[type]; + + result = H5C_cork(cache_ptr, baddrs, H5C__UNCORK, NULL); + if(result < 0) { + + pass = FALSE; + failure_mssg = "error in H5C_cork()."; + } + } + return; +} /* uncork_entry_type() */ + + +/*------------------------------------------------------------------------- * Function: insert_entry() * * Purpose: Insert the entry indicated by the type and index. diff --git a/test/cache_common.h b/test/cache_common.h index 2b110c9..04f0232 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -613,6 +613,8 @@ void create_pinned_entry_dependency(H5F_t * file_ptr, void reset_entries(void); void cork_entry_type(H5F_t * file_ptr, int32_t type); +void uncork_entry_type(H5F_t * file_ptr, int32_t type); + void resize_entry(H5F_t * file_ptr, |