diff options
Diffstat (limited to 'test/cache2.c')
-rw-r--r-- | test/cache2.c | 1958 |
1 files changed, 1934 insertions, 24 deletions
diff --git a/test/cache2.c b/test/cache2.c index 118838b..32ca9b4 100644 --- a/test/cache2.c +++ b/test/cache2.c @@ -965,6 +965,11 @@ smoke_check_5(void) /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), + /* enum H5C2_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C2_flash_incr__off, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, + /* enum H5C2_cache_decr_mode decr_mode = */ H5C2_decr__threshold, @@ -1200,6 +1205,11 @@ smoke_check_6(void) /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), + /* enum H5C2_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C2_flash_incr__off, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, + /* enum H5C2_cache_decr_mode decr_mode = */ H5C2_decr__threshold, @@ -1435,6 +1445,11 @@ smoke_check_7(void) /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (8 * 1024 * 1024), + /* enum H5C2_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C2_flash_incr__off, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, + /* enum H5C2_cache_decr_mode decr_mode = */ H5C2_decr__age_out_with_threshold, @@ -1671,6 +1686,11 @@ smoke_check_8(void) /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), + /* enum H5C2_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C2_flash_incr__off, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, + /* enum H5C2_cache_decr_mode decr_mode = */ H5C2_decr__age_out_with_threshold, @@ -9343,7 +9363,7 @@ check_flush_cache__flush_op_test(H5C2_t * cache_ptr, int check_size, struct fo_flush_entry_check check[]) { - const char * fcn_name = "check_flush_cache__flush_op_test"; + /* const char * fcn_name = "check_flush_cache__flush_op_test"; */ static char msg[128]; herr_t result; int i; @@ -9836,7 +9856,7 @@ check_flush_cache__flush_op_test(H5C2_t * cache_ptr, static void check_flush_cache__flush_op_eviction_test(H5C2_t * cache_ptr) { - const char * fcn_name = "check_flush_cache__flush_op_eviction_test"; + /* const char * fcn_name = "check_flush_cache__flush_op_eviction_test"; */ int i; int num_variable_entries = 10; int num_monster_entries = 31; @@ -16856,7 +16876,7 @@ check_pin_entry_errs(void) * * Modifications: * - * - Modified call to H5C2_protect() to pass H5C2__NO_FLAGS_SET in the + * - Modified call to H5C2_protect() to pass2 H5C2__NO_FLAGS_SET in the * the new flags parameter. * * JRM -- 3/28/07 @@ -17747,6 +17767,10 @@ check_check_evictions_enabled_err(void) * * Modifications: * + * John Mainzer 1/8/08 + * Added a basic set of tests for the flash cache size + * increment code. + * *------------------------------------------------------------------------- */ @@ -17756,7 +17780,7 @@ enum H5C2_resize_status rpt_status; static void test_rpt_fcn(UNUSED H5C2_t * cache_ptr, UNUSED int32_t version, UNUSED double hit_rate, - UNUSED enum H5C2_resize_status status, + enum H5C2_resize_status status, UNUSED size_t old_max_cache_size, UNUSED size_t new_max_cache_size, UNUSED size_t old_min_clean_size, @@ -17800,6 +17824,11 @@ check_auto_cache_resize(void) /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), + /* enum H5C2_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C2_flash_incr__off, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, + /* enum H5C2_cache_decr_mode decr_mode = */ H5C2_decr__threshold, @@ -18160,7 +18189,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* the current cache configuration is unconvenient for testing cache + /* the current cache configuration is inconvenient for testing cache * size reduction, so lets change it some something easier to work * with. */ @@ -18190,6 +18219,9 @@ check_auto_cache_resize(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1000 * 1000); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -18540,6 +18572,9 @@ check_auto_cache_resize(void) auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -18728,6 +18763,10 @@ check_auto_cache_resize(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out; @@ -19000,7 +19039,7 @@ check_auto_cache_resize(void) } } - if ( show_progress ) HDfprintf(stderr, "*check point %d\n", checkpoint++); + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* now just bang on one entry -- after three epochs, this should * get all entries other than the one evicted, and the cache size @@ -19151,6 +19190,10 @@ check_auto_cache_resize(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out; @@ -19691,6 +19734,10 @@ check_auto_cache_resize(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out; @@ -20115,6 +20162,10 @@ check_auto_cache_resize(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out_with_threshold; @@ -20381,6 +20432,10 @@ check_auto_cache_resize(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out_with_threshold; @@ -20912,6 +20967,1105 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* now test the flash cache size increment code. At least at present, + * there should be no interaction between the regular auto-resize + * code and the flash cache size increment code other than a reset + * of the counter and stats collection used by the regular auto-resize + * code. Thus we do only limited tests of the two pieces of code + * operating together. + * + * Start with simple test to verify that the flash cache increment + * code increases the cache size when and as expected. + */ + + /* Place the cache in a know state via a flush destroy on the cache + * to clear out all entries, and then a reset on all the entries. + * Then configure the cache for the flash cache size increase tests, + * and force the flash size increase code through all its operational + * modes. Verify that all perform as expected. + */ + + if ( pass2 ) { + + flush_cache2(cache_ptr, TRUE, FALSE, FALSE); + + reset_entries2(); + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + if ( pass2 ) { + + auto_size_ctl.version = H5C2__CURR_AUTO_SIZE_CTL_VER; + auto_size_ctl.rpt_fcn = test_rpt_fcn; + + auto_size_ctl.set_initial_size = TRUE; + auto_size_ctl.initial_size = 64 * 1024; + + auto_size_ctl.min_clean_fraction = 0.5; + + auto_size_ctl.max_size = 1024 * 1024; + auto_size_ctl.min_size = 5 * 1024; + + auto_size_ctl.epoch_length = 100; + + + auto_size_ctl.incr_mode = H5C2_incr__threshold; + + auto_size_ctl.lower_hr_threshold = 0.75; + + auto_size_ctl.increment = 2.0; + + auto_size_ctl.apply_max_increment = TRUE; + auto_size_ctl.max_increment = (32 * 1024); + + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__add_space; + auto_size_ctl.flash_multiple = 1.0; + auto_size_ctl.flash_threshold = 0.5; + + + auto_size_ctl.decr_mode = H5C2_decr__age_out_with_threshold; + + auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */ + + auto_size_ctl.decrement = 0.5; + + auto_size_ctl.apply_max_decrement = TRUE; + auto_size_ctl.max_decrement = (1 * 1000 * 1024); + + auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */ + + auto_size_ctl.apply_empty_reserve = TRUE; + auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ + + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = "H5C2_set_cache_auto_resize_config failed 12.\n"; + } + } + + if ( pass2 ) { + + if ( ( cache_ptr->max_cache_size != (64 * 1024) ) || + ( cache_ptr->min_clean_size != (32 * 1024) ) || + ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( cache_ptr->cache_accesses != 0 ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (0).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Load a huge entry into the cache */ + if ( pass2 ) { + + protect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 0); + + if ( pass2 ) { + unprotect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 0, + NO_CHANGE, H5C2__NO_FLAGS_SET); + } + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) || + ( cache_ptr->min_clean_size != (32 * 1024) ) || + ( cache_ptr->index_len != 1 ) || + ( cache_ptr->index_size != HUGE_ENTRY_SIZE ) || + ( cache_ptr->cache_accesses != 1 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (1).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Now load a monster entry. Since a monster entry is larger than + * half the size of the cache, and there is not sufficient space + * for a monster entry in the cache, we will add space to the + * cache to make room for the entry. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + + if ( pass2 ) { + unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + NO_CHANGE, H5C2__NO_FLAGS_SET); + } + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (80 * 1024) ) || + ( cache_ptr->min_clean_size != (40 * 1024) ) || + ( cache_ptr->index_len != 2 ) || + ( cache_ptr->index_size != (HUGE_ENTRY_SIZE + + MONSTER_ENTRY_SIZE) ) || + ( cache_ptr->cache_accesses != 1 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (2).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Load a second monster entry. Since the monster entry is larger + * than half the size of the cache yet again, and there is not + * sufficient space for the monster entry in the cache, we again + * add space to the cache to make space for the entry. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 1); + + unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 1, + NO_CHANGE, H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) || + ( cache_ptr->min_clean_size != ( 72 * 1024) ) || + ( cache_ptr->index_len != 3 ) || + ( cache_ptr->index_size != ((2 * MONSTER_ENTRY_SIZE) + + HUGE_ENTRY_SIZE) ) || + ( cache_ptr->cache_accesses != 1 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (3).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Load a third moster entry. Should be no cache size increase this + * time. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 2); + + unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 2, + NO_CHANGE, H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) || + ( cache_ptr->min_clean_size != ( 72 * 1024) ) || + ( cache_ptr->index_len != 2 ) || + ( cache_ptr->index_size != (2 * MONSTER_ENTRY_SIZE) ) || + ( cache_ptr->cache_accesses != 2 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (4).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* delete existing entries to prepare for next test, and reset + * the size of the cache. + */ + if ( pass2 ) { + + expunge_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 1); + expunge_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 2); + + if ( pass2 ) { + + result = H5C2_set_cache_auto_resize_config(cache_ptr, + &auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = + "H5C2_set_cache_auto_resize_config failed 13.\n"; + } + } + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) || + ( cache_ptr->min_clean_size != (32 * 1024) ) || + ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (5).\n"; + } + } + + /* repeat the above basic test, only this time, use inserts to add + * entries to the cache, not protects. + */ + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* insert a huge entry into the cache */ + if ( pass2 ) { + + insert_entry2(cache_ptr, HUGE_ENTRY_TYPE, 1, TRUE, + H5C2__NO_FLAGS_SET); + /* protect and unprotect a couple times to increment cache_accesses */ + protect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 1); + unprotect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 1, + NO_CHANGE, H5C2__NO_FLAGS_SET); + protect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 1); + unprotect_entry2(cache_ptr, HUGE_ENTRY_TYPE, 1, + NO_CHANGE, H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) || + ( cache_ptr->min_clean_size != (32 * 1024) ) || + ( cache_ptr->index_len != 1 ) || + ( cache_ptr->index_size != HUGE_ENTRY_SIZE ) || + ( cache_ptr->cache_accesses != 2 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (6).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Now insert a monster entry. Since a monster entry is larger than + * half the size of the cache, and there is not sufficient space + * for a monster entry in the cache, we will add space to the + * cache to make room for the entry. + */ + if ( pass2 ) { + + insert_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 4, TRUE, + H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (80 * 1024) ) || + ( cache_ptr->min_clean_size != (40 * 1024) ) || + ( cache_ptr->index_len != 2 ) || + ( cache_ptr->index_size != + HUGE_ENTRY_SIZE + MONSTER_ENTRY_SIZE ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (7).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Insert a second monster entry. Cache size should increase again. + */ + if ( pass2 ) { + + insert_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 5, TRUE, + H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) || + ( cache_ptr->min_clean_size != ( 72 * 1024) ) || + ( cache_ptr->index_len != 3 ) || + ( cache_ptr->index_size != + 2 * MONSTER_ENTRY_SIZE + HUGE_ENTRY_SIZE ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (8).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Insert a third monster entry. Should be no cache size increase this + * time. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 6); + + unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 6, + NO_CHANGE, H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) || + ( cache_ptr->min_clean_size != ( 72 * 1024) ) || + ( cache_ptr->index_len != 2 ) || + ( cache_ptr->index_size != (2 * MONSTER_ENTRY_SIZE) ) || + ( cache_ptr->cache_accesses != 1 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (9).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* delete existing entries to prepare for next test, and reset + * the size of the cache. We must also change the size of the needed + * variable entries before we run the test, so will protect and + * unprotect them now so as to get the correct initial size. + */ + if ( pass2 ) { + + expunge_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 5); + expunge_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 6); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1024); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1024); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1024); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 13); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 13, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1024); + + flush_cache2(cache_ptr, TRUE, FALSE, FALSE); + + + if ( pass2 ) { + + auto_size_ctl.initial_size = 6 * 1024; + result = H5C2_set_cache_auto_resize_config(cache_ptr, + &auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = + "H5C2_set_cache_auto_resize_config failed 13.\n"; + } + } + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || + ( cache_ptr->min_clean_size != (3 * 1024) ) || + ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (10).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Now load the variable entries into the cache */ + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, + H5C2__NO_FLAGS_SET); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, + H5C2__NO_FLAGS_SET); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, + H5C2__NO_FLAGS_SET); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 13); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 13, NO_CHANGE, + H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || + ( cache_ptr->min_clean_size != (3 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 4 * 1024 ) || + ( cache_ptr->cache_accesses != 4 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (11).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* protect a variable entry, and re-size it to 3K. Should be + * no effect on the size of the cache. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 3 * 1024); + + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || + ( cache_ptr->min_clean_size != (3 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 6 * 1024 ) || + ( cache_ptr->cache_accesses != 5 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (12).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* protect the variable entry again, and re-size it to 10K. Should + * resize the cache to 13 KB. Note that cache_accesses will be 0 + * in this case, since cache_accesses is incremented on the protect. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 10 * 1024); + + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (13 * 1024) ) || + ( cache_ptr->min_clean_size != (13 * 512) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 13 * 1024 ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (13).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* protect a second variable entry, and re-size it to 10K. Should + * resize to 22 KB. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 10 * 1024); + + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || + ( cache_ptr->min_clean_size != (11 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 22 * 1024 ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (14).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* protect a third variable entry, and re-size it to 10K. Should + * be no change in cache size. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 10 * 1024); + + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || + ( cache_ptr->min_clean_size != (11 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 31 * 1024 ) || + ( cache_ptr->cache_accesses != 1 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (15).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* re-size the variable entries back down to their initial size, and + * restore the cache to its initial size as well, in preparation + * for the next test. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); + + if ( pass2 ) { + + auto_size_ctl.initial_size = 6 * 1024; + result = H5C2_set_cache_auto_resize_config(cache_ptr, + &auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = + "H5C2_set_cache_auto_resize_config failed 14.\n"; + } + } + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || + ( cache_ptr->min_clean_size != (3 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 4 * 1024 ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (16).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Now test flash cache resizes with pinned entries... + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, + H5C2__PIN_ENTRY_FLAG); + resize_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || + ( cache_ptr->min_clean_size != (6 * 512) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 5 * 1024 ) || + ( cache_ptr->cache_accesses != 1 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (17).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + if ( pass2 ) { + + resize_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024, TRUE); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (13 * 1024) ) || + ( cache_ptr->min_clean_size != (13 * 512) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 13 * 1024 ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (18).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, + H5C2__PIN_ENTRY_FLAG); + resize_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || + ( cache_ptr->min_clean_size != (11 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 22 * 1024 ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (19).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, + H5C2__PIN_ENTRY_FLAG); + resize_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || + ( cache_ptr->min_clean_size != (11 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 31 * 1024 ) || + ( cache_ptr->cache_accesses != 1 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (20).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Unpin the entries. Note that no entries are evicted as we don't + * load any entries. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, + H5C2__UNPIN_ENTRY_FLAG); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, + H5C2__UNPIN_ENTRY_FLAG); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, + H5C2__UNPIN_ENTRY_FLAG); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || + ( cache_ptr->min_clean_size != (11 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 31 * 1024 ) || + ( cache_ptr->cache_accesses != 4 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (21).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* re-size the variable entries back down to their initial size, and + * restore the cache to its initial size as well, in preparation + * for the next test. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry_with_size_change2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, + H5C2__DIRTIED_FLAG|H5C2__SIZE_CHANGED_FLAG, 1 * 1024); + + if ( pass2 ) { + + auto_size_ctl.initial_size = 6 * 1024; + result = H5C2_set_cache_auto_resize_config(cache_ptr, + &auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = + "H5C2_set_cache_auto_resize_config failed 15.\n"; + } + } + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || + ( cache_ptr->min_clean_size != (3 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 4 * 1024 ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (22).\n"; + } + } + + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, + H5C2__PIN_ENTRY_FLAG); + resize_pinned_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) || + ( cache_ptr->min_clean_size != (6 * 512) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 5 * 1024 ) || + ( cache_ptr->cache_accesses != 1 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (23).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + if ( pass2 ) { + + resize_pinned_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (13 * 1024) ) || + ( cache_ptr->min_clean_size != (13 * 512) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 13 * 1024 ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (24).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, + H5C2__PIN_ENTRY_FLAG); + resize_pinned_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || + ( cache_ptr->min_clean_size != (11 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 22 * 1024 ) || + ( cache_ptr->cache_accesses != 0 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (25).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, + H5C2__PIN_ENTRY_FLAG); + resize_pinned_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || + ( cache_ptr->min_clean_size != (11 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 31 * 1024 ) || + ( cache_ptr->cache_accesses != 1 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (26).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Unpin the entries. Note that no entries are evicted as we don't + * load any entries. + */ + if ( pass2 ) { + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE, + H5C2__UNPIN_ENTRY_FLAG); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE, + H5C2__UNPIN_ENTRY_FLAG); + + protect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); + unprotect_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE, + H5C2__UNPIN_ENTRY_FLAG); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || + ( cache_ptr->min_clean_size != (11 * 1024) ) || + ( cache_ptr->index_len != 4 ) || + ( cache_ptr->index_size != 31 * 1024 ) || + ( cache_ptr->cache_accesses != 4 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (27).\n"; + } + } + + /* We have finished a basic check of the flash cache size increment + * code. Tidy up for a more extensive test... + */ + if ( pass2 ) { + + expunge_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 10); + expunge_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 11); + expunge_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 12); + expunge_entry2(cache_ptr, VARIABLE_ENTRY_TYPE, 13); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) || + ( cache_ptr->min_clean_size != (11 * 1024) ) || + ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( cache_ptr->cache_accesses != 4 ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (28).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* ...and then reconfigure. Note that we change the flash_multiple + * and flash_threshold just to make sure that such changed perform + * as expected. + */ + if ( pass2 ) { + + auto_size_ctl.version = H5C2__CURR_AUTO_SIZE_CTL_VER; + auto_size_ctl.rpt_fcn = test_rpt_fcn; + + auto_size_ctl.set_initial_size = TRUE; + auto_size_ctl.initial_size = 4 * 1024; + + auto_size_ctl.min_clean_fraction = 0.5; + + auto_size_ctl.max_size = 20 * 1024; + auto_size_ctl.min_size = 4 * 1024; + + auto_size_ctl.epoch_length = 100; + + + auto_size_ctl.incr_mode = H5C2_incr__threshold; + + auto_size_ctl.lower_hr_threshold = 0.75; + + auto_size_ctl.increment = 2.0; + + auto_size_ctl.apply_max_increment = TRUE; + auto_size_ctl.max_increment = (4 * 1024); + + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__add_space; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.4; + + + auto_size_ctl.decr_mode = H5C2_decr__age_out_with_threshold; + + auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */ + + auto_size_ctl.decrement = 0.5; + + auto_size_ctl.apply_max_decrement = TRUE; + auto_size_ctl.max_decrement = (2 * 1024); + + auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */ + + auto_size_ctl.apply_empty_reserve = TRUE; + auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */ + + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = "H5C2_set_cache_auto_resize_config failed 15.\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + if ( pass2 ) { + + if ( ( cache_ptr->max_cache_size != (4 * 1024) ) || + ( cache_ptr->min_clean_size != (4 * 512) ) || + ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) || + ( cache_ptr->cache_accesses != 0 ) ) { + + pass2 = FALSE; + failure_mssg2 = "bad cache after initialization 15.\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* protect and unprotect a large entry -- no change in cache size since + * a large entry will just fill the available space in the cache. + */ + if ( pass2 ) { + + rpt_fcn_called = FALSE; + + protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); + unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE, + H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (4 * 1024) ) || + ( cache_ptr->min_clean_size != (4 * 512) ) || + ( cache_ptr->index_len != 1 ) || + ( cache_ptr->index_size != LARGE_ENTRY_SIZE ) || + ( cache_ptr->cache_accesses != 1 ) || + ( rpt_fcn_called == TRUE ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (29).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* protect and unprotect another a large entry -- should trigger a + * flash cache size increase to 12 KB (remember that flash_multiple is + * set to 2.0). + */ + if ( pass2 ) { + + rpt_fcn_called = FALSE; + + protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 1); + unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 1, NO_CHANGE, + H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (12 * 1024) ) || + ( cache_ptr->min_clean_size != (12 * 512) ) || + ( cache_ptr->index_len != 2 ) || + ( cache_ptr->index_size != 2 * LARGE_ENTRY_SIZE ) || + ( cache_ptr->cache_accesses != 1 ) || + ( rpt_fcn_called != TRUE ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (30).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* protect and unprotect two more large entries -- shouldnt trigger a + * flash cache size increase. + */ + if ( pass2 ) { + + rpt_fcn_called = FALSE; + + protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 2); + unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 2, NO_CHANGE, + H5C2__NO_FLAGS_SET); + protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3); + unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 3, NO_CHANGE, + H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (12 * 1024) ) || + ( cache_ptr->min_clean_size != (12 * 512) ) || + ( cache_ptr->index_len != 3 ) || + ( cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE ) || + ( cache_ptr->cache_accesses != 3 ) || + ( rpt_fcn_called != FALSE ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (31).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* do many accesses of a single entry to talk the cache into reducing + * its size to the minimum. + */ + if ( pass2 ) { + + rpt_fcn_called = FALSE; + i = 0; + while ( ( pass2 ) && ( i < 1000 ) ) + { + protect_entry2(cache_ptr, TINY_ENTRY_TYPE, 0); + + if ( pass2 ) { + unprotect_entry2(cache_ptr, TINY_ENTRY_TYPE, 0, + NO_CHANGE, H5C2__NO_FLAGS_SET); + } + i++; + } + + if ( ( ! rpt_fcn_called ) || + ( cache_ptr->max_cache_size != (4 * 1024) ) || + ( cache_ptr->min_clean_size != (2 * 1024) ) || + ( cache_ptr->index_size != (1 * TINY_ENTRY_SIZE) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (32).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Force another flash increase */ + if ( pass2 ) { + + rpt_fcn_called = FALSE; + + protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); + unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE, + H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (4 * 1024 + 128) ) || + ( cache_ptr->min_clean_size != (2 * 1024 + 64) ) || + ( cache_ptr->index_len != 2 ) || + ( cache_ptr->index_size != + LARGE_ENTRY_SIZE + TINY_ENTRY_SIZE ) || + ( cache_ptr->cache_accesses != 1 ) || + ( rpt_fcn_called == FALSE ) || + ( rpt_status != flash_increase ) ) ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (33).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* force regular size increase up to maximum */ + if ( pass2 ) { + + rpt_fcn_called = FALSE; + i = 0; + while ( ( pass2 ) && ( i < 500 ) ) + { + protect_entry2(cache_ptr, TINY_ENTRY_TYPE, i); + + if ( pass2 ) { + unprotect_entry2(cache_ptr, TINY_ENTRY_TYPE, i, + NO_CHANGE, H5C2__NO_FLAGS_SET); + } + i++; + } + + if ( ( cache_ptr->max_cache_size != (20 * 1024) ) || + ( cache_ptr->min_clean_size != (10 * 1024) ) || + ( rpt_fcn_called == FALSE ) || + ( rpt_status != at_max_size ) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache config (34).\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + if ( pass2 ) { takedown_cache2(cache_ptr, FALSE, FALSE); @@ -20945,6 +22099,10 @@ check_auto_cache_resize(void) * * Modifications: * + * Added code to include the flash cache size increment + * code in this test. + * JRM -- 1/10/08 + * *------------------------------------------------------------------------- */ @@ -20982,6 +22140,11 @@ check_auto_cache_resize_disable(void) /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), + /* enum H5C2_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C2_flash_incr__off, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, + /* enum H5C2_cache_decr_mode decr_mode = */ H5C2_decr__threshold, @@ -21073,6 +22236,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -21230,11 +22397,14 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; auto_size_ctl.upper_hr_threshold = 0.995; - auto_size_ctl.decrement = 0.5; auto_size_ctl.apply_max_decrement = FALSE; @@ -21387,6 +22557,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -21543,6 +22717,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -21699,6 +22877,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -21854,6 +23036,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__off; @@ -22011,6 +23197,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out; @@ -22235,6 +23425,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out; @@ -22466,6 +23660,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out_with_threshold; @@ -22701,6 +23899,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -22826,6 +24028,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -22951,6 +24157,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -23076,6 +24286,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -23201,6 +24415,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -23327,6 +24545,10 @@ check_auto_cache_resize_disable(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__off; @@ -23428,6 +24650,175 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Now test the flash cache size increment code to verify that it + * is disabled when it should be. + * + * Since the flash size increase code doesn't look at hit rate, or + * use epochs (other than to start a new epoch if a flash cache size + * increase is triggered), we go about these tests somewhat differently + * than the rest of the tests in this function. + * + * As of this writing, there is only one flash cache size increment + * mode (add space), which is triggered whenever the size of a newly + * loaded or inserted entry, or the delta between old and new entry + * sizes exceeds some fraction of the current maximum cache size, and + * the cache doesn't have enough free space to accomodate the new/ + * resize entry without performing evictions. The range of permissible + * values for the flash_threshold (0.1 to 1.0 as of this writing), and + * for the flash_multiple (0.1 to 10.0) do not permit the facility to + * be turned off by configuration. Thus, flash cache size increases + * can be disabled only via the flash_incr_mode, and by setting the + * current max_cache_size equal to max_size. + * + * We have already tested the latter in check_auto_cache_resize(), so + * we need only thest the former here. Do this by disabling flash + * cache size increments via the flash_incr_mode, and then creating + * situations that would trigger flash cache size increases were that + * code enabled. + */ + + if ( pass2 ) { + + auto_size_ctl.version = H5C2__CURR_AUTO_SIZE_CTL_VER; + auto_size_ctl.rpt_fcn = test_rpt_fcn; + + auto_size_ctl.set_initial_size = TRUE; + auto_size_ctl.initial_size = 64 * 1024; + + auto_size_ctl.min_clean_fraction = 0.5; + + auto_size_ctl.max_size = 256 * 1024; + auto_size_ctl.min_size = 32 * 1024; + + auto_size_ctl.epoch_length = 1000; + + + auto_size_ctl.incr_mode = H5C2_incr__threshold; + + auto_size_ctl.lower_hr_threshold = 0.75; + + auto_size_ctl.increment = 2.0; + + auto_size_ctl.apply_max_increment = TRUE; + auto_size_ctl.max_increment = (2 * 1024); + + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 1.0; + auto_size_ctl.flash_threshold = 0.25; + + + auto_size_ctl.decr_mode = H5C2_decr__age_out_with_threshold; + + auto_size_ctl.upper_hr_threshold = 0.995; + + auto_size_ctl.decrement = 0.5; + + auto_size_ctl.apply_max_decrement = TRUE; + auto_size_ctl.max_decrement = (1 * 1024); + + auto_size_ctl.epochs_before_eviction = 3; + + auto_size_ctl.apply_empty_reserve = TRUE; + auto_size_ctl.empty_reserve = 0.05; + + + result = H5C2_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = "H5C2_set_cache_auto_resize_config failed 17.\n"; + } + } + + if ( pass2 ) { + + if ( ( cache_ptr->max_cache_size != (64 * 1024) ) || + ( cache_ptr->min_clean_size != (32 * 1024) ) ) { + + pass2 = FALSE; + failure_mssg2 = "bad cache size after set resize re-config 16.\n"; + } + } + + /* We have reduced the max cache size to well below the current index + * size. Protect and unprotect an entry to allow the cache to evict + * entries and get within bounds + */ + if ( pass2 ) { + + rpt_fcn_called = FALSE; + + protect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0); + unprotect_entry2(cache_ptr, LARGE_ENTRY_TYPE, 0, + NO_CHANGE, H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) || + ( cache_ptr->min_clean_size != (32 * 1024) ) || + ( cache_ptr->index_len != 1 ) || + ( cache_ptr->index_size != LARGE_ENTRY_SIZE ) || + ( rpt_fcn_called != FALSE ) ) ) ) { + + HDfprintf(stdout, "\nmax_cache_size = %ld.\n", + (long)(cache_ptr->max_cache_size)); + HDfprintf(stdout, "min_clean_size = %ld.\n", + (long)(cache_ptr->min_clean_size)); + HDfprintf(stdout, "index_len = %ld.\n", + (long)(cache_ptr->index_len)); + HDfprintf(stdout, "index_size = %ld.\n", + (long)(cache_ptr->index_size)); + HDfprintf(stdout, "rpt_fcn_called = %ld.\n", + (long)(rpt_fcn_called)); + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache size change results 46.\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + + /* Now protect and unprotect a monster entry. If the flash cache + * size increment code was active, this would trigger an increase. + * Verify that it doesn't. + * + * This finishes the additional tests needed for the flash cache + * size increase code. + */ + if ( pass2 ) { + + rpt_fcn_called = FALSE; + + protect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0); + unprotect_entry2(cache_ptr, MONSTER_ENTRY_TYPE, 0, + NO_CHANGE, H5C2__NO_FLAGS_SET); + + if ( ( pass2 ) && + ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) || + ( cache_ptr->min_clean_size != (32 * 1024) ) || + ( cache_ptr->index_len != 1 ) || + ( cache_ptr->index_size != MONSTER_ENTRY_SIZE ) || + ( rpt_fcn_called != FALSE ) ) ) ) { + + HDfprintf(stdout, "\nmax_cache_size = %ld.\n", + (long)(cache_ptr->max_cache_size)); + HDfprintf(stdout, "min_clean_size = %ld.\n", + (long)(cache_ptr->min_clean_size)); + HDfprintf(stdout, "index_len = %ld.\n", + (long)(cache_ptr->index_len)); + HDfprintf(stdout, "index_size = %ld.\n", + (long)(cache_ptr->index_size)); + HDfprintf(stdout, "rpt_fcn_called = %ld.\n", + (long)(rpt_fcn_called)); + + pass2 = FALSE; + failure_mssg2 = "Unexpected cache size change results 47.\n"; + } + } + + if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); + if ( pass2 ) { takedown_cache2(cache_ptr, FALSE, FALSE); @@ -23499,6 +24890,11 @@ check_auto_cache_resize_epoch_markers(void) /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), + /* enum H5C2_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C2_flash_incr__off, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, + /* enum H5C2_cache_decr_mode decr_mode = */ H5C2_decr__threshold, @@ -23581,6 +24977,10 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out; @@ -23754,6 +25154,10 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out; @@ -23872,6 +25276,10 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -23947,6 +25355,10 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__age_out_with_threshold; @@ -24057,6 +25469,10 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (4 * 1024 * 1024); + auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + auto_size_ctl.flash_multiple = 2.0; + auto_size_ctl.flash_threshold = 0.5; + auto_size_ctl.decr_mode = H5C2_decr__off; @@ -24144,6 +25560,11 @@ check_auto_cache_resize_epoch_markers(void) * * Modifications: * + * Added code to verify that errors in the flash cache size + * increment related fields are caught as well. + * + * JRM -- 1/17/08 + * *------------------------------------------------------------------------- */ @@ -24163,6 +25584,9 @@ check_auto_cache_resize_epoch_markers(void) ( (a).increment == (b).increment ) && \ ( (a).apply_max_increment == (b).apply_max_increment ) && \ ( (a).max_increment == (b).max_increment ) && \ + ( (a).flash_incr_mode == (b).flash_incr_mode ) && \ + ( (a).flash_multiple == (b).flash_multiple ) && \ + ( (a).flash_threshold == (b).flash_threshold ) && \ ( (a).decr_mode == (b).decr_mode ) && \ ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \ ( (a).decrement == (b).decrement ) && \ @@ -24203,6 +25627,11 @@ check_auto_cache_resize_input_errs(void) /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), + /* enum H5C2_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C2_flash_incr__off, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, + /* enum H5C2_cache_decr_mode decr_mode = */ H5C2_decr__threshold, @@ -24305,6 +25734,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -24377,6 +25810,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -24450,6 +25887,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -24520,6 +25961,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -24592,6 +26037,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -24661,6 +26110,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -24734,6 +26187,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -24803,6 +26260,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -24872,6 +26333,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -24944,6 +26409,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -25013,6 +26482,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -25086,6 +26559,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -25156,6 +26633,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -25228,6 +26709,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -25297,6 +26782,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -25366,6 +26855,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -25438,6 +26931,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -25483,6 +26980,382 @@ check_auto_cache_resize_input_errs(void) } } + /* test for bad flash_incr_mode rejection */ + + if ( pass2 ) { + + invalid_auto_size_ctl.version = H5C2__CURR_AUTO_SIZE_CTL_VER; + invalid_auto_size_ctl.rpt_fcn = NULL; + + invalid_auto_size_ctl.set_initial_size = TRUE; + invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; + + invalid_auto_size_ctl.min_clean_fraction = 0.1; + + invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; + invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; + + invalid_auto_size_ctl.epoch_length = 5000; + + + invalid_auto_size_ctl.incr_mode = H5C2_incr__threshold; + + invalid_auto_size_ctl.lower_hr_threshold = 0.75; + + invalid_auto_size_ctl.increment = 2.0; + + invalid_auto_size_ctl.apply_max_increment = TRUE; + invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + + invalid_auto_size_ctl.flash_incr_mode = + (enum H5C2_cache_flash_incr_mode) -1; /* INVALID */ + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + + + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; + + invalid_auto_size_ctl.upper_hr_threshold = 0.999; + + invalid_auto_size_ctl.decrement = 0.9; + + invalid_auto_size_ctl.apply_max_decrement = TRUE; + invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); + + invalid_auto_size_ctl.epochs_before_eviction = 3; + + invalid_auto_size_ctl.apply_empty_reserve = TRUE; + invalid_auto_size_ctl.empty_reserve = 0.05; + + result = H5C2_set_cache_auto_resize_config(cache_ptr, + &invalid_auto_size_ctl); + + if ( result != FAIL ) { + + pass2 = FALSE; + failure_mssg2 = + "H5C2_set_cache_auto_resize_config accepted bad flash_incr_mode.\n"; + } + } + + if ( pass2 ) { + + result = H5C2_get_cache_auto_resize_config(cache_ptr, + &test_auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 19."; + + } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ + ref_auto_size_ctl, FALSE) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected auto resize config 19."; + } + } + + /* test for bad flash_multiple rejection */ + + if ( pass2 ) { + + invalid_auto_size_ctl.version = H5C2__CURR_AUTO_SIZE_CTL_VER; + invalid_auto_size_ctl.rpt_fcn = NULL; + + invalid_auto_size_ctl.set_initial_size = TRUE; + invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; + + invalid_auto_size_ctl.min_clean_fraction = 0.1; + + invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; + invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; + + invalid_auto_size_ctl.epoch_length = 5000; + + + invalid_auto_size_ctl.incr_mode = H5C2_incr__threshold; + + invalid_auto_size_ctl.lower_hr_threshold = 0.75; + + invalid_auto_size_ctl.increment = 2.0; + + invalid_auto_size_ctl.apply_max_increment = TRUE; + invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + + invalid_auto_size_ctl.flash_incr_mode = + H5C2_flash_incr__add_space; + invalid_auto_size_ctl.flash_multiple = 0.09; /* INVALID */ + invalid_auto_size_ctl.flash_threshold = 0.5; + + + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; + + invalid_auto_size_ctl.upper_hr_threshold = 0.999; + + invalid_auto_size_ctl.decrement = 0.9; + + invalid_auto_size_ctl.apply_max_decrement = TRUE; + invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); + + invalid_auto_size_ctl.epochs_before_eviction = 3; + + invalid_auto_size_ctl.apply_empty_reserve = TRUE; + invalid_auto_size_ctl.empty_reserve = 0.05; + + result = H5C2_set_cache_auto_resize_config(cache_ptr, + &invalid_auto_size_ctl); + + if ( result != FAIL ) { + + pass2 = FALSE; + failure_mssg2 = + "H5C2_set_cache_auto_resize_config accepted bad flash_multiple(1).\n"; + } + } + + if ( pass2 ) { + + result = H5C2_get_cache_auto_resize_config(cache_ptr, + &test_auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 20."; + + } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ + ref_auto_size_ctl, FALSE) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected auto resize config 20."; + } + } + + if ( pass2 ) { + + invalid_auto_size_ctl.version = H5C2__CURR_AUTO_SIZE_CTL_VER; + invalid_auto_size_ctl.rpt_fcn = NULL; + + invalid_auto_size_ctl.set_initial_size = TRUE; + invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; + + invalid_auto_size_ctl.min_clean_fraction = 0.1; + + invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; + invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; + + invalid_auto_size_ctl.epoch_length = 5000; + + + invalid_auto_size_ctl.incr_mode = H5C2_incr__threshold; + + invalid_auto_size_ctl.lower_hr_threshold = 0.75; + + invalid_auto_size_ctl.increment = 2.0; + + invalid_auto_size_ctl.apply_max_increment = TRUE; + invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + + invalid_auto_size_ctl.flash_incr_mode = + H5C2_flash_incr__add_space; + invalid_auto_size_ctl.flash_multiple = 10.01; /* INVALID */ + invalid_auto_size_ctl.flash_threshold = 0.5; + + + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; + + invalid_auto_size_ctl.upper_hr_threshold = 0.999; + + invalid_auto_size_ctl.decrement = 0.9; + + invalid_auto_size_ctl.apply_max_decrement = TRUE; + invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); + + invalid_auto_size_ctl.epochs_before_eviction = 3; + + invalid_auto_size_ctl.apply_empty_reserve = TRUE; + invalid_auto_size_ctl.empty_reserve = 0.05; + + result = H5C2_set_cache_auto_resize_config(cache_ptr, + &invalid_auto_size_ctl); + + if ( result != FAIL ) { + + pass2 = FALSE; + failure_mssg2 = + "H5C2_set_cache_auto_resize_config accepted bad flash_multiple(2).\n"; + } + } + + if ( pass2 ) { + + result = H5C2_get_cache_auto_resize_config(cache_ptr, + &test_auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 21."; + + } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ + ref_auto_size_ctl, FALSE) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected auto resize config 21."; + } + } + + /* test for bad flash_threshold rejection */ + + if ( pass2 ) { + + invalid_auto_size_ctl.version = H5C2__CURR_AUTO_SIZE_CTL_VER; + invalid_auto_size_ctl.rpt_fcn = NULL; + + invalid_auto_size_ctl.set_initial_size = TRUE; + invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; + + invalid_auto_size_ctl.min_clean_fraction = 0.1; + + invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; + invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; + + invalid_auto_size_ctl.epoch_length = 5000; + + + invalid_auto_size_ctl.incr_mode = H5C2_incr__threshold; + + invalid_auto_size_ctl.lower_hr_threshold = 0.75; + + invalid_auto_size_ctl.increment = 2.0; + + invalid_auto_size_ctl.apply_max_increment = TRUE; + invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + + invalid_auto_size_ctl.flash_incr_mode = + H5C2_flash_incr__add_space; + invalid_auto_size_ctl.flash_multiple = 1.0; + invalid_auto_size_ctl.flash_threshold = 0.09; /* INVALID */ + + + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; + + invalid_auto_size_ctl.upper_hr_threshold = 0.999; + + invalid_auto_size_ctl.decrement = 0.9; + + invalid_auto_size_ctl.apply_max_decrement = TRUE; + invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); + + invalid_auto_size_ctl.epochs_before_eviction = 3; + + invalid_auto_size_ctl.apply_empty_reserve = TRUE; + invalid_auto_size_ctl.empty_reserve = 0.05; + + result = H5C2_set_cache_auto_resize_config(cache_ptr, + &invalid_auto_size_ctl); + + if ( result != FAIL ) { + + pass2 = FALSE; + failure_mssg2 = + "H5C2_set_cache_auto_resize_config accepted bad flash_threshold(1).\n"; + } + } + + if ( pass2 ) { + + result = H5C2_get_cache_auto_resize_config(cache_ptr, + &test_auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 22."; + + } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ + ref_auto_size_ctl, FALSE) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected auto resize config 22."; + } + } + + if ( pass2 ) { + + invalid_auto_size_ctl.version = H5C2__CURR_AUTO_SIZE_CTL_VER; + invalid_auto_size_ctl.rpt_fcn = NULL; + + invalid_auto_size_ctl.set_initial_size = TRUE; + invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024; + + invalid_auto_size_ctl.min_clean_fraction = 0.1; + + invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; + invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; + + invalid_auto_size_ctl.epoch_length = 5000; + + + invalid_auto_size_ctl.incr_mode = H5C2_incr__threshold; + + invalid_auto_size_ctl.lower_hr_threshold = 0.75; + + invalid_auto_size_ctl.increment = 2.0; + + invalid_auto_size_ctl.apply_max_increment = TRUE; + invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + + invalid_auto_size_ctl.flash_incr_mode = + H5C2_flash_incr__add_space; + invalid_auto_size_ctl.flash_multiple = 1.0; + invalid_auto_size_ctl.flash_threshold = 1.001; /* INVALID */ + + + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; + + invalid_auto_size_ctl.upper_hr_threshold = 0.999; + + invalid_auto_size_ctl.decrement = 0.9; + + invalid_auto_size_ctl.apply_max_decrement = TRUE; + invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); + + invalid_auto_size_ctl.epochs_before_eviction = 3; + + invalid_auto_size_ctl.apply_empty_reserve = TRUE; + invalid_auto_size_ctl.empty_reserve = 0.05; + + result = H5C2_set_cache_auto_resize_config(cache_ptr, + &invalid_auto_size_ctl); + + if ( result != FAIL ) { + + pass2 = FALSE; + failure_mssg2 = + "H5C2_set_cache_auto_resize_config accepted bad flash_threshold(2).\n"; + } + } + + if ( pass2 ) { + + result = H5C2_get_cache_auto_resize_config(cache_ptr, + &test_auto_size_ctl); + + if ( result != SUCCEED ) { + + pass2 = FALSE; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 23."; + + } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ + ref_auto_size_ctl, FALSE) ) { + + pass2 = FALSE; + failure_mssg2 = "Unexpected auto resize config 23."; + } + } + /* test for bad decr_mode rejection */ @@ -25511,6 +27384,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = (enum H5C2_cache_decr_mode) -1; /* INVALID */ @@ -25546,13 +27423,13 @@ check_auto_cache_resize_input_errs(void) if ( result != SUCCEED ) { pass2 = FALSE; - failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 19."; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 24."; } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ ref_auto_size_ctl, FALSE) ) { pass2 = FALSE; - failure_mssg2 = "Unexpected auto resize config 19."; + failure_mssg2 = "Unexpected auto resize config 24."; } } @@ -25581,6 +27458,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = (enum H5C2_cache_decr_mode) 4; /* INVALID */ @@ -25616,13 +27497,13 @@ check_auto_cache_resize_input_errs(void) if ( result != SUCCEED ) { pass2 = FALSE; - failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 20."; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 25."; } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ ref_auto_size_ctl, FALSE) ) { pass2 = FALSE; - failure_mssg2 = "Unexpected auto resize config 20."; + failure_mssg2 = "Unexpected auto resize config 25."; } } @@ -25654,6 +27535,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -25688,13 +27573,13 @@ check_auto_cache_resize_input_errs(void) if ( result != SUCCEED ) { pass2 = FALSE; - failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 21."; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 26."; } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ ref_auto_size_ctl, FALSE) ) { pass2 = FALSE; - failure_mssg2 = "Unexpected auto resize config 21."; + failure_mssg2 = "Unexpected auto resize config 26."; } } @@ -25723,6 +27608,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__threshold; @@ -25757,13 +27646,13 @@ check_auto_cache_resize_input_errs(void) if ( result != SUCCEED ) { pass2 = FALSE; - failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 22."; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 27."; } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ ref_auto_size_ctl, FALSE) ) { pass2 = FALSE; - failure_mssg2 = "Unexpected auto resize config 22."; + failure_mssg2 = "Unexpected auto resize config 27."; } } @@ -25795,6 +27684,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__age_out; @@ -25828,13 +27721,13 @@ check_auto_cache_resize_input_errs(void) if ( result != SUCCEED ) { pass2 = FALSE; - failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 23."; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 28."; } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ ref_auto_size_ctl, FALSE) ) { pass2 = FALSE; - failure_mssg2 = "Unexpected auto resize config 23."; + failure_mssg2 = "Unexpected auto resize config 28."; } } @@ -25863,6 +27756,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__age_out_with_threshold; @@ -25897,13 +27794,13 @@ check_auto_cache_resize_input_errs(void) if ( result != SUCCEED ) { pass2 = FALSE; - failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 24."; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 29."; } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ ref_auto_size_ctl, FALSE) ) { pass2 = FALSE; - failure_mssg2 = "Unexpected auto resize config 24."; + failure_mssg2 = "Unexpected auto resize config 29."; } } @@ -25935,6 +27832,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__age_out; @@ -25968,13 +27869,13 @@ check_auto_cache_resize_input_errs(void) if ( result != SUCCEED ) { pass2 = FALSE; - failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 25."; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 30."; } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ ref_auto_size_ctl, FALSE) ) { pass2 = FALSE; - failure_mssg2 = "Unexpected auto resize config 25."; + failure_mssg2 = "Unexpected auto resize config 30."; } } @@ -26003,6 +27904,10 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_increment = TRUE; invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); + invalid_auto_size_ctl.flash_incr_mode = H5C2_flash_incr__off; + invalid_auto_size_ctl.flash_multiple = 2.0; + invalid_auto_size_ctl.flash_threshold = 0.5; + invalid_auto_size_ctl.decr_mode = H5C2_decr__age_out_with_threshold; @@ -26037,13 +27942,13 @@ check_auto_cache_resize_input_errs(void) if ( result != SUCCEED ) { pass2 = FALSE; - failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 26."; + failure_mssg2 = "H5C2_get_cache_auto_resize_config failed 31."; } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \ ref_auto_size_ctl, FALSE) ) { pass2 = FALSE; - failure_mssg2 = "Unexpected auto resize config 26."; + failure_mssg2 = "Unexpected auto resize config 31."; } } @@ -26168,7 +28073,12 @@ check_auto_cache_resize_aux_fcns(void) /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), + /* enum H5C2_cache_flash_incr_mode */ + /* flash_incr_mode = */ H5C2_flash_incr__off, + /* double flash_multiple = */ 2.0, + /* double flash_threshold = */ 0.5, + /* enum H5C2_cache_decr_mode decr_mode = */ H5C2_decr__off, /* double upper_hr_threshold = */ 0.995, @@ -26714,7 +28624,7 @@ main(void) run_full_test2 = FALSE; #endif /* NDEBUG */ -#if 0 +#if 1 run_full_test2 = TRUE; #endif |