summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2008-01-18 17:52:12 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2008-01-18 17:52:12 (GMT)
commitd236e2a9926cc62048d9489a60ab0d5f4dfcd41c (patch)
tree0ed0d874bd62c7d8453082bb4186d6b5f640fc86 /test
parent1039d639520e92455b01850095bd94664ff4de53 (diff)
downloadhdf5-d236e2a9926cc62048d9489a60ab0d5f4dfcd41c.zip
hdf5-d236e2a9926cc62048d9489a60ab0d5f4dfcd41c.tar.gz
hdf5-d236e2a9926cc62048d9489a60ab0d5f4dfcd41c.tar.bz2
[svn-r14442] Modified metadata cache to adapt more quickly to the insertion of a
large entry, or to a large increases in the size of an existing entry. This required some additions to the cache configuration structure, and thus will require changes in the metadata cache documentation. The basic idea is to monitor the size of entries as they are loaded, inserted, or increased in size. If the size of the entry (or increase) exceeds some user selected fraction of the size of the cache, increase the size of the cache. Note that this fix was designed quickly -- while it deals with the use case that exposed the problem, we may have to revisit the issue later. Tested serial and parallel on Phoenix, and h5committest.
Diffstat (limited to 'test')
-rw-r--r--test/cache.c1957
-rw-r--r--test/cache_api.c389
-rw-r--r--test/cache_common.c107
-rw-r--r--test/cache_common.h5
4 files changed, 2422 insertions, 36 deletions
diff --git a/test/cache.c b/test/cache.c
index a0bc5b1..6ea92ef 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -965,6 +965,11 @@ smoke_check_5(void)
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
+
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -1200,6 +1205,11 @@ smoke_check_6(void)
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
+
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -1435,6 +1445,11 @@ smoke_check_7(void)
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (8 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
+
/* enum H5C_cache_decr_mode decr_mode = */
H5C_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 H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
+
/* enum H5C_cache_decr_mode decr_mode = */
H5C_decr__age_out_with_threshold,
@@ -17295,6 +17315,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.
+ *
*-------------------------------------------------------------------------
*/
@@ -17304,7 +17328,7 @@ enum H5C_resize_status rpt_status;
static void test_rpt_fcn(UNUSED H5C_t * cache_ptr,
UNUSED int32_t version,
UNUSED double hit_rate,
- UNUSED enum H5C_resize_status status,
+ enum H5C_resize_status status,
UNUSED size_t old_max_cache_size,
UNUSED size_t new_max_cache_size,
UNUSED size_t old_min_clean_size,
@@ -17348,6 +17372,11 @@ check_auto_cache_resize(void)
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
+
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -17708,7 +17737,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.
*/
@@ -17738,6 +17767,10 @@ 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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -18088,6 +18121,10 @@ 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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -18276,6 +18313,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -18699,6 +18740,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -19239,6 +19284,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -19663,6 +19712,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -19929,6 +19982,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -20465,6 +20522,1110 @@ check_auto_cache_resize(void)
takedown_cache(cache_ptr, FALSE, FALSE);
}
+ /* 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.
+ */
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ /* allocate a cache, enable the flash cache size increase code, and
+ * then force the flash size increase code through all its operational
+ * modes. Verify that all performs as expected.
+ */
+
+ if ( pass ) {
+
+ reset_entries();
+
+ cache_ptr = setup_cache((size_t)(2 * 1024),
+ (size_t)(1 * 1024));
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ /* now repeat the above tests using the add space flash cache size
+ * increment algorithm.
+ */
+
+ if ( pass ) {
+
+ auto_size_ctl.version = H5C__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 = H5C_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 = H5C_flash_incr__add_space;
+ auto_size_ctl.flash_multiple = 1.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
+
+ auto_size_ctl.decr_mode = H5C_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 = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_set_cache_auto_resize_config failed 12.\n";
+ }
+ }
+
+ if ( pass ) {
+
+ 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 ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (0).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ /* Load a huge entry into the cache */
+ if ( pass ) {
+
+ protect_entry(cache_ptr, HUGE_ENTRY_TYPE, 0);
+
+ if ( pass ) {
+ unprotect_entry(cache_ptr, HUGE_ENTRY_TYPE, 0,
+ NO_CHANGE, H5C__NO_FLAGS_SET);
+ }
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0);
+
+ if ( pass ) {
+ unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0,
+ NO_CHANGE, H5C__NO_FLAGS_SET);
+ }
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (2).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ /* Load a second moster 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 ( pass ) {
+
+ protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 1);
+
+ unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 1,
+ NO_CHANGE, H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 2);
+
+ unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 2,
+ NO_CHANGE, H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ expunge_entry(cache_ptr, MONSTER_ENTRY_TYPE, 1);
+ expunge_entry(cache_ptr, MONSTER_ENTRY_TYPE, 2);
+
+ if ( pass ) {
+
+ result = H5C_set_cache_auto_resize_config(cache_ptr,
+ &auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_set_cache_auto_resize_config failed 13.\n";
+ }
+ }
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ insert_entry(cache_ptr, HUGE_ENTRY_TYPE, 1, TRUE,
+ H5C__NO_FLAGS_SET);
+ /* protect and unprotect a couple times to increment cache_accesses */
+ protect_entry(cache_ptr, HUGE_ENTRY_TYPE, 1);
+ unprotect_entry(cache_ptr, HUGE_ENTRY_TYPE, 1,
+ NO_CHANGE, H5C__NO_FLAGS_SET);
+ protect_entry(cache_ptr, HUGE_ENTRY_TYPE, 1);
+ unprotect_entry(cache_ptr, HUGE_ENTRY_TYPE, 1,
+ NO_CHANGE, H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ insert_entry(cache_ptr, MONSTER_ENTRY_TYPE, 4, TRUE,
+ H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ insert_entry(cache_ptr, MONSTER_ENTRY_TYPE, 5, TRUE,
+ H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 6);
+
+ unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 6,
+ NO_CHANGE, H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ expunge_entry(cache_ptr, MONSTER_ENTRY_TYPE, 5);
+ expunge_entry(cache_ptr, MONSTER_ENTRY_TYPE, 6);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 10,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1024);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 11,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1024);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 12,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1024);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 13);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 13,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1024);
+
+ flush_cache(cache_ptr, TRUE, FALSE, FALSE);
+
+
+ if ( pass ) {
+
+ auto_size_ctl.initial_size = 6 * 1024;
+ result = H5C_set_cache_auto_resize_config(cache_ptr,
+ &auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_set_cache_auto_resize_config failed 13.\n";
+ }
+ }
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (10).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ /* Now load the variable entries into the cache */
+ if ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE,
+ H5C__NO_FLAGS_SET);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE,
+ H5C__NO_FLAGS_SET);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE,
+ H5C__NO_FLAGS_SET);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 13);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 13, NO_CHANGE,
+ H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 10,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 3 * 1024);
+
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 10,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 10 * 1024);
+
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 11,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 10 * 1024);
+
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 12,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 10 * 1024);
+
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 10,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024);
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 11,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024);
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 12,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024);
+
+ if ( pass ) {
+
+ auto_size_ctl.initial_size = 6 * 1024;
+ result = H5C_set_cache_auto_resize_config(cache_ptr,
+ &auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_set_cache_auto_resize_config failed 14.\n";
+ }
+ }
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (16).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ /* Now test flash cache resizes with pinned entries...
+ */
+ if ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE,
+ H5C__PIN_ENTRY_FLAG);
+ resize_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (17).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ if ( pass ) {
+
+ resize_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024, TRUE);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (18).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ if ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE,
+ H5C__PIN_ENTRY_FLAG);
+ resize_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (19).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ if ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE,
+ H5C__PIN_ENTRY_FLAG);
+ resize_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE,
+ H5C__UNPIN_ENTRY_FLAG);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE,
+ H5C__UNPIN_ENTRY_FLAG);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE,
+ H5C__UNPIN_ENTRY_FLAG);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 10,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024);
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 11,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024);
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
+ unprotect_entry_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 12,
+ H5C__DIRTIED_FLAG|H5C__SIZE_CHANGED_FLAG, 1 * 1024);
+
+ if ( pass ) {
+
+ auto_size_ctl.initial_size = 6 * 1024;
+ result = H5C_set_cache_auto_resize_config(cache_ptr,
+ &auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_set_cache_auto_resize_config failed 15.\n";
+ }
+ }
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (22).\n";
+ }
+ }
+
+ if ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE,
+ H5C__PIN_ENTRY_FLAG);
+ resize_pinned_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (23).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ if ( pass ) {
+
+ resize_pinned_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (24).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ if ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE,
+ H5C__PIN_ENTRY_FLAG);
+ resize_pinned_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (25).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ if ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE,
+ H5C__PIN_ENTRY_FLAG);
+ resize_pinned_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE,
+ H5C__UNPIN_ENTRY_FLAG);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE,
+ H5C__UNPIN_ENTRY_FLAG);
+
+ protect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
+ unprotect_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE,
+ H5C__UNPIN_ENTRY_FLAG);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ expunge_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
+ expunge_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
+ expunge_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
+ expunge_entry(cache_ptr, VARIABLE_ENTRY_TYPE, 13);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ auto_size_ctl.version = H5C__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 = H5C_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 = H5C_flash_incr__add_space;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.4;
+
+
+ auto_size_ctl.decr_mode = H5C_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 = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_set_cache_auto_resize_config failed 15.\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ if ( pass ) {
+
+ 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 ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ rpt_fcn_called = FALSE;
+
+ protect_entry(cache_ptr, LARGE_ENTRY_TYPE, 0);
+ unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE,
+ H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ rpt_fcn_called = FALSE;
+
+ protect_entry(cache_ptr, LARGE_ENTRY_TYPE, 1);
+ unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, 1, NO_CHANGE,
+ H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ rpt_fcn_called = FALSE;
+
+ protect_entry(cache_ptr, LARGE_ENTRY_TYPE, 2);
+ unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, 2, NO_CHANGE,
+ H5C__NO_FLAGS_SET);
+ protect_entry(cache_ptr, LARGE_ENTRY_TYPE, 3);
+ unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, 3, NO_CHANGE,
+ H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ rpt_fcn_called = FALSE;
+ i = 0;
+ while ( ( pass ) && ( i < 1000 ) )
+ {
+ protect_entry(cache_ptr, TINY_ENTRY_TYPE, 0);
+
+ if ( pass ) {
+ unprotect_entry(cache_ptr, TINY_ENTRY_TYPE, 0,
+ NO_CHANGE, H5C__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) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (32).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ /* Force another flash increase */
+ if ( pass ) {
+
+ rpt_fcn_called = FALSE;
+
+ protect_entry(cache_ptr, LARGE_ENTRY_TYPE, 0);
+ unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE,
+ H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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 ) ) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (33).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+ /* force regular size increase up to maximum */
+ if ( pass ) {
+
+ rpt_fcn_called = FALSE;
+ i = 0;
+ while ( ( pass ) && ( i < 500 ) )
+ {
+ protect_entry(cache_ptr, TINY_ENTRY_TYPE, i);
+
+ if ( pass ) {
+ unprotect_entry(cache_ptr, TINY_ENTRY_TYPE, i,
+ NO_CHANGE, H5C__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 ) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache config (34).\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
+
+ if ( pass ) {
+
+ takedown_cache(cache_ptr, FALSE, FALSE);
+ }
+
if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
if ( pass ) { PASSED(); } else { H5_FAILED(); }
@@ -20493,6 +21654,10 @@ check_auto_cache_resize(void)
*
* Modifications:
*
+ * Added code to include the flash cache size increment
+ * code in this test.
+ * JRM -- 1/10/08
+ *
*-------------------------------------------------------------------------
*/
@@ -20530,6 +21695,11 @@ check_auto_cache_resize_disable(void)
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 1.0,
+ /* double flash_threshold = */ 0.25,
+
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -20621,6 +21791,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -20778,6 +21952,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -20935,6 +22113,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -21091,6 +22273,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -21247,6 +22433,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -21402,6 +22592,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__off;
@@ -21559,6 +22753,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -21783,6 +22981,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -22014,6 +23216,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -22249,6 +23455,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -22374,6 +23584,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -22499,6 +23713,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -22624,6 +23842,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -22749,6 +23971,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -22875,6 +24101,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__off;
@@ -22976,6 +24206,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 ( pass ) {
+
+ auto_size_ctl.version = H5C__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 = H5C_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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 1.0;
+ auto_size_ctl.flash_threshold = 0.25;
+
+
+ auto_size_ctl.decr_mode = H5C_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 = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_set_cache_auto_resize_config failed 17.\n";
+ }
+ }
+
+ if ( pass ) {
+
+ if ( ( cache_ptr->max_cache_size != (64 * 1024) ) ||
+ ( cache_ptr->min_clean_size != (32 * 1024) ) ) {
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ rpt_fcn_called = FALSE;
+
+ protect_entry(cache_ptr, LARGE_ENTRY_TYPE, 0);
+ unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, 0,
+ NO_CHANGE, H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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));
+
+ pass = FALSE;
+ failure_mssg = "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 ( pass ) {
+
+ rpt_fcn_called = FALSE;
+
+ protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0);
+ unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0,
+ NO_CHANGE, H5C__NO_FLAGS_SET);
+
+ if ( ( pass ) &&
+ ( ( ( 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));
+
+ pass = FALSE;
+ failure_mssg = "Unexpected cache size change results 47.\n";
+ }
+ }
+
+ if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
+
if ( pass ) {
takedown_cache(cache_ptr, FALSE, FALSE);
@@ -23047,6 +24446,11 @@ check_auto_cache_resize_epoch_markers(void)
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
+
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -23129,6 +24533,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -23302,6 +24710,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out;
@@ -23420,6 +24832,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__threshold;
@@ -23495,6 +24911,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold;
@@ -23605,6 +25025,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 = H5C_flash_incr__off;
+ auto_size_ctl.flash_multiple = 2.0;
+ auto_size_ctl.flash_threshold = 0.5;
+
auto_size_ctl.decr_mode = H5C_decr__off;
@@ -23692,6 +25116,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
+ *
*-------------------------------------------------------------------------
*/
@@ -23711,8 +25140,14 @@ 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).flash_incr_mode == (b).flash_incr_mode ) && \
+ ( (a).flash_multiple == (b).flash_multiple ) && \
+ ( (a).flash_threshold == (b).flash_threshold ) && \
( (a).decrement == (b).decrement ) && \
( (a).apply_max_decrement == (b).apply_max_decrement ) && \
( (a).max_decrement == (b).max_decrement ) && \
@@ -23751,6 +25186,11 @@ check_auto_cache_resize_input_errs(void)
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
+
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
@@ -23853,6 +25293,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 = H5C_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 = H5C_decr__threshold;
@@ -23925,6 +25369,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 = H5C_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 = H5C_decr__threshold;
@@ -23998,6 +25446,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 = H5C_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 = H5C_decr__threshold;
@@ -24068,6 +25520,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 = H5C_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 = H5C_decr__threshold;
@@ -24140,6 +25596,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 = H5C_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 = H5C_decr__threshold;
@@ -24209,6 +25669,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 = H5C_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 = H5C_decr__threshold;
@@ -24282,6 +25746,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 = H5C_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 = H5C_decr__threshold;
@@ -24351,6 +25819,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 = H5C_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 = H5C_decr__threshold;
@@ -24420,6 +25892,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 = H5C_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 = H5C_decr__threshold;
@@ -24492,6 +25968,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 = H5C_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 = H5C_decr__threshold;
@@ -24561,6 +26041,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 = H5C_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 = H5C_decr__threshold;
@@ -24634,6 +26118,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 = H5C_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 = H5C_decr__threshold;
@@ -24704,6 +26192,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 = H5C_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 = H5C_decr__threshold;
@@ -24776,6 +26268,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 = H5C_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 = H5C_decr__threshold;
@@ -24845,6 +26341,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 = H5C_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 = H5C_decr__threshold;
@@ -24914,6 +26414,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 = H5C_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 = H5C_decr__threshold;
@@ -24986,6 +26490,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 = H5C_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 = H5C_decr__threshold;
@@ -25032,6 +26540,382 @@ check_auto_cache_resize_input_errs(void)
}
+ /* test for bad flash_incr_mode rejection */
+
+ if ( pass ) {
+
+ invalid_auto_size_ctl.version = H5C__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 = H5C_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 H5C_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 = H5C_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 = H5C_set_cache_auto_resize_config(cache_ptr,
+ &invalid_auto_size_ctl);
+
+ if ( result != FAIL ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "H5C_set_cache_auto_resize_config accepted bad flash_incr_mode.\n";
+ }
+ }
+
+ if ( pass ) {
+
+ result = H5C_get_cache_auto_resize_config(cache_ptr,
+ &test_auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 19.";
+
+ } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
+ ref_auto_size_ctl, FALSE) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected auto resize config 19.";
+ }
+ }
+
+ /* test for bad flash_multiple rejection */
+
+ if ( pass ) {
+
+ invalid_auto_size_ctl.version = H5C__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 = H5C_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 =
+ H5C_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 = H5C_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 = H5C_set_cache_auto_resize_config(cache_ptr,
+ &invalid_auto_size_ctl);
+
+ if ( result != FAIL ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "H5C_set_cache_auto_resize_config accepted bad flash_multiple(1).\n";
+ }
+ }
+
+ if ( pass ) {
+
+ result = H5C_get_cache_auto_resize_config(cache_ptr,
+ &test_auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 20.";
+
+ } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
+ ref_auto_size_ctl, FALSE) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected auto resize config 20.";
+ }
+ }
+
+ if ( pass ) {
+
+ invalid_auto_size_ctl.version = H5C__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 = H5C_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 =
+ H5C_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 = H5C_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 = H5C_set_cache_auto_resize_config(cache_ptr,
+ &invalid_auto_size_ctl);
+
+ if ( result != FAIL ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "H5C_set_cache_auto_resize_config accepted bad flash_multiple(2).\n";
+ }
+ }
+
+ if ( pass ) {
+
+ result = H5C_get_cache_auto_resize_config(cache_ptr,
+ &test_auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 21.";
+
+ } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
+ ref_auto_size_ctl, FALSE) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected auto resize config 21.";
+ }
+ }
+
+ /* test for bad flash_threshold rejection */
+
+ if ( pass ) {
+
+ invalid_auto_size_ctl.version = H5C__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 = H5C_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 =
+ H5C_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 = H5C_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 = H5C_set_cache_auto_resize_config(cache_ptr,
+ &invalid_auto_size_ctl);
+
+ if ( result != FAIL ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "H5C_set_cache_auto_resize_config accepted bad flash_threshold(1).\n";
+ }
+ }
+
+ if ( pass ) {
+
+ result = H5C_get_cache_auto_resize_config(cache_ptr,
+ &test_auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 22.";
+
+ } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
+ ref_auto_size_ctl, FALSE) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected auto resize config 22.";
+ }
+ }
+
+ if ( pass ) {
+
+ invalid_auto_size_ctl.version = H5C__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 = H5C_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 =
+ H5C_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 = H5C_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 = H5C_set_cache_auto_resize_config(cache_ptr,
+ &invalid_auto_size_ctl);
+
+ if ( result != FAIL ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "H5C_set_cache_auto_resize_config accepted bad flash_threshold(2).\n";
+ }
+ }
+
+ if ( pass ) {
+
+ result = H5C_get_cache_auto_resize_config(cache_ptr,
+ &test_auto_size_ctl);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 23.";
+
+ } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
+ ref_auto_size_ctl, FALSE) ) {
+
+ pass = FALSE;
+ failure_mssg = "Unexpected auto resize config 23.";
+ }
+ }
+
/* test for bad decr_mode rejection */
if ( pass ) {
@@ -25059,6 +26943,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 = H5C_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 H5C_cache_decr_mode) -1; /* INVALID */
@@ -25094,13 +26982,13 @@ check_auto_cache_resize_input_errs(void)
if ( result != SUCCEED ) {
pass = FALSE;
- failure_mssg = "H5C_get_cache_auto_resize_config failed 19.";
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 24.";
} else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
- failure_mssg = "Unexpected auto resize config 19.";
+ failure_mssg = "Unexpected auto resize config 24.";
}
}
@@ -25129,6 +27017,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 = H5C_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 H5C_cache_decr_mode) 4; /* INVALID */
@@ -25164,13 +27056,13 @@ check_auto_cache_resize_input_errs(void)
if ( result != SUCCEED ) {
pass = FALSE;
- failure_mssg = "H5C_get_cache_auto_resize_config failed 20.";
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 25.";
} else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
- failure_mssg = "Unexpected auto resize config 20.";
+ failure_mssg = "Unexpected auto resize config 25.";
}
}
@@ -25202,6 +27094,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 = H5C_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 = H5C_decr__threshold;
@@ -25236,13 +27132,13 @@ check_auto_cache_resize_input_errs(void)
if ( result != SUCCEED ) {
pass = FALSE;
- failure_mssg = "H5C_get_cache_auto_resize_config failed 21.";
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 26.";
} else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
- failure_mssg = "Unexpected auto resize config 21.";
+ failure_mssg = "Unexpected auto resize config 26.";
}
}
@@ -25271,6 +27167,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 = H5C_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 = H5C_decr__threshold;
@@ -25305,13 +27205,13 @@ check_auto_cache_resize_input_errs(void)
if ( result != SUCCEED ) {
pass = FALSE;
- failure_mssg = "H5C_get_cache_auto_resize_config failed 22.";
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 27.";
} else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
- failure_mssg = "Unexpected auto resize config 22.";
+ failure_mssg = "Unexpected auto resize config 27.";
}
}
@@ -25343,6 +27243,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 = H5C_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 = H5C_decr__age_out;
@@ -25376,13 +27280,13 @@ check_auto_cache_resize_input_errs(void)
if ( result != SUCCEED ) {
pass = FALSE;
- failure_mssg = "H5C_get_cache_auto_resize_config failed 23.";
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 28.";
} else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
- failure_mssg = "Unexpected auto resize config 23.";
+ failure_mssg = "Unexpected auto resize config 28.";
}
}
@@ -25411,6 +27315,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 = H5C_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 = H5C_decr__age_out_with_threshold;
@@ -25445,13 +27353,13 @@ check_auto_cache_resize_input_errs(void)
if ( result != SUCCEED ) {
pass = FALSE;
- failure_mssg = "H5C_get_cache_auto_resize_config failed 24.";
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 29.";
} else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
- failure_mssg = "Unexpected auto resize config 24.";
+ failure_mssg = "Unexpected auto resize config 29.";
}
}
@@ -25483,6 +27391,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 = H5C_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 = H5C_decr__age_out;
@@ -25516,13 +27428,13 @@ check_auto_cache_resize_input_errs(void)
if ( result != SUCCEED ) {
pass = FALSE;
- failure_mssg = "H5C_get_cache_auto_resize_config failed 25.";
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 30.";
} else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
- failure_mssg = "Unexpected auto resize config 25.";
+ failure_mssg = "Unexpected auto resize config 30.";
}
}
@@ -25551,6 +27463,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 = H5C_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 = H5C_decr__age_out_with_threshold;
@@ -25585,13 +27501,13 @@ check_auto_cache_resize_input_errs(void)
if ( result != SUCCEED ) {
pass = FALSE;
- failure_mssg = "H5C_get_cache_auto_resize_config failed 26.";
+ failure_mssg = "H5C_get_cache_auto_resize_config failed 31.";
} else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
ref_auto_size_ctl, FALSE) ) {
pass = FALSE;
- failure_mssg = "Unexpected auto resize config 26.";
+ failure_mssg = "Unexpected auto resize config 31.";
}
}
@@ -25716,6 +27632,11 @@ check_auto_cache_resize_aux_fcns(void)
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
+
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
diff --git a/test/cache_api.c b/test/cache_api.c
index a1da62f..6a75d11 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -50,6 +50,9 @@ const char *FILENAME[] = {
( (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 ) && \
@@ -139,6 +142,9 @@ static void check_file_mdc_api_errs(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 ) && \
@@ -166,8 +172,14 @@ static void check_file_mdc_api_errs(void);
(i).increment = (e).increment; \
(i).apply_max_increment = (e).apply_max_increment; \
(i).max_increment = (e).max_increment; \
+ (i).flash_incr_mode = (e).flash_incr_mode; \
+ (i).flash_multiple = (e).flash_multiple; \
+ (i).flash_threshold = (e).flash_threshold; \
(i).decr_mode = (e).decr_mode; \
(i).upper_hr_threshold = (e).upper_hr_threshold; \
+ (i).flash_incr_mode = (e).flash_incr_mode; \
+ (i).flash_multiple = (e).flash_multiple; \
+ (i).flash_threshold = (e).flash_threshold; \
(i).decrement = (e).decrement; \
(i).apply_max_decrement = (e).apply_max_decrement; \
(i).max_decrement = (e).max_decrement; \
@@ -208,6 +220,10 @@ check_fapl_mdc_api_calls(void)
/* double increment = */ 2.1,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024 + 1),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out,
/* double upper_hr_threshold = */ 0.998,
/* double decrement = */ 0.91,
@@ -695,7 +711,7 @@ validate_mdc_config(hid_t file_id,
/* Recall that in any configuration supplied by the cache
* at run time, the set_initial_size field will always
* be FALSE, regardless of the value passed in. Thus we
- * always resume that this field need not match that of
+ * always presume that this field need not match that of
* the supplied external configuration.
*
* The cache also sets the initial_size field to the current
@@ -773,6 +789,10 @@ check_file_mdc_api_calls(void)
/* double increment = */ 2.1,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024 + 1),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out,
/* double upper_hr_threshold = */ 0.998,
/* double decrement = */ 0.91,
@@ -802,6 +822,10 @@ check_file_mdc_api_calls(void)
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (2 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 1.5,
+ /* double flash_threshold = */ 0.4,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
/* double upper_hr_threshold = */ 0.9995,
/* double decrement = */ 0.95,
@@ -831,6 +855,10 @@ check_file_mdc_api_calls(void)
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.1,
+ /* double flash_threshold = */ 0.6,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -860,6 +888,10 @@ check_file_mdc_api_calls(void)
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (2 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 1.1,
+ /* double flash_threshold = */ 0.3,
/* enum H5C_cache_decr_mode decr_mode = */
H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
@@ -1389,6 +1421,10 @@ mdc_api_call_smoke_check(void)
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ FALSE,
/* size_t max_increment = */ 4000000,
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -1418,6 +1454,10 @@ mdc_api_call_smoke_check(void)
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ FALSE,
/* size_t max_increment = */ 4000000,
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -1447,6 +1487,10 @@ mdc_api_call_smoke_check(void)
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ FALSE,
/* size_t max_increment = */ 4000000,
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2092,7 +2136,7 @@ mdc_api_call_smoke_check(void)
* used to test error rejection in the MDC related API calls.
*/
-#define NUM_INVALID_CONFIGS 36
+#define NUM_INVALID_CONFIGS 41
H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
{
@@ -2115,6 +2159,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2143,6 +2191,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double lower_hr_threshold = */ 0.9,
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* size_t max_increment = */ (4 * 1024 * 1024),
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
@@ -2173,6 +2225,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2202,6 +2258,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2231,6 +2291,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2260,6 +2324,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2289,6 +2357,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2318,6 +2390,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2347,6 +2423,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2376,6 +2456,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2405,6 +2489,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2434,6 +2522,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2463,6 +2555,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2492,6 +2588,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2521,6 +2621,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2550,6 +2654,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2579,6 +2687,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2608,6 +2720,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2637,6 +2753,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 0.999999999999,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2666,6 +2786,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ (hbool_t)-1,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2677,7 +2801,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 20 -- bad decr_mode */
+ /* 20 -- invalid flash_incr_mode */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2695,6 +2819,175 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ -1,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
+ /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
+ /* hbool_t apply_max_decrement = */ TRUE,
+ /* size_t max_decrement = */ (1 * 1024 * 1024),
+ /* int epochs_before_eviction = */ 3,
+ /* hbool_t apply_empty_reserve = */ TRUE,
+ /* double empty_reserve = */ 0.1,
+ /* int dirty_bytes_threshold = */ (256 * 1024)
+ },
+ {
+ /* 21 -- flash_multiple too small */
+ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
+ /* hbool_t rpt_fcn_enabled = */ FALSE,
+ /* hbool_t open_trace_file = */ FALSE,
+ /* hbool_t close_trace_file = */ FALSE,
+ /* char trace_file_name[] = */ "",
+ /* hbool_t evictions_enabled = */ TRUE,
+ /* hbool_t set_initial_size = */ TRUE,
+ /* size_t initial_size = */ (1 * 1024 * 1024),
+ /* double min_clean_fraction = */ 0.25,
+ /* size_t max_size = */ (16 * 1024 * 1024),
+ /* size_t min_size = */ ( 1 * 1024 * 1024),
+ /* long int epoch_length = */ 50000,
+ /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
+ /* double lower_hr_threshold = */ 0.9,
+ /* double increment = */ 2.0,
+ /* hbool_t apply_max_increment = */ TRUE,
+ /* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__add_space,
+ /* double flash_multiple = */ 0.09,
+ /* double flash_threshold = */ 0.5,
+ /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
+ /* hbool_t apply_max_decrement = */ TRUE,
+ /* size_t max_decrement = */ (1 * 1024 * 1024),
+ /* int epochs_before_eviction = */ 3,
+ /* hbool_t apply_empty_reserve = */ TRUE,
+ /* double empty_reserve = */ 0.1,
+ /* int dirty_bytes_threshold = */ (256 * 1024)
+ },
+ {
+ /* 22 -- flash_multiple too big */
+ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
+ /* hbool_t rpt_fcn_enabled = */ FALSE,
+ /* hbool_t open_trace_file = */ FALSE,
+ /* hbool_t close_trace_file = */ FALSE,
+ /* char trace_file_name[] = */ "",
+ /* hbool_t evictions_enabled = */ TRUE,
+ /* hbool_t set_initial_size = */ TRUE,
+ /* size_t initial_size = */ (1 * 1024 * 1024),
+ /* double min_clean_fraction = */ 0.25,
+ /* size_t max_size = */ (16 * 1024 * 1024),
+ /* size_t min_size = */ ( 1 * 1024 * 1024),
+ /* long int epoch_length = */ 50000,
+ /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
+ /* double lower_hr_threshold = */ 0.9,
+ /* double increment = */ 2.0,
+ /* hbool_t apply_max_increment = */ TRUE,
+ /* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__add_space,
+ /* double flash_multiple = */ 10.001,
+ /* double flash_threshold = */ 0.5,
+ /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
+ /* hbool_t apply_max_decrement = */ TRUE,
+ /* size_t max_decrement = */ (1 * 1024 * 1024),
+ /* int epochs_before_eviction = */ 3,
+ /* hbool_t apply_empty_reserve = */ TRUE,
+ /* double empty_reserve = */ 0.1,
+ /* int dirty_bytes_threshold = */ (256 * 1024)
+ },
+ {
+ /* 23 -- flash_threshold too small */
+ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
+ /* hbool_t rpt_fcn_enabled = */ FALSE,
+ /* hbool_t open_trace_file = */ FALSE,
+ /* hbool_t close_trace_file = */ FALSE,
+ /* char trace_file_name[] = */ "",
+ /* hbool_t evictions_enabled = */ TRUE,
+ /* hbool_t set_initial_size = */ TRUE,
+ /* size_t initial_size = */ (1 * 1024 * 1024),
+ /* double min_clean_fraction = */ 0.25,
+ /* size_t max_size = */ (16 * 1024 * 1024),
+ /* size_t min_size = */ ( 1 * 1024 * 1024),
+ /* long int epoch_length = */ 50000,
+ /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
+ /* double lower_hr_threshold = */ 0.9,
+ /* double increment = */ 2.0,
+ /* hbool_t apply_max_increment = */ TRUE,
+ /* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__add_space,
+ /* double flash_multiple = */ 1.0,
+ /* double flash_threshold = */ 0.099,
+ /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
+ /* hbool_t apply_max_decrement = */ TRUE,
+ /* size_t max_decrement = */ (1 * 1024 * 1024),
+ /* int epochs_before_eviction = */ 3,
+ /* hbool_t apply_empty_reserve = */ TRUE,
+ /* double empty_reserve = */ 0.1,
+ /* int dirty_bytes_threshold = */ (256 * 1024)
+ },
+ {
+ /* 24 -- flash_threshold too big */
+ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
+ /* hbool_t rpt_fcn_enabled = */ FALSE,
+ /* hbool_t open_trace_file = */ FALSE,
+ /* hbool_t close_trace_file = */ FALSE,
+ /* char trace_file_name[] = */ "",
+ /* hbool_t evictions_enabled = */ TRUE,
+ /* hbool_t set_initial_size = */ TRUE,
+ /* size_t initial_size = */ (1 * 1024 * 1024),
+ /* double min_clean_fraction = */ 0.25,
+ /* size_t max_size = */ (16 * 1024 * 1024),
+ /* size_t min_size = */ ( 1 * 1024 * 1024),
+ /* long int epoch_length = */ 50000,
+ /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
+ /* double lower_hr_threshold = */ 0.9,
+ /* double increment = */ 2.0,
+ /* hbool_t apply_max_increment = */ TRUE,
+ /* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__add_space,
+ /* double flash_multiple = */ 1.0,
+ /* double flash_threshold = */ 1.001,
+ /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
+ /* double upper_hr_threshold = */ 0.999,
+ /* double decrement = */ 0.9,
+ /* hbool_t apply_max_decrement = */ TRUE,
+ /* size_t max_decrement = */ (1 * 1024 * 1024),
+ /* int epochs_before_eviction = */ 3,
+ /* hbool_t apply_empty_reserve = */ TRUE,
+ /* double empty_reserve = */ 0.1,
+ /* int dirty_bytes_threshold = */ (256 * 1024)
+ },
+ {
+ /* 25 -- bad decr_mode */
+ /* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
+ /* hbool_t rpt_fcn_enabled = */ FALSE,
+ /* hbool_t open_trace_file = */ FALSE,
+ /* hbool_t close_trace_file = */ FALSE,
+ /* char trace_file_name[] = */ "",
+ /* hbool_t evictions_enabled = */ TRUE,
+ /* hbool_t set_initial_size = */ TRUE,
+ /* size_t initial_size = */ (1 * 1024 * 1024),
+ /* double min_clean_fraction = */ 0.25,
+ /* size_t max_size = */ (16 * 1024 * 1024),
+ /* size_t min_size = */ ( 1 * 1024 * 1024),
+ /* long int epoch_length = */ 50000,
+ /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold,
+ /* double lower_hr_threshold = */ 0.9,
+ /* double increment = */ 2.0,
+ /* hbool_t apply_max_increment = */ TRUE,
+ /* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ -1,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2706,7 +2999,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 21 -- upper_hr_threshold too big */
+ /* 26 -- upper_hr_threshold too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2724,6 +3017,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
/* double upper_hr_threshold = */ 1.00001,
/* double decrement = */ 0.9,
@@ -2735,7 +3032,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 22 -- decrement too small */
+ /* 27 -- decrement too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2753,6 +3050,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ -0.0000000001,
@@ -2764,7 +3065,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 23 -- decrement too big */
+ /* 28 -- decrement too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2782,6 +3083,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 1.0000000001,
@@ -2793,7 +3098,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 24 -- epochs_before_eviction too small */
+ /* 29 -- epochs_before_eviction too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2811,6 +3116,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2822,7 +3131,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 24 -- epochs_before_eviction too big */
+ /* 30 -- epochs_before_eviction too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2840,6 +3149,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2851,7 +3164,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 26 -- invalid apply_empty_reserve */
+ /* 31 -- invalid apply_empty_reserve */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2869,6 +3182,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2880,7 +3197,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 27 -- empty_reserve too small */
+ /* 32 -- empty_reserve too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2898,6 +3215,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2909,7 +3230,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 28 -- empty_reserve too big */
+ /* 33 -- empty_reserve too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2927,6 +3248,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -2938,7 +3263,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 29 -- upper_hr_threshold too small */
+ /* 34 -- upper_hr_threshold too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2956,6 +3281,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ -0.000000001,
/* double decrement = */ 0.9,
@@ -2967,7 +3296,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 30 -- upper_hr_threshold too big */
+ /* 35 -- upper_hr_threshold too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -2985,6 +3314,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 1.00000001,
/* double decrement = */ 0.9,
@@ -2996,7 +3329,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 31 -- upper_hr_threshold <= lower_hr_threshold */
+ /* 36 -- upper_hr_threshold <= lower_hr_threshold */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -3014,6 +3347,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.9,
/* double decrement = */ 0.9,
@@ -3025,7 +3362,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 32 -- dirty_bytes_threshold too small */
+ /* 37 -- dirty_bytes_threshold too small */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -3043,6 +3380,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.999,
/* double decrement = */ 0.9,
@@ -3054,7 +3395,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (H5C__MIN_MAX_CACHE_SIZE / 2) - 1
},
{
- /* 33 -- dirty_bytes_threshold too big */
+ /* 38 -- dirty_bytes_threshold too big */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -3072,6 +3413,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold,
/* double upper_hr_threshold = */ 0.9,
/* double decrement = */ 0.9,
@@ -3083,7 +3428,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (H5C__MAX_MAX_CACHE_SIZE / 4) + 1
},
{
- /* 34 -- attempt to disable evictions when auto incr enabled */
+ /* 39 -- attempt to disable evictions when auto incr enabled */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -3101,6 +3446,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__off,
/* double upper_hr_threshold = */ 0.9,
/* double decrement = */ 0.9,
@@ -3112,7 +3461,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* int dirty_bytes_threshold = */ (256 * 1024)
},
{
- /* 35 -- attempt to disable evictions when auto decr enabled */
+ /* 40 -- attempt to disable evictions when auto decr enabled */
/* int version = */ H5C__CURR_AUTO_SIZE_CTL_VER,
/* hbool_t rpt_fcn_enabled = */ FALSE,
/* hbool_t open_trace_file = */ FALSE,
@@ -3130,6 +3479,10 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
/* double increment = */ 2.0,
/* hbool_t apply_max_increment = */ TRUE,
/* size_t max_increment = */ (4 * 1024 * 1024),
+ /* enum H5C_cache_flash_incr_mode */
+ /* flash_incr_mode = */ H5C_flash_incr__off,
+ /* double flash_multiple = */ 2.0,
+ /* double flash_threshold = */ 0.5,
/* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out,
/* double upper_hr_threshold = */ 0.9,
/* double decrement = */ 0.9,
diff --git a/test/cache_common.c b/test/cache_common.c
index d2be959..25eb988 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -1722,6 +1722,91 @@ resize_entry(H5C_t * cache_ptr,
/*-------------------------------------------------------------------------
+ * Function: resize_pinned_entry
+ *
+ * Purpose: Given a pointer to a cache, an entry type, an index, and
+ * a new size, change the size of the target pinned entry
+ * to match the supplied new size.
+ *
+ * Do nothing if pass is false on entry.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 1/11/08
+ *
+ * Modifications:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+resize_pinned_entry(H5C_t * cache_ptr,
+ int32_t type,
+ int32_t idx,
+ size_t new_size)
+{
+ herr_t result;
+ test_entry_t * base_addr;
+ test_entry_t * entry_ptr;
+
+ HDassert( cache_ptr );
+ HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) );
+ HDassert( type = VARIABLE_ENTRY_TYPE ) ;
+ HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes[type] ) );
+
+ if ( pass ) {
+
+ if ( ! entry_in_cache(cache_ptr, type, idx) ) {
+
+ pass = FALSE;
+ failure_mssg = "entry not in cache.";
+
+ } else {
+
+ base_addr = entries[type];
+ entry_ptr = &(base_addr[idx]);
+
+ HDassert( entry_ptr->index == idx );
+ HDassert( entry_ptr->type == type );
+ HDassert( entry_ptr == entry_ptr->self );
+
+ if ( ! ( (entry_ptr->header).is_pinned ) ) {
+
+ pass = FALSE;
+ failure_mssg = "entry to be resized is not pinned.";
+
+ } else {
+
+ entry_ptr->size = new_size;
+
+ result = H5C_resize_pinned_entry(cache_ptr,
+ (void *)entry_ptr,
+ new_size);
+
+ if ( result != SUCCEED ) {
+
+ pass = FALSE;
+ failure_mssg = "error(s) in H5C_resize_pinned_entry().";
+
+ } else {
+
+ HDassert( entry_ptr->size = (entry_ptr->header).size );
+
+ }
+ }
+ }
+ }
+
+ return;
+
+} /* resize_pinned_entry() */
+
+
+/*-------------------------------------------------------------------------
* Function: verify_clean
*
* Purpose: Verify that all cache entries are marked as clean. If any
@@ -2460,6 +2545,12 @@ mark_pinned_entry_dirty(H5C_t * cache_ptr,
entry_ptr->is_dirty = TRUE;
+ if ( size_changed ) {
+
+ /* update entry size now to keep the sanity checks happy */
+ entry_ptr->size = new_size;
+ }
+
result = H5C_mark_pinned_entry_dirty(cache_ptr,
(void *)entry_ptr,
size_changed,
@@ -2472,6 +2563,22 @@ mark_pinned_entry_dirty(H5C_t * cache_ptr,
( entry_ptr->size != entry_ptr->header.size ) ||
( entry_ptr->addr != entry_ptr->header.addr ) ) {
+#if 0 /* This is useful debugging code -- keep it around */
+ HDfprintf(stdout, "result = %ld.\n", (long)result);
+ HDfprintf(stdout, "entry_ptr->header.is_dirty = %d.\n",
+ (int)(entry_ptr->header.is_dirty));
+ HDfprintf(stdout, "entry_ptr->header.is_pinned = %d.\n",
+ (int)(entry_ptr->header.is_pinned));
+ HDfprintf(stdout,
+ "(entry_ptr->header.type != &(types[type])) = %d.\n",
+ (int)(entry_ptr->header.type != &(types[type])));
+ HDfprintf(stdout,
+ "entry_ptr->size = %ld, entry_ptr->header.size = %ld.\n",
+ (long)(entry_ptr->size), (long)(entry_ptr->header.size));
+ HDfprintf(stdout,
+ "entry_ptr->addr = %ld, entry_ptr->header.addr = %ld.\n",
+ (long)(entry_ptr->addr), (long)(entry_ptr->header.addr));
+#endif
pass = FALSE;
failure_mssg = "error in H5C_mark_pinned_entry_dirty().";
diff --git a/test/cache_common.h b/test/cache_common.h
index 23832dc..e1d33f2 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -655,6 +655,11 @@ void resize_entry(H5C_t * cache_ptr,
size_t new_size,
hbool_t resize_pin);
+void resize_pinned_entry(H5C_t * cache_ptr,
+ int32_t type,
+ int32_t idx,
+ size_t new_size);
+
H5C_t * setup_cache(size_t max_cache_size, size_t min_clean_size);
void row_major_scan_forward(H5C_t * cache_ptr,