summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2006-04-28 13:27:54 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2006-04-28 13:27:54 (GMT)
commit8a7b9b3221f192ed0e64b00c3a90d5e6a1fb9e19 (patch)
tree2a4a38cc7b359149409ba55d919031ce9d25e932 /test
parent6a77572c26b354541cafed74bf583e0de0ddfe9a (diff)
downloadhdf5-8a7b9b3221f192ed0e64b00c3a90d5e6a1fb9e19.zip
hdf5-8a7b9b3221f192ed0e64b00c3a90d5e6a1fb9e19.tar.gz
hdf5-8a7b9b3221f192ed0e64b00c3a90d5e6a1fb9e19.tar.bz2
[svn-r12311] Purpose:
Add pinned entry capability to cache. Description: For frequently accessed cache entries, the protect/unprotect overhead is sometimes a bottleneck. Solution: Allow entries to be pinned in the cache. Pinned entries can't be evicted, but can be flushed or modified. Platforms tested: h5committested -- minus one small typo in test/cache.c whose fix was tested on copper and heping only. Misc. update:
Diffstat (limited to 'test')
-rw-r--r--test/cache.c3608
-rw-r--r--test/cache_common.c333
-rw-r--r--test/cache_common.h69
3 files changed, 3986 insertions, 24 deletions
diff --git a/test/cache.c b/test/cache.c
index 58b2af5..3157435 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -42,6 +42,11 @@ static void check_flush_cache__multi_entry_test(H5C_t * cache_ptr,
unsigned int flush_flags,
int spec_size,
struct flush_cache_test_spec spec[]);
+static void check_flush_cache__pe_multi_entry_test(H5C_t * cache_ptr,
+ int test_num,
+ unsigned int flush_flags,
+ int spec_size,
+ struct pe_flush_cache_test_spec spec[]);
static void check_flush_cache__single_entry(H5C_t * cache_ptr);
static void check_flush_cache__single_entry_test(H5C_t * cache_ptr,
int test_num,
@@ -55,17 +60,40 @@ static void check_flush_cache__single_entry_test(H5C_t * cache_ptr,
hbool_t expected_cleared,
hbool_t expected_flushed,
hbool_t expected_destroyed);
+static void check_flush_cache__pinned_single_entry_test(H5C_t * cache_ptr,
+ int test_num,
+ int entry_type,
+ int entry_idx,
+ hbool_t dirty_flag,
+ hbool_t mark_dirty,
+ hbool_t unprotect_unpin,
+ unsigned int flags,
+ unsigned int flush_flags,
+ hbool_t expected_cleared,
+ hbool_t expected_flushed,
+ hbool_t expected_destroyed);
static void check_flush_protected_err(void);
+static void check_rename_entry(void);
+static void check_rename_entry__run_test(H5C_t * cache_ptr, int test_num,
+ struct rename_entry_test_spec * spec_ptr);
+static void check_pin_protected_entry(void);
+static void check_destroy_pinned_err(void);
static void check_destroy_protected_err(void);
static void check_duplicate_insert_err(void);
static void check_rename_err(void);
+static void check_double_pin_err(void);
+static void check_double_unpin_err(void);
+static void check_pin_entry_errs(void);
+static void check_pin_protected_entry(void);
static void check_double_protect_err(void);
static void check_double_unprotect_err(void);
+static void check_mark_pinned_entry_dirty_errs(void);
static void check_auto_cache_resize(void);
static void check_auto_cache_resize_disable(void);
static void check_auto_cache_resize_epoch_markers(void);
static void check_auto_cache_resize_input_errs(void);
static void check_auto_cache_resize_aux_fcns(void);
+static void check_get_entry_status(void);
/**************************************************************************/
@@ -253,9 +281,13 @@ smoke_check_1(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* smoke_check_1() */
@@ -440,9 +472,13 @@ smoke_check_2(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* smoke_check_2() */
@@ -626,9 +662,13 @@ smoke_check_3(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* smoke_check_3() */
@@ -813,9 +853,13 @@ smoke_check_4(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* smoke_check_4() */
@@ -1044,9 +1088,13 @@ smoke_check_5(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* smoke_check_5() */
@@ -1275,9 +1323,13 @@ smoke_check_6(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* smoke_check_6() */
@@ -1507,9 +1559,13 @@ smoke_check_7(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* smoke_check_7() */
@@ -1739,9 +1795,13 @@ smoke_check_8(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* smoke_check_8() */
@@ -1915,9 +1975,11 @@ write_permitted_check(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
@@ -1927,6 +1989,8 @@ write_permitted_check(void)
#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
+ return;
+
} /* write_permitted_check() */
@@ -1999,9 +2063,13 @@ check_flush_cache(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_flush_cache() */
@@ -2109,6 +2177,9 @@ check_flush_cache__empty_cache(H5C_t * cache_ptr)
*
* Modifications:
*
+ * JRM -- 4/5/06
+ * Added pinned entry tests.
+ *
*-------------------------------------------------------------------------
*/
@@ -3127,6 +3198,747 @@ check_flush_cache__multi_entry(H5C_t * cache_ptr)
flush_flags, spec_size, spec);
}
+ /* Now do pinned entry tests:
+ *
+ * For the most part, this test is directed at testing the ability
+ * of the flush routine to unravel collections of pinned entries.
+ */
+
+ if ( pass )
+ {
+ int test_num = 1;
+ unsigned int flush_flags = H5C__NO_FLAGS_SET;
+ int spec_size = 8;
+ struct pe_flush_cache_test_spec spec[8] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 100,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 75,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 2,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 25,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 2,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 3,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 50,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 3,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 4,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 10,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 4,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 5,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 20,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 5,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 6,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 30,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 6,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ },
+ {
+ /* entry_num = */ 7,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 40,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 7,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, 10, 20, 30, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ FALSE
+ }
+ };
+
+ check_flush_cache__pe_multi_entry_test(cache_ptr, test_num,
+ flush_flags, spec_size, spec);
+ }
+
+
+ if ( pass )
+ {
+ int test_num = 2;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG;
+ int spec_size = 8;
+ struct pe_flush_cache_test_spec spec[8] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 100,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 75,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 2,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 25,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 2,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 3,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 50,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 3,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 4,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 10,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 5,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 20,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE,
+ -1, -1, -1, -1 -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {10, -1, -1, -1 -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 6,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 30,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 2,
+ /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {10, 20, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 7,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 40,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 3,
+ /* pin_type[MAX_PINS] = */ {MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ MONSTER_ENTRY_TYPE,
+ -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {10, 20, 30, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ }
+ };
+
+ check_flush_cache__pe_multi_entry_test(cache_ptr, test_num,
+ flush_flags, spec_size, spec);
+ }
+
+ if ( pass )
+ {
+ int test_num = 3;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG;
+ int spec_size = 8;
+ struct pe_flush_cache_test_spec spec[8] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 100,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 75,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 2,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 25,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 3,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 50,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 4,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 10,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 5,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 20,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 6,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 30,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 7,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 40,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ }
+ };
+
+ check_flush_cache__pe_multi_entry_test(cache_ptr, test_num,
+ flush_flags, spec_size, spec);
+ }
+
+
+ if ( pass )
+ {
+ int test_num = 4;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG |
+ H5C__FLUSH_MARKED_ENTRIES_FLAG;
+ int spec_size = 8;
+ struct pe_flush_cache_test_spec spec[8] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 100,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 75,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 2,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 25,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 3,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 50,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 4,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 10,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 5,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 20,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 4,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 6,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 30,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 4,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ PICO_ENTRY_TYPE,
+ -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, 75, 25, 50, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 7,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 40,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ FALSE,
+ /* expected_flushed = */ TRUE,
+ /* expected_destroyed = */ TRUE
+ }
+ };
+
+ check_flush_cache__pe_multi_entry_test(cache_ptr, test_num,
+ flush_flags, spec_size, spec);
+ }
+
+
+ if ( pass )
+ {
+ int test_num = 5;
+ unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG |
+ H5C__FLUSH_MARKED_ENTRIES_FLAG;
+ int spec_size = 8;
+ struct pe_flush_cache_test_spec spec[8] =
+ {
+ {
+ /* entry_num = */ 0,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 100,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 0,
+ /* pin_type[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {-1, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 1,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 75,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 2,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 25,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 3,
+ /* entry_type = */ PICO_ENTRY_TYPE,
+ /* entry_index = */ 50,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__NO_FLAGS_SET,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 4,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 10,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 5,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 20,
+ /* insert_flag = */ FALSE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ TRUE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 6,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 30,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ FALSE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ },
+ {
+ /* entry_num = */ 7,
+ /* entry_type = */ MONSTER_ENTRY_TYPE,
+ /* entry_index = */ 40,
+ /* insert_flag = */ TRUE,
+ /* dirty_flag = */ TRUE,
+ /* flags = */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* num_pins = */ 1,
+ /* pin_type[MAX_PINS] = */ {PICO_ENTRY_TYPE,
+ -1, -1, -1, -1, -1, -1, -1},
+ /* pin_idx[MAX_PINS] = */ {100, -1, -1, -1, -1, -1, -1, -1},
+ /* expected_loaded = */ FALSE,
+ /* expected_cleared = */ TRUE,
+ /* expected_flushed = */ FALSE,
+ /* expected_destroyed = */ TRUE
+ }
+ };
+
+ check_flush_cache__pe_multi_entry_test(cache_ptr, test_num,
+ flush_flags, spec_size, spec);
+ }
+
+ return;
+
} /* check_flush_cache__multi_entry() */
@@ -3342,10 +4154,241 @@ check_flush_cache__multi_entry_test(H5C_t * cache_ptr,
i++;
}
+ return;
+
} /* check_flush_cache__multi_entry_test() */
/*-------------------------------------------------------------------------
+ * Function: check_flush_cache__pe_multi_entry_test()
+ *
+ * Purpose: Run a multi entry flush cache test.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 4/5/06
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_flush_cache__pe_multi_entry_test(H5C_t * cache_ptr,
+ int test_num,
+ unsigned int flush_flags,
+ int spec_size,
+ struct pe_flush_cache_test_spec spec[])
+{
+ /* const char * fcn_name = "check_flush_cache__pe_multi_entry_test"; */
+ static char msg[128];
+ herr_t result;
+ int i;
+ int j;
+ size_t total_entry_size = 0;
+ test_entry_t * base_addr;
+ test_entry_t * entry_ptr;
+
+ if ( cache_ptr == NULL ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "cache_ptr NULL on entry to pe multi entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ else if ( ( cache_ptr->index_len != 0 ) ||
+ ( cache_ptr->index_size != 0 ) ) {
+
+ pass = FALSE;
+
+ HDsnprintf(msg, (size_t)128,
+ "cache not empty at beginning of pe multi entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ else if ( ( spec_size < 1 ) || ( spec == NULL ) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "missing/bad test spec on entry to pe multi entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+
+ i = 0;
+ while ( ( pass ) && ( i < spec_size ) )
+ {
+ if ( ( spec[i].entry_num != i ) ||
+ ( spec[i].entry_type < 0 ) ||
+ ( spec[i].entry_type >= NUMBER_OF_ENTRY_TYPES ) ||
+ ( spec[i].entry_index < 0 ) ||
+ ( spec[i].entry_index > max_indices[spec[i].entry_type] ) ||
+ ( spec[i].num_pins < 0 ) ||
+ ( spec[i].num_pins > MAX_PINS ) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "bad data in spec[%d] on entry to pe multi entry test #%d.",
+ i, test_num);
+ failure_mssg = msg;
+ }
+ i++;
+ }
+
+ i = 0;
+ while ( ( pass ) && ( i < spec_size ) )
+ {
+ if ( spec[i].insert_flag ) {
+
+ insert_entry(cache_ptr, spec[i].entry_type, spec[i].entry_index,
+ spec[i].dirty_flag, spec[i].flags);
+
+ } else {
+
+ protect_entry(cache_ptr, spec[i].entry_type, spec[i].entry_index);
+
+ unprotect_entry(cache_ptr, spec[i].entry_type, spec[i].entry_index,
+ (int)(spec[i].dirty_flag), spec[i].flags);
+ }
+
+ total_entry_size += entry_sizes[spec[i].entry_type];
+
+ for ( j = 0; j < spec[i].num_pins; j++ )
+ {
+ create_pinned_entry_dependency(cache_ptr,
+ spec[i].entry_type,
+ spec[i].entry_index,
+ spec[i].pin_type[j],
+ spec[i].pin_idx[j]);
+ }
+
+ i++;
+ }
+
+ if ( pass ) {
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, flush_flags);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "flush with flags 0x%x failed in pe multi entry test #%d.",
+ flush_flags, test_num);
+ failure_mssg = msg;
+ }
+ }
+
+ i = 0;
+ while ( ( pass ) && ( i < spec_size ) )
+ {
+ base_addr = entries[spec[i].entry_type];
+ entry_ptr = &(base_addr[spec[i].entry_index]);
+
+ if ( ( entry_ptr->loaded != spec[i].expected_loaded ) ||
+ ( entry_ptr->cleared != spec[i].expected_cleared ) ||
+ ( entry_ptr->flushed != spec[i].expected_flushed ) ||
+ ( entry_ptr->destroyed != spec[i].expected_destroyed ) ) {
+
+#if 0 /* This is useful debugging code. Lets keep it around. */
+
+ HDfprintf(stdout,
+ "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n",
+ (int)(entry_ptr->loaded),
+ (int)(spec[i].expected_loaded),
+ (int)(entry_ptr->cleared),
+ (int)(spec[i].expected_cleared),
+ (int)(entry_ptr->flushed),
+ (int)(spec[i].expected_flushed),
+ (int)(entry_ptr->destroyed),
+ (int)(spec[i].expected_destroyed));
+
+#endif
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Bad status on entry %d after flush in pe multi entry test #%d.",
+ i, test_num);
+ failure_mssg = msg;
+ }
+ i++;
+ }
+
+ if ( pass ) {
+
+ if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 )
+ &&
+ ( ( cache_ptr->index_len != spec_size )
+ ||
+ ( cache_ptr->index_size != total_entry_size )
+ )
+ )
+ ||
+ ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 )
+ &&
+ ( ( cache_ptr->index_len != 0 )
+ ||
+ ( cache_ptr->index_size != 0 )
+ )
+ )
+ ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Unexpected cache len/size after flush in pe multi entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ }
+
+ /* clean up the cache to prep for the next test */
+ if ( pass ) {
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr,
+ H5C__FLUSH_INVALIDATE_FLAG);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Flush failed on cleanup in pe multi entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ else if ( ( cache_ptr->index_len != 0 ) ||
+ ( cache_ptr->index_size != 0 ) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Unexpected cache len/size after cleanup in pe multi entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+
+ }
+ }
+
+ i = 0;
+ while ( ( pass ) && ( i < spec_size ) )
+ {
+ base_addr = entries[spec[i].entry_type];
+ entry_ptr = &(base_addr[spec[i].entry_index]);
+
+ entry_ptr->loaded = FALSE;
+ entry_ptr->cleared = FALSE;
+ entry_ptr->flushed = FALSE;
+ entry_ptr->destroyed = FALSE;
+
+ i++;
+ }
+
+ return;
+
+} /* check_flush_cache__pe_multi_entry_test() */
+
+
+/*-------------------------------------------------------------------------
* Function: check_flush_cache__single_entry()
*
* Purpose: Verify that flush_cache behaves as expected when the cache
@@ -3358,6 +4401,9 @@ check_flush_cache__multi_entry_test(H5C_t * cache_ptr,
*
* Modifications:
*
+ * JRM -- 3/29/06
+ * Added tests for pinned entries.
+ *
*-------------------------------------------------------------------------
*/
@@ -4634,6 +5680,1257 @@ check_flush_cache__single_entry(H5C_t * cache_ptr)
);
}
+ /* Now run single entry tests for pinned entries. Test all combinations
+ * of:
+ *
+ * 1) Unpin by unprotect vs. unpin by call to H5C_unpin_entry().
+ *
+ * 2) Marked dirty by unprotect or not.
+ *
+ * 3) Marked dirty by call to H5C_mark_pinned_entry_dirty() or not.
+ *
+ * 4) Entry marked for flush or not.
+ *
+ * 5) Call flush with H5C__FLUSH_MARKED_ENTRIES_FLAG or not.
+ *
+ * 6) Call flush with H5C__FLUSH_CLEAR_ONLY_FLAG or not.
+ *
+ * This yields a total of 64 tests.
+ */
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 1,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 2,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 3,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 4,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 5,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 6,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 7,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 8,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 9,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 10,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 11,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 12,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 13,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 14,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 15,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 16,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__NO_FLAGS_SET,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 17,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 18,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 19,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 20,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 21,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 22,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 23,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 24,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 25,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 26,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 27,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 28,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 29,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE, /* can't mark a clean entry */
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 30,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE, /* can't makr a clean entry */
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 31,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 32,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ TRUE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 33,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 34,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 35,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 36,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 37,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 38,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 39,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 40,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 41,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 42,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 43,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 44,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 45,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 46,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 47,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 48,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 49,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 50,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 51,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 52,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 53,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 54,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 55,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 56,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__NO_FLAGS_SET,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 57,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 58,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 59,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 60,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ FALSE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 61,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE, /* can't mark a clean entry */
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 62,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ FALSE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ FALSE,
+ /* expected_flushed */ FALSE, /* can't makr a clean entry */
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 63,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ FALSE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ if ( pass ) {
+
+ check_flush_cache__pinned_single_entry_test
+ (
+ /* cache_ptr */ cache_ptr,
+ /* test_num */ 64,
+ /* entry_type */ PICO_ENTRY_TYPE,
+ /* entry_idx */ 0,
+ /* dirty_flag */ TRUE,
+ /* mark_dirty */ TRUE,
+ /* unprotect_unpin */ TRUE,
+ /* flags */ H5C__SET_FLUSH_MARKER_FLAG,
+ /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG |
+ H5C__FLUSH_CLEAR_ONLY_FLAG,
+ /* expected_cleared */ TRUE,
+ /* expected_flushed */ FALSE,
+ /* expected_destroyed */ FALSE
+ );
+ }
+
+ return;
+
} /* check_flush_cache__single_entry() */
@@ -4808,10 +7105,559 @@ check_flush_cache__single_entry_test(H5C_t * cache_ptr,
entry_ptr->destroyed = FALSE;
}
}
+
+ return;
+
+} /* check_flush_cache__single_entry_test() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: check_flush_cache__pinned_single_entry_test()
+ *
+ * Purpose: Run a pinned single entry flush cache test.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 3/28/06
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_flush_cache__pinned_single_entry_test(H5C_t * cache_ptr,
+ int test_num,
+ int entry_type,
+ int entry_idx,
+ hbool_t dirty_flag,
+ hbool_t mark_dirty,
+ hbool_t unprotect_unpin,
+ unsigned int flags,
+ unsigned int flush_flags,
+ hbool_t expected_cleared,
+ hbool_t expected_flushed,
+ hbool_t expected_destroyed)
+{
+ /* const char *fcn_name = "check_flush_cache__pinned_single_entry_test"; */
+ static char msg[128];
+ hbool_t expected_loaded = TRUE;
+ herr_t result;
+ test_entry_t * base_addr;
+ test_entry_t * entry_ptr;
+
+ if ( cache_ptr == NULL ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "cache_ptr NULL on entry to pinned single entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ else if ( ( cache_ptr->index_len != 0 ) ||
+ ( cache_ptr->index_size != 0 ) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "cache not empty at beginning of pinned single entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ else if ( ( entry_type < 0 ) || ( entry_type >= NUMBER_OF_ENTRY_TYPES ) ||
+ ( entry_idx < 0 ) || ( entry_idx > max_indices[entry_type] ) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Bad parameters on entry to single entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+
+ if ( pass ) {
+
+ base_addr = entries[entry_type];
+ entry_ptr = &(base_addr[entry_idx]);
+
+ protect_entry(cache_ptr, entry_type, entry_idx);
+
+ unprotect_entry(cache_ptr, entry_type, entry_idx,
+ (int)dirty_flag, (flags | H5C__PIN_ENTRY_FLAG));
+
+ if ( mark_dirty ) {
+
+ mark_pinned_entry_dirty(cache_ptr, entry_type, entry_idx,
+ FALSE, (size_t)0);
+ }
+ }
+
+ if ( pass ) {
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr, flush_flags);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "flush with flags 0x%x failed in pinned single entry test #%d.",
+ flush_flags, test_num);
+ failure_mssg = msg;
+ }
+ else if ( ( entry_ptr->loaded != expected_loaded ) ||
+ ( entry_ptr->cleared != expected_cleared ) ||
+ ( entry_ptr->flushed != expected_flushed ) ||
+ ( entry_ptr->destroyed != expected_destroyed ) ) {
+
+ HDfprintf(stdout,
+ "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n",
+ (int)(entry_ptr->loaded),
+ (int)expected_loaded,
+ (int)(entry_ptr->cleared),
+ (int)expected_cleared,
+ (int)(entry_ptr->flushed),
+ (int)expected_flushed,
+ (int)(entry_ptr->destroyed),
+ (int)expected_destroyed);
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Unexpected entry status after flush in single entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ else if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 )
+ &&
+ ( ( cache_ptr->index_len != 1 )
+ ||
+ ( cache_ptr->index_size != entry_sizes[entry_type] )
+ )
+ )
+ ||
+ ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 )
+ &&
+ ( ( cache_ptr->index_len != 0 )
+ ||
+ ( cache_ptr->index_size != 0 )
+ )
+ )
+ ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Unexpected cache len/size after flush in pinned single entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ }
+
+
+ /* clean up the cache to prep for the next test */
+ if ( pass ) {
+
+ if ( unprotect_unpin ) {
+
+ protect_entry(cache_ptr, entry_type, entry_idx);
+
+ unprotect_entry(cache_ptr, entry_type, entry_idx,
+ (int)dirty_flag, H5C__UNPIN_ENTRY_FLAG);
+
+ } else {
+
+ unpin_entry(cache_ptr, entry_type, entry_idx);
+
+ }
+ }
+
+ if ( pass ) {
+
+ result = H5C_flush_cache(NULL, -1, -1, cache_ptr,
+ H5C__FLUSH_INVALIDATE_FLAG);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Flush failed on cleanup in single entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ else if ( ( cache_ptr->index_len != 0 ) ||
+ ( cache_ptr->index_size != 0 ) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Unexpected cache len/size after cleanup in pinned single entry test #%d.",
+ test_num);
+ failure_mssg = msg;
+
+ } else {
+
+ entry_ptr->loaded = FALSE;
+ entry_ptr->cleared = FALSE;
+ entry_ptr->flushed = FALSE;
+ entry_ptr->destroyed = FALSE;
+ }
+ }
+
+ return;
+
} /* check_flush_cache__single_entry_test() */
/*-------------------------------------------------------------------------
+ * Function: check_rename_entry()
+ *
+ * Purpose: Verify that H5C_rename_entry behaves as expected. In
+ * particular, verify that it works correctly with pinned
+ * entries.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 4/26/06
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_rename_entry(void)
+{
+ const char * fcn_name = "check_rename_entry";
+ int i;
+ H5C_t * cache_ptr = NULL;
+ struct rename_entry_test_spec test_specs[4] =
+ {
+ {
+ /* int entry_type = */ PICO_ENTRY_TYPE,
+ /* int entry_index = */ 10,
+ /* hbool_t is_dirty = */ FALSE,
+ /* hbool_t is_pinned = */ FALSE
+ },
+ {
+ /* int entry_type = */ PICO_ENTRY_TYPE,
+ /* int entry_index = */ 20,
+ /* hbool_t is_dirty = */ TRUE,
+ /* hbool_t is_pinned = */ FALSE
+ },
+ {
+ /* int entry_type = */ PICO_ENTRY_TYPE,
+ /* int entry_index = */ 30,
+ /* hbool_t is_dirty = */ FALSE,
+ /* hbool_t is_pinned = */ TRUE
+ },
+ {
+ /* int entry_type = */ PICO_ENTRY_TYPE,
+ /* int entry_index = */ 40,
+ /* hbool_t is_dirty = */ TRUE,
+ /* hbool_t is_pinned = */ TRUE
+ }
+ };
+
+ TESTING("H5C_rename_entry() functionality");
+
+ pass = TRUE;
+
+ /* allocate a cache, load entries into it, and then rename
+ * them. To the extent possible, verify that the desired
+ * actions took place.
+ *
+ * At present, we should do the following tests:
+ *
+ * 1) Rename a clean, unprotected, unpinned entry.
+ *
+ * 2) Rename a dirty, unprotected, unpinned entry.
+ *
+ * 3) Rename a clean, unprotected, pinned entry.
+ *
+ * 4) Rename a dirty, unprotected, pinned entry.
+ *
+ * In all cases, the entry should have moved to its
+ * new location, and have been marked dirty if it wasn't
+ * already.
+ *
+ * Unpinned entries should have been moved to the head
+ * of the LRU list.
+ *
+ * Pinned entries should remain untouched on the pinned entry
+ * list.
+ */
+
+ if ( pass ) {
+
+ reset_entries();
+
+ cache_ptr = setup_cache((size_t)(2 * 1024 * 1024),
+ (size_t)(1 * 1024 * 1024));
+ }
+
+ i = 0;
+ while ( ( pass ) && ( i < 4 ) )
+ {
+ check_rename_entry__run_test(cache_ptr, i, &(test_specs[i]));
+ i++;
+ }
+
+ if ( pass ) {
+
+ takedown_cache(cache_ptr, FALSE, FALSE);
+ }
+
+ if ( pass ) { PASSED(); } else { H5_FAILED(); }
+
+ if ( ! pass ) {
+
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
+ fcn_name, failure_mssg);
+ }
+
+ return;
+
+} /* check_rename_entry() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: check_rename_entry__run_test()
+ *
+ * Purpose: Run a rename entry test.
+ *
+ * Do nothing if pass is FALSE on entry.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 4/27/06
+ *
+ * Modifications:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_rename_entry__run_test(H5C_t * cache_ptr,
+ int test_num,
+ struct rename_entry_test_spec * spec_ptr)
+{
+ /* const char * fcn_name = "check_rename_entry__run_test"; */
+ static char msg[128];
+ unsigned int flags = H5C__NO_FLAGS_SET;
+ test_entry_t * base_addr;
+ test_entry_t * entry_ptr;
+ H5C_cache_entry_t * test_ptr = NULL;
+
+ if ( cache_ptr == NULL ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "cache_ptr NULL on entry to rename test #%d.",
+ test_num);
+ failure_mssg = msg;
+
+ } else if ( spec_ptr == NULL ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "spec_ptr NULL on entry to rename test #%d.",
+ test_num);
+ failure_mssg = msg;
+
+ }
+
+ if ( pass ) {
+
+ base_addr = entries[spec_ptr->entry_type];
+ entry_ptr = &(base_addr[spec_ptr->entry_index]);
+
+ if ( ( entry_ptr->self != entry_ptr ) ||
+ ( ( entry_ptr->cache_ptr != cache_ptr ) &&
+ ( entry_ptr->cache_ptr != NULL ) ) ||
+ ( ! ( entry_ptr->at_main_addr ) ) ||
+ ( entry_ptr->addr != entry_ptr->main_addr ) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "bad entry_ptr in rename test #%d.",
+ test_num);
+ failure_mssg = msg;
+
+ } else if ( spec_ptr->is_pinned ) {
+
+ flags |= H5C__PIN_ENTRY_FLAG;
+ }
+ }
+
+ protect_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index);
+
+ unprotect_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index,
+ (int)(spec_ptr->is_dirty), flags);
+
+ rename_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, FALSE);
+
+ if ( pass ) {
+
+ /* verify that the rename took place, and that the cache's internal
+ * structures are as expected. Note that some sanity checking is
+ * done by rename_entry(), so we don't have to repeat it here.
+ */
+
+ if ( spec_ptr->is_pinned ) {
+
+ if ( ! ( entry_ptr->header.is_pinned ) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Pinned entry not pinned after rename in test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+
+ if ( pass ) {
+
+ test_ptr = cache_ptr->pel_head_ptr;
+
+ while ( ( test_ptr != NULL ) &&
+ ( test_ptr != (H5C_cache_entry_t *)entry_ptr ) )
+ {
+ test_ptr = test_ptr->next;
+ }
+
+ if ( test_ptr == NULL ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Pinned entry not in pel after rename in test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ }
+
+ unpin_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index);
+
+ } else {
+
+ if ( entry_ptr->header.is_pinned ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Unpinned entry pinned after rename in test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+
+ if ( ( entry_ptr->header.prev != NULL ) ||
+ ( cache_ptr->LRU_head_ptr != (H5C_cache_entry_t *)entry_ptr ) )
+ {
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "Entry not at head of LRU after rename in test #%d.",
+ test_num);
+ failure_mssg = msg;
+ }
+ }
+ }
+
+ /* put the entry back where it started from */
+ rename_entry(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, TRUE);
+
+ return;
+
+} /* check_rename_entry__run_test() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: check_pin_protected_entry()
+ *
+ * Purpose: Verify that H5C_pin_protected_entry behaves as expected.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 4/28/06
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_pin_protected_entry(void)
+{
+ const char * fcn_name = "check_pin_protected_entry";
+ static char msg[128];
+ herr_t result;
+ H5C_t * cache_ptr = NULL;
+ test_entry_t * base_addr;
+ test_entry_t * entry_ptr;
+
+ TESTING("H5C_pin_protected_entry() functionality");
+
+ pass = TRUE;
+
+ /* Create a cache, protect an entry, and then use H5C_pin_protected_entry()
+ * to pin it. Verify that the entry is in fact pined. Unprotect the entry
+ * to unpin it, and then destroy the cache.
+ */
+
+ if ( pass ) {
+
+ reset_entries();
+
+ cache_ptr = setup_cache((size_t)(2 * 1024 * 1024),
+ (size_t)(1 * 1024 * 1024));
+ }
+
+ protect_entry(cache_ptr, 0, 0);
+
+ if ( pass ) {
+
+ base_addr = entries[0];
+ entry_ptr = &(base_addr[0]);
+
+ result = H5C_pin_protected_entry(cache_ptr, (void *)entry_ptr);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "H5C_pin_protected_entry() reports failure.");
+ failure_mssg = msg;
+
+ } else if ( ! ( entry_ptr->header.is_pinned ) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128, "entry not pinned when it should be.");
+ failure_mssg = msg;
+
+ } else {
+
+ entry_ptr->is_pinned = TRUE;
+ }
+ }
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__UNPIN_ENTRY_FLAG);
+
+ if ( pass ) {
+
+ takedown_cache(cache_ptr, FALSE, FALSE);
+ }
+
+ if ( pass ) { PASSED(); } else { H5_FAILED(); }
+
+ if ( ! pass ) {
+
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
+ fcn_name, failure_mssg);
+ }
+
+ return;
+
+} /* check_pin_protected_entry() */
+
+
+/*-------------------------------------------------------------------------
* Function: check_flush_protected_err()
*
* Purpose: Verify that an attempt to flush the cache when it contains
@@ -4876,14 +7722,91 @@ check_flush_protected_err(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_flush_protected_err() */
/*-------------------------------------------------------------------------
+ * Function: check_destroy_pinned_err()
+ *
+ * Purpose: Verify that an attempt to destroy the cache when it contains
+ * a pinned entry that can't be unpined during the flush destroy
+ * will generate an error.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 4/7/06
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_destroy_pinned_err(void)
+{
+ const char * fcn_name = "check_destroy_pinned_err()";
+ H5C_t * cache_ptr = NULL;
+
+ TESTING("destroy cache with permanently pinned entry error");
+
+ pass = TRUE;
+
+ /* allocate a cache, pin an entry, and try to flush destroy. This
+ * should fail. Unpin the entry and flush destroy again -- should
+ * succeed.
+ */
+
+ if ( pass ) {
+
+ reset_entries();
+
+ cache_ptr = setup_cache((size_t)(2 * 1024),
+ (size_t)(1 * 1024));
+
+ protect_entry(cache_ptr, 0, 0);
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG);
+
+ if ( H5C_dest(NULL, -1, -1, cache_ptr) >= 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "destroy succeeded on cache with pinned entry.\n";
+
+ } else {
+
+ unpin_entry(cache_ptr, 0, 0);
+
+ if ( H5C_dest(NULL, -1, -1, cache_ptr) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "destroy failed after unpin.\n";
+
+ }
+ }
+ }
+
+ if ( pass ) { PASSED(); } else { H5_FAILED(); }
+
+ if ( ! pass ) {
+
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
+ fcn_name, failure_mssg);
+ }
+
+ return;
+
+} /* check_destroy_pinned_err() */
+
+
+/*-------------------------------------------------------------------------
* Function: check_destroy_protected_err()
*
* Purpose: Verify that an attempt to destroy the cache when it contains
@@ -4943,9 +7866,13 @@ check_destroy_protected_err(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_destroy_protected_err() */
@@ -5018,9 +7945,13 @@ check_duplicate_insert_err(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_duplicate_insert_err() */
@@ -5107,14 +8038,316 @@ check_rename_err(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_rename_err() */
/*-------------------------------------------------------------------------
+ * Function: check_double_pin_err()
+ *
+ * Purpose: Verify that an attempt to pin an entry that is already
+ * pinned will generate an error.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 4/24/06
+ *
+ * Modifications:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_double_pin_err(void)
+{
+ const char * fcn_name = "check_double_pin_err()";
+ herr_t result;
+ H5C_t * cache_ptr = NULL;
+ test_entry_t * entry_ptr;
+
+ TESTING("pin a pinned entry error");
+
+ pass = TRUE;
+
+ /* allocate a cache, protect an entry, unprotect it with the pin flag,
+ * protect it again, and then try to unprotect it again with the pin
+ * flag. This should fail. Unpin the entry and destroy the cache
+ * -- should succeed.
+ */
+
+ if ( pass ) {
+
+ reset_entries();
+
+ cache_ptr = setup_cache((size_t)(2 * 1024),
+ (size_t)(1 * 1024));
+
+ protect_entry(cache_ptr, 0, 0);
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG);
+
+ protect_entry(cache_ptr, 0, 0);
+
+ entry_ptr = &((entries[0])[0]);
+ }
+
+ if ( pass ) {
+
+ result = H5C_unprotect(NULL, -1, -1, cache_ptr, &(types[0]),
+ entry_ptr->addr, (void *)entry_ptr,
+ H5C__PIN_ENTRY_FLAG, 0);
+
+ if ( result > 0 ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "attempt to pin a pinned entry succeeded.\n";
+
+ } else {
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__UNPIN_ENTRY_FLAG);
+ }
+ }
+
+ if ( pass ) {
+
+ takedown_cache(cache_ptr, FALSE, FALSE);
+ }
+
+ if ( pass ) { PASSED(); } else { H5_FAILED(); }
+
+ if ( ! pass ) {
+
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
+ fcn_name, failure_mssg);
+ }
+
+ return;
+
+} /* check_double_pin_err() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: check_double_unpin_err()
+ *
+ * Purpose: Verify that an attempt to unpin an unpinned entry will
+ * generate an error.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 4/24/06
+ *
+ * Modifications:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_double_unpin_err(void)
+{
+ const char * fcn_name = "check_double_unpin_err()";
+ herr_t result;
+ H5C_t * cache_ptr = NULL;
+ test_entry_t * entry_ptr;
+
+ TESTING("unpin an unpinned entry error");
+
+ pass = TRUE;
+
+ /* allocate a cache, protect an entry, unprotect it with the unpin flag.
+ * -- This should fail.
+ *
+ * Try again with H5C_unpin_entry -- this should also fail.
+ *
+ * Destroy the cache -- should succeed.
+ */
+
+ if ( pass ) {
+
+ reset_entries();
+
+ cache_ptr = setup_cache((size_t)(2 * 1024),
+ (size_t)(1 * 1024));
+
+ protect_entry(cache_ptr, 0, 0);
+
+ entry_ptr = &((entries[0])[0]);
+ }
+
+ if ( pass ) {
+
+ result = H5C_unprotect(NULL, -1, -1, cache_ptr, &(types[0]),
+ entry_ptr->addr, (void *)entry_ptr,
+ H5C__UNPIN_ENTRY_FLAG, 0);
+
+ if ( result > 0 ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "attempt to unpin an unpinned entry succeeded 1.\n";
+
+ } else {
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET);
+ }
+ }
+
+ if ( pass ) {
+
+ result = H5C_unpin_entry(cache_ptr, (void *)entry_ptr);
+
+ if ( result > 0 ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "attempt to unpin an unpinned entry succeeded 2.\n";
+
+ }
+ }
+
+ if ( pass ) {
+
+ takedown_cache(cache_ptr, FALSE, FALSE);
+ }
+
+ if ( pass ) { PASSED(); } else { H5_FAILED(); }
+
+ if ( ! pass ) {
+
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
+ fcn_name, failure_mssg);
+ }
+
+ return;
+
+} /* check_double_unpin_err() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: check_pin_entry_errs()
+ *
+ * Purpose: Verify that invalid calls to H5C_pin_protected_entry()
+ * generate errors as expected.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 4/24/06
+ *
+ * Modifications:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_pin_entry_errs(void)
+{
+ const char * fcn_name = "check_pin_entry_errs()";
+ herr_t result;
+ H5C_t * cache_ptr = NULL;
+ test_entry_t * entry_ptr;
+
+ TESTING("pin entry related errors");
+
+ pass = TRUE;
+
+ /* Allocate a cache, protect an entry, unprotect it with no flags,
+ * and then call H5C_pin_protected_entry() to pin it -- This should fail.
+ *
+ * Protect the entry again, unprotect it with a pin flag, protect it
+ * again, and then call H5C_pin_protected_entry() to pin it -- This
+ * should fail also.
+ *
+ * Unprotect the entry with the unpin flag.
+ *
+ * Destroy the cache -- should succeed.
+ */
+
+ if ( pass ) {
+
+ reset_entries();
+
+ cache_ptr = setup_cache((size_t)(2 * 1024),
+ (size_t)(1 * 1024));
+
+ protect_entry(cache_ptr, 0, 0);
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET);
+
+ entry_ptr = &((entries[0])[0]);
+ }
+
+ if ( pass ) {
+
+ result = H5C_pin_protected_entry(cache_ptr, (void *)entry_ptr);
+
+ if ( result > 0 ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "attempt to pin an unprotected entry succeeded.\n";
+
+ } else {
+
+ protect_entry(cache_ptr, 0, 0);
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG);
+
+ protect_entry(cache_ptr, 0, 0);
+ }
+ }
+
+ if ( pass ) {
+
+ result = H5C_pin_protected_entry(cache_ptr, (void *)entry_ptr);
+
+ if ( result > 0 ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "attempt to pin a pinned, protected entry succeeded.\n";
+
+ } else {
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__UNPIN_ENTRY_FLAG);
+
+ }
+ }
+
+ if ( pass ) {
+
+ takedown_cache(cache_ptr, FALSE, FALSE);
+ }
+
+ if ( pass ) { PASSED(); } else { H5_FAILED(); }
+
+ if ( ! pass ) {
+
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
+ fcn_name, failure_mssg);
+ }
+
+ return;
+
+} /* check_pin_entry_errs() */
+
+
+/*-------------------------------------------------------------------------
* Function: check_double_protect_err()
*
* Purpose: Verify that an attempt to protect an entry that is already
@@ -5183,9 +8416,13 @@ check_double_protect_err(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_double_protect_err() */
@@ -5266,14 +8503,128 @@ check_double_unprotect_err(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_double_unprotect_err() */
/*-------------------------------------------------------------------------
+ * Function: check_mark_pinned_entry_dirty_errs()
+ *
+ * Purpose: Verify that:
+ *
+ * 1) a call to H5C_mark_pinned_entry_dirty with an upinned
+ * entry as the target will generate an error.
+ *
+ * 2) a call to H5C_mark_pinned_entry_dirty with a protected
+ * entry as the target will generate an error.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 4/25/06
+ *
+ * Modifications:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_mark_pinned_entry_dirty_errs(void)
+{
+ const char * fcn_name = "check_mark_pinned_entry_dirty_errs()";
+ herr_t result;
+ H5C_t * cache_ptr = NULL;
+ test_entry_t * entry_ptr;
+
+ TESTING("mark pinned entry dirty related errors");
+
+ pass = TRUE;
+
+ /* allocate a cache, protect an entry, and then attempt to mark it dirty
+ * with the H5C_mark_pinned_entry_dirty() call -- This should fail.
+ *
+ * Then unprotect the entry without pinning it, and try to mark it dirty
+ * again -- this should fail too.
+ *
+ * Destroy the cache -- should succeed.
+ */
+
+ if ( pass ) {
+
+ reset_entries();
+
+ cache_ptr = setup_cache((size_t)(2 * 1024),
+ (size_t)(1 * 1024));
+
+ protect_entry(cache_ptr, 0, 0);
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG);
+
+ protect_entry(cache_ptr, 0, 0);
+
+ entry_ptr = &((entries[0])[0]);
+ }
+
+ if ( pass ) {
+
+ result = H5C_mark_pinned_entry_dirty(cache_ptr, (void *)entry_ptr,
+ FALSE, 0);
+
+ if ( result > 0 ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "attempt dirty a pinned and protected entry succeeded.\n";
+
+ } else {
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__UNPIN_ENTRY_FLAG);
+ }
+ }
+
+ if ( pass ) {
+
+ result = H5C_mark_pinned_entry_dirty(cache_ptr, (void *)entry_ptr,
+ FALSE, 0);
+
+
+ if ( result > 0 ) {
+
+ pass = FALSE;
+ failure_mssg =
+ "attempt dirty a unpinned and unprotected entry succeeded.\n";
+
+ }
+ }
+
+ if ( pass ) {
+
+ takedown_cache(cache_ptr, FALSE, FALSE);
+ }
+
+ if ( pass ) { PASSED(); } else { H5_FAILED(); }
+
+ if ( ! pass ) {
+
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
+ fcn_name, failure_mssg);
+ }
+
+ return;
+
+} /* check_mark_pinned_entry_dirty_errs() */
+
+
+/*-------------------------------------------------------------------------
* Function: check_auto_cache_resize()
*
* Purpose: Exercise the automatic cache resizing functionality.
@@ -8471,9 +11822,13 @@ check_auto_cache_resize(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_auto_cache_resize() */
@@ -10983,9 +14338,13 @@ check_auto_cache_resize_disable(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_auto_cache_resize_disable() */
@@ -11662,9 +15021,13 @@ check_auto_cache_resize_epoch_markers(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_auto_cache_resize_epoch_markers() */
@@ -13634,9 +16997,13 @@ check_auto_cache_resize_input_errs(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_auto_cache_resize_input_errs() */
@@ -14207,14 +17574,205 @@ check_auto_cache_resize_aux_fcns(void)
if ( pass ) { PASSED(); } else { H5_FAILED(); }
- if ( ! pass )
+ if ( ! pass ) {
+
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ }
+
+ return;
} /* check_auto_cache_resize_aux_fcns() */
/*-------------------------------------------------------------------------
+ * Function: check_get_entry_status()
+ *
+ * Purpose: Verify that H5AC_get_entry_status() behaves as expected.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 4/28/06
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static void
+check_get_entry_status(void)
+{
+ const char * fcn_name = "check_get_entry_status";
+ static char msg[128];
+ herr_t result;
+ unsigned int status;
+ H5C_t * cache_ptr = NULL;
+ test_entry_t * base_addr;
+ test_entry_t * entry_ptr;
+
+ TESTING("H5AC_check_get_entry_status() functionality");
+
+ pass = TRUE;
+
+ if ( pass ) {
+
+ reset_entries();
+
+ cache_ptr = setup_cache((size_t)(2 * 1024 * 1024),
+ (size_t)(1 * 1024 * 1024));
+
+ base_addr = entries[0];
+ entry_ptr = &(base_addr[0]);
+ }
+
+ if ( pass ) {
+
+ result = H5AC_get_entry_status(cache_ptr, entry_ptr->addr, &status);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "H5AC_get_entry_status() reports failure 1.");
+ failure_mssg = msg;
+
+ } else if ( status != 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128, "Unexpected status 1.");
+ failure_mssg = msg;
+ }
+ }
+
+ protect_entry(cache_ptr, 0, 0);
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET);
+
+ if ( pass ) {
+
+ result = H5AC_get_entry_status(cache_ptr, entry_ptr->addr, &status);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "H5AC_get_entry_status() reports failure 2.");
+ failure_mssg = msg;
+
+ } else if ( status != H5AC_ES__IN_CACHE ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128, "Unexpected status 2.");
+ failure_mssg = msg;
+ }
+ }
+
+ protect_entry(cache_ptr, 0, 0);
+
+ if ( pass ) {
+
+ result = H5AC_get_entry_status(cache_ptr, entry_ptr->addr, &status);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "H5AC_get_entry_status() reports failure 3.");
+ failure_mssg = msg;
+
+ } else if ( status != (H5AC_ES__IN_CACHE | H5AC_ES__IS_PROTECTED) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128, "Unexpected status 3.");
+ failure_mssg = msg;
+ }
+ }
+
+ unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__PIN_ENTRY_FLAG);
+
+ if ( pass ) {
+
+ result = H5AC_get_entry_status(cache_ptr, entry_ptr->addr, &status);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "H5AC_get_entry_status() reports failure 4.");
+ failure_mssg = msg;
+
+ } else if ( status != (H5AC_ES__IN_CACHE | H5AC_ES__IS_PINNED) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128, "Unexpected status 4.");
+ failure_mssg = msg;
+ }
+ }
+
+ mark_pinned_entry_dirty(cache_ptr, 0, 0, FALSE, 0);
+
+ if ( pass ) {
+
+ result = H5AC_get_entry_status(cache_ptr, entry_ptr->addr, &status);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "H5AC_get_entry_status() reports failure 5.");
+ failure_mssg = msg;
+
+ } else if ( status != (H5AC_ES__IN_CACHE |
+ H5AC_ES__IS_PINNED |
+ H5AC_ES__IS_DIRTY) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128, "Unexpected status 5.");
+ failure_mssg = msg;
+ }
+ }
+
+ unpin_entry(cache_ptr, 0, 0);
+
+ if ( pass ) {
+
+ result = H5AC_get_entry_status(cache_ptr, entry_ptr->addr, &status);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128,
+ "H5AC_get_entry_status() reports failure 6.");
+ failure_mssg = msg;
+
+ } else if ( status != (H5AC_ES__IN_CACHE | H5AC_ES__IS_DIRTY) ) {
+
+ pass = FALSE;
+ HDsnprintf(msg, (size_t)128, "Unexpected status 6.");
+ failure_mssg = msg;
+ }
+ }
+
+ if ( pass ) {
+
+ takedown_cache(cache_ptr, FALSE, FALSE);
+ }
+
+ if ( pass ) { PASSED(); } else { H5_FAILED(); }
+
+ if ( ! pass ) {
+
+ HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n",
+ fcn_name, failure_mssg);
+ }
+
+ return;
+
+} /* check_get_entry_status() */
+
+
+/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Run tests on the cache code contained in H5C.c
@@ -14257,17 +17815,25 @@ main(void)
#if 1
write_permitted_check();
check_flush_cache();
+ check_rename_entry();
+ check_pin_protected_entry();
check_flush_protected_err();
+ check_destroy_pinned_err();
check_destroy_protected_err();
check_duplicate_insert_err();
check_rename_err();
+ check_double_pin_err();
+ check_double_unpin_err();
+ check_pin_entry_errs();
check_double_protect_err();
check_double_unprotect_err();
+ check_mark_pinned_entry_dirty_errs();
check_auto_cache_resize();
check_auto_cache_resize_disable();
check_auto_cache_resize_epoch_markers();
check_auto_cache_resize_input_errs();
check_auto_cache_resize_aux_fcns();
+ check_get_entry_status();
#endif
return(0);
diff --git a/test/cache_common.c b/test/cache_common.c
index c87fb7f..55276d0 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -505,6 +505,11 @@ monster_clear(H5F_t * f, void * thing, hbool_t dest)
*
* Modifications:
*
+ * JRM -- 4/4/06
+ * Added code to decrement the pinning_ref_count s of entries
+ * pinned by the target entry, and to unpin those entries
+ * if the reference count drops to zero.
+ *
*-------------------------------------------------------------------------
*/
@@ -512,18 +517,23 @@ herr_t
destroy(H5F_t UNUSED * f,
void * thing)
{
+ int i;
test_entry_t * entry_ptr;
test_entry_t * base_addr;
+ test_entry_t * pinned_entry_ptr;
+ test_entry_t * pinned_base_addr;
HDassert( thing );
entry_ptr = (test_entry_t *)thing;
base_addr = entries[entry_ptr->type];
- HDassert ( entry_ptr->index >= 0 );
- HDassert ( entry_ptr->index <= max_indices[entry_ptr->type] );
+ HDassert( entry_ptr->index >= 0 );
+ HDassert( entry_ptr->index <= max_indices[entry_ptr->type] );
HDassert( entry_ptr == &(base_addr[entry_ptr->index]) );
HDassert( entry_ptr == entry_ptr->self );
+ HDassert( entry_ptr->cache_ptr != NULL );
+ HDassert( entry_ptr->cache_ptr->magic == H5C__H5C_T_MAGIC );
HDassert( entry_ptr->header.addr == entry_ptr->addr );
HDassert( entry_ptr->header.size == entry_ptr->size );
HDassert( entry_ptr->size == entry_sizes[entry_ptr->type] );
@@ -531,7 +541,42 @@ destroy(H5F_t UNUSED * f,
HDassert( !(entry_ptr->is_dirty) );
HDassert( !(entry_ptr->header.is_dirty) );
+ if ( entry_ptr->num_pins > 0 ) {
+
+ for ( i = 0; i < entry_ptr->num_pins; i++ )
+ {
+ pinned_base_addr = entries[entry_ptr->pin_type[i]];
+ pinned_entry_ptr = &(pinned_base_addr[entry_ptr->pin_idx[i]]);
+
+ HDassert( 0 <= pinned_entry_ptr->type );
+ HDassert( pinned_entry_ptr->type < NUMBER_OF_ENTRY_TYPES );
+ HDassert( pinned_entry_ptr->type == entry_ptr->pin_type[i] );
+ HDassert( pinned_entry_ptr->index >= 0 );
+ HDassert( pinned_entry_ptr->index <=
+ max_indices[pinned_entry_ptr->type] );
+ HDassert( pinned_entry_ptr->index == entry_ptr->pin_idx[i] );
+ HDassert( pinned_entry_ptr == pinned_entry_ptr->self );
+ HDassert( pinned_entry_ptr->header.is_pinned );
+ HDassert( pinned_entry_ptr->is_pinned );
+ HDassert( pinned_entry_ptr->pinning_ref_count > 0 );
+
+ pinned_entry_ptr->pinning_ref_count--;
+
+ if ( pinned_entry_ptr->pinning_ref_count <= 0 ) {
+
+ unpin_entry(pinned_entry_ptr->cache_ptr,
+ pinned_entry_ptr->type,
+ pinned_entry_ptr->index);
+ }
+
+ entry_ptr->pin_type[i] = -1;
+ entry_ptr->pin_idx[i] = -1;
+ }
+ entry_ptr->num_pins = 0;
+ }
+
entry_ptr->destroyed = TRUE;
+ entry_ptr->cache_ptr = NULL;
return(SUCCEED);
@@ -966,6 +1011,88 @@ monster_size(H5F_t * f, void * thing, size_t * size_ptr)
/**************************************************************************/
/*-------------------------------------------------------------------------
+ * Function: create_pinned_entry_dependency
+ *
+ * Purpose: Do noting if pass is FALSE on entry.
+ *
+ * Otherwise, set up a pinned entry dependency so we can
+ * test the pinned entry modifications to the flush routine.
+ *
+ * Given the types and indicies of the pinned and pinning
+ * entries, add the pinned entry to the list of pinned
+ * entries in the pinning entry, increment the
+ * pinning reference count of the pinned entry, and
+ * if that count was zero initially, pin the entry.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 6/10/04
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+create_pinned_entry_dependency(H5C_t * cache_ptr,
+ int pinning_type,
+ int pinning_idx,
+ int pinned_type,
+ int pinned_idx)
+{
+ test_entry_t * pinning_base_addr;
+ test_entry_t * pinning_entry_ptr;
+ test_entry_t * pinned_base_addr;
+ test_entry_t * pinned_entry_ptr;
+
+ if ( pass ) {
+
+ HDassert( ( 0 <= pinning_type ) &&
+ ( pinning_type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= pinning_idx ) &&
+ ( pinning_idx <= max_indices[pinning_type] ) );
+ HDassert( ( 0 <= pinned_type ) &&
+ ( pinned_type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= pinned_idx ) &&
+ ( pinned_idx <= max_indices[pinned_type] ) );
+
+ pinning_base_addr = entries[pinning_type];
+ pinning_entry_ptr = &(pinning_base_addr[pinning_idx]);
+
+ pinned_base_addr = entries[pinned_type];
+ pinned_entry_ptr = &(pinned_base_addr[pinned_idx]);
+
+ HDassert( pinning_entry_ptr->index == pinning_idx );
+ HDassert( pinning_entry_ptr->type == pinning_type );
+ HDassert( pinning_entry_ptr == pinning_entry_ptr->self );
+ HDassert( pinning_entry_ptr->num_pins < MAX_PINS );
+
+ HDassert( pinning_entry_ptr->index == pinning_idx );
+ HDassert( pinning_entry_ptr->type == pinning_type );
+ HDassert( pinning_entry_ptr == pinning_entry_ptr->self );
+ HDassert( ! ( pinning_entry_ptr->is_protected ) );
+
+ pinning_entry_ptr->pin_type[pinning_entry_ptr->num_pins] = pinned_type;
+ pinning_entry_ptr->pin_idx[pinning_entry_ptr->num_pins] = pinned_idx;
+ (pinning_entry_ptr->num_pins)++;
+
+ if ( pinned_entry_ptr->pinning_ref_count == 0 ) {
+
+ protect_entry(cache_ptr, pinned_type, pinned_idx);
+ unprotect_entry(cache_ptr, pinned_type, pinned_idx, FALSE,
+ H5C__PIN_ENTRY_FLAG);
+ }
+
+ (pinned_entry_ptr->pinning_ref_count)++;
+ }
+
+ return;
+
+} /* create_pinned_entry_dependency() */
+
+
+/*-------------------------------------------------------------------------
* Function: entry_in_cache
*
* Purpose: Given a pointer to a cache, an entry type, and an index,
@@ -1032,6 +1159,10 @@ entry_in_cache(H5C_t * cache_ptr,
*
* Modifications:
*
+ * JRM -- 3/31/06
+ * Added initialization for new pinned entry test related
+ * fields.
+ *
*-------------------------------------------------------------------------
*/
@@ -1041,6 +1172,7 @@ reset_entries(void)
{
int i;
int j;
+ int k;
int32_t max_index;
haddr_t addr = 0;
haddr_t alt_addr = PICO_ALT_BASE_ADDR;
@@ -1074,6 +1206,7 @@ reset_entries(void)
base_addr[j].header.aux_prev = NULL;
base_addr[j].self = &(base_addr[j]);
+ base_addr[j].cache_ptr = NULL;
base_addr[j].addr = addr;
base_addr[j].at_main_addr = TRUE;
base_addr[j].main_addr = addr;
@@ -1086,6 +1219,15 @@ reset_entries(void)
base_addr[j].is_dirty = FALSE;
base_addr[j].is_protected = FALSE;
+ base_addr[j].is_pinned = FALSE;
+ base_addr[j].pinning_ref_count = 0;
+ base_addr[j].num_pins = 0;
+ for ( k = 0; k < MAX_PINS; k++ )
+ {
+ base_addr[j].pin_type[k] = -1;
+ base_addr[j].pin_idx[k] = -1;
+ }
+
base_addr[j].loaded = FALSE;
base_addr[j].cleared = FALSE;
base_addr[j].flushed = FALSE;
@@ -1391,6 +1533,10 @@ flush_cache(H5C_t * cache_ptr,
* The interface no longer permits clean inserts.
* Accordingly, the dirty parameter is no longer meaningfull.
*
+ * JRM -- 4/5/06
+ * Added code to initialize the new cache_ptr field of the
+ * test_entry_t structure.
+ *
*-------------------------------------------------------------------------
*/
@@ -1439,7 +1585,8 @@ insert_entry(H5C_t * cache_ptr,
HDfprintf(stdout, "result = %d\n", (int)result);
HDfprintf(stdout, "entry_ptr->header.is_protected = %d\n",
(int)(entry_ptr->header.is_protected));
- HDfprintf(stdout, "entry_ptr->header.type != &(types[type]) = %d\n",
+ HDfprintf(stdout,
+ "entry_ptr->header.type != &(types[type]) = %d\n",
(int)(entry_ptr->header.type != &(types[type])));
HDfprintf(stdout,
"entry_ptr->size != entry_ptr->header.size = %d\n",
@@ -1449,6 +1596,9 @@ insert_entry(H5C_t * cache_ptr,
(int)(entry_ptr->addr != entry_ptr->header.addr));
#endif
}
+ HDassert( entry_ptr->cache_ptr == NULL );
+
+ entry_ptr->cache_ptr = cache_ptr;
HDassert( entry_ptr->header.is_dirty );
HDassert( ((entry_ptr->header).type)->id == type );
@@ -1460,6 +1610,82 @@ insert_entry(H5C_t * cache_ptr,
/*-------------------------------------------------------------------------
+ * Function: mark_pinned_entry_dirty()
+ *
+ * Purpose: Mark the specified entry as dirty.
+ *
+ * Do nothing if pass is FALSE on entry.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 3/28/06
+ *
+ * Modifications:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+mark_pinned_entry_dirty(H5C_t * cache_ptr,
+ int32_t type,
+ int32_t idx,
+ hbool_t size_changed,
+ size_t new_size)
+{
+ /* const char * fcn_name = "mark_pinned_entry_dirty()"; */
+ herr_t result;
+ test_entry_t * base_addr;
+ test_entry_t * entry_ptr;
+
+ if ( pass ) {
+
+ HDassert( cache_ptr );
+ HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) );
+
+ 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 );
+ HDassert( entry_ptr->cache_ptr == cache_ptr );
+ HDassert( ! (entry_ptr->header.is_protected) );
+ HDassert( entry_ptr->header.is_pinned );
+ HDassert( entry_ptr->is_pinned );
+
+ entry_ptr->is_dirty = TRUE;
+
+ result = H5C_mark_pinned_entry_dirty(cache_ptr,
+ (void *)entry_ptr,
+ size_changed,
+ new_size);
+
+ if ( ( result < 0 ) ||
+ ( ! (entry_ptr->header.is_dirty) ) ||
+ ( ! (entry_ptr->header.is_pinned) ) ||
+ ( entry_ptr->header.type != &(types[type]) ) ||
+ ( entry_ptr->size != entry_ptr->header.size ) ||
+ ( entry_ptr->addr != entry_ptr->header.addr ) ) {
+
+ pass = FALSE;
+ failure_mssg = "error in H5C_mark_pinned_entry_dirty().";
+
+ }
+
+ HDassert( ((entry_ptr->header).type)->id == type );
+
+ }
+
+ return;
+
+} /* mark_pinned_entry_dirty() */
+
+
+/*-------------------------------------------------------------------------
* Function: rename_entry()
*
* Purpose: Rename the entry indicated by the type and index to its
@@ -1503,9 +1729,11 @@ rename_entry(H5C_t * cache_ptr,
HDassert( entry_ptr->index == idx );
HDassert( entry_ptr->type == type );
HDassert( entry_ptr == entry_ptr->self );
+ HDassert( entry_ptr->cache_ptr == cache_ptr );
HDassert( !(entry_ptr->is_protected) );
HDassert( !(entry_ptr->header.is_protected) );
+
if ( entry_ptr->at_main_addr && !main_addr ) {
/* rename to alt addr */
@@ -1635,7 +1863,11 @@ protect_entry(H5C_t * cache_ptr,
failure_mssg = "error in H5C_protect().";
} else {
+
+ HDassert( ( entry_ptr->cache_ptr == NULL ) ||
+ ( entry_ptr->cache_ptr == cache_ptr ) );
+ entry_ptr->cache_ptr = cache_ptr;
entry_ptr->is_protected = TRUE;
}
@@ -1649,6 +1881,76 @@ protect_entry(H5C_t * cache_ptr,
/*-------------------------------------------------------------------------
+ * Function: unpin_entry()
+ *
+ * Purpose: Unpin the entry indicated by the type and index.
+ *
+ * Do nothing if pass is FALSE on entry.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 3/28/06
+ *
+ * Modifications:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+unpin_entry(H5C_t * cache_ptr,
+ int32_t type,
+ int32_t idx)
+{
+ /* const char * fcn_name = "unpin_entry()"; */
+ herr_t result;
+ test_entry_t * base_addr;
+ test_entry_t * entry_ptr;
+
+ if ( pass ) {
+
+ HDassert( cache_ptr );
+ HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) );
+
+ 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 );
+ HDassert( entry_ptr->cache_ptr == cache_ptr );
+ HDassert( ! (entry_ptr->header.is_protected) );
+ HDassert( entry_ptr->header.is_pinned );
+ HDassert( entry_ptr->is_pinned );
+
+ result = H5C_unpin_entry(cache_ptr, (void *)entry_ptr);
+
+ if ( ( result < 0 ) ||
+ ( entry_ptr->header.is_pinned ) ||
+ ( entry_ptr->header.type != &(types[type]) ) ||
+ ( entry_ptr->size != entry_ptr->header.size ) ||
+ ( entry_ptr->addr != entry_ptr->header.addr ) ) {
+
+ pass = FALSE;
+ failure_mssg = "error in H5C_unpin().";
+
+ }
+
+ entry_ptr->is_pinned = FALSE;
+
+ HDassert( ((entry_ptr->header).type)->id == type );
+
+ }
+
+ return;
+
+} /* unpin_entry() */
+
+
+/*-------------------------------------------------------------------------
* Function: unprotect_entry()
*
* Purpose: Unprotect the entry indicated by the type and index.
@@ -1674,6 +1976,9 @@ protect_entry(H5C_t * cache_ptr,
* Update for new entry size parameter in H5C_unprotect().
* We don't use them here for now.
*
+ * JRM -- 3/31/06
+ * Update for pinned entries.
+ *
*-------------------------------------------------------------------------
*/
@@ -1686,6 +1991,8 @@ unprotect_entry(H5C_t * cache_ptr,
{
/* const char * fcn_name = "unprotect_entry()"; */
herr_t result;
+ hbool_t pin_flag_set;
+ hbool_t unpin_flag_set;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -1701,9 +2008,17 @@ unprotect_entry(H5C_t * cache_ptr,
HDassert( entry_ptr->index == idx );
HDassert( entry_ptr->type == type );
HDassert( entry_ptr == entry_ptr->self );
+ HDassert( entry_ptr->cache_ptr == cache_ptr );
HDassert( entry_ptr->header.is_protected );
HDassert( entry_ptr->is_protected );
+ pin_flag_set = ((flags & H5C__PIN_ENTRY_FLAG) != 0 );
+ unpin_flag_set = ((flags & H5C__UNPIN_ENTRY_FLAG) != 0 );
+
+ HDassert ( ! ( pin_flag_set && unpin_flag_set ) );
+ HDassert ( ( ! pin_flag_set ) || ( ! (entry_ptr->is_pinned) ) );
+ HDassert ( ( ! unpin_flag_set ) || ( entry_ptr->is_pinned ) );
+
if ( ( dirty == TRUE ) || ( dirty == FALSE ) ) {
flags |= (dirty ? H5AC__DIRTIED_FLAG : H5AC__NO_FLAGS_SET);
@@ -1727,6 +2042,18 @@ unprotect_entry(H5C_t * cache_ptr,
else
{
entry_ptr->is_protected = FALSE;
+
+ if ( pin_flag_set ) {
+
+ HDassert ( entry_ptr->header.is_pinned );
+ entry_ptr->is_pinned = TRUE;
+
+ } else if ( unpin_flag_set ) {
+
+ HDassert ( ! ( entry_ptr->header.is_pinned ) );
+ entry_ptr->is_pinned = FALSE;
+
+ }
}
HDassert( ((entry_ptr->header).type)->id == type );
diff --git a/test/cache_common.h b/test/cache_common.h
index acacb30..ac58b1a 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -105,6 +105,9 @@
#define MONSTER_ALT_BASE_ADDR (haddr_t)(HUGE_ALT_BASE_ADDR + \
(HUGE_ENTRY_SIZE * NUM_HUGE_ENTRIES))
+#define MAX_PINS 8 /* Maximum number of entries that can be
+ * directly pinned by a single entry.
+ */
typedef struct test_entry_t
{
H5C_cache_entry_t header; /* entry data used by the cache
@@ -113,6 +116,10 @@ typedef struct test_entry_t
struct test_entry_t * self; /* pointer to this entry -- used for
* sanity checking.
*/
+ H5C_t * cache_ptr; /* pointer to the cache in which
+ * the entry resides, or NULL if the
+ * entry is not in cache.
+ */
haddr_t addr; /* where the cache thinks this entry
* is located
*/
@@ -146,6 +153,25 @@ typedef struct test_entry_t
hbool_t is_protected; /* entry should currently be on
* the cache's protected list.
*/
+ hbool_t is_pinned; /* entry is currently pinned in
+ * the cache.
+ */
+ int pinning_ref_count; /* Number of entries that
+ * pin this entry in the cache.
+ * When this count drops to zero,
+ * this entry should be unpinned.
+ */
+ int num_pins; /* Number of entries that this
+ * entry pins in the cache. This
+ * value must be in the range
+ * [0, MAX_PINS].
+ */
+ int pin_type[MAX_PINS]; /* array of the types of entries
+ * pinned by this entry.
+ */
+ int pin_idx[MAX_PINS]; /* array of the indicies of
+ * entries pinned by this entry.
+ */
hbool_t loaded; /* entry has been loaded since the
* last time it was reset.
*/
@@ -247,6 +273,33 @@ struct flush_cache_test_spec
hbool_t expected_destroyed;
};
+struct pe_flush_cache_test_spec
+{
+ int entry_num;
+ int entry_type;
+ int entry_index;
+ hbool_t insert_flag;
+ hbool_t dirty_flag;
+ unsigned int flags;
+ int num_pins;
+ int pin_type[MAX_PINS];
+ int pin_idx[MAX_PINS];
+ hbool_t expected_loaded;
+ hbool_t expected_cleared;
+ hbool_t expected_flushed;
+ hbool_t expected_destroyed;
+};
+
+struct rename_entry_test_spec
+{
+ int entry_type;
+ int entry_index;
+ hbool_t is_dirty;
+ hbool_t is_pinned;
+};
+
+
+
/* global variable externs: */
@@ -376,6 +429,12 @@ void insert_entry(H5C_t * cache_ptr,
hbool_t dirty,
unsigned int flags);
+void mark_pinned_entry_dirty(H5C_t * cache_ptr,
+ int32_t type,
+ int32_t idx,
+ hbool_t size_changed,
+ size_t new_size);
+
void rename_entry(H5C_t * cache_ptr,
int32_t type,
int32_t idx,
@@ -389,6 +448,12 @@ hbool_t entry_in_cache(H5C_t * cache_ptr,
int32_t type,
int32_t idx);
+void create_pinned_entry_dependency(H5C_t * cache_ptr,
+ int pinning_type,
+ int pinning_idx,
+ int pinned_type,
+ int pinned_idx);
+
void reset_entries(void);
H5C_t * setup_cache(size_t max_cache_size, size_t min_clean_size);
@@ -488,6 +553,10 @@ void flush_cache(H5C_t * cache_ptr,
hbool_t dump_stats,
hbool_t dump_detailed_stats);
+void unpin_entry(H5C_t * cache_ptr,
+ int32_t type,
+ int32_t idx);
+
void unprotect_entry(H5C_t * cache_ptr,
int32_t type,
int32_t idx,