summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2017-03-13 19:04:33 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2017-03-13 19:04:33 (GMT)
commit847d675f2743ec420ef6c9efdd6e52ae93b4fe44 (patch)
tree3e74669322711c4ea14f8fd80ecf14da984c6212 /test
parent56e5b4ed05fb3bad51c226ec5b567871a45e0bce (diff)
parent4fad103187db9095afc8eab90b5f5544feb1d19b (diff)
downloadhdf5-847d675f2743ec420ef6c9efdd6e52ae93b4fe44.zip
hdf5-847d675f2743ec420ef6c9efdd6e52ae93b4fe44.tar.gz
hdf5-847d675f2743ec420ef6c9efdd6e52ae93b4fe44.tar.bz2
Merge pull request #333 in HDFFV/hdf5 from merge_page_buffering_07 to develop
* commit '4fad103187db9095afc8eab90b5f5544feb1d19b': Bring changes to I/O parameters from page_buffering branch. Merge in reentrency changes to "make space in cache" from page_buffering branch. Minor cleanups and bring over "prefetched dirty" fixes for entries loaded from a cache image. Remove some usage of "prefetched_dirty" flag (which hasn't been merged from the page_buffering branch yet. Also, bring over improvements to flush candidate entries for parallel code. Align with incoming page buffering changes: minor cleanups, centralize removing entries from collective metadata read list
Diffstat (limited to 'test')
-rw-r--r--test/accum.c59
-rw-r--r--test/cache.c102
-rw-r--r--test/cache_image.c649
-rw-r--r--test/cache_tagging.c58
-rw-r--r--test/evict_on_close.c1
5 files changed, 787 insertions, 82 deletions
diff --git a/test/accum.c b/test/accum.c
index 1fcd051..d134bbc 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -45,18 +45,18 @@
H5F_t * f = NULL;
/* Function Prototypes */
-unsigned test_write_read(const H5F_io_info_t *fio_info);
-unsigned test_write_read_nonacc_front(const H5F_io_info_t *fio_info);
-unsigned test_write_read_nonacc_end(const H5F_io_info_t *fio_info);
-unsigned test_accum_overlap(const H5F_io_info_t *fio_info);
-unsigned test_accum_overlap_clean(const H5F_io_info_t *fio_info);
-unsigned test_accum_overlap_size(const H5F_io_info_t *fio_info);
-unsigned test_accum_non_overlap_size(const H5F_io_info_t *fio_info);
-unsigned test_accum_adjust(const H5F_io_info_t *fio_info);
-unsigned test_read_after(const H5F_io_info_t *fio_info);
-unsigned test_free(const H5F_io_info_t *fio_info);
-unsigned test_big(const H5F_io_info_t *fio_info);
-unsigned test_random_write(const H5F_io_info_t *fio_info);
+unsigned test_write_read(const H5F_io_info2_t *fio_info);
+unsigned test_write_read_nonacc_front(const H5F_io_info2_t *fio_info);
+unsigned test_write_read_nonacc_end(const H5F_io_info2_t *fio_info);
+unsigned test_accum_overlap(const H5F_io_info2_t *fio_info);
+unsigned test_accum_overlap_clean(const H5F_io_info2_t *fio_info);
+unsigned test_accum_overlap_size(const H5F_io_info2_t *fio_info);
+unsigned test_accum_non_overlap_size(const H5F_io_info2_t *fio_info);
+unsigned test_accum_adjust(const H5F_io_info2_t *fio_info);
+unsigned test_read_after(const H5F_io_info2_t *fio_info);
+unsigned test_free(const H5F_io_info2_t *fio_info);
+unsigned test_big(const H5F_io_info2_t *fio_info);
+unsigned test_random_write(const H5F_io_info2_t *fio_info);
unsigned test_swmr_write_big(hbool_t newest_format);
/* Helper Function Prototypes */
@@ -90,7 +90,7 @@ void accum_printf(void);
int
main(void)
{
- H5F_io_info_t fio_info; /* I/O info for operation */
+ H5F_io_info2_t fio_info; /* I/O info for operation */
unsigned nerrors = 0; /* track errors */
hid_t fid = -1;
@@ -109,7 +109,8 @@ main(void)
/* Set up I/O info for operation */
fio_info.f = f;
- if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) FAIL_STACK_ERROR
+ if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) FAIL_STACK_ERROR
+ if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) FAIL_STACK_ERROR
/* Reset metadata accumulator for the file */
if(accum_reset(&fio_info) < 0) FAIL_STACK_ERROR
@@ -166,7 +167,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_write_read(const H5F_io_info_t *fio_info)
+test_write_read(const H5F_io_info2_t *fio_info)
{
int i = 0;
int *write_buf, *read_buf;
@@ -222,7 +223,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_write_read_nonacc_front(const H5F_io_info_t *fio_info)
+test_write_read_nonacc_front(const H5F_io_info2_t *fio_info)
{
int i = 0;
int *write_buf, *read_buf;
@@ -281,7 +282,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_write_read_nonacc_end(const H5F_io_info_t *fio_info)
+test_write_read_nonacc_end(const H5F_io_info2_t *fio_info)
{
int i = 0;
int *write_buf, *read_buf;
@@ -340,7 +341,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_free(const H5F_io_info_t *fio_info)
+test_free(const H5F_io_info2_t *fio_info)
{
int i = 0;
int32_t *wbuf = NULL;
@@ -527,7 +528,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_accum_overlap(const H5F_io_info_t *fio_info)
+test_accum_overlap(const H5F_io_info2_t *fio_info)
{
int i = 0;
int32_t *wbuf, *rbuf;
@@ -699,7 +700,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_accum_overlap_clean(const H5F_io_info_t *fio_info)
+test_accum_overlap_clean(const H5F_io_info2_t *fio_info)
{
int i = 0;
int32_t *wbuf, *rbuf;
@@ -878,7 +879,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_accum_non_overlap_size(const H5F_io_info_t *fio_info)
+test_accum_non_overlap_size(const H5F_io_info2_t *fio_info)
{
int i = 0;
int32_t *wbuf, *rbuf;
@@ -945,7 +946,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_accum_overlap_size(const H5F_io_info_t *fio_info)
+test_accum_overlap_size(const H5F_io_info2_t *fio_info)
{
int i = 0;
int32_t *wbuf, *rbuf;
@@ -1023,7 +1024,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_accum_adjust(const H5F_io_info_t *fio_info)
+test_accum_adjust(const H5F_io_info2_t *fio_info)
{
int i = 0;
int s = 1048576; /* size of buffer */
@@ -1279,7 +1280,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_read_after(const H5F_io_info_t *fio_info)
+test_read_after(const H5F_io_info2_t *fio_info)
{
int i = 0;
int s = 128; /* size of buffer */
@@ -1358,7 +1359,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_big(const H5F_io_info_t *fio_info)
+test_big(const H5F_io_info2_t *fio_info)
{
uint8_t *wbuf, *wbuf2, *rbuf, *zbuf; /* Buffers for reading & writing, etc */
unsigned u; /* Local index variable */
@@ -1666,7 +1667,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_random_write(const H5F_io_info_t *fio_info)
+test_random_write(const H5F_io_info2_t *fio_info)
{
uint8_t *wbuf, *rbuf; /* Buffers for reading & writing */
unsigned seed = 0; /* Random # seed */
@@ -1820,7 +1821,7 @@ test_swmr_write_big(hbool_t newest_format)
pid_t pid; /* Process ID */
#endif /* H5_HAVE_UNISTD_H */
int status; /* Status returned from child process */
- H5F_io_info_t fio_info; /* I/O info for operation */
+ H5F_io_info2_t fio_info; /* I/O info for operation */
char *new_argv[] = {NULL};
char *driver = NULL; /* VFD string (from env variable) */
@@ -1877,7 +1878,9 @@ test_swmr_write_big(hbool_t newest_format)
/* Set up I/O info for operation */
fio_info.f = rf;
- if(NULL == (fio_info.dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id)))
+ if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id)))
+ FAIL_STACK_ERROR
+ if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id)))
FAIL_STACK_ERROR
/* We'll be writing lots of garbage data, so extend the
diff --git a/test/cache.c b/test/cache.c
index 87b1272..c381776 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -9825,7 +9825,6 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
}
}
-
if(pass) {
/* Now load a large entry. This should result in the eviction
@@ -10370,14 +10369,28 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
* However, (VET 9)'s serialize function needs to modify (VET, 8),
* which is currently not in cache. Thus it calls H5C_protect(VET, 8)
* to gain access to it. H5C_protect(VET, 8) loads (VET, 8), and
- * then attempts to evict entries to make space for it. While (VET, 9)
- * is still at the bottom of the LRU, it is marked flush in progress
- * and this is skipped. Thus the next entries on the LRU are (MET, 0)
- * thru (MET, 30) and (LET, 0) thru (LET, 10) -- all of which are dirty,
+ * then attempts to evict entries to make space for it.
+ *
+ * However, H5C_make_space_in_cache() now exits without taking
+ * any action on re-entrant calls. Thus H5C_protect(VET, 8) simply
+ * loads the entry into the cache -- resulting in a cache that is
+ * 10 KB oversize. The subsequent unprotect puts (VET, 8) at the
+ * head of the LRU and marks it dirty.
+ *
+ * After (VET, 9) is serialized, it is flushed, and moved to the
+ * head of the LRU.
+ *
+ * At this point, the H5C_make_space_in_cache() call made by
+ * H5C_protect(LET, 11) now has 14 KB of space to make.
+ *
+ * The next entries on the LRU are (MET, 0) thru (MET, 30),
+ * (LET, 0) thru (LET, 10), and (VET, 8) -- all of which are dirty,
* and are therefore flushed and moved to the head of the LRU list.
*
* The next entry on the bottom of the LRU list is (VET, 0), which
- * is clean, and is therefore evicted to make space for (VET, 8).
+ * is clean, and is therefore evicted, leaving H5C_make_space_in_cache()
+ * with 4 KB of space to create.
+ *
* This space is sufficient, so H5C_protect(VET, 8) inserts
* (VET, 8) into the cache's index, marks it as protected, and
* returns to the serialize function for (VET, 9).
@@ -10386,22 +10399,10 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
* calls H5C_unprotect(VET, 8), which markes (VET, 8) as dirty and
* unprotected, and places it at the head of the LRU.
*
- * The serialize function for (VET, 9) then returns, and (VET, 9) is
- * is written to disk, marked clean, and moved to the head of the LRU.
+ * (VET, 0) is the next item on the LRU -- it is clean and is therefore
+ * evicted -- leaving 6 KB of free space after (LET, 11) is inserted
+ * into the cache.
*
- * At this point, the cache is still full (since (VET, 8) took the
- * space created by the eviction of (VET, 0)). Thus
- * H5C_protect(LET, 11) continues to look for space. While
- * (MET, 0) was the next item on the LRU list when it called the
- * serialize function for (VET, 9), the function notices that the
- * LRU has been modified, and restarts its search for candidates
- * for eviction at the bottom of the LRU.
- *
- * (MET, 0) is now at the bottom of the LRU, and is clean. Thus
- * it is evicted. This makes sufficient space for (LET, 11), so
- * H5C_protect(LET, 11) inserts it into the cache, marks it as
- * protected, and returns.
- *
* H5C_unprotect(LET, 11) marks (LET, 11) as unprotected, and then
* returns as well.
*
@@ -10427,9 +10428,9 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
*
* (VET, 7) N 5 KB N N - -
*
- * (VET, 8) Y 10 KB Y N - -
+ * (VET, 8) Y 10 KB N N - -
*
- * (VET, 9) Y 10 KB N N - -
+ * (VET, 9) N 10 KB N N - -
*
* Start by updating the expected table for the expected changes in
* entry status:
@@ -10448,25 +10449,22 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
expected[0].serialized = TRUE;
expected[0].destroyed = TRUE;
expected[8].in_cache = TRUE;
- expected[8].is_dirty = TRUE;
+ expected[8].is_dirty = FALSE;
expected[8].deserialized = TRUE;
- expected[8].serialized = FALSE;
+ expected[8].serialized = TRUE;
expected[8].destroyed = FALSE;
- expected[9].in_cache = TRUE;
+ expected[9].in_cache = FALSE;
expected[9].is_dirty = FALSE;
expected[9].serialized = TRUE;
- expected[9].destroyed = FALSE;
+ expected[9].destroyed = TRUE;
- expected[10].in_cache = FALSE;
+ expected[10].in_cache = TRUE;
expected[10].is_dirty = FALSE;
expected[10].serialized = TRUE;
- expected[10].destroyed = TRUE;
+ expected[10].destroyed = FALSE;
num_large_entries = 12;
- /* a newly loaded entry is not inserted in the cache until after
- * space has been made for it. Thus (LET, 11) will not be flushed.
- */
for (i = num_variable_entries;
i < num_variable_entries + num_monster_entries + num_large_entries - 1;
i++)
@@ -10484,10 +10482,10 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
/* verify cache size */
if((cache_ptr->index_len != 44) ||
(cache_ptr->index_size != (2 * 1024 * 1024) -
- (2 * VARIABLE_ENTRY_SIZE) -
- (10 * LARGE_ENTRY_SIZE)) ||
- (cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) +
- (30 * MONSTER_ENTRY_SIZE) +
+ (2 * 1024) -
+ (1 * LARGE_ENTRY_SIZE)) ||
+ (cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) +
+ (31 * MONSTER_ENTRY_SIZE) +
(12 * LARGE_ENTRY_SIZE)))) {
pass = FALSE;
@@ -10497,15 +10495,27 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
/* verify entry status */
verify_entry_status(cache_ptr,
9,
- (num_variable_entries + num_monster_entries + num_large_entries),
+ (num_variable_entries + num_monster_entries +
+ num_large_entries),
expected);
}
if(pass) {
- /* protect and unprotect VET 8 to move it to the top of the LRU */
+ /* protect and unprotect VET 9 to evict MET 0 */
+ protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 9, H5C__NO_FLAGS_SET);
+
+ /* protect and unprotect VET 8 to dirty it and move it to the
+ * top of the LRU. Since we are dirtying it again, reset its
+ * serialized flag.
+ */
+ base_addr = entries[VARIABLE_ENTRY_TYPE];
+ entry_ptr = &(base_addr[8]);
+ entry_ptr->serialized = FALSE;
+
protect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8);
- unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8, H5C__NO_FLAGS_SET);
+ unprotect_entry(file_ptr, VARIABLE_ENTRY_TYPE, 8, H5C__DIRTIED_FLAG);
/* Again, touch all the non VARIABLE_ENTRY_TYPE entries in the
@@ -10517,7 +10527,13 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
/* skip MET 0 in first pass so that we evict VET 9 when we
* reload MET 0
+ *
+ * Since we are reloading MET 0, reset its destroyed flag.
*/
+ base_addr = entries[MONSTER_ENTRY_TYPE];
+ entry_ptr = &(base_addr[0]);
+ entry_ptr->destroyed = FALSE;
+
for (i = 1; i < num_monster_entries; i++)
{
protect_entry(file_ptr, MONSTER_ENTRY_TYPE, i);
@@ -10550,7 +10566,9 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
expected[i].is_dirty = TRUE;
}
- /* update MET 0 to set its in cache flag, and reset the its destroyed flag */
+ /* update MET 0 to set its in cache flag, and reset
+ * its destroyed flag
+ */
expected[10].in_cache = TRUE;
/* pass through non variable entries will flush VET 8, and evict VET 9.
@@ -10719,8 +10737,8 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
if((cache_ptr->insertions[VARIABLE_ENTRY_TYPE] != 0) ||
(cache_ptr->pinned_insertions[VARIABLE_ENTRY_TYPE] != 0) ||
(cache_ptr->clears[VARIABLE_ENTRY_TYPE] != 0) ||
- (cache_ptr->flushes[VARIABLE_ENTRY_TYPE] != 8) ||
- (cache_ptr->evictions[VARIABLE_ENTRY_TYPE] != 11) ||
+ (cache_ptr->flushes[VARIABLE_ENTRY_TYPE] != 9) ||
+ (cache_ptr->evictions[VARIABLE_ENTRY_TYPE] != 12) ||
(cache_ptr->take_ownerships[VARIABLE_ENTRY_TYPE] != 0) ||
(cache_ptr->moves[VARIABLE_ENTRY_TYPE] != 1) ||
(cache_ptr->entry_flush_moves[VARIABLE_ENTRY_TYPE] != 0) ||
diff --git a/test/cache_image.c b/test/cache_image.c
index de0507b..0e7928a 100644
--- a/test/cache_image.c
+++ b/test/cache_image.c
@@ -4560,7 +4560,7 @@ cache_image_smoke_check_4(void)
* If sufficient zoos have been created, continue to
* 10). Otherwise goto 5)
*
- * 10) Open the file.
+ * 10) Open the file R/O.
*
* Verify that the file contains a metadata cache
* image superblock extension message.
@@ -4571,14 +4571,23 @@ cache_image_smoke_check_4(void)
*
* 13) Open the file.
*
- * Verify that the file doesn't contain a metadata cache
+ * Verify that the file contains a metadata cache
* image superblock extension message.
*
* 14) Validate all the zoos.
*
* 15) Close the file.
*
- * 16) Delete the file.
+ * 16) Open the file.
+ *
+ * Verify that the file doesn't contain a metadata cache
+ * image superblock extension message.
+ *
+ * 17) Validate all the zoos.
+ *
+ * 18) Close the file.
+ *
+ * 19) Delete the file.
*
* Return: void
*
@@ -4821,9 +4830,56 @@ cache_image_smoke_check_5(void)
} /* end while */
cp += 5;
+ /* 10) Open the file read only.
+ *
+ * Verify that the file contains a metadata cache image
+ * superblock extension message.
+ */
+ if(pass) {
+ open_hdf5_file(/* create_file */ FALSE,
+ /* mdci_sbem_expected */ TRUE,
+ /* read_only */ TRUE,
+ /* set_mdci_fapl */ FALSE,
+ /* config_fsm */ FALSE,
+ /* hdf_file_name */ filename,
+ /* cache_image_flags */ 0,
+ /* file_id_ptr */ &file_id,
+ /* file_ptr_ptr */ &file_ptr,
+ /* cache_ptr_ptr */ &cache_ptr);
+ }
+
+ if(show_progress)
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 11) Validate all the zoos. */
+ i = min_group;
+ while(pass && i <= max_group) {
+ sprintf(process_group_name, "/process_%d", i);
+ validate_zoo(file_id, process_group_name, i++);
+ }
-
- /* 10) Open the file.
+#if H5C_COLLECT_CACHE_STATS
+ if( pass) {
+ if(cache_ptr->images_loaded == 0) {
+ pass = FALSE;
+ failure_mssg = "metadata cache image block not loaded(2).";
+ }
+ }
+#endif /* H5C_COLLECT_CACHE_STATS */
+
+ if(show_progress)
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+ /* 12) Close the file. */
+ if(pass) {
+ if(H5Fclose(file_id) < 0) {
+ pass = FALSE;
+ failure_mssg = "H5Fclose() failed.\n";
+ }
+ }
+
+ /* 13) Open the file R/W.
*
* Verify that the file contains a metadata cache image
* superblock extension message.
@@ -4847,7 +4903,7 @@ cache_image_smoke_check_5(void)
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 11) Validate all the zoos. */
+ /* 14) Validate all the zoos. */
i = min_group;
while ( ( pass ) && ( i <= max_group ) ) {
@@ -4871,7 +4927,7 @@ cache_image_smoke_check_5(void)
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 12) Close the file. */
+ /* 15) Close the file. */
if ( pass ) {
@@ -4883,7 +4939,7 @@ cache_image_smoke_check_5(void)
}
- /* 13) Open the file.
+ /* 16) Open the file.
*
* Verify that the file doesn't contain a metadata cache image
* superblock extension message.
@@ -4907,7 +4963,7 @@ cache_image_smoke_check_5(void)
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 14) Validate all the zoos.
+ /* 17) Validate all the zoos.
*
* Verify that the metadata cache image superblock
* extension message has been deleted.
@@ -4935,7 +4991,7 @@ cache_image_smoke_check_5(void)
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 15) Close the file. */
+ /* 18) Close the file. */
if ( pass ) {
@@ -4950,7 +5006,7 @@ cache_image_smoke_check_5(void)
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
- /* 16) Delete the file */
+ /* 19) Delete the file */
if ( pass ) {
@@ -6444,6 +6500,576 @@ cache_image_api_error_check_3(void)
/*-------------------------------------------------------------------------
+ * Function: cache_image_api_error_check_4()
+ *
+ * Purpose: This test is one of a sequence of tests intended
+ * to verify correct management of API errors.
+ *
+ * The object of this test is to verify that a request for
+ * a cache image when a version 2 superblock is not available/
+ * not requested is handled correctly.
+ * (the cache image request should be ignored silently).
+ *
+ * The test is set up as follows:
+ *
+ * 1) Create a FAPL requesting a cache image, but WITHOUT
+ * specifying the latest file format.
+ *
+ * 2) Create a HDF5 file using the above FAPL.
+ *
+ * 3) Create some datasets in the file.
+ *
+ * 4) Close the file.
+ *
+ * 5) Open the file read only. Verify that the file doesn't
+ * contain a cache image.
+ *
+ * 6) Verify that the datasets exist and contain the
+ * expected data
+ *
+ * Verify that the cache image was not loaded.
+ *
+ * 7) Close the file.
+ *
+ * 8) Open the file R/W using the FAPL defined in 1) above.
+ * Verify that the file does not contain a cache image.
+ *
+ * 9) Close the file.
+ *
+ * 10) Open the file R/W using the FAPL defined in 1) above.
+ * Verify that the file does not contain a cache image.
+ *
+ * 11) Verify that the data sets contain the expected data
+ *
+ * Verify that a cache image was not loaded.
+ *
+ * 12) Create several more data sets.
+ *
+ * 13) Close the file.
+ *
+ * 14) Open the file read write.
+ *
+ * Verify that the file does not contain a cache image.
+ *
+ * 15) Verify the data sets exist and contain the expected
+ * data.
+ *
+ * Verify that a cache image was not loaded.
+ *
+ * 16) Close the file.
+ *
+ * 17) Delete the file.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 9/25/15
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static unsigned
+cache_image_api_error_check_4(void)
+{
+ const char * fcn_name = "cache_image_api_error_check_4()";
+ char filename[512];
+ hbool_t show_progress = FALSE;
+ hid_t fapl_id = -1;
+ hid_t file_id = -1;
+ H5F_t *file_ptr = NULL;
+ H5C_t *cache_ptr = NULL;
+ int cp = 0;
+ H5AC_cache_image_config_t cache_image_config;
+
+ TESTING("metadata cache image api error check 4");
+
+ pass = TRUE;
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* setup the file name */
+ if ( pass ) {
+
+ if ( h5_fixname(FILENAMES[0], H5P_DEFAULT, filename, sizeof(filename))
+ == NULL ) {
+
+ pass = FALSE;
+ failure_mssg = "h5_fixname() failed.\n";
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+ /* 1) Create a FAPL requesting a cache image, but WITHOUT
+ * specifying the latest file format.
+ */
+ if ( pass ) {
+
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+
+ if ( fapl_id < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5Pcreate() failed.\n";
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+ if ( pass ) {
+
+ /* set cache image config fields to taste */
+ cache_image_config.version = H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION;
+ cache_image_config.generate_image = TRUE;
+ cache_image_config.save_resize_status = FALSE;
+ cache_image_config.entry_ageout = H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE;
+
+ if ( H5Pset_mdc_image_config(fapl_id, &cache_image_config) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5Pset_mdc_image_config() failed.\n";
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 2) Create a HDF5 file using the above FAPL. */
+
+ if ( pass ) {
+
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+
+ if ( file_id < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5Fcreate() failed.\n";
+
+ } else {
+
+ file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+
+ if ( file_ptr == NULL ) {
+
+ pass = FALSE;
+ failure_mssg = "Can't get file_ptr.";
+
+ }
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+ /* get a pointer to the files internal data structure and then
+ * to the cache structure
+ */
+ if ( pass ) {
+
+ if ( file_ptr->shared->cache == NULL ) {
+
+ pass = FALSE;
+ failure_mssg = "can't get cache pointer(1).\n";
+
+ } else {
+
+ cache_ptr = file_ptr->shared->cache;
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 3) Create some datasets in the file. */
+
+ if ( pass ) {
+
+ create_datasets(file_id, 0, 5);
+ }
+
+#if H5C_COLLECT_CACHE_STATS
+ if ( pass ) {
+
+ HDassert(cache_ptr);
+
+ if ( cache_ptr->images_loaded != 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "metadata cache image block loaded(1).";
+ }
+ }
+#endif /* H5C_COLLECT_CACHE_STATS */
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 4) Close the file. */
+
+ if ( pass ) {
+
+ if ( H5Fclose(file_id) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5Fclose() failed.\n";
+
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 5) Open the file read only. */
+
+ if ( pass ) {
+
+ open_hdf5_file(/* create_file */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
+ /* read_only */ TRUE,
+ /* set_mdci_fapl */ FALSE,
+ /* config_fsm */ FALSE,
+ /* hdf_file_name */ filename,
+ /* cache_image_flags */ H5C_CI__ALL_FLAGS,
+ /* file_id_ptr */ &file_id,
+ /* file_ptr_ptr */ &file_ptr,
+ /* cache_ptr_ptr */ &cache_ptr);
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 6) Verify that the datasets exist and contain the
+ * expected data
+ */
+
+ if ( pass ) {
+
+ verify_datasets(file_id, 0, 5);
+ }
+
+#if H5C_COLLECT_CACHE_STATS
+ if ( pass ) {
+
+ if ( cache_ptr->images_loaded != 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "metadata cache image block loaded(2).";
+ }
+ }
+#endif /* H5C_COLLECT_CACHE_STATS */
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 7) Close the file. */
+
+ if ( pass ) {
+
+ if ( H5Fclose(file_id) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5Fclose() failed.\n";
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 8) Open the file R/W using the FAPL defined in 1) above.
+ *
+ * Verify that the file does not contain a cache image.
+ */
+
+ if ( pass ) {
+
+ file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id);
+
+ if ( file_id < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5Fopen() failed.\n";
+
+ } else {
+
+ file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+
+ if ( file_ptr == NULL ) {
+
+ pass = FALSE;
+ failure_mssg = "Can't get file_ptr.";
+
+ }
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+ /* get a pointer to the files internal data structure and then
+ * to the cache structure
+ */
+ if ( pass ) {
+
+ if ( file_ptr->shared->cache == NULL ) {
+
+ pass = FALSE;
+ failure_mssg = "can't get cache pointer(1).\n";
+
+ } else {
+
+ cache_ptr = file_ptr->shared->cache;
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+ if ( pass ) {
+
+ if ( ( cache_ptr->load_image == TRUE ) ||
+ ( cache_ptr->delete_image == TRUE ) ) {
+
+ pass = FALSE;
+ failure_mssg = "mdci sb extension message present?\n";
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 9) Close the file. */
+
+ if ( pass ) {
+
+ if ( H5Fclose(file_id) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5Fclose() failed.\n";
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+
+ /* 10) Open the file R/W using the FAPL defined in 1) above.
+ * Verify that the file does not contain a cache image.
+ */
+
+ if ( pass ) {
+
+ file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id);
+
+ if ( file_id < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5Fopen() failed.\n";
+
+ } else {
+
+ file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+
+ if ( file_ptr == NULL ) {
+
+ pass = FALSE;
+ failure_mssg = "Can't get file_ptr.";
+
+ }
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+ /* get a pointer to the files internal data structure and then
+ * to the cache structure
+ */
+ if ( pass ) {
+
+ if ( file_ptr->shared->cache == NULL ) {
+
+ pass = FALSE;
+ failure_mssg = "can't get cache pointer(1).\n";
+
+ } else {
+
+ cache_ptr = file_ptr->shared->cache;
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+ if ( pass ) {
+
+ if ( ( cache_ptr->load_image == TRUE ) ||
+ ( cache_ptr->delete_image == TRUE ) ) {
+
+ pass = FALSE;
+ failure_mssg = "mdci sb extension message present?\n";
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 11) Verify that the data sets contain the expected data
+ *
+ * Verify that a cache image was not loaded.
+ */
+
+ if ( pass ) {
+
+ verify_datasets(file_id, 0, 5);
+ }
+
+#if H5C_COLLECT_CACHE_STATS
+ if ( pass ) {
+
+ if ( cache_ptr->images_loaded != 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "metadata cache image block loaded(2).";
+ }
+ }
+#endif /* H5C_COLLECT_CACHE_STATS */
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 12) Create several more data sets. */
+
+ if ( pass ) {
+
+ create_datasets(file_id, 6, 10);
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 13) Close the file. */
+
+ if ( pass ) {
+
+ if ( H5Fclose(file_id) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5Fclose() failed.\n";
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 14) Open the file read write.
+ *
+ * Verify that the file does not contain a cache image.
+ */
+
+ if ( pass ) {
+
+ open_hdf5_file(/* create_file */ FALSE,
+ /* mdci_sbem_expected */ FALSE,
+ /* read_only */ FALSE,
+ /* set_mdci_fapl */ FALSE,
+ /* config_fsm */ FALSE,
+ /* hdf_file_name */ filename,
+ /* cache_image_flags */ H5C_CI__ALL_FLAGS,
+ /* file_id_ptr */ &file_id,
+ /* file_ptr_ptr */ &file_ptr,
+ /* cache_ptr_ptr */ &cache_ptr);
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 15) Verify the data sets exist and contain the expected data.
+ *
+ * Verify that a cache image was not loaded.
+ */
+
+ if ( pass ) {
+
+ verify_datasets(file_id, 0, 10);
+ }
+
+#if H5C_COLLECT_CACHE_STATS
+ if ( pass ) {
+
+ if ( cache_ptr->images_loaded != 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "metadata cache image block loaded(2).";
+ }
+ }
+#endif /* H5C_COLLECT_CACHE_STATS */
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 16) Close the file. */
+
+ if ( pass ) {
+
+ if ( H5Fclose(file_id) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "H5Fclose() failed.\n";
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* 17) Delete the file */
+
+ if ( pass ) {
+
+ if ( HDremove(filename) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "HDremove() failed.\n";
+ }
+ }
+
+ if ( show_progress )
+ HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
+
+
+ /* tidy up */
+ if ( fapl_id != -1 )
+ H5Pclose(fapl_id);
+
+
+ if ( pass ) { PASSED(); } else { H5_FAILED(); }
+
+ if ( ! pass )
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
+ FUNC, failure_mssg);
+
+ return !pass;
+
+} /* cache_image_api_error_check_4() */
+/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Run tests on the cache code contained in H5C.c
@@ -6489,6 +7115,7 @@ main(void)
nerrs += cache_image_api_error_check_1();
nerrs += cache_image_api_error_check_2();
nerrs += cache_image_api_error_check_3();
+ nerrs += cache_image_api_error_check_4();
return(nerrs > 0);
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 02ce19b..8901468 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -53,13 +53,16 @@
/* ===================== */
/* Helper Functions */
+#ifndef NDEBUG
static int dump_cache(hid_t fid);
+#endif /* NDEBUG */ /* end debugging functions */
static int verify_no_unknown_tags(hid_t fid);
static int mark_all_entries_investigated(hid_t fid);
static int reset_all_entries_investigated(hid_t fid);
static int verify_tag(hid_t fid, int id, haddr_t tag);
static int get_object_header_tag(hid_t loc_id, haddr_t *tag);
static int get_sbe_tag(hid_t fid, haddr_t *tag);
+
/* Tests */
static unsigned check_file_creation_tags(hid_t fcpl_id, int type);
static unsigned check_file_open_tags(hid_t fcpl, int type);
@@ -71,7 +74,6 @@ static unsigned check_attribute_rename_tags(hid_t fcpl, int type);
static unsigned check_dataset_creation_tags(hid_t fcpl, int type);
static unsigned check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type);
static unsigned check_link_removal_tags(hid_t fcpl, int type);
-
static unsigned check_group_creation_tags(void);
static unsigned check_multi_group_creation_tags(void);
static unsigned check_group_open_tags(void);
@@ -95,6 +97,7 @@ static unsigned check_invalid_tag_application(void);
/* ================ */
+#ifndef NDEBUG
/*-------------------------------------------------------------------------
* Function: dump_cache()
@@ -128,6 +131,7 @@ static int dump_cache(hid_t fid)
error:
return -1;
} /* dump_cache */
+#endif /* NDEBUG */ /* end debugging functions */
/*-------------------------------------------------------------------------
@@ -445,8 +449,10 @@ check_file_creation_tags(hid_t fcpl_id, int type)
/* Create a test file with provided fcpl_t */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+#ifndef NDEBUG
/* if verbose, print cache index to screen before verification . */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* verify there is a superblock entry with superblock tag */
if ( verify_tag(fid, H5AC_SUPERBLOCK_ID, H5AC__SUPERBLOCK_TAG) < 0 ) TEST_ERROR;
@@ -551,8 +557,10 @@ check_file_open_tags(hid_t fcpl, int type)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen before verification . */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* verify there is a superblock entry with superblock tag. */
if ( verify_tag(fid, H5AC_SUPERBLOCK_ID, H5AC__SUPERBLOCK_TAG) < 0 ) TEST_ERROR;
@@ -653,8 +661,10 @@ check_group_creation_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group's tagged metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -756,8 +766,10 @@ check_multi_group_creation_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify there is an object header for each group */
for (i = 0; i < MULTIGROUPS; i++) {
@@ -888,8 +900,10 @@ check_link_iteration_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group's tagged metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -1005,8 +1019,10 @@ check_dense_attribute_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify free space header and section info */
if ( verify_tag(fid, H5AC_FSPACE_SINFO_ID, d_tag) < 0 ) TEST_ERROR;
@@ -1061,8 +1077,10 @@ check_dense_attribute_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* verify object header belonging to dataset */
if ( verify_tag(fid, H5AC_OHDR_ID, d_tag) < 0 ) TEST_ERROR;
@@ -1169,8 +1187,10 @@ check_group_open_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -1273,8 +1293,10 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* verify object header belonging to group */
if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR;
@@ -1407,8 +1429,10 @@ check_attribute_open_tags(hid_t fcpl, int type)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* verify object header belonging to group */
if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR;
@@ -1550,8 +1574,10 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -1712,8 +1738,10 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* verify object header belonging to group */
if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR;
@@ -1834,8 +1862,10 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -1959,8 +1989,10 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -2097,8 +2129,10 @@ check_dataset_open_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -2228,8 +2262,10 @@ check_dataset_write_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify 10 b-tree nodes belonging to dataset */
for (i=0; i<10; i++)
@@ -2351,8 +2387,10 @@ check_attribute_write_tags(hid_t fcpl, int type)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify object header of group */
if ( verify_tag(fid, H5AC_OHDR_ID, g_tag) < 0 ) TEST_ERROR;
@@ -2506,8 +2544,10 @@ check_dataset_read_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify 19 b-tree nodes belonging to dataset */
for (i=0; i<19; i++)
@@ -2636,8 +2676,10 @@ check_dataset_size_retrieval(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify 19 b-tree nodes belonging to dataset */
for (i=0; i<19; i++)
@@ -2769,8 +2811,10 @@ check_dataset_extend_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, d_tag) < 0 ) TEST_ERROR;
@@ -2866,8 +2910,10 @@ check_object_info_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group's tagged metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -2972,8 +3018,10 @@ check_object_copy_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group's tagged metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -3122,8 +3170,10 @@ check_link_removal_tags(hid_t fcpl, int type)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group's tagged metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -3271,8 +3321,10 @@ check_link_getname_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group's tagged metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -3371,8 +3423,10 @@ check_external_link_creation_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* Verify root group metadata */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
@@ -3478,8 +3532,10 @@ check_external_link_open_tags(void)
/* Verification of Metadata Tag Values */
/* =================================== */
+#ifndef NDEBUG
/* if verbose, print cache index to screen for visual verification */
if ( verbose ) dump_cache(fid);
+#endif /* NDEBUG */ /* end debugging functions */
/* verify tag value of first file's root group */
if ( verify_tag(fid, H5AC_OHDR_ID, root_tag) < 0 ) TEST_ERROR;
diff --git a/test/evict_on_close.c b/test/evict_on_close.c
index 3986d5a..b00c1e4 100644
--- a/test/evict_on_close.c
+++ b/test/evict_on_close.c
@@ -40,6 +40,7 @@
#include "H5Ipkg.h"
/* Uncomment to manually inspect cache states */
+/* (Requires debug build of the library) */
/* #define EOC_MANUAL_INSPECTION */
const char *FILENAMES[] = {