summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am4
-rw-r--r--test/Makefile.in61
-rw-r--r--test/cache1.c28237
-rw-r--r--test/cache1_api.c4058
-rw-r--r--test/cache1_common.c4613
-rw-r--r--test/cache1_common.h786
-rw-r--r--test/cache_api.c46
-rw-r--r--test/cache_common.c42
-rw-r--r--test/cache_common.h20
-rw-r--r--test/cache_jnl_file_marking.c2
-rw-r--r--test/cache_journal.c2
11 files changed, 69 insertions, 37802 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index f827abd..77d0fd0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -37,7 +37,7 @@ SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) \
# These tests (fheap, btree2) are under development and are not used by
# the library yet. Move them to the end so that their failure do not block
# other current library code tests.
-TEST_PROG=testhdf5 lheap ohdr stab gheap cache1 cache1_api cache cache_api \
+TEST_PROG=testhdf5 lheap ohdr stab gheap cache cache_api \
cache_journal pool hyperslab istore bittests dt_arith \
dtypes dsets cmpd_dset extend external objcopy links unlink big mtime \
fillval mount flush1 flush2 enum \
@@ -71,7 +71,7 @@ endif
# The libh5test library provides common support code for the tests.
noinst_LTLIBRARIES=libh5test.la
-libh5test_la_SOURCES=h5test.c testframe.c cache1_common.c cache_common.c
+libh5test_la_SOURCES=h5test.c testframe.c cache_common.c
# Use libhd5test.la to compile all of the tests
LDADD=libh5test.la $(LIBHDF5)
diff --git a/test/Makefile.in b/test/Makefile.in
index aadd78c..f6a3740 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -71,12 +71,10 @@ CONFIG_CLEAN_FILES = testerror.sh
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libh5test_la_LIBADD =
-am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache1_common.lo \
- cache_common.lo
+am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo
libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS)
am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \
- stab$(EXEEXT) gheap$(EXEEXT) cache1$(EXEEXT) \
- cache1_api$(EXEEXT) cache$(EXEEXT) cache_api$(EXEEXT) \
+ stab$(EXEEXT) gheap$(EXEEXT) cache$(EXEEXT) cache_api$(EXEEXT) \
cache_journal$(EXEEXT) pool$(EXEEXT) hyperslab$(EXEEXT) \
istore$(EXEEXT) bittests$(EXEEXT) dt_arith$(EXEEXT) \
dtypes$(EXEEXT) dsets$(EXEEXT) cmpd_dset$(EXEEXT) \
@@ -111,14 +109,6 @@ cache_SOURCES = cache.c
cache_OBJECTS = cache.$(OBJEXT)
cache_LDADD = $(LDADD)
cache_DEPENDENCIES = libh5test.la $(LIBHDF5)
-cache1_SOURCES = cache1.c
-cache1_OBJECTS = cache1.$(OBJEXT)
-cache1_LDADD = $(LDADD)
-cache1_DEPENDENCIES = libh5test.la $(LIBHDF5)
-cache1_api_SOURCES = cache1_api.c
-cache1_api_OBJECTS = cache1_api.$(OBJEXT)
-cache1_api_LDADD = $(LDADD)
-cache1_api_DEPENDENCIES = libh5test.la $(LIBHDF5)
cache_api_SOURCES = cache_api.c
cache_api_OBJECTS = cache_api.$(OBJEXT)
cache_api_LDADD = $(LDADD)
@@ -355,11 +345,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libh5test_la_SOURCES) big.c bittests.c btree2.c cache.c \
- cache1.c cache1_api.c cache_api.c cache_jnl_file_marking.c \
- cache_journal.c cmpd_dset.c cross_read.c dangle.c dsets.c \
- dt_arith.c dtransform.c dtypes.c enum.c err_compat.c \
- error_test.c extend.c external.c fheap.c fillval.c flush1.c \
- flush2.c gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \
+ cache_api.c cache_jnl_file_marking.c cache_journal.c \
+ cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \
+ dtransform.c dtypes.c enum.c err_compat.c error_test.c \
+ extend.c external.c fheap.c fillval.c flush1.c flush2.c \
+ gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \
gen_filters.c gen_new_array.c gen_new_fill.c gen_new_group.c \
gen_new_mtime.c gen_new_super.c gen_noencoder.c \
gen_nullspace.c gen_udlinks.c getname.c gheap.c hyperslab.c \
@@ -368,18 +358,18 @@ SOURCES = $(libh5test_la_SOURCES) big.c bittests.c btree2.c cache.c \
$(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \
vfd.c
DIST_SOURCES = $(libh5test_la_SOURCES) big.c bittests.c btree2.c \
- cache.c cache1.c cache1_api.c cache_api.c \
- cache_jnl_file_marking.c cache_journal.c cmpd_dset.c \
- cross_read.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c \
- enum.c err_compat.c error_test.c extend.c external.c fheap.c \
- fillval.c flush1.c flush2.c gen_bad_ohdr.c gen_bogus.c \
- gen_cross.c gen_deflate.c gen_filters.c gen_new_array.c \
- gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c \
- gen_noencoder.c gen_nullspace.c gen_udlinks.c getname.c \
- gheap.c hyperslab.c istore.c lheap.c links.c mount.c mtime.c \
- ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c \
- space_overflow.c stab.c $(testhdf5_SOURCES) testmeta.c \
- $(ttsafe_SOURCES) unlink.c vfd.c
+ cache.c cache_api.c cache_jnl_file_marking.c cache_journal.c \
+ cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \
+ dtransform.c dtypes.c enum.c err_compat.c error_test.c \
+ extend.c external.c fheap.c fillval.c flush1.c flush2.c \
+ gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \
+ gen_filters.c gen_new_array.c gen_new_fill.c gen_new_group.c \
+ gen_new_mtime.c gen_new_super.c gen_noencoder.c \
+ gen_nullspace.c gen_udlinks.c getname.c gheap.c hyperslab.c \
+ istore.c lheap.c links.c mount.c mtime.c ntypes.c objcopy.c \
+ ohdr.c pool.c reserved.c set_extent.c space_overflow.c stab.c \
+ $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \
+ vfd.c
ETAGS = etags
CTAGS = ctags
am__tty_colors = \
@@ -679,7 +669,7 @@ SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) \
# These tests (fheap, btree2) are under development and are not used by
# the library yet. Move them to the end so that their failure do not block
# other current library code tests.
-TEST_PROG = testhdf5 lheap ohdr stab gheap cache1 cache1_api cache cache_api \
+TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api \
cache_journal pool hyperslab istore bittests dt_arith \
dtypes dsets cmpd_dset extend external objcopy links unlink big mtime \
fillval mount flush1 flush2 enum \
@@ -702,7 +692,7 @@ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_n
# The libh5test library provides common support code for the tests.
noinst_LTLIBRARIES = libh5test.la
-libh5test_la_SOURCES = h5test.c testframe.c cache1_common.c cache_common.c
+libh5test_la_SOURCES = h5test.c testframe.c cache_common.c
# Use libhd5test.la to compile all of the tests
LDADD = libh5test.la $(LIBHDF5)
@@ -816,12 +806,6 @@ btree2$(EXEEXT): $(btree2_OBJECTS) $(btree2_DEPENDENCIES)
cache$(EXEEXT): $(cache_OBJECTS) $(cache_DEPENDENCIES)
@rm -f cache$(EXEEXT)
$(LINK) $(cache_OBJECTS) $(cache_LDADD) $(LIBS)
-cache1$(EXEEXT): $(cache1_OBJECTS) $(cache1_DEPENDENCIES)
- @rm -f cache1$(EXEEXT)
- $(LINK) $(cache1_OBJECTS) $(cache1_LDADD) $(LIBS)
-cache1_api$(EXEEXT): $(cache1_api_OBJECTS) $(cache1_api_DEPENDENCIES)
- @rm -f cache1_api$(EXEEXT)
- $(LINK) $(cache1_api_OBJECTS) $(cache1_api_LDADD) $(LIBS)
cache_api$(EXEEXT): $(cache_api_OBJECTS) $(cache_api_DEPENDENCIES)
@rm -f cache_api$(EXEEXT)
$(LINK) $(cache_api_OBJECTS) $(cache_api_LDADD) $(LIBS)
@@ -992,9 +976,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bittests.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btree2.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache1_api.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache1_common.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache_api.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache_common.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cache_jnl_file_marking.Po@am__quote@
diff --git a/test/cache1.c b/test/cache1.c
deleted file mode 100644
index 0422525..0000000
--- a/test/cache1.c
+++ /dev/null
@@ -1,28237 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* Programmer: John Mainzer
- * 6/9/04
- *
- * This file contains tests for the cache implemented in
- * H5C.c
- */
-#include "h5test.h"
-#include "H5Iprivate.h"
-#include "H5AC1private.h"
-#include "cache1_common.h"
-
-/* private function declarations: */
-
-static void smoke_check_1(void);
-static void smoke_check_2(void);
-static void smoke_check_3(void);
-static void smoke_check_4(void);
-static void smoke_check_5(void);
-static void smoke_check_6(void);
-static void smoke_check_7(void);
-static void smoke_check_8(void);
-static void smoke_check_9(void);
-static void smoke_check_10(void);
-static void write_permitted1_check(void);
-static void check_insert_entry1(void);
-static void check_flush_cache1(void);
-static void check_flush_cache1__empty_cache(H5C1_t * cache_ptr);
-static void check_flush_cache1__multi_entry(H5C1_t * cache_ptr);
-static void check_flush_cache1__multi_entry_test(H5C1_t * cache_ptr,
- int test_num,
- unsigned int flush_flags,
- int spec_size,
- struct flush_cache_test_spec spec[]);
-static void check_flush_cache1__pe_multi_entry_test(H5C1_t * cache_ptr,
- int test_num,
- unsigned int flush_flags,
- int spec_size,
- struct pe_flush_cache_test_spec spec[]);
-static void check_flush_cache1__single_entry(H5C1_t * cache_ptr);
-static void check_flush_cache1__single_entry_test(H5C1_t * cache_ptr,
- int test_num,
- int entry_type,
- int entry_idx,
- hbool_t insert_flag,
- hbool_t dirty_flag,
- unsigned int flags,
- unsigned int flush_flags,
- hbool_t expected_loaded,
- hbool_t expected_cleared,
- hbool_t expected_flushed,
- hbool_t expected_destroyed);
-static void check_flush_cache1__pinned_single_entry_test(H5C1_t * cache_ptr,
- int test_num,
- int entry_type,
- int entry_idx,
- hbool_t dirty_flag,
- hbool_t mark_dirty,
- hbool_t pop_mark_dirty_prot,
- hbool_t pop_mark_dirty_pinned,
- 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_cache1__flush_ops(H5C1_t * cache_ptr);
-static void check_flush_cache1__flush_op_test(H5C1_t * cache_ptr,
- int test_num,
- unsigned int flush_flags,
- int spec_size,
- struct fo_flush_cache_test_spec spec[],
- int init_expected_index_len,
- size_t init_expected_index_size,
- int expected_index_len,
- size_t expected_index_size,
- int check_size,
- struct fo_flush_entry_check check[]);
-static void check_flush_cache1__flush_op_eviction_test(H5C1_t * cache_ptr);
-static void check_flush_protected_err(void);
-static void check_get_entry_status(void);
-static void check_expunge_entry1(void);
-static void check_multiple_read_protect(void);
-static void check_rename_entry1(void);
-static void check_rename_entry1__run_test(H5C1_t * cache_ptr, int test_num,
- struct rename_entry_test_spec * spec_ptr);
-static void check_pin_protected_entry1(void);
-static void check_resize_entry1(void);
-static void check_evictions_enabled(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_double_protect_err(void);
-static void check_double_unprotect_err(void);
-static void check_mark_entry_dirty_errs(void);
-static void check_expunge_entry1_errs(void);
-static void check_resize_entry1_errs(void);
-static void check_unprotect_ro_dirty_err(void);
-static void check_protect_ro_rw_err(void);
-static void check_check_evictions_enabled_err(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);
-
-
-/**************************************************************************/
-/**************************************************************************/
-/********************************* tests: *********************************/
-/**************************************************************************/
-/**************************************************************************/
-
-/*-------------------------------------------------------------------------
- * Function: smoke_check_1()
- *
- * Purpose: A basic functional test, inserts, destroys, and renames in
- * the mix, along with repeated protects and unprotects.
- * All entries are marked as clean.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/16/04
- *
- * Modifications:
- *
- * JRM -- 1/18/05
- * Added code to skip this test if the skip_long_tests1 global
- * is true.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-smoke_check_1(void)
-{
- const char * fcn_name = "smoke_check_1";
- hbool_t show_progress = FALSE;
- hbool_t dirty_inserts = FALSE;
- int dirty_unprotects = FALSE;
- int dirty_destroys = FALSE;
- hbool_t display_stats = FALSE;
- int32_t lag = 10;
- int mile_stone = 1;
- H5C1_t * cache_ptr = NULL;
-
- TESTING("smoke check #1 -- all clean, ins, dest, ren, 4/2 MB cache");
-
- if ( skip_long_tests1 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(4 * 1024 * 1024),
- (size_t)(2 * 1024 * 1024));
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ TRUE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ FALSE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* smoke_check_1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: smoke_check_2()
- *
- * Purpose: A basic functional test, with inserts, destroys, and
- * renames in the mix, along with some repeated protects
- * and unprotects. About half the entries are marked as
- * dirty.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- * JRM -- 1/18/05
- * Added code to skip this test if the skip_long_tests1 global
- * is true.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-smoke_check_2(void)
-{
- const char * fcn_name = "smoke_check_2";
- hbool_t show_progress = FALSE;
- hbool_t dirty_inserts = TRUE;
- int dirty_unprotects = TRUE;
- int dirty_destroys = TRUE;
- hbool_t display_stats = FALSE;
- int32_t lag = 10;
- int mile_stone = 1;
- H5C1_t * cache_ptr = NULL;
-
- TESTING("smoke check #2 -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache");
-
- if ( skip_long_tests1 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(4 * 1024 * 1024),
- (size_t)(2 * 1024 * 1024));
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ TRUE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ FALSE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* smoke_check_2() */
-
-
-/*-------------------------------------------------------------------------
- * Function: smoke_check_3()
- *
- * Purpose: A basic functional test on a tiny cache, with inserts,
- * destroys, and renames in the mix, along with repeated
- * protects and unprotects. All entries are marked as clean.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/16/04
- *
- * Modifications:
- *
- * JRM -- 1/18/05
- * Added code to skip this test if the skip_long_tests1 global
- * is true.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-smoke_check_3(void)
-{
- const char * fcn_name = "smoke_check_3";
- hbool_t show_progress = FALSE;
- hbool_t dirty_inserts = FALSE;
- int dirty_unprotects = FALSE;
- int dirty_destroys = FALSE;
- hbool_t display_stats = FALSE;
- int32_t lag = 10;
- int mile_stone = 1;
- H5C1_t * cache_ptr = NULL;
-
- TESTING("smoke check #3 -- all clean, ins, dest, ren, 2/1 KB cache");
-
- if ( skip_long_tests1 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ TRUE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ FALSE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* smoke_check_3() */
-
-
-/*-------------------------------------------------------------------------
- * Function: smoke_check_4()
- *
- * Purpose: A basic functional test on a tiny cache, with inserts,
- * destroys, and renames in the mix, along with repeated
- * protects and unprotects. About half the entries are
- * marked as dirty.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- * JRM -- 1/18/05
- * Added code to skip this test if the skip_long_tests1 global
- * is true.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-smoke_check_4(void)
-{
- const char * fcn_name = "smoke_check_4";
- hbool_t show_progress = FALSE;
- hbool_t dirty_inserts = TRUE;
- int dirty_unprotects = TRUE;
- int dirty_destroys = TRUE;
- hbool_t display_stats = FALSE;
- int32_t lag = 10;
- int mile_stone = 1;
- H5C1_t * cache_ptr = NULL;
-
- TESTING("smoke check #4 -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache");
-
- if ( skip_long_tests1 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ TRUE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ FALSE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* smoke_check_4() */
-
-
-/*-------------------------------------------------------------------------
- * Function: smoke_check_5()
- *
- * Purpose: A basic functional test on a cache with automatic cache
- * resizing enabled, with inserts in the mix, along with
- * repeated protects and unprotects. All entries are marked
- * as clean.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 10/14/04
- *
- * Modifications:
- *
- * JRM -- 1/18/05
- * Added code to skip this test if the skip_long_tests1 global
- * is true.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-smoke_check_5(void)
-{
- const char * fcn_name = "smoke_check_5";
- herr_t result;
- hbool_t show_progress = FALSE;
- hbool_t dirty_inserts = FALSE;
- int dirty_unprotects = FALSE;
- hbool_t display_stats = FALSE;
- int32_t max_index = 1024;
- int mile_stone = 1;
- H5C1_t * cache_ptr = NULL;
- H5C1_auto_size_ctl_t auto_size_ctl =
- {
- /* int32_t version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
-#if 1
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ NULL,
-#else
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ H5C1_def_auto_resize_rpt_fcn,
-#endif
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (2 * 1024 * 1024),
-
- /* double min_clean_fraction = */ 0.1,
-
- /* size_t max_size = */ (32 * 1024 * 1025),
- /* size_t min_size = */ (512 * 1024),
-
- /* int64_t epoch_length = */ 50000,
-
-
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
-
- /* double lower_hr_threshold = */ 0.75,
-
- /* double increment = */ 2.0,
-
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
-
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
-
-
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__threshold,
-
- /* double upper_hr_threshold = */ 0.995,
-
- /* double decrement = */ 0.9,
-
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
-
- /* int32_t epochs_before_eviction = */ 3,
-
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.5
- };
-
- TESTING("smoke check #5 -- all clean, ins, prot, unprot, AR cache 1");
-
- if ( skip_long_tests1 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- if ( run_full_test1 ) {
-
- max_index = (10 * 1024) - 1;
- }
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- if ( pass1 ) {
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 1.\n";
- }
- }
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ FALSE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* smoke_check_5() */
-
-
-/*-------------------------------------------------------------------------
- * Function: smoke_check_6()
- *
- * Purpose: A basic functional test on a cache with automatic cache
- * resizing enabled, with inserts in the mix, along with
- * repeated protects and unprotects. About one half of all
- * entries are marked as dirty.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 10/25/04
- *
- * Modifications:
- *
- * JRM -- 1/18/05
- * Added code to skip this test if the skip_long_tests1 global
- * is true.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-smoke_check_6(void)
-{
- const char * fcn_name = "smoke_check_6";
- herr_t result;
- hbool_t show_progress = FALSE;
- hbool_t dirty_inserts = TRUE;
- int dirty_unprotects = FALSE;
- hbool_t display_stats = FALSE;
- int mile_stone = 1;
- int32_t max_index = 1024;
- H5C1_t * cache_ptr = NULL;
- H5C1_auto_size_ctl_t auto_size_ctl =
- {
- /* int32_t version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
-#if 1
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ NULL,
-#else
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ H5C1_def_auto_resize_rpt_fcn,
-#endif
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (2 * 1024 * 1024),
-
- /* double min_clean_fraction = */ 0.1,
-
- /* size_t max_size = */ (32 * 1024 * 1025),
- /* size_t min_size = */ (512 * 1024),
-
- /* int64_t epoch_length = */ 50000,
-
-
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
-
- /* double lower_hr_threshold = */ 0.75,
-
- /* double increment = */ 2.0,
-
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
-
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
-
-
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__threshold,
-
- /* double upper_hr_threshold = */ 0.995,
-
- /* double decrement = */ 0.9,
-
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
-
- /* int32_t epochs_before_eviction = */ 3,
-
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05
- };
-
- TESTING("smoke check #6 -- ~1/2 dirty, ins, prot, unprot, AR cache 1");
-
- pass1 = TRUE;
-
- if ( skip_long_tests1 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- if ( run_full_test1 ) {
-
- max_index = (10 * 1024) - 1;
- }
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- if ( pass1 ) {
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 1.\n";
- }
- }
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ FALSE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* smoke_check_6() */
-
-
-/*-------------------------------------------------------------------------
- * Function: smoke_check_7()
- *
- * Purpose: A basic functional test on a cache with automatic cache
- * resizing enabled, with inserts in the mix, along with
- * repeated protects and unprotects. All entries are marked
- * as clean.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 12/2/04
- *
- * Modifications:
- *
- * JRM -- 1/18/05
- * Added code to skip this test if the skip_long_tests1 global
- * is true.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-smoke_check_7(void)
-{
- const char * fcn_name = "smoke_check_7";
- herr_t result;
- hbool_t show_progress = FALSE;
- hbool_t dirty_inserts = FALSE;
- int dirty_unprotects = FALSE;
- hbool_t display_stats = FALSE;
- int mile_stone = 1;
- int32_t max_index = 1024;
- H5C1_t * cache_ptr = NULL;
- H5C1_auto_size_ctl_t auto_size_ctl =
- {
- /* int32_t version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
-#if 1
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ NULL,
-#else
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ H5C1_def_auto_resize_rpt_fcn,
-#endif
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (2 * 1024 * 1024),
-
- /* double min_clean_fraction = */ 0.1,
-
- /* size_t max_size = */ (32 * 1024 * 1025),
- /* size_t min_size = */ (512 * 1024),
-
- /* int64_t epoch_length = */ 100000,
-
-
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
-
- /* double lower_hr_threshold = */ 0.75,
-
- /* double increment = */ 2.0,
-
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (8 * 1024 * 1024),
-
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
-
-
- /* enum H5C1_cache_decr_mode decr_mode = */
- H5C1_decr__age_out_with_threshold,
-
- /* double upper_hr_threshold = */ 0.995,
-
- /* double decrement = */ 0.9,
-
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
-
- /* int32_t epochs_before_eviction = */ 3,
-
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1
- };
-
- TESTING("smoke check #7 -- all clean, ins, prot, unprot, AR cache 2");
-
- if ( skip_long_tests1 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- if ( run_full_test1 ) {
-
- max_index = (10 * 1024) - 1;
- }
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- if ( pass1 ) {
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 1.\n";
- }
- }
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ FALSE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* smoke_check_7() */
-
-
-/*-------------------------------------------------------------------------
- * Function: smoke_check_8()
- *
- * Purpose: A basic functional test on a cache with automatic cache
- * resizing enabled, with inserts in the mix, along with
- * repeated protects and unprotects. About one half of all
- * entries are marked as dirty.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 10/25/04
- *
- * Modifications:
- *
- * JRM -- 1/18/05
- * Added code to skip this test if the skip_long_tests1 global
- * is true.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-smoke_check_8(void)
-{
- const char * fcn_name = "smoke_check_8";
- herr_t result;
- hbool_t show_progress = FALSE;
- hbool_t dirty_inserts = TRUE;
- int dirty_unprotects = FALSE;
- hbool_t display_stats = FALSE;
- int mile_stone = 1;
- int32_t max_index = 1024;
- H5C1_t * cache_ptr = NULL;
- H5C1_auto_size_ctl_t auto_size_ctl =
- {
- /* int32_t version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
-#if 1
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ NULL,
-#else
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ H5C1_def_auto_resize_rpt_fcn,
-#endif
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (2 * 1024 * 1024),
-
- /* double min_clean_fraction = */ 0.1,
-
- /* size_t max_size = */ (32 * 1024 * 1025),
- /* size_t min_size = */ (512 * 1024),
-
- /* int64_t epoch_length = */ 100000,
-
-
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
-
- /* double lower_hr_threshold = */ 0.75,
-
- /* double increment = */ 2.0,
-
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
-
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
-
-
- /* enum H5C1_cache_decr_mode decr_mode = */
- H5C1_decr__age_out_with_threshold,
-
- /* double upper_hr_threshold = */ 0.995,
-
- /* double decrement = */ 0.9,
-
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
-
- /* int32_t epochs_before_eviction = */ 3,
-
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1
- };
-
- TESTING("smoke check #8 -- ~1/2 dirty, ins, prot, unprot, AR cache 2");
-
- if ( skip_long_tests1 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- if ( run_full_test1 ) {
-
- max_index = (10 * 1024) - 1;
- }
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- if ( pass1 ) {
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 1.\n";
- }
- }
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts);
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ FALSE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- hl_col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* max_index */ max_index,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ FALSE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* smoke_check_8() */
-
-
-/*-------------------------------------------------------------------------
- * Function: smoke_check_9()
- *
- * Purpose: A repeat of smoke check 1, only with the cache corked
- * part of the time.
- *
- * Recall that smoke check 1 is a basic functional test,
- * with inserts, destroys, and renames in the mix, along
- * with repeated protects and unprotects. All entries are
- * marked as clean.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 8/1/07
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-smoke_check_9(void)
-{
- const char * fcn_name = "smoke_check_9";
- herr_t result;
- hbool_t show_progress = FALSE;
- hbool_t dirty_inserts = FALSE;
- int dirty_unprotects = FALSE;
- int dirty_destroys = FALSE;
- hbool_t display_stats = FALSE;
- hbool_t display_detailed_stats = FALSE;
- int32_t lag = 10;
- int mile_stone = 1;
- H5C1_t * cache_ptr = NULL;
-
- TESTING("smoke check #9 -- all clean, ins, dest, ren, 4/2 MB, corked");
-
- if ( skip_long_tests1 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(4 * 1024 * 1024),
- (size_t)(2 * 1024 * 1024));
-
- /* disable evictions */
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't disable evictions 1.\n";
- }
- }
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ display_detailed_stats,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- /* enable evictions */
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, TRUE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't enable evictions 1.\n";
- }
- }
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions enabled \n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ display_detailed_stats,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ TRUE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't disable evictions 2.\n";
- }
- }
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions disabled \n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ display_detailed_stats,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, TRUE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't enable evictions 2.\n";
- }
- }
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions enabled \n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't disable evictions 3.\n";
- }
- }
-
- if ( show_progress ) /* 12 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ display_detailed_stats,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 13 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ FALSE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 14 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, TRUE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't enable evictions 3.\n";
- }
- }
-
- if ( show_progress ) /* 15 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions enabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ display_detailed_stats,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 16 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't disable evictions 4.\n";
- }
- }
-
-
- if ( show_progress ) /* 17 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 18 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* smoke_check_9() */
-
-
-/*-------------------------------------------------------------------------
- * Function: smoke_check_10()
- *
- * Purpose: A repeat of smoke check 2, only with the cache corked
- * part of the time.
- *
- * Recall that smoke check 2 is a basic functional test,
- * with inserts, destroys, and renames in the mix, along
- * with some repeated protects and unprotects. About half
- * the entries are marked as dirty.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 8/1/07
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-smoke_check_10(void)
-{
- const char * fcn_name = "smoke_check_10";
- herr_t result;
- hbool_t show_progress = FALSE;
- hbool_t dirty_inserts = TRUE;
- int dirty_unprotects = TRUE;
- int dirty_destroys = TRUE;
- hbool_t display_stats = FALSE;
- hbool_t display_detailed_stats = FALSE;
- int32_t lag = 10;
- int mile_stone = 1;
- H5C1_t * cache_ptr = NULL;
-
- TESTING("smoke check #10 -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked");
-
- if ( skip_long_tests1 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(4 * 1024 * 1024),
- (size_t)(2 * 1024 * 1024));
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions enabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ display_detailed_stats,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't disable evictions 1.\n";
- }
- }
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ display_detailed_stats,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ TRUE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, TRUE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't enable evictions 1.\n";
- }
- }
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions enabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ display_detailed_stats,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ dirty_destroys,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't disable evictions 2.\n";
- }
- }
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, TRUE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't enable evictions 2.\n";
- }
- }
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions enabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ display_detailed_stats,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 12 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't disable evictions 3.\n";
- }
- }
-
- if ( show_progress ) /* 13 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ FALSE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 14 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, TRUE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't enable evictions 3.\n";
- }
- }
-
- if ( show_progress ) /* 15 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions enabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ display_detailed_stats,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ dirty_inserts,
- /* dirty_unprotects */ dirty_unprotects);
-
- if ( show_progress ) /* 16 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "can't disable evictions 4.\n";
- }
- }
-
- if ( show_progress ) /* 17 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d -- evictions disabled\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 18 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* smoke_check_10() */
-
-
-/*-------------------------------------------------------------------------
- * Function: write_permitted1_check()
- *
- * Purpose: A basic test of the write permitted function. In essence,
- * we load the cache up with dirty entryies, set
- * write_permitted1 to FALSE, and then protect a bunch of
- * entries. If there are any writes while write_permitted1 is
- * FALSE, the test will fail.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-write_permitted1_check(void)
-{
-
-#if H5C1_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
-
- const char * fcn_name = "write_permitted1_check";
- hbool_t show_progress = FALSE;
- hbool_t display_stats = FALSE;
- int32_t lag = 10;
- int mile_stone = 1;
- H5C1_t * cache_ptr = NULL;
-
-#endif /* H5C1_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
- TESTING("write permitted check -- 1/0 MB cache");
-
-#if H5C1_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- reset_entries1();
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- cache_ptr = setup_cache1((size_t)(1 * 1024 * 1024),
- (size_t)(0));
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ TRUE,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ TRUE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ TRUE,
- /* dirty_unprotects */ TRUE);
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- write_permitted1 = FALSE;
-
- row_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ FALSE,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ TRUE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ FALSE,
- /* dirty_unprotects */ NO_CHANGE);
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- write_permitted1 = TRUE;
-
- row_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ TRUE,
- /* do_renames */ TRUE,
- /* rename_to_main_addr */ FALSE,
- /* do_destroys */ FALSE,
- /* do_mult_ro_protects */ TRUE,
- /* dirty_destroys */ TRUE,
- /* dirty_unprotects */ TRUE);
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* flush and destroy all entries in the cache: */
-
- flush_cache1(/* cache_ptr */ cache_ptr,
- /* destroy_entries */ TRUE,
- /* dump_stats */ FALSE,
- /* dump_detailed_stats */ FALSE);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- col_major_scan_forward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ TRUE,
- /* dirty_inserts */ TRUE,
- /* dirty_unprotects */ TRUE);
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- write_permitted1 = FALSE;
-
- col_major_scan_backward1(/* cache_ptr */ cache_ptr,
- /* lag */ lag,
- /* verbose */ FALSE,
- /* reset_stats */ TRUE,
- /* display_stats */ display_stats,
- /* display_detailed_stats */ TRUE,
- /* do_inserts */ FALSE,
- /* dirty_inserts */ FALSE,
- /* dirty_unprotects */ NO_CHANGE);
-
- write_permitted1 = TRUE;
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- takedown_cache1(cache_ptr, display_stats, TRUE);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- verify_clean1();
- verify_unprotected1();
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
-#else /* H5C1_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
- SKIPPED();
-
- HDfprintf(stdout, " Clean and dirty LRU lists disabled.\n");
-
-#endif /* H5C1_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
- return;
-
-} /* write_permitted1_check() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_insert_entry1()
- *
- * Purpose: Verify that H5C1_insert_entry behaves as expected.
- * Test the behaviour with different flags.
- *
- * This test was added primarily to test basic insert
- * pinned entry functionallity, but I through in explicit
- * tests for other functionallity that is tested implicitly
- * elsewhere.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 8/10/06
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_insert_entry1(void)
-{
- const char * fcn_name = "check_insert_entry1";
- int entry_type = PICO_ENTRY_TYPE;
- int i;
- herr_t result;
- hbool_t in_cache;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- size_t entry_size;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
- struct H5C1_cache_entry_t * search_ptr;
-
-
- TESTING("H5C1_insert_entry() functionality");
-
- pass1 = TRUE;
-
- /* Allocate a cache, and insert entries into it using all
- * combinations of flags. Verify that the entries are inserted,
- * and that the flags have the desired effects.
- *
- * Note that the dirty parameter in insert_entry1 is no longer
- * used, as we have decided that all inserted entries are
- * dirty by definition. (Which sounds very reasonable, but didn't
- * used to be the case.)
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024 * 1024),
- (size_t)(1 * 1024 * 1024));
- }
-
- if ( pass1 ) {
-
- insert_entry1(cache_ptr, entry_type, 0, TRUE, H5C1__NO_FLAGS_SET);
- insert_entry1(cache_ptr, entry_type, 1, TRUE,
- H5C1__SET_FLUSH_MARKER_FLAG);
- insert_entry1(cache_ptr, entry_type, 2, TRUE, H5C1__PIN_ENTRY_FLAG);
- insert_entry1(cache_ptr, entry_type, 3, TRUE,
- (H5C1__SET_FLUSH_MARKER_FLAG | H5C1__PIN_ENTRY_FLAG));
- }
-
-
- /* Verify that the entries are inserted as desired. */
-
- i = 0;
- base_addr = entries1[0];
- while ( ( pass1 ) && ( i < 4 ) )
- {
- entry_ptr = &(base_addr[i]);
-
- /* Start by checking everything we can via H5C1_get_entry_status() */
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected,
- &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5AC1_get_entry_status() reports failure.";
- }
-
- if ( pass1 ) {
-
- /* check the universals */
- if ( ( ! in_cache ) || ( ! is_dirty ) || ( is_protected ) ||
- ( entry_size != entry_sizes1[entry_type] ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 1.";
- }
- }
-
- if ( pass1 ) {
-
- /* verify that the pinned flag got set correctly */
- if ( ( i == 2 ) || ( i == 3 ) ) {
-
- if ( ! is_pinned ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 2.";
- }
- } else if ( is_pinned ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 3.";
-
- } else if ( is_pinned != ((entry_ptr->header).is_pinned) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 4.";
- }
- }
-
- /* Thats all we can get from H5AC1_get_entry_status().
- * Now start looking at the cache data structures directly.
- */
-
- if ( pass1 ) {
-
- /* Verify that the flush marker got set correctly */
- if ( ( i == 1 ) || ( i == 3 ) ) {
-
- if ( ! ((entry_ptr->header).flush_marker) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 5.";
- }
- } else if ( (entry_ptr->header).flush_marker ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 6.";
- }
- }
-
- if ( pass1 ) {
-
- /* Verify that pinned entries are in the pinned entry list */
- if ( (entry_ptr->header).is_pinned ) {
-
- search_ptr = cache_ptr->pel_head_ptr;
-
- while ( ( search_ptr != NULL ) &&
- ( search_ptr !=
- (struct H5C1_cache_entry_t *)entry_ptr ) )
- {
- search_ptr = search_ptr->next;
- }
-
- if ( search_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 7.";
- }
- }
- }
-
- if ( pass1 ) {
-
- /* Verify that unpinned entries are in the LRU list */
- if ( ! ((entry_ptr->header).is_pinned) ) {
-
- search_ptr = cache_ptr->LRU_head_ptr;
-
- while ( ( search_ptr != NULL ) &&
- ( search_ptr !=
- (struct H5C1_cache_entry_t *)entry_ptr ) )
- {
- search_ptr = search_ptr->next;
- }
-
- if ( search_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 8.";
- }
- }
- }
-
-#if H5C1_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
- if ( pass1 ) {
-
- /* Verify that unpinned entries are in the dirty LRU list */
- if ( ! ((entry_ptr->header).is_pinned) ) {
-
- search_ptr = cache_ptr->dLRU_head_ptr;
-
- while ( ( search_ptr != NULL ) &&
- ( search_ptr !=
- (struct H5C1_cache_entry_t *)entry_ptr ) )
- {
- search_ptr = search_ptr->aux_next;
- }
-
- if ( search_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 9.";
- }
- }
- }
-#endif /* H5C1_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
-
- i++;
-
- } /* while */
-
-
- /* So much for looking at the individual entries. Now verify
- * that the various counts and sized in the cache header are
- * as expected.
- */
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 4 * entry_sizes1[entry_type] ) ||
- ( cache_ptr->slist_len != 4 ) ||
- ( cache_ptr->slist_size != 4 * entry_sizes1[entry_type] ) ||
- ( cache_ptr->pl_len != 0 ) ||
- ( cache_ptr->pl_size != (size_t)0 ) ||
- ( cache_ptr->pel_len != 2 ) ||
- ( cache_ptr->pel_size != 2 * entry_sizes1[entry_type] ) ||
- ( cache_ptr->LRU_list_len != 2 ) ||
- ( cache_ptr->LRU_list_size != 2 * entry_sizes1[entry_type] ) ||
-#if H5C1_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
- ( cache_ptr->dLRU_list_len != 2 ) ||
- ( cache_ptr->dLRU_list_size != 2 * entry_sizes1[entry_type] ) ||
-#endif /* H5C1_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
- ( cache_ptr->cLRU_list_len != 0 ) ||
- ( cache_ptr->cLRU_list_size != (size_t)0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 10.";
- }
- }
-
-
- /* Finally, if stats collection is enabled, verify that the expected
- * stats are collected.
- */
-#if H5C1_COLLECT_CACHE_STATS
- if ( pass1 ) {
-
- if ( ( cache_ptr->insertions[entry_type] != 4 ) ||
- ( cache_ptr->pinned_insertions[entry_type] != 2 ) ||
- ( cache_ptr->pins[entry_type] != 2 ) ||
- ( cache_ptr->unpins[entry_type] != 0 ) ||
- ( cache_ptr->dirty_pins[entry_type] != 0 ) ||
- ( cache_ptr->max_index_len != 4 ) ||
- ( cache_ptr->max_index_size != 4 * entry_sizes1[entry_type] ) ||
- ( cache_ptr->max_slist_len != 4 ) ||
- ( cache_ptr->max_slist_size != 4 * entry_sizes1[entry_type] ) ||
- ( cache_ptr->max_pl_len != 0 ) ||
- ( cache_ptr->max_pl_size != (size_t)0 ) ||
- ( cache_ptr->max_pel_len != 2 ) ||
- ( cache_ptr->max_pel_size != 2 * entry_sizes1[entry_type] ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected insert results 11.";
- }
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
-
- /* Unpin the pinned entries so we can take down the cache cleanly. */
-
- if ( pass1 ) {
-
- unpin_entry1(cache_ptr, entry_type, 2);
- unpin_entry1(cache_ptr, entry_type, 3);
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_insert_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1()
- *
- * Purpose: Verify that flush_cache1 behaves as expected. In particular,
- * test the behaviour with different flags.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 1/10/05
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_cache1(void)
-{
- const char * fcn_name = "check_flush_cache1";
- H5C1_t * cache_ptr = NULL;
-
- TESTING("H5C1_flush_cache() functionality");
-
- pass1 = TRUE;
-
- /* allocate a cache, and flush it under various circumstances.
- * To the extent possible, verify that the desired actions took
- * place.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024 * 1024),
- (size_t)(1 * 1024 * 1024));
- }
-
- /* first test behaviour on an empty cache. Can't do much sanity
- * checking in this case, so simply check the return values.
- */
-
- if ( pass1 ) {
-
- check_flush_cache1__empty_cache(cache_ptr);
- }
-
- /* now do a series of similar tests with a cache with a single entry.
- * Start with a clean entry, with no flags set.
- */
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry(cache_ptr);
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__multi_entry(cache_ptr);
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__flush_ops(cache_ptr);
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_flush_cache1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1__empty_cache()
- *
- * Purpose: Verify that flush_cache1 behaves as expected with an empty
- * cache.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 1/12/05
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_cache1__empty_cache(H5C1_t * cache_ptr)
-{
- /* const char * fcn_name = "check_flush_cache1__empty_cache"; */
- herr_t result;
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "cache_ptr NULL on entry to empty cache case.";
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "cache not empty at beginning of empty cache case.";
- }
-
-
- /* Test behaviour on an empty cache. Can't do much sanity
- * checking in this case, so simply check the return values.
- */
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr, H5C1__NO_FLAGS_SET);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "flush with flags = 0x00 failed on empty cache.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__FLUSH_INVALIDATE_FLAG);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "flush with flags = 0x04 failed on empty cache.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__FLUSH_CLEAR_ONLY_FLAG);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "flush with flags = 0x08 failed on empty cache.\n";
- }
- }
-
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__FLUSH_MARKED_ENTRIES_FLAG);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "flush with flags = 0x10 failed on empty cache.\n";
- }
- }
-
-} /* check_flush_cache1__empty_cache() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1__multi_entry()
- *
- * Purpose: Verify that flush_cache1 behaves as expected when the cache
- * contains multiple elements.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 1/14/05
- *
- * Modifications:
- *
- * JRM -- 4/5/06
- * Added pinned entry tests.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_cache1__multi_entry(H5C1_t * cache_ptr)
-{
- /* const char * fcn_name = "check_flush_cache1__multi_entry"; */
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "cache_ptr NULL on entry to multi entry case.";
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "cache not empty at beginning of multi entry case.";
- }
-
- if ( pass1 )
- {
- int test_num = 1;
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 8;
- struct flush_cache_test_spec spec[8] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- if ( pass1 )
- {
- int test_num = 2;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- int spec_size = 8;
- struct flush_cache_test_spec spec[8] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
-
- check_flush_cache1__multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- if ( pass1 )
- {
- int test_num = 3;
- unsigned int flush_flags = H5C1__FLUSH_CLEAR_ONLY_FLAG;
- int spec_size = 8;
- struct flush_cache_test_spec spec[8] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 25,
- /* insert_flag = */ TRUE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 50,
- /* insert_flag = */ TRUE,
- /* dirty_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 4,
- /* entry_type = */ MONSTER_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 6,
- /* entry_type = */ MONSTER_ENTRY_TYPE,
- /* entry_index = */ 30,
- /* insert_flag = */ TRUE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 7,
- /* entry_type = */ MONSTER_ENTRY_TYPE,
- /* entry_index = */ 40,
- /* insert_flag = */ TRUE,
- /* dirty_flag = */ TRUE,
- /* flags = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- if ( pass1 )
- {
- int test_num = 4;
- unsigned int flush_flags = H5C1__FLUSH_MARKED_ENTRIES_FLAG;
- int spec_size = 8;
- struct flush_cache_test_spec spec[8] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 25,
- /* insert_flag = */ TRUE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 50,
- /* insert_flag = */ TRUE,
- /* dirty_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 4,
- /* entry_type = */ MONSTER_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- if ( pass1 )
- {
- int test_num = 5;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG;
- int spec_size = 8;
- struct flush_cache_test_spec spec[8] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ TRUE
- }
- };
-
- check_flush_cache1__multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- if ( pass1 )
- {
- int test_num = 6;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG;
- int spec_size = 8;
- struct flush_cache_test_spec spec[8] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
-
- check_flush_cache1__multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- if ( pass1 )
- {
- int test_num = 7;
- unsigned int flush_flags = H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG;
- int spec_size = 8;
- struct flush_cache_test_spec spec[8] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 25,
- /* insert_flag = */ TRUE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 50,
- /* insert_flag = */ TRUE,
- /* dirty_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 4,
- /* entry_type = */ MONSTER_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 6,
- /* entry_type = */ MONSTER_ENTRY_TYPE,
- /* entry_index = */ 30,
- /* insert_flag = */ TRUE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 7,
- /* entry_type = */ MONSTER_ENTRY_TYPE,
- /* entry_index = */ 40,
- /* insert_flag = */ TRUE,
- /* dirty_flag = */ TRUE,
- /* flags = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- if ( pass1 )
- {
- int test_num = 8;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG;
- int spec_size = 8;
- struct flush_cache_test_spec spec[8] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ TRUE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ TRUE
- }
- };
-
- check_flush_cache1__multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- /* verify that all other flags are ignored */
- if ( pass1 )
- {
- int test_num = 9;
- unsigned int flush_flags = (unsigned)
- ~(H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG);
- int spec_size = 8;
- struct flush_cache_test_spec spec[8] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* dirty_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__NO_FLAGS_SET,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* 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 = */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__multi_entry_test(cache_ptr, test_num,
- 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 ( pass1 )
- {
- int test_num = 1;
- unsigned int flush_flags = H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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_cache1__pe_multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- if ( pass1 )
- {
- int test_num = 2;
- unsigned int flush_flags = H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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_cache1__pe_multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
- if ( pass1 )
- {
- int test_num = 3;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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_cache1__pe_multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- if ( pass1 )
- {
- int test_num = 4;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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_cache1__pe_multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
-
- if ( pass1 )
- {
- int test_num = 5;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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 = */ H5C1__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_cache1__pe_multi_entry_test(cache_ptr, test_num,
- flush_flags, spec_size, spec);
- }
-
- return;
-
-} /* check_flush_cache1__multi_entry() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1__multi_entry_test()
- *
- * Purpose: Run a multi entry flush cache test.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 1/13/05
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_cache1__multi_entry_test(H5C1_t * cache_ptr,
- int test_num,
- unsigned int flush_flags,
- int spec_size,
- struct flush_cache_test_spec spec[])
-{
- /* const char * fcn_name = "check_flush_cache1__multi_entry_test"; */
- static char msg[128];
- herr_t result;
- int i;
- size_t total_entry_size = 0;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
-#if 0 /* JRM */
- /* This gets used a lot, so lets leave it in. */
-
- HDfprintf(stdout, "check_flush_cache1__multi_entry_test: test %d\n",
- test_num);
-#endif /* JRM */
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "cache_ptr NULL on entry to single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
-
- HDsnprintf(msg, (size_t)128,
- "cache not empty at beginning of multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( spec_size < 1 ) || ( spec == NULL ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "missing/bad test spec on entry to multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
-
- i = 0;
- while ( ( pass1 ) && ( 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_indices1[spec[i].entry_type] ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "bad data in spec[%d] on entry to multi entry test #%d.",
- i, test_num);
- failure_mssg1 = msg;
- }
- i++;
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < spec_size ) )
- {
- if ( spec[i].insert_flag ) {
-
- insert_entry1(cache_ptr, spec[i].entry_type, spec[i].entry_index,
- spec[i].dirty_flag, spec[i].flags);
-
- } else {
-
- protect_entry1(cache_ptr, spec[i].entry_type, spec[i].entry_index);
-
- unprotect_entry1(cache_ptr, spec[i].entry_type, spec[i].entry_index,
- (int)(spec[i].dirty_flag), spec[i].flags);
- }
-
- total_entry_size += entry_sizes1[spec[i].entry_type];
-
- i++;
- }
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr, flush_flags);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "flush with flags 0x%x failed in multi entry test #%d.",
- flush_flags, test_num);
- failure_mssg1 = msg;
- }
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < spec_size ) )
- {
- base_addr = entries1[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
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Bad status on entry %d after flush in multi entry test #%d.",
- i, test_num);
- failure_mssg1 = msg;
- }
- i++;
- }
-
- if ( pass1 ) {
-
- if ( ( ( (flush_flags & H5C1__FLUSH_INVALIDATE_FLAG) == 0 )
- &&
- ( ( cache_ptr->index_len != spec_size )
- ||
- ( cache_ptr->index_size != total_entry_size )
- )
- )
- ||
- ( ( (flush_flags & H5C1__FLUSH_INVALIDATE_FLAG) != 0 )
- &&
- ( ( cache_ptr->index_len != 0 )
- ||
- ( cache_ptr->index_size != 0 )
- )
- )
- ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size after flush in multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- }
-
- /* clean up the cache to prep for the next test */
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__FLUSH_INVALIDATE_FLAG);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Flush failed on cleanup in multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size after cleanup in multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
-
- }
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < spec_size ) )
- {
- base_addr = entries1[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_cache1__multi_entry_test() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1__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_cache1__pe_multi_entry_test(H5C1_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_cache1__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 0 /* JRM */
- /* This is useful debugging code. Leave it in for now. */
-
- HDfprintf(stdout, "check_flush_cache1__pe_multi_entry_test: test %d\n",
- test_num);
-#endif /* JRM */
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "cache_ptr NULL on entry to pe multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
-
- HDsnprintf(msg, (size_t)128,
- "cache not empty at beginning of pe multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( spec_size < 1 ) || ( spec == NULL ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "missing/bad test spec on entry to pe multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
-
- i = 0;
- while ( ( pass1 ) && ( 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_indices1[spec[i].entry_type] ) ||
- ( spec[i].num_pins < 0 ) ||
- ( spec[i].num_pins > MAX_PINS ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "bad data in spec[%d] on entry to pe multi entry test #%d.",
- i, test_num);
- failure_mssg1 = msg;
- }
- i++;
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < spec_size ) )
- {
- if ( spec[i].insert_flag ) {
-
- insert_entry1(cache_ptr, spec[i].entry_type, spec[i].entry_index,
- spec[i].dirty_flag, spec[i].flags);
-
- } else {
-
- protect_entry1(cache_ptr, spec[i].entry_type, spec[i].entry_index);
-
- unprotect_entry1(cache_ptr, spec[i].entry_type, spec[i].entry_index,
- (int)(spec[i].dirty_flag), spec[i].flags);
- }
-
- total_entry_size += entry_sizes1[spec[i].entry_type];
-
- for ( j = 0; j < spec[i].num_pins; j++ )
- {
- create_pinned_entry_dependency1(cache_ptr,
- spec[i].entry_type,
- spec[i].entry_index,
- spec[i].pin_type[j],
- spec[i].pin_idx[j]);
- }
-
- i++;
- }
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr, flush_flags);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "flush with flags 0x%x failed in pe multi entry test #%d.",
- flush_flags, test_num);
- failure_mssg1 = msg;
- }
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < spec_size ) )
- {
- base_addr = entries1[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
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Bad status on entry %d after flush in pe multi entry test #%d.",
- i, test_num);
- failure_mssg1 = msg;
- }
- i++;
- }
-
- if ( pass1 ) {
-
- if ( ( ( (flush_flags & H5C1__FLUSH_INVALIDATE_FLAG) == 0 )
- &&
- ( ( cache_ptr->index_len != spec_size )
- ||
- ( cache_ptr->index_size != total_entry_size )
- )
- )
- ||
- ( ( (flush_flags & H5C1__FLUSH_INVALIDATE_FLAG) != 0 )
- &&
- ( ( cache_ptr->index_len != 0 )
- ||
- ( cache_ptr->index_size != 0 )
- )
- )
- ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size after flush in pe multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- }
-
- /* clean up the cache to prep for the next test */
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__FLUSH_INVALIDATE_FLAG);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Flush failed on cleanup in pe multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size after cleanup in pe multi entry test #%d.",
- test_num);
- failure_mssg1 = msg;
-
- }
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < spec_size ) )
- {
- base_addr = entries1[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_cache1__pe_multi_entry_test() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1__flush_ops()
- *
- * Purpose: Run the flush ops cache tests.
- *
- * These are tests that test the cache's ability to handle
- * the case in which the flush callback dirties, resizes,
- * and/or renames entries.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 9/3/06
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_cache1__flush_ops(H5C1_t * cache_ptr)
-{
- /* const char * fcn_name = "check_flush_cache1__flush_ops"; */
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "cache_ptr NULL on entry to flush ops test.";
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "cache not empty at beginning of flush ops test.";
- }
-
- if ( pass1 ) /* test #1 */
- {
- /* start with a very simple test, in which there are two entries
- * resident in cache, and the second entry dirties the first in
- * the flush callback. No size changes, and no flush flags.
- */
- int test_num = 1;
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 2;
- int init_expected_index_len = 2;
- size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE;
- int expected_index_len = 2;
- size_t expected_index_size = 2 * PICO_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ 0,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
-
- if ( pass1 ) /* test #2 */
- {
- /* Same as test 1, only this time set the flush invalidate flag.
- * Note that we must repeat all tests with the flush invalidate flag
- * as this triggers a different set of code to execute the flush.
- *
- * Create two entries resident in cache, and have the second entry
- * dirty the first in the flush callback.
- */
- int test_num = 2;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- int spec_size = 2;
- int init_expected_index_len = 2;
- size_t init_expected_index_size = 2 * PICO_ENTRY_SIZE;
- int expected_index_len = 0;
- size_t expected_index_size = 0;
- struct fo_flush_cache_test_spec spec[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE,0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
-
- if ( pass1 ) /* test #3 */
- {
- /* Single entry test verifying that the cache can handle the case in
- * which the call back function resizes the entry for which it has
- * been called.
- */
- int test_num = 3;
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4;
- int expected_index_len = 1;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE / 2;
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__SIZE_CHANGED_FLAG,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
-
- if ( pass1 ) /* test #4 */
- {
- /* Repeat test #4 with the flush invalidate flag.
- *
- * Single entry test verifying that the cache can handle the case in
- * which the call back function resizes the entry for which it has
- * been called.
- */
- int test_num = 4;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 4;
- int expected_index_len = 0;
- size_t expected_index_size = 0;
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__SIZE_CHANGED_FLAG,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
-
- if ( pass1 ) /* test #5 & #6 */
- {
- /* Single entry test verifying that the cache can handle the case in
- * which the call back function renames the entry for which it has
- * been called.
- *
- * Run this entry twice, as the first run moves the entry to its
- * alternate address, and the second moves it back.
- */
- int test_num = 5; /* and 6 */
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE;
- int expected_index_len = 1;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the rename to move the target entry back to its
- * main address. The first test moved it to its alternate address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the renamed entry is moved forward in the slist. In the second
- * it is moved backwards.
- *
- * Since there is only one entry in the cache, this doesn't really
- * matter in this case. But we will do similar tests later with
- * other entries in the cache.
- */
- if ( pass1 ) {
-
- spec[0].flush_ops[0].flag = TRUE;
- test_num = 6;
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
- }
-
- if ( pass1 ) /* test #7 & #8 */
- {
- /* Run tests 5 & 6 again, using the flush invalidate flag on the
- * second test.
- *
- * Single entry test verifying that the cache can handle the case in
- * which the call back function renames the entry for which it has
- * been called.
- *
- * Run this entry twice, as the first run moves the entry to its
- * alternate address, and the second moves it back.
- */
- int test_num = 7; /* and 8 */
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE;
- int expected_index_len = 1;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the rename to move the target entry back to its
- * main address. The first test moved it to its alternate address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the renamed entry is moved forward in the slist. In the second
- * it is moved backwards.
- *
- * Since there is only one entry in the cache, this doesn't really
- * matter in this case. But we will do similar tests later with
- * other entries in the cache.
- */
-
- if ( pass1 ) {
-
- test_num = 8;
- flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- expected_index_len = 0;
- expected_index_size = 0;
- spec[0].flush_ops[0].flag = TRUE;
- spec[0].expected_destroyed = TRUE;
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
- }
-
- if ( pass1 ) /* test #9 & #10 */
- {
- /* Single entry test verifying that the cache can handle the case in
- * which the call back function both resizes and renames the entry
- * for which it has been called.
- *
- * Again, we run this entry twice, as the first run moves the entry to its
- * alternate address, and the second moves it back.
- */
- int test_num = 9; /* and 10 */
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2;
- int expected_index_len = 1;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4;
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__SIZE_CHANGED_FLAG,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 2,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the rename to move the target entry back to its
- * main address. The first test moved it to its alternate address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the renamed entry is moved forward in the slist. In the second
- * it is moved backwards.
- *
- * Since there is only one entry in the cache, this doesn't really
- * matter in this case. But we will do similar tests later with
- * other entries in the cache.
- */
- if ( pass1 ) {
-
- spec[0].flush_ops[0].flag = TRUE;
- test_num = 10;
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
- }
-
- if ( pass1 ) /* test #11 & #12 */
- {
- /* Repeat the previous test with the flush invalidate flag on the
- * second test.
- *
- * Single entry test verifying that the cache can handle the case in
- * which the call back function both resizes and renames the entry
- * for which it has been called.
- *
- * Again, we run this entry twice, as the first run moves the entry to its
- * alternate address, and the second moves it back.
- */
- int test_num = 11; /* and 12 */
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = VARIABLE_ENTRY_SIZE / 2;
- int expected_index_len = 1;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE / 4;
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__SIZE_CHANGED_FLAG,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 2,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the rename to move the target entry back to its
- * main address. The first test moved it to its alternate address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the renamed entry is moved forward in the slist. In the second
- * it is moved backwards.
- *
- * Since there is only one entry in the cache, this doesn't really
- * matter in this case. But we will do similar tests later with
- * other entries in the cache.
- */
- if ( pass1 ) {
-
- test_num = 12;
- flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- expected_index_len = 0;
- expected_index_size = 0;
- spec[0].flush_ops[1].flag = TRUE;
- spec[0].expected_destroyed = TRUE;
-
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
- }
-
- if ( pass1 ) /* test #13 */
- {
- /* Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * dirties two entries that are not in cache. No size
- * changes.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 13;
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE;
- int expected_index_len = 3;
- size_t expected_index_size = 3 * PICO_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 2,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, 0, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ PICO_ENTRY_SIZE,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ PICO_ENTRY_SIZE,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
-
- if ( pass1 ) /* test #14 */
- {
- /* Repeat previous test with the flush invalidate flag.
- *
- * Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * dirties two entries that are not in cache. No size
- * changes.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 14;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * PICO_ENTRY_SIZE;
- int expected_index_len = 0;
- size_t expected_index_size = (size_t)0;
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 2,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, 0, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, 0, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ PICO_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ PICO_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
-
- if ( pass1 ) /* test #15 */
- {
- /* Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * resizes and dirties two entries that are not in cache.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 15;
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
- int expected_index_len = 3;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE +
- (VARIABLE_ENTRY_SIZE / 4) +
- (VARIABLE_ENTRY_SIZE / 2);
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
-
- if ( pass1 ) /* test #16 */
- {
- /* Repeat previous test with the flush invalidate flag.
- *
- * Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * resizes and dirties two entries that are not in cache.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 16;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
- int expected_index_len = 0;
- size_t expected_index_size = (size_t)0;
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
-
- if ( pass1 ) /* test #17 & #18 */
- {
- /* Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * resizes, dirties, and renames two entries that are not in cache.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 17; /* and 18 */
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
- int expected_index_len = 3;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE +
- (VARIABLE_ENTRY_SIZE / 4) +
- (VARIABLE_ENTRY_SIZE / 2);
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the renames to move the target entries back to
- * their main address. The first test moved them to their alternate
- * address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the renamed entries are moved forward in the slist. In the second
- * they are moved backwards.
- */
- if ( pass1 ) {
-
- test_num = 18;
- spec[0].flush_ops[2].flag = TRUE;
- spec[0].flush_ops[5].flag = TRUE;
- checks[0].at_main_addr = TRUE;
- checks[1].at_main_addr = TRUE;
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
- }
-
- if ( pass1 ) /* test #19 & #20 */
- {
- /* Repeat the above test with the flush invalidate flag on the
- * second test.
- *
- * Test the ability of the cache to handle the case in which
- * the flush function of an entry that is resident in cache
- * resizes, dirties, and renames two entries that are not in cache.
- *
- * At present, I am assured that this case will never occur, but
- * lets make sure we can handle it regardless.
- */
- int test_num = 19; /* and 20 */
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 1;
- int init_expected_index_len = 1;
- size_t init_expected_index_size = 1 * VARIABLE_ENTRY_SIZE;
- int expected_index_len = 3;
- size_t expected_index_size = VARIABLE_ENTRY_SIZE +
- (VARIABLE_ENTRY_SIZE / 4) +
- (VARIABLE_ENTRY_SIZE / 2);
- struct fo_flush_cache_test_spec spec[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 2;
- struct fo_flush_entry_check checks[2] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- /* this change forces the renames to move the target entries back to
- * their main address. The first test moved them to their alternate
- * address.
- *
- * Note that these two tests are not the same, as in the first test,
- * the renamed entries are moved forward in the slist. In the second
- * they are moved backwards.
- */
- if ( pass1 ) {
-
- test_num = 20;
- flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- expected_index_len = 0;
- expected_index_size = (size_t)0;
- spec[0].expected_destroyed = TRUE;
- spec[0].flush_ops[2].flag = TRUE;
- spec[0].flush_ops[5].flag = TRUE;
- checks[0].at_main_addr = TRUE;
- checks[0].in_cache = FALSE;
- checks[0].expected_destroyed = TRUE;
- checks[1].at_main_addr = TRUE;
- checks[1].in_cache = FALSE;
- checks[1].expected_destroyed = TRUE;
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
- }
-
- if ( pass1 ) /* test #21 */
- {
- /* Now mix things up a bit.
- *
- * Load several entries, two of which have flush functions that
- * resize, dirty, and rename two entries that are not in the
- * cache. Mark only one of these entries, and then flush the
- * cache with the flush marked entries flag.
- *
- * This is the only test in which we test the
- * H5C1__FLUSH_MARKED_ENTRIES_FLAG. The hope is that since
- * we test the two features extensively by themselves, so
- * it should be sufficient to verify that they play together
- * as expected.
- */
- int test_num = 21;
- unsigned int flush_flags = H5C1__FLUSH_MARKED_ENTRIES_FLAG;
- int spec_size = 4;
- int init_expected_index_len = 4;
- size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (2 * PICO_ENTRY_SIZE);
- int expected_index_len = 6;
- size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) +
- (VARIABLE_ENTRY_SIZE / 4) +
- (VARIABLE_ENTRY_SIZE / 2) +
- (2 * PICO_ENTRY_SIZE);
- struct fo_flush_cache_test_spec spec[4] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG | H5C1__SET_FLUSH_MARKER_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 11,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG | H5C1__SET_FLUSH_MARKER_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 4;
- struct fo_flush_entry_check checks[4] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ TRUE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ TRUE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 12,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- reset_entries1();
- }
-
- if ( pass1 ) /* test #22 */
- {
- /* Mix things up some more.
- *
- * Load lots of entries, some of which have flush functions that
- * resize, dirty, and rename two entries that are not in the
- * cache.
- *
- * Also load entries that have flush ops on entries that are in
- * cache.
- */
- int test_num = 22;
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 6;
- int init_expected_index_len = 6;
- size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE);
- int expected_index_len = 10;
- size_t expected_index_size = (2 * VARIABLE_ENTRY_SIZE) +
- (2 * (VARIABLE_ENTRY_SIZE / 4)) +
- (2 * (VARIABLE_ENTRY_SIZE / 2)) +
- (4 * PICO_ENTRY_SIZE);
- struct fo_flush_cache_test_spec spec[6] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 11,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 4,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 5,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 20,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 4;
- struct fo_flush_entry_check checks[4] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 12,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- reset_entries1();
- }
-
- if ( pass1 ) /* test #23 */
- {
- /* Repeat test #23 with the flush invalidate flag set.
- *
- * Mix things up some more.
- *
- * Load lots of entries, some of which have flush functions that
- * resize, dirty, and rename two entries that are not in the
- * cache.
- *
- * Also load entries that have flush ops on entries that are in
- * cache.
- */
- int test_num = 23;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- int spec_size = 6;
- int init_expected_index_len = 6;
- size_t init_expected_index_size = (2 * VARIABLE_ENTRY_SIZE) + (4 * PICO_ENTRY_SIZE);
- int expected_index_len = 0;
- size_t expected_index_size = 0;
- struct fo_flush_cache_test_spec spec[6] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 11,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 6,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 10, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 10, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 12, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 12, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 1,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 4,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 5,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 20,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
- int check_size = 4;
- struct fo_flush_entry_check checks[4] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 0,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 10,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 12,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- reset_entries1();
- }
-
- /* So much for tests involving only flush operations.
- *
- * Now create some tests mixing flush ops and pins.
- */
- if ( pass1 ) /* test #24 */
- {
- /* Pico entries 50 and 150 pin pico entry 100, and also dirty
- * pico entry 100 on flush.
- */
- int test_num = 24;
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 3;
- int init_expected_index_len = 3;
- size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE;
- int expected_index_len = 3;
- size_t expected_index_size = 3 * PICO_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[3] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 50,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 1,
- /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 150,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 1,
- /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__DIRTY, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
-
- if ( pass1 ) /* test #25 */
- {
- /* Repeat the previous test with the flush invalidate flag.
- *
- * Pico entries 50 and 150 pin pico entry 100, and also dirty
- * pico entry 100 on flush.
- */
- int test_num = 25;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- int spec_size = 3;
- int init_expected_index_len = 3;
- size_t init_expected_index_size = 3 * PICO_ENTRY_SIZE;
- int expected_index_len = 0;
- size_t expected_index_size = (size_t)0;
- struct fo_flush_cache_test_spec spec[3] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 50,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 1,
- /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ PICO_ENTRY_TYPE,
- /* entry_index = */ 150,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 1,
- /* pin_type = */ {PICO_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 1,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, PICO_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__DIRTY, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ (size_t)0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
- }
-
- if ( pass1 ) /* test #26 */
- {
- /* This one is complex.
- *
- * In the following overvies table, VET stands for
- * VARIABLE_ENTRY_TYPE.
- *
- * In trying to follow what happens when we flush the
- * set of entries constructed below, recall that each
- * flush operation is executed the first time the
- * entry is flushed, and then not executed again.
- * This may be a weakness in the tests, but that
- * is the way it is for now.
- *
- * After thinking about it for a while, I'm not sure that
- * the interaction between pins and flush operations needs
- * all that much testing, as the two are essentially
- * orthoginal. Thus this is a bit of a smoke check to
- * verify that we get the expected results.
- *
- * (VET, 100) initially not resident in cache
- *
- * (VET, 200) initially clean and resident in cache
- *
- * (VET, 300) initially not resident in cache
- *
- * (VET, 2100) initially clean and resident in cache
- *
- * (VET, 2200) initially not resident in cache
- *
- * (VET, 2300) initially clean and resident in cache
- *
- * (VET, 1000) initially clean, and in cache
- * dirties (VET, 100)
- * resizes (VET, 200)
- * dirty (VET, 300) -- dirty first to bring into cache.
- * renames (VET, 300)
- *
- * (VET, 2000) initially clean, and in cache
- * dirties (VET, 2100)
- * resizes (VET, 2200)
- * renames (VET, 2300)
- *
- * (VET, 350) initially clean, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 350)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 450) initially dirty, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * renames (VET, 450)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 650) initially clean, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 650)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 750) initially dirty, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 750)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 500) initially dirty, and in cache
- * dirties (VET, 350)
- * dirties (VET, 450)
- * dirties (VET, 650)
- * dirties (VET, 750)
- */
- int test_num = 26;
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 10;
- int init_expected_index_len = 10;
- size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE;
- int expected_index_len = 13;
- size_t expected_index_size = 9 * VARIABLE_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[10] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 200,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2300,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1000,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 4,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2000,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 5,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 350,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 6,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 450,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 7,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 650,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 8,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 750,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 9,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 500,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 3;
- struct fo_flush_entry_check checks[3] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 300,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2200,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ TRUE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
-
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- reset_entries1();
- }
-
- if ( pass1 ) /* test #27 */
- {
- /* Repeat test #26 with the flush invalidate flag.
- *
- * In the following overview table, VET stands for
- * VARIABLE_ENTRY_TYPE.
- *
- * In trying to follow what happens when we flush the
- * set of entries constructed below, recall that each
- * flush operation is executed the first time the
- * entry is flushed, and then not executed again.
- * This may be a weakness in the tests, but that
- * is the way it is for now.
- *
- * After thinking about it for a while, I'm not sure that
- * the interaction between pins and flush operations needs
- * all that much testing, as the two are essentially
- * orthoginal. The big thing is to verify that flushes of
- * pinned entries with flush ops result in the expected
- * updates of the cache.
- *
- * Thus this is a bit of a smoke check to * verify that we
- * get the expected results.
- *
- * (VET, 100) initially not resident in cache
- *
- * (VET, 200) initially clean and resident in cache
- *
- * (VET, 300) initially not resident in cache
- *
- * (VET, 2100) initially clean and resident in cache
- *
- * (VET, 2200) initially not resident in cache
- *
- * (VET, 2300) initially clean and resident in cache
- *
- * (VET, 1000) initially clean, and in cache
- * dirties (VET, 100)
- * resizes (VET, 200)
- * dirty (VET, 300) -- dirty first to bring into cache.
- * renames (VET, 300)
- *
- * (VET, 2000) initially clean, and in cache
- * dirties (VET, 2100)
- * resizes (VET, 2200)
- * renames (VET, 2300)
- *
- * (VET, 350) initially clean, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 350)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 450) initially dirty, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * renames (VET, 450)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 650) initially clean, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 650)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 750) initially dirty, and in cache
- * pins (VET, 1000)
- * dirties (VET, 1000)
- * resizes (VET, 750)
- * pins (VET, 2000)
- * dirties (VET, 2000)
- *
- * (VET, 500) initially dirty, and in cache
- * dirties (VET, 350)
- * dirties (VET, 450)
- * dirties (VET, 650)
- * dirties (VET, 750)
- */
- int test_num = 27;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- int spec_size = 10;
- int init_expected_index_len = 10;
- size_t init_expected_index_size = 10 * VARIABLE_ENTRY_SIZE;
- int expected_index_len = 0;
- size_t expected_index_size = (size_t)0;
- struct fo_flush_cache_test_spec spec[10] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 200,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2300,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 1000,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 4,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2000,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 2200, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 2300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 5,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 350,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 350, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 6,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 450,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 450, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 7,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 650,
- /* insert_flag = */ TRUE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 650, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 8,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 750,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 2,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {1000, 2000, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 1000, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 2000, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 750, FALSE, VARIABLE_ENTRY_SIZE / 4 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 9,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 500,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 4,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 350, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 450, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 650, FALSE, 0 },
- { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 750, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
- int check_size = 3;
- struct fo_flush_entry_check checks[3] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 300,
- /* expected_size = */ VARIABLE_ENTRY_SIZE,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 2200,
- /* expected_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ TRUE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
-
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- reset_entries1();
- }
-
- if ( pass1 ) /* test #28 */
- {
- /* Test the expected fheap case, in which an entry dirties
- * and resizes itself, and dirties an entry which it has
- * pinned.
- */
- int test_num = 28;
- unsigned int flush_flags = H5C1__NO_FLAGS_SET;
- int spec_size = 5;
- int init_expected_index_len = 5;
- size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE;
- int expected_index_len = 5;
- size_t expected_index_size = 4 * VARIABLE_ENTRY_SIZE;
- struct fo_flush_cache_test_spec spec[5] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 200,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 200, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 300,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 400,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- },
- {
- /* entry_num = */ 4,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 500,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 500, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ FALSE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ 0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- reset_entries1();
- }
-
- if ( pass1 ) /* test #29 */
- {
- /* Repeat test #28 with the flush invalidate flag.
- *
- * Test the expected fheap case, in which an entry dirties
- * and resizes itself, and dirties an entry which it has
- * pinned.
- */
- int test_num = 29;
- unsigned int flush_flags = H5C1__FLUSH_INVALIDATE_FLAG;
- int spec_size = 5;
- int init_expected_index_len = 5;
- size_t init_expected_index_size = 3 * VARIABLE_ENTRY_SIZE;
- int expected_index_len = 0;
- size_t expected_index_size = 0;
- struct fo_flush_cache_test_spec spec[5] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 100,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 1,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 200,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 2,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 200, FALSE, VARIABLE_ENTRY_SIZE },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 200, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 2,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 300,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {400, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 400, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 300, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 300, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 3,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 400,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__NO_FLAGS_SET,
- /* new_size = */ 0,
- /* num_pins = */ 0,
- /* pin_type = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {0, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 0,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- },
- {
- /* entry_num = */ 4,
- /* entry_type = */ VARIABLE_ENTRY_TYPE,
- /* entry_index = */ 500,
- /* insert_flag = */ FALSE,
- /* flags = */ H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG,
- /* new_size = */ VARIABLE_ENTRY_SIZE / 4,
- /* num_pins = */ 1,
- /* pin_type = */ {VARIABLE_ENTRY_TYPE, 0, 0, 0, 0, 0, 0, 0},
- /* pin_idx = */ {100, 0, 0, 0, 0, 0, 0, 0},
- /* num_flush_ops = */ 3,
- /* flush_ops = */
- /* op_code: type: idx: flag: size: */
- { { FLUSH_OP__DIRTY, VARIABLE_ENTRY_TYPE, 100, FALSE, 0 },
- { FLUSH_OP__RESIZE, VARIABLE_ENTRY_TYPE, 500, FALSE, VARIABLE_ENTRY_SIZE / 2 },
- { FLUSH_OP__RENAME, VARIABLE_ENTRY_TYPE, 500, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 },
- { FLUSH_OP__NO_OP, 0, 0, FALSE, 0 } },
- /* expected_loaded = */ TRUE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ TRUE,
- /* expected_destroyed = */ TRUE
- }
- };
- int check_size = 0;
- struct fo_flush_entry_check checks[1] =
- {
- {
- /* entry_num = */ 0,
- /* entry_type = */ 0,
- /* entry_index = */ 0,
- /* expected_size = */ 0,
- /* in_cache = */ FALSE,
- /* at_main_addr = */ FALSE,
- /* is_dirty = */ FALSE,
- /* is_protected = */ FALSE,
- /* is_pinned = */ FALSE,
- /* expected_loaded = */ FALSE,
- /* expected_cleared = */ FALSE,
- /* expected_flushed = */ FALSE,
- /* expected_destroyed = */ FALSE
- }
- };
-
- check_flush_cache1__flush_op_test(cache_ptr,
- test_num,
- flush_flags,
- spec_size,
- spec,
- init_expected_index_len,
- init_expected_index_size,
- expected_index_len,
- expected_index_size,
- check_size,
- checks);
-
- reset_entries1();
- }
-
- /* finally finish up with the flush ops eviction test */
- check_flush_cache1__flush_op_eviction_test(cache_ptr);
-
- return;
-
-} /* check_flush_cache1__flush_ops() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1__flush_op_test()
- *
- * Purpose: Run a flush op flush cache test. Of the nature of
- * flush operations, this is a multi-entry test.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 9/3/06
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_cache1__flush_op_test(H5C1_t * cache_ptr,
- int test_num,
- unsigned int flush_flags,
- int spec_size,
- struct fo_flush_cache_test_spec spec[],
- int init_expected_index_len,
- size_t init_expected_index_size,
- int expected_index_len,
- size_t expected_index_size,
- int check_size,
- struct fo_flush_entry_check check[])
-{
- /* const char * fcn_name = "check_flush_cache1__flush_op_test"; */
- static char msg[128];
- herr_t result;
- int i;
- int j;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
-#if 0 /* This is useful debugging code -- lets keep it around. */
- HDfprintf(stdout, "check_flush_cache1__flush_op_test: test %d\n",
- test_num);
-#endif
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "cache_ptr NULL on entry to flush op test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
-
- HDsnprintf(msg, (size_t)128,
- "cache not empty at beginning of flush op test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( spec_size < 1 ) || ( spec == NULL ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "missing/bad test spec on entry to flush op test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
-
- i = 0;
- while ( ( pass1 ) && ( 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_indices1[spec[i].entry_type] ) ||
- ( spec[i].num_pins < 0 ) ||
- ( spec[i].num_pins > MAX_PINS ) ||
- ( spec[i].num_flush_ops < 0 ) ||
- ( spec[i].num_flush_ops > MAX_FLUSH_OPS ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "bad data in spec[%d] on entry to flush op test #%d.",
- i, test_num);
- failure_mssg1 = msg;
- }
- i++;
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < check_size ) )
- {
- if ( ( check[i].entry_num != i ) ||
- ( check[i].entry_type < 0 ) ||
- ( check[i].entry_type >= NUMBER_OF_ENTRY_TYPES ) ||
- ( check[i].entry_index < 0 ) ||
- ( check[i].entry_index > max_indices1[check[i].entry_type] ) ||
- ( check[i].expected_size <= (size_t)0 ) ||
- ( ( check[i].in_cache != TRUE ) &&
- ( check[i].in_cache != FALSE ) ) ||
- ( ( check[i].at_main_addr != TRUE ) &&
- ( check[i].at_main_addr != FALSE ) ) ||
- ( ( check[i].is_dirty != TRUE ) &&
- ( check[i].is_dirty != FALSE ) ) ||
- ( ( check[i].is_protected != TRUE ) &&
- ( check[i].is_protected != FALSE ) ) ||
- ( ( check[i].is_pinned != TRUE ) &&
- ( check[i].is_pinned != FALSE ) ) ||
- ( ( check[i].expected_loaded != TRUE ) &&
- ( check[i].expected_loaded != FALSE ) ) ||
- ( ( check[i].expected_cleared != TRUE ) &&
- ( check[i].expected_cleared != FALSE ) ) ||
- ( ( check[i].expected_flushed != TRUE ) &&
- ( check[i].expected_flushed != FALSE ) ) ||
- ( ( check[i].expected_destroyed != TRUE ) &&
- ( check[i].expected_destroyed != FALSE ) ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "bad data in check[%d] on entry to flush op test #%d.",
- i, test_num);
- failure_mssg1 = msg;
- }
- i++;
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < spec_size ) )
- {
- if ( spec[i].insert_flag ) {
-
- insert_entry1(cache_ptr, spec[i].entry_type, spec[i].entry_index,
- TRUE, spec[i].flags);
-
- } else {
-
- protect_entry1(cache_ptr, spec[i].entry_type, spec[i].entry_index);
-
- unprotect_entry1_with_size_change(cache_ptr, spec[i].entry_type,
- spec[i].entry_index,
- spec[i].flags, spec[i].new_size);
- }
-
- for ( j = 0; j < spec[i].num_pins; j++ )
- {
- create_pinned_entry_dependency1(cache_ptr,
- spec[i].entry_type,
- spec[i].entry_index,
- spec[i].pin_type[j],
- spec[i].pin_idx[j]);
- }
-
- for ( j = 0; j < spec[i].num_flush_ops; j++ )
- {
- add_flush_op1(spec[i].entry_type,
- spec[i].entry_index,
- spec[i].flush_ops[j].op_code,
- spec[i].flush_ops[j].type,
- spec[i].flush_ops[j].idx,
- spec[i].flush_ops[j].flag,
- spec[i].flush_ops[j].size);
- }
-
- i++;
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != init_expected_index_len ) ||
- ( cache_ptr->index_size != init_expected_index_size ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size before flush in flush op test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr, flush_flags);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "flush with flags 0x%x failed in flush op test #%d.",
- flush_flags, test_num);
- failure_mssg1 = msg;
- }
- }
-
-
- i = 0;
- while ( ( pass1 ) && ( i < spec_size ) )
- {
- base_addr = entries1[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));
-
- HDfprintf(stdout, "entry_ptr->header.is_dirty = %d\n",
- (int)(entry_ptr->header.is_dirty));
-#endif
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Bad status on entry %d after flush op test #%d.",
- i, test_num);
- failure_mssg1 = msg;
- }
- i++;
- }
-
- if ( pass1 ) {
-
- i = 0;
- while ( ( pass1 ) && ( i < check_size ) )
- {
- if ( check[i].in_cache != entry_in_cache1(cache_ptr,
- check[i].entry_type,
- check[i].entry_index) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Check1 failed on entry %d after flush op test #%d.",
- i, test_num);
- failure_mssg1 = msg;
- }
-
- base_addr = entries1[check[i].entry_type];
- entry_ptr = &(base_addr[check[i].entry_index]);
-
- if ( ( entry_ptr->size != check[i].expected_size ) ||
- ( ( ! entry_ptr->header.destroy_in_progress ) &&
- ( check[i].in_cache ) &&
- ( entry_ptr->header.size != check[i].expected_size ) ) ||
- ( entry_ptr->at_main_addr != check[i].at_main_addr ) ||
- ( entry_ptr->is_dirty != check[i].is_dirty ) ||
- ( entry_ptr->header.is_dirty != check[i].is_dirty ) ||
- ( entry_ptr->is_protected != check[i].is_protected ) ||
- ( entry_ptr->header.is_protected != check[i].is_protected ) ||
- ( entry_ptr->is_pinned != check[i].is_pinned ) ||
- ( entry_ptr->header.is_pinned != check[i].is_pinned ) ||
- ( entry_ptr->loaded != check[i].expected_loaded ) ||
- ( entry_ptr->cleared != check[i].expected_cleared ) ||
- ( entry_ptr->flushed != check[i].expected_flushed ) ||
- ( entry_ptr->destroyed != check[i].expected_destroyed ) ) {
-
-#if 0 /* This is useful debugging code. Lets keep it around for a while. */
-
- if ( entry_ptr->size != check[i].expected_size ) {
- HDfprintf(stdout, "entry_ptr->size (expected) = %d (%d).\n",
- (int)(entry_ptr->size),
- (int)(check[i].expected_size));
- }
- if ( ( ! entry_ptr->header.destroy_in_progress ) &&
- ( check[i].in_cache ) &&
- ( entry_ptr->header.size != check[i].expected_size ) ) {
- HDfprintf(stdout,
- "(!destroy in progress and in cache and size (expected) = %d (%d).\n",
- (int)(entry_ptr->header.size),
- (int)(check[i].expected_size));
- }
- if ( entry_ptr->at_main_addr != check[i].at_main_addr ) {
- HDfprintf(stdout, "(%d,%d) at main addr (expected) = %d (%d).\n",
- (int)(check[i].entry_type),
- (int)(check[i].entry_index),
- (int)(entry_ptr->at_main_addr),
- (int)(check[i].at_main_addr));
- }
- if ( entry_ptr->is_dirty != check[i].is_dirty ) {
- HDfprintf(stdout, "entry_ptr->is_dirty (expected) = %d (%d).\n",
- (int)(entry_ptr->is_dirty),
- (int)(check[i].is_dirty));
- }
- if ( entry_ptr->header.is_dirty != check[i].is_dirty ) {
- HDfprintf(stdout, "entry_ptr->header.is_dirty (expected) = %d (%d).\n",
- (int)(entry_ptr->header.is_dirty),
- (int)(check[i].is_dirty));
- }
- if ( entry_ptr->is_protected != check[i].is_protected ) {
- HDfprintf(stdout, "entry_ptr->is_protected (expected) = %d (%d).\n",
- (int)(entry_ptr->is_protected),
- (int)(check[i].is_protected));
- }
- if ( entry_ptr->header.is_protected != check[i].is_protected ) {
- HDfprintf(stdout, "entry_ptr->header.is_protected (expected) = %d (%d).\n",
- (int)(entry_ptr->is_protected),
- (int)(check[i].is_protected));
- }
- if ( entry_ptr->is_pinned != check[i].is_pinned ) {
- HDfprintf(stdout, "entry_ptr->is_pinned (expected) = %d (%d).\n",
- (int)(entry_ptr->is_pinned),
- (int)(check[i].is_pinned));
- }
- if ( entry_ptr->header.is_pinned != check[i].is_pinned ) {
- HDfprintf(stdout, "entry_ptr->header.is_pinned (expected) = %d (%d).\n",
- (int)(entry_ptr->header.is_pinned),
- (int)(check[i].is_pinned));
- }
- if ( entry_ptr->loaded != check[i].expected_loaded ) {
- HDfprintf(stdout, "entry_ptr->loaded (expected) = %d (%d).\n",
- (int)(entry_ptr->loaded),
- (int)(check[i].expected_loaded));
- }
- if ( entry_ptr->cleared != check[i].expected_cleared ) {
- HDfprintf(stdout, "entry_ptr->cleared (expected) = %d (%d).\n",
- (int)(entry_ptr->cleared),
- (int)(check[i].expected_cleared));
- }
- if ( entry_ptr->flushed != check[i].expected_flushed ) {
- HDfprintf(stdout, "entry_ptr->flushed (expected) = %d (%d).\n",
- (int)(entry_ptr->flushed),
- (int)(check[i].expected_flushed));
- }
- if ( entry_ptr->destroyed != check[i].expected_destroyed ) {
- HDfprintf(stdout, "entry_ptr->destroyed (expected) = %d (%d).\n",
- (int)(entry_ptr->destroyed),
- (int)(check[i].expected_destroyed));
- }
-#endif
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Check2 failed on entry %d after flush op test #%d.",
- i, test_num);
- failure_mssg1 = msg;
- }
- i++;
- }
- }
-
- if ( pass1 ) {
-
- if ( ( ( (flush_flags & H5C1__FLUSH_INVALIDATE_FLAG) == 0 )
- &&
- ( ( cache_ptr->index_len != expected_index_len )
- ||
- ( cache_ptr->index_size != expected_index_size )
- )
- )
- ||
- ( ( (flush_flags & H5C1__FLUSH_INVALIDATE_FLAG) != 0 )
- &&
- ( ( cache_ptr->index_len != 0 )
- ||
- ( cache_ptr->index_size != 0 )
- )
- )
- ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size after flush in flush op test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- }
-
- /* clean up the cache to prep for the next test */
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__FLUSH_INVALIDATE_FLAG);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Flush failed on cleanup in flush op test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size after cleanup in flush op test #%d.",
- test_num);
- failure_mssg1 = msg;
-
- }
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < spec_size ) )
- {
- base_addr = entries1[spec[i].entry_type];
- entry_ptr = &(base_addr[spec[i].entry_index]);
-
- entry_ptr->size = entry_sizes1[spec[i].entry_type];
-
- entry_ptr->loaded = FALSE;
- entry_ptr->cleared = FALSE;
- entry_ptr->flushed = FALSE;
- entry_ptr->destroyed = FALSE;
-
- i++;
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < check_size ) )
- {
- base_addr = entries1[check[i].entry_type];
- entry_ptr = &(base_addr[check[i].entry_index]);
-
- entry_ptr->size = entry_sizes1[check[i].entry_type];
-
- entry_ptr->loaded = FALSE;
- entry_ptr->cleared = FALSE;
- entry_ptr->flushed = FALSE;
- entry_ptr->destroyed = FALSE;
-
- i++;
- }
-
- return;
-
-} /* check_flush_cache1__flush_op_test() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1__flush_op_eviction_test()
- *
- * Purpose: Verify that flush operations work as expected when an
- * entry is evicted.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 10/3/06
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_cache1__flush_op_eviction_test(H5C1_t * cache_ptr)
-{
- /* const char * fcn_name = "check_flush_cache1__flush_op_eviction_test"; */
- int i;
- int num_variable_entries1 = 8;
- int num_monster_entries1 = 31;
- int num_large_entries1 = 0;
- herr_t result;
- test_entry_t * entry_ptr;
- test_entry_t * base_addr;
- struct expected_entry_status expected[8 + 31 + 14] =
- {
- /* the expected array is used to maintain a table of the expected status of every
- * entry used in this test. Note that since the function that processes this
- * array only processes as much of it as it is told to, we don't have to
- * worry about maintaining the status of entries that we haven't used yet.
- */
- /* entry entry in at main */
- /* type: index: size: cache: addr: dirty: prot: pinned: loaded: clrd: flshd: dest: */
- { VARIABLE_ENTRY_TYPE, 0, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 1, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 2, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 3, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 4, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 5, VARIABLE_ENTRY_SIZE/2, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 6, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { VARIABLE_ENTRY_TYPE, 7, VARIABLE_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 0, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 1, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 2, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 3, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 4, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 5, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 6, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 7, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 8, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 9, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 10, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 11, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 12, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 13, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 14, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 15, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 16, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 17, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 18, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 19, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 20, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 21, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 22, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 23, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 25, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 26, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 27, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 28, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 29, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 0, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 1, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 2, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 3, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 4, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 5, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 6, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 7, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 8, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 9, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 10, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 11, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 12, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE },
- { LARGE_ENTRY_TYPE, 13, LARGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE }
- };
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "cache_ptr NULL on entry to flush ops test.";
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "cache not empty at start of flush ops eviction test.";
- }
- else if ( ( cache_ptr->max_cache_size != (2 * 1024 * 1024 ) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024 ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected cache config at start of flush op eviction test.";
-
- } else {
-
- /* set min clean size to zero for this test as it simplifies
- * computing the expected cache size after each operation.
- */
-
- cache_ptr->min_clean_size = 0;
- }
-
- if ( pass1 ) {
-
- /* the basic idea in this test is to insert a bunch of entries
- * with flush operations associated with them, and then load
- * other entries into the cache until the cache is full. At
- * that point, load yet more entries into the cache, and see
- * if the flush operations are performed as expected.
- *
- * To make things a bit more interesting, we also include a
- * couple of pins.
- */
-
- /* reset the stats before we start. If stats are enabled, we will
- * check to see if they are as expected at the end.
- */
- H5C1_stats__reset(cache_ptr);
-
-
- /* load a few entries with pin relationships and flush ops.
- * Start by just loading the entries.
- */
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 0);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 0,
- H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG,
- (VARIABLE_ENTRY_SIZE / 2));
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 1);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 1,
- H5C1__NO_FLAGS_SET, (size_t)0);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 2);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 2,
- H5C1__NO_FLAGS_SET, (size_t)0);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 3);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 3,
- H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG,
- (VARIABLE_ENTRY_SIZE / 2));
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 4);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 4,
- H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG,
- (VARIABLE_ENTRY_SIZE / 2));
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 5);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 5,
- H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG,
- (VARIABLE_ENTRY_SIZE / 2));
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 6);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 6,
- H5C1__NO_FLAGS_SET, (size_t)0);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 7);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 7,
- H5C1__NO_FLAGS_SET, (size_t)0);
-
- if ( ( cache_ptr->index_len != 8 ) ||
- ( cache_ptr->index_size != (4 * (VARIABLE_ENTRY_SIZE / 2)) +
- (4 * VARIABLE_ENTRY_SIZE) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 1.";
- }
- }
-
- if ( pass1 ) {
-
- /* Now set up the pinning relationships:
- *
- * Briefly, (VET, 0) is pinned by (VET, 1), (VET, 2), and (VET, 3)
- * (VET, 7) is pinned by (VET, 3), and (VET, 5)
- */
- create_pinned_entry_dependency1(cache_ptr, VARIABLE_ENTRY_TYPE, 1,
- VARIABLE_ENTRY_TYPE, 0);
- create_pinned_entry_dependency1(cache_ptr, VARIABLE_ENTRY_TYPE, 2,
- VARIABLE_ENTRY_TYPE, 0);
- create_pinned_entry_dependency1(cache_ptr, VARIABLE_ENTRY_TYPE, 3,
- VARIABLE_ENTRY_TYPE, 0);
- create_pinned_entry_dependency1(cache_ptr, VARIABLE_ENTRY_TYPE, 3,
- VARIABLE_ENTRY_TYPE, 7);
- create_pinned_entry_dependency1(cache_ptr, VARIABLE_ENTRY_TYPE, 5,
- VARIABLE_ENTRY_TYPE, 7);
-
- /* Next, set up the flush operations:
- *
- * Briefly, (VET, 1) dirties (VET, 0)
- * resizes (VET, 0) to 3/4 VARIABLE_ENTRY_SIZE
- *
- * (VET, 2) dirties (VET, 0)
- * resizes (VET, 0) to VARIABLE_ENTRY_SIZE
- * renames (VET, 0) to its alternate address
- *
- * (VET, 3) dirties (VET, 0)
- * resizes itself to VARIABLE_ENTRY_SIZE
- *
- * (VET, 7) dirties (VET, 6)
- */
- add_flush_op1(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__DIRTY,
- VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0);
- add_flush_op1(VARIABLE_ENTRY_TYPE, 1, FLUSH_OP__RESIZE,
- VARIABLE_ENTRY_TYPE, 0, FALSE,
- 3 * VARIABLE_ENTRY_SIZE / 4);
-
- add_flush_op1(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__DIRTY,
- VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0);
- add_flush_op1(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__RESIZE,
- VARIABLE_ENTRY_TYPE, 0, FALSE, VARIABLE_ENTRY_SIZE);
- add_flush_op1(VARIABLE_ENTRY_TYPE, 2, FLUSH_OP__RENAME,
- VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0);
-
- add_flush_op1(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__DIRTY,
- VARIABLE_ENTRY_TYPE, 0, FALSE, (size_t)0);
- add_flush_op1(VARIABLE_ENTRY_TYPE, 3, FLUSH_OP__RESIZE,
- VARIABLE_ENTRY_TYPE, 3, FALSE, VARIABLE_ENTRY_SIZE);
-
- add_flush_op1(VARIABLE_ENTRY_TYPE, 7, FLUSH_OP__DIRTY,
- VARIABLE_ENTRY_TYPE, 6, FALSE, (size_t)0);
- }
-
- if ( pass1 ) {
-
- /* to summarize, at present the following variable size entries
- * are in cache with the following characteristics:
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 5 KB Y Y - -
- *
- * (VET, 1) Y 10 KB N N 0 dirty (VET, 0),
- * resize (VET, 0) to 7.5 KB
- *
- * (VET, 2) Y 10 KB N N 0 dirty (VET, 0)
- * resize (VET, 0) to 10 KB
- * rename (VET, 0) to its alternate address
- *
- * (VET, 3) Y 5 KB Y N 0, 7 dirty (VET, 0)
- * resize (VET, 3) to 10 KB
- *
- * (VET, 4) Y 5 KB Y N - -
- *
- * (VET, 5) Y 5 KB Y N 7 -
- *
- * (VET, 6) Y 10 KB N N - -
- *
- * (VET, 7) Y 10 KB N Y - dirty (VET, 6)
- *
- * Recall that in this test bed, flush operations are excuted the
- * first time the associated entry is flushed, and are then
- * deleted.
- */
-
- /* Now fill up the cache with other, unrelated entries */
- for ( i = 0; i < 31; i++ )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, MONSTER_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- for ( i = 0; i < 1; i++ )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- /* The cache should now be exactly full */
- if ( ( cache_ptr->index_len != 40 ) ||
- ( cache_ptr->index_size != 2 * 1024 * 1024 ) ||
- ( cache_ptr->index_size != ((4 * VARIABLE_ENTRY_SIZE / 2) +
- (4 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (1 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 2.";
-
- } else {
-
- /* verify the expected status of all entries we have loaded to date: */
- num_large_entries1 = 1;
- verify_entry_status1(cache_ptr,
- 0,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
- }
-
-
- if ( pass1 ) {
-
- /* Now load a large entry. This should result in the eviction
- * of (VET,1), and the increase in the size of (VET, 0) from .5
- * VARIABLE_ENTRY_SIZE to .75 VARIABLE_ENTRY_SIZE.
- *
- * The following table illustrates the intended state of affairs
- * after the eviction:
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 7.5 KB Y Y - -
- *
- * (VET, 1) N 10 KB N N - -
- *
- * (VET, 2) Y 10 KB N N 0 dirty (VET, 0)
- * resize (VET, 0) to 10 KB
- * rename (VET, 0) to its alternate address
- *
- * (VET, 3) Y 5 KB Y N 0, 7 dirty (VET, 0)
- * resize (VET, 3) to 10 KB
- *
- * (VET, 4) Y 5 KB Y N - -
- *
- * (VET, 5) Y 5 KB Y N 7 -
- *
- * (VET, 6) Y 10 KB N N - -
- *
- * (VET, 7) Y 10 KB Y Y - dirty (VET, 6)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
- expected[0].size = 3 * VARIABLE_ENTRY_SIZE / 4;
- expected[1].in_cache = FALSE;
- expected[1].flushed = TRUE;
- expected[1].destroyed = TRUE;
-
- num_large_entries1 = 2;
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 1);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, 1,
- H5C1__DIRTIED_FLAG, (size_t)0);
-
- if ( ( cache_ptr->index_len != 40 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (VARIABLE_ENTRY_SIZE) +
- (VARIABLE_ENTRY_SIZE / 4) +
- (LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->index_size != ((1 * 3 * VARIABLE_ENTRY_SIZE / 4 ) +
- (3 * VARIABLE_ENTRY_SIZE / 2 ) +
- (3 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (2 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 3.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 1,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- if ( pass1 ) {
-
- /* Now load another large entry. This should result in the eviction
- * of (VET, 2), the increase in the size of (VET, 0) from .75
- * VARIABLE_ENTRY_SIZE to 1.0 VARIABLE_ENTRY_SIZE, and the renaming
- * of (VET, 0) to its alternate address.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 10 KB Y Y - -
- *
- * (VET, 1) N 10 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) Y 5 KB Y N 0, 7 dirty (VET, 0)
- * resize (VET, 3) to 10 KB
- *
- * (VET, 4) Y 5 KB Y N - -
- *
- * (VET, 5) Y 5 KB Y N 7 -
- *
- * (VET, 6) Y 10 KB N N - -
- *
- * (VET, 7) Y 10 KB Y Y - dirty (VET, 6)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
- expected[0].size = VARIABLE_ENTRY_SIZE;
- expected[0].at_main_addr = FALSE;
- expected[2].in_cache = FALSE;
- expected[2].flushed = TRUE;
- expected[2].destroyed = TRUE;
-
- num_large_entries1 = 3;
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 2);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, 2,
- H5C1__DIRTIED_FLAG, (size_t)0);
-
- if ( ( cache_ptr->index_len != 40 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (2 * VARIABLE_ENTRY_SIZE) +
- (VARIABLE_ENTRY_SIZE / 2) +
- (2 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->index_size != ((3 * VARIABLE_ENTRY_SIZE / 2) +
- (3 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (3 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 4.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 2,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- if ( pass1 ) {
-
- /* load two more large entries. This should result in (VET, 3) being
- * flushed, and increasing its size from 1/2 VARIABLE_ENTRY_SIZE to
- * VARIABLE_ENTRY_SIZE.
- *
- * As a result of this size increase, the cache will have to look
- * for another entry to evict. After flushing (VET, 4) and (VET, 5),
- * it should evict (VET, 6), yielding the needed memory.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 10 KB Y Y - -
- *
- * (VET, 1) N 10 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) Y 10 KB N N 0, 7 -
- *
- * (VET, 4) Y 5 KB N N - -
- *
- * (VET, 5) Y 5 KB N N 7 -
- *
- * (VET, 6) N 10 KB N N - -
- *
- * (VET, 7) Y 10 KB Y Y - dirty (VET, 6)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
-
- expected[3].size = VARIABLE_ENTRY_SIZE;
- expected[3].is_dirty = FALSE;
- expected[3].flushed = TRUE;
- expected[4].is_dirty = FALSE;
- expected[4].flushed = TRUE;
- expected[5].is_dirty = FALSE;
- expected[5].flushed = TRUE;
- expected[6].in_cache = FALSE;
- expected[6].flushed = TRUE;
- expected[6].destroyed = TRUE;
-
- num_large_entries1 = 5;
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 3);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, 3,
- H5C1__DIRTIED_FLAG, (size_t)0);
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 4);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, 4,
- H5C1__DIRTIED_FLAG, (size_t)0);
-
- /* verify cache size */
- if ( ( cache_ptr->index_len != 41 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (3 * VARIABLE_ENTRY_SIZE) +
- (1 * VARIABLE_ENTRY_SIZE ) + /* size increases of (VET, 0) & (VET, 3) */
- (4 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 2) +
- (3 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (5 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 5.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 3,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- if ( pass1 ) {
-
- /* now touch all the non VARIABLE_ENTRY_TYPE entries in the
- * cache to bring all the VARIABLE_ENTRY_TYPE entries to the
- * end of the LRU list.
- *
- * Note that we don't have to worry about (VET, 0) and (VET, 7)
- * as they are pinned and thus not in the LRU list to begin with.
- */
- for ( i = 0; i < 31; i++ )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, MONSTER_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- for ( i = 0; i < 5; i++ )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- /* verify cache size */
- if ( ( cache_ptr->index_len != 41 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (2 * VARIABLE_ENTRY_SIZE) +
- (4 * LARGE_ENTRY_SIZE) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 6.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 4,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- if ( pass1 ) {
-
- /* Now load three more large entries. This should result
- * in the eviction of (VET, 3), and the unpinning of (VET, 0)
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 10 KB Y N - -
- *
- * (VET, 1) N 10 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) N 10 KB N N - -
- *
- * (VET, 4) Y 5 KB N N - -
- *
- * (VET, 5) Y 5 KB N N 7 -
- *
- * (VET, 6) N 10 KB N N - -
- *
- * (VET, 7) Y 10 KB Y Y - dirty (VET, 6)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
-
- expected[0].is_pinned = FALSE;
- expected[3].in_cache = FALSE;
- expected[3].destroyed = TRUE;
-
- num_large_entries1 = 8;
-
- for ( i = 5; i < 8; i++ )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- /* verify cache size */
- if ( ( cache_ptr->index_len != 43 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (3 * VARIABLE_ENTRY_SIZE) +
- (7 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE / 2) +
- (2 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (8 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 7.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 5,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- if ( pass1 ) {
-
- /* load another large entry. (VET, 4) should be evicted.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 10 KB Y N - -
- *
- * (VET, 1) N 10 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) N 10 KB N N - -
- *
- * (VET, 4) N 5 KB N N - -
- *
- * (VET, 5) Y 5 KB N N 7 -
- *
- * (VET, 6) N 10 KB N N - -
- *
- * (VET, 7) Y 10 KB Y Y - dirty (VET, 6)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
-
- expected[4].in_cache = FALSE;
- expected[4].destroyed = TRUE;
-
- num_large_entries1 = 9;
-
- for ( i = 8; i < 9; i++ )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- /* verify cache size */
- if ( ( cache_ptr->index_len != 43 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (3 * VARIABLE_ENTRY_SIZE) -
- (VARIABLE_ENTRY_SIZE / 2) +
- (8 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE / 2) +
- (2 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (9 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 8.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 6,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- if ( pass1 ) {
-
- /* Load another large entry.
- *
- * (VET, 5) should be evicted, and (VET, 7) should be unpinned.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) Y 10 KB Y N - -
- *
- * (VET, 1) N 10 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) N 10 KB N N - -
- *
- * (VET, 4) N 5 KB N N - -
- *
- * (VET, 5) N 5 KB N N - -
- *
- * (VET, 6) N 10 KB N N - -
- *
- * (VET, 7) Y 10 KB Y N - dirty (VET, 6)
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
-
- expected[5].in_cache = FALSE;
- expected[5].destroyed = TRUE;
- expected[7].is_pinned = FALSE;
-
- num_large_entries1 = 10;
-
- for ( i = 9; i < 10; i++ )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- /* verify cache size */
- if ( ( cache_ptr->index_len != 43 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (4 * VARIABLE_ENTRY_SIZE) +
- (9 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (10 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 9.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 7,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- if ( pass1 ) {
-
- /* Again, touch all the non VARIABLE_ENTRY_TYPE entries in the
- * cache to bring all the VARIABLE_ENTRY_TYPE entries to the
- * end of the LRU list.
- *
- * Both (VET, 0) and (VET, 7) have been unpinned, so they are
- * now in the LRU list.
- */
- for ( i = 0; i < 31; i++ )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, MONSTER_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- for ( i = 0; i < 10; i++ )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- /* verify cache size */
- if ( ( cache_ptr->index_len != 43 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (4 * VARIABLE_ENTRY_SIZE) +
- (9 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->index_size != ((2 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (10 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 10.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 8,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- if ( pass1 ) {
-
- /* load two more large entries.
- *
- * (VET, 0) should be flushed, but not evicted initially since it is dirty.
- *
- * (VET, 7) should be evicted, but (VET, 7) has an eviction operation that
- * dirties (VET, 6). Since (VET, 6) is not in the cache, it will be loaded.
- * Since this results in no net increase in free space, the cache will
- * continue to attempt to create free space.
- *
- * The cache will then flush all the monster and large entries, but since they
- * are all dirty, they will not be evicted.
- *
- * Finally, it will reach (VET, 0) again, and evict it on the second pass1.
- * This finally makes the necessary space.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) N 10 KB N N - -
- *
- * (VET, 1) N 10 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) N 10 KB N N - -
- *
- * (VET, 4) N 5 KB N N - -
- *
- * (VET, 5) N 5 KB N N - -
- *
- * (VET, 6) Y 10 KB Y N - -
- *
- * (VET, 7) N 10 KB N N - -
- *
- * Start by updating the expected table for the expected changes in entry status:
- *
- * Note that we reset the loaded, cleared, flushed, and destroyed fields of
- * (VET,6) so we can track what is happening.
- */
- base_addr = entries1[VARIABLE_ENTRY_TYPE];
- entry_ptr = &(base_addr[6]);
- entry_ptr->loaded = FALSE;
- entry_ptr->cleared = FALSE;
- entry_ptr->flushed = FALSE;
- entry_ptr->destroyed = FALSE;
-
- expected[0].in_cache = FALSE;
- expected[0].is_dirty = FALSE;
- expected[0].flushed = TRUE;
- expected[0].destroyed = TRUE;
- expected[6].in_cache = TRUE;
- expected[6].is_dirty = TRUE;
- expected[6].loaded = TRUE;
- expected[6].flushed = FALSE;
- expected[6].destroyed = FALSE;
- expected[7].in_cache = FALSE;
- expected[7].flushed = TRUE;
- expected[7].destroyed = TRUE;
-
- num_large_entries1 = 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_entries1;
- i < num_variable_entries1 + num_monster_entries1 + num_large_entries1 - 1;
- i++ )
- {
- expected[i].is_dirty = FALSE;
- expected[i].flushed = TRUE;
- }
-
- for ( i = 10; i < 12; i++ )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- /* verify cache size */
- if ( ( cache_ptr->index_len != 44 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (5 * VARIABLE_ENTRY_SIZE) +
- (11 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (12 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 11.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 9,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- if ( pass1 ) {
-
- /* Again, touch all the non VARIABLE_ENTRY_TYPE entries in the
- * cache to bring the last remaining VARIABLE_ENTRY_TYPE entry to the
- * end of the LRU list.
- */
- for ( i = 0; i < num_monster_entries1; i++ )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, MONSTER_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- for ( i = 0; i < num_large_entries1; i++ )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- /* update the expected array to mark all these entries dirty again. */
- for ( i = num_variable_entries1;
- i < num_variable_entries1 + num_monster_entries1 + num_large_entries1 - 1;
- i++ )
- {
- expected[i].is_dirty = TRUE;
- }
-
- /* verify cache size */
- if ( ( cache_ptr->index_len != 44 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (5 * VARIABLE_ENTRY_SIZE) +
- (11 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->index_size != ((1 * VARIABLE_ENTRY_SIZE) +
- (31 * MONSTER_ENTRY_SIZE) +
- (12 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 12.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 10,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- if ( pass1 ) {
-
- /* Load two more large entries.
- *
- * Since (VET, 6) is dirty, at first this will just cause (VET, 6) to be flushed.
- *
- * But all other entries in the cache are dirty, so the cache will flush them all,
- * and then evict (VET, 6) on the second pass1.
- *
- * The following table shows the expected states of the variable
- * size entries after the test.
- *
- * in
- * entry: cache? size: dirty? pinned? pins: flush operations:
- *
- * (VET, 0) N 10 KB N N - -
- *
- * (VET, 1) N 10 KB N N - -
- *
- * (VET, 2) N 10 KB N N - -
- *
- * (VET, 3) N 10 KB N N - -
- *
- * (VET, 4) N 5 KB N N - -
- *
- * (VET, 5) N 5 KB N N - -
- *
- * (VET, 6) N 10 KB N N - -
- *
- * (VET, 7) N 10 KB N N - -
- *
- * Start by updating the expected table for the expected changes in entry status:
- */
-
- expected[6].in_cache = FALSE;
- expected[6].is_dirty = FALSE;
- expected[6].flushed = TRUE;
- expected[6].destroyed = TRUE;
-
- num_large_entries1 = 14;
-
- /* a newly loaded entry is not inserted in the cache until after space has been
- * made for it. Thus (LET, 13) will not be flushed.
- */
- for ( i = num_variable_entries1;
- i < num_variable_entries1 + num_monster_entries1 + num_large_entries1 - 1;
- i++ )
- {
- expected[i].is_dirty = FALSE;
- expected[i].flushed = TRUE;
- }
-
- for ( i = 12; i < 14; i++ )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
- unprotect_entry1_with_size_change(cache_ptr, LARGE_ENTRY_TYPE, i,
- H5C1__DIRTIED_FLAG, (size_t)0);
- }
-
- /* verify cache size */
- if ( ( cache_ptr->index_len != 45 ) ||
- ( cache_ptr->index_size != (2 * 1024 * 1024) -
- (6 * VARIABLE_ENTRY_SIZE) +
- (13 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->index_size != ((31 * MONSTER_ENTRY_SIZE) +
- (14 * LARGE_ENTRY_SIZE)) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected size/len in flush op eviction test 13.";
- }
-
- /* verify entry status */
- verify_entry_status1(cache_ptr,
- 11,
- (num_variable_entries1 + num_monster_entries1 + num_large_entries1),
- expected);
- }
-
- /* at this point we have cycled all the variable size entries through the cache.
- *
- * flush the cache and end the test.
- */
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__FLUSH_INVALIDATE_FLAG);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Cache flush invalidate failed after flush op eviction test";
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache len/size after cleanup of flush op eviction test";
-
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- /* If we are collecting stats, check to see if we get the expected
- * values.
- *
- * Testing the stats code is fairly new, but given the extent
- * to which I find myself depending on the stats, I've decided
- * to start testing the stats whenever it is convenient to do
- * so.
- */
- if ( pass1 ) {
-
- 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] != 14 ) ||
- ( cache_ptr->evictions[VARIABLE_ENTRY_TYPE] != 9 ) ||
- ( cache_ptr->renames[VARIABLE_ENTRY_TYPE] != 1 ) ||
- ( cache_ptr->entry_flush_renames[VARIABLE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->cache_flush_renames[VARIABLE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pins[VARIABLE_ENTRY_TYPE] != 2 ) ||
- ( cache_ptr->unpins[VARIABLE_ENTRY_TYPE] != 2 ) ||
- ( cache_ptr->dirty_pins[VARIABLE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pinned_flushes[VARIABLE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pinned_clears[VARIABLE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->size_increases[VARIABLE_ENTRY_TYPE] != 3 ) ||
- ( cache_ptr->size_decreases[VARIABLE_ENTRY_TYPE] != 4 ) ||
- ( cache_ptr->entry_flush_size_changes[VARIABLE_ENTRY_TYPE] != 1 ) ||
- ( cache_ptr->cache_flush_size_changes[VARIABLE_ENTRY_TYPE] != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected variable size entry stats.";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->insertions[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pinned_insertions[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->clears[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->flushes[LARGE_ENTRY_TYPE] != 38 ) ||
- ( cache_ptr->evictions[LARGE_ENTRY_TYPE] != 14 ) ||
- ( cache_ptr->renames[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->entry_flush_renames[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->cache_flush_renames[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pins[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->unpins[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->dirty_pins[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pinned_flushes[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pinned_clears[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->size_increases[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->size_decreases[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->entry_flush_size_changes[LARGE_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->cache_flush_size_changes[LARGE_ENTRY_TYPE] != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected monster entry stats.";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->insertions[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pinned_insertions[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->clears[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->flushes[MONSTER_ENTRY_TYPE] != 93 ) ||
- ( cache_ptr->evictions[MONSTER_ENTRY_TYPE] != 31 ) ||
- ( cache_ptr->renames[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->entry_flush_renames[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->cache_flush_renames[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pins[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->unpins[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->dirty_pins[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pinned_flushes[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->pinned_clears[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->size_increases[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->size_decreases[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->entry_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) ||
- ( cache_ptr->cache_flush_size_changes[MONSTER_ENTRY_TYPE] != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected monster entry stats.";
- }
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
- if ( pass1 ) {
-
- reset_entries1();
- }
-
- return;
-
-} /* check_flush_cache1__flush_op_eviction_test() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1__single_entry()
- *
- * Purpose: Verify that flush_cache1 behaves as expected when the cache
- * contains only one element.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 1/12/05
- *
- * Modifications:
- *
- * JRM -- 3/29/06
- * Added tests for pinned entries.
- *
- * JRM -- 5/17/06
- * Complete reqrite of pinned entry tests to accomodate
- * the new H5C1_mark_pinned_or_protected_entry_dirty()
- * call.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_cache1__single_entry(H5C1_t * cache_ptr)
-{
- /* const char * fcn_name = "check_flush_cache1__single_entry"; */
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "cache_ptr NULL on entry to single entry case.";
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "cache not empty at beginning of single entry case.";
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 1,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__NO_FLAGS_SET,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 2,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__NO_FLAGS_SET,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 3,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 4,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 5,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 6,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 7,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 8,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 9,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 10,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 11,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 12,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 13,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 14,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 15,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 16,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 17,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__NO_FLAGS_SET,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 18,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__NO_FLAGS_SET,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 19,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 20,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 21,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 22,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 23,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 24,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 25,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 26,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 27,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 28,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 29,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 30,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 31,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 32,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ FALSE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ TRUE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 33,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__NO_FLAGS_SET,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 34,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__NO_FLAGS_SET,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 35,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 36,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 37,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 38,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 39,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 40,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 41,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 42,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 43,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 44,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 45,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 46,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 47,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 48,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__NO_FLAGS_SET,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 49,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__NO_FLAGS_SET,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 50,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__NO_FLAGS_SET,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 51,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 52,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 53,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 54,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 55,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 56,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 57,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 58,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 59,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 60,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ FALSE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 61,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 62,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_MARKED_ENTRIES_FLAG |
- H5C1__FLUSH_INVALIDATE_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ FALSE,
- /* expected_flushed */ TRUE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 63,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ FALSE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
- if ( pass1 ) {
-
- check_flush_cache1__single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ 64,
- /* entry_type */ PICO_ENTRY_TYPE,
- /* entry_idx */ 0,
- /* insert_flag */ TRUE,
- /* dirty_flag */ TRUE,
- /* flags */ H5C1__SET_FLUSH_MARKER_FLAG,
- /* flush_flags */ H5C1__FLUSH_INVALIDATE_FLAG |
- H5C1__FLUSH_CLEAR_ONLY_FLAG |
- H5C1__FLUSH_MARKED_ENTRIES_FLAG,
- /* expected_loaded */ FALSE,
- /* expected_cleared */ TRUE,
- /* expected_flushed */ FALSE,
- /* expected_destroyed */ TRUE
- );
- }
-
-
- /* Now run single entry tests for pinned entries. Test all combinations
- * of:
- *
- * 1) Unpin by unprotect vs. unpin by call to H5C1_unpin_entry().
- *
- * 2) Marked dirty by unprotect or not.
- *
- * 3) Marked dirty by call to H5C1_mark_pinned_entry_dirty() or not.
- *
- * 4) Marked dirty by call to H5C1_mark_pinned_or_protected_entry_dirty()
- * while protected or not.
- *
- * 5) Marked dirty by call to H5C1_mark_pinned_or_protected_entry_dirty()
- * while pinned or not.
- *
- * 6) Entry marked for flush or not.
- *
- * 7) Call flush with H5C1__FLUSH_MARKED_ENTRIES_FLAG or not.
- *
- * 8) Call flush with H5C1__FLUSH_CLEAR_ONLY_FLAG or not.
- *
- * This yields a total of 256 tests.
- *
- * The tests and their expected results are given in the spec table
- * below. The values assigned to the expected_cleared, expected_flushed,
- * and expected_destroyed fields are somewhat arcane, so the following
- * overview may be useful.
- *
- * In addition to simply checking to see if the test case runs,
- * we also check to see if the desired operations take place on the
- * cache entry. Thus expected_cleared is set to TRUE if we expect
- * the entry to be flushed, expected_flushed is set to TRUE if we
- * we expect the entry to be flushed, and expected_destroyed is set
- * to TRUE if we expect the entry to be destroyed.
- *
- * In this test, we are working with pinned entries which can't be
- * evicted, so expected_destroyed is always FALSE. We could pull it
- * from the table, but it is a hold over from the code this test
- * was adapted from, and it doesn't do any particular harm.
- *
- * In general, we expect an entry to be flushed if it is dirty, and
- * flush in invoked WITHOUT the H5C1__FLUSH_CLEAR_ONLY_FLAG. However,
- * there are exceptions: If flush is invoked with the
- * H5C1__FLUSH_MARKED_ENTRIES_FLAG, only marked entries will be flushed.
- *
- * Further, unprotecting an entry with the H5C1__SET_FLUSH_MARKER_FLAG
- * will NOT mark the entry unless the entry has either been marked
- * dirty either before or durting the unprotect call. This results in
- * some counterintuitive entries in the table. It make be useful to
- * look in the test code to see the exact order of operations.
- *
- * Similarly, we expect an entry to be cleared if it is dirty, and
- * flush is invoked WITH the H5C1__FLUSH_CLEAR_ONLY_FLAG. Again, there
- * are exceptions -- If flush is also invoked with the
- * H5C1__FLUSH_MARKED_ENTRIES_FLAG, only the marked entries will be
- * cleared.
- *
- * The above comments about applying unprotect with the
- * H5C1__SET_FLUSH_MARKER_FLAG apply here as well.
- */
-
- if ( pass1 ) {
-
- int i;
- struct pinned_single_entry_test_spec
- {
- int test_num;
- int entry_type;
- int entry_idx;
- hbool_t dirty_flag;
- hbool_t mark_dirty;
- hbool_t pop_mark_dirty_prot;
- hbool_t pop_mark_dirty_pinned;
- hbool_t unprotect_unpin;
- unsigned int flags;
- unsigned int flush_flags;
- hbool_t expected_cleared;
- hbool_t expected_flushed;
- hbool_t expected_destroyed;
- } spec[256] =
- /* pop pop
- * ent mark mark
- * test entry -ry dirty mark dirty dirty unprot flush expect expect expect
- * num type idx flag dirty prot pinned unpin flags flags clear flush destroy
- */
- { { 1, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, FALSE, FALSE },
- { 2, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, FALSE, FALSE },
- { 3, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 4, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 5, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 6, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 7, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 8, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 9, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 10, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 11, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 12, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 13, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 14, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 15, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 16, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 17, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 18, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 19, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 20, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 21, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 22, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 23, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 24, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 25, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 26, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 27, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 28, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 29, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 30, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 31, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 32, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 33, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, FALSE, FALSE },
- { 34, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, FALSE, FALSE },
- { 35, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 36, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 37, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 38, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 39, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 40, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 41, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 42, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 43, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 44, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 45, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 46, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 47, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 48, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 49, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 50, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 51, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 52, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 53, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 54, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 55, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 56, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 57, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 58, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 59, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 60, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 61, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 62, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 63, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 64, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__NO_FLAGS_SET, FALSE, TRUE, FALSE },
- { 65, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 66, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 67, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 68, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 69, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 70, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 71, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 72, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 73, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 74, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 75, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 76, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 77, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 78, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 79, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 80, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 81, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 82, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 83, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 84, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 85, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 86, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 87, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 88, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 89, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 90, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 91, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 92, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 93, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 94, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 95, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 96, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 97, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 98, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 99, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 100, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 101, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 102, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 103, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 104, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 105, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 106, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 107, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 108, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, FALSE, FALSE },
- { 109, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 110, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 111, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 112, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 113, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 114, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 115, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 116, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 117, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 118, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 119, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 120, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 121, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 122, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 123, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 124, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 125, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 126, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 127, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 128, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG, FALSE, TRUE, FALSE },
- { 129, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 130, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 131, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 132, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 133, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 134, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 135, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 136, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 137, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 138, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 139, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 140, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 141, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 142, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 143, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 144, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 145, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 146, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 147, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 148, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 149, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 150, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 151, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 152, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 153, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 154, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 155, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 156, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 157, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 158, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 159, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 160, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 161, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 162, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 163, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 164, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 165, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 166, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 167, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 168, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 169, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 170, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 171, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 172, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 173, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 174, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 175, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 176, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 177, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 178, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 179, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 180, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 181, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 182, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 183, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 184, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 185, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 186, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 187, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 188, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 189, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 190, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 191, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 192, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 193, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 194, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 195, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 196, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 197, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 198, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 199, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 200, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 201, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 202, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 203, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 204, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 205, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 206, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 207, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 208, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 209, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 210, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 211, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 212, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 213, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 214, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 215, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 216, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 217, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 218, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 219, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 220, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 221, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 222, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 223, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 224, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C1__NO_FLAGS_SET, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 225, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 226, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 227, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 228, PICO_ENTRY_TYPE, 0, FALSE, FALSE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 229, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 230, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 231, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 232, PICO_ENTRY_TYPE, 0, FALSE, FALSE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 233, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 234, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 235, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 236, PICO_ENTRY_TYPE, 0, FALSE, TRUE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, FALSE, FALSE, FALSE },
- { 237, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 238, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 239, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 240, PICO_ENTRY_TYPE, 0, FALSE, TRUE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 241, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 242, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 243, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 244, PICO_ENTRY_TYPE, 0, TRUE, FALSE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 245, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 246, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 247, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 248, PICO_ENTRY_TYPE, 0, TRUE, FALSE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 249, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 250, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 251, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 252, PICO_ENTRY_TYPE, 0, TRUE, TRUE, FALSE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 253, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 254, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, FALSE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 255, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, FALSE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE },
- { 256, PICO_ENTRY_TYPE, 0, TRUE, TRUE, TRUE, TRUE, TRUE, H5C1__SET_FLUSH_MARKER_FLAG, H5C1__FLUSH_MARKED_ENTRIES_FLAG | H5C1__FLUSH_CLEAR_ONLY_FLAG, TRUE, FALSE, FALSE } };
-
- i = 0;
- while ( ( pass1 ) && ( i < 256 ) )
- {
- check_flush_cache1__pinned_single_entry_test
- (
- /* cache_ptr */ cache_ptr,
- /* test_num */ spec[i].test_num,
- /* entry_type */ spec[i].entry_type,
- /* entry_idx */ spec[i].entry_idx,
- /* dirty_flag */ spec[i].dirty_flag,
- /* mark_dirty */ spec[i].mark_dirty,
- /* pop_mark_dirty_prot */ spec[i].pop_mark_dirty_prot,
- /* pop_mark_dirty_pinned */ spec[i].pop_mark_dirty_pinned,
- /* unprotect_unpin */ spec[i].unprotect_unpin,
- /* flags */ spec[i].flags,
- /* flush_flags */ spec[i].flush_flags,
- /* expected_cleared */ spec[i].expected_cleared,
- /* expected_flushed */ spec[i].expected_flushed,
- /* expected_destroyed */ spec[i].expected_destroyed
- );
- i++;
- }
- }
-
- return;
-
-} /* check_flush_cache1__single_entry() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1__single_entry_test()
- *
- * Purpose: Run a single entry flush cache test.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 1/12/05
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_cache1__single_entry_test(H5C1_t * cache_ptr,
- int test_num,
- int entry_type,
- int entry_idx,
- hbool_t insert_flag,
- hbool_t dirty_flag,
- unsigned int flags,
- unsigned int flush_flags,
- hbool_t expected_loaded,
- hbool_t expected_cleared,
- hbool_t expected_flushed,
- hbool_t expected_destroyed)
-{
- /* const char * fcn_name = "check_flush_cache1__single_entry_test"; */
- static char msg[128];
- herr_t result;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "cache_ptr NULL on entry to single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "cache not empty at beginning of single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( entry_type < 0 ) || ( entry_type >= NUMBER_OF_ENTRY_TYPES ) ||
- ( entry_idx < 0 ) || ( entry_idx > max_indices1[entry_type] ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Bad parameters on entry to single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
-
- if ( pass1 ) {
-
- base_addr = entries1[entry_type];
- entry_ptr = &(base_addr[entry_idx]);
-
- if ( insert_flag ) {
-
- insert_entry1(cache_ptr, entry_type, entry_idx, dirty_flag, flags);
-
- } else {
-
- protect_entry1(cache_ptr, entry_type, entry_idx);
-
- unprotect_entry1(cache_ptr, entry_type, entry_idx,
- (int)dirty_flag, flags);
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr, flush_flags);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "flush with flags 0x%x failed in single entry test #%d.",
- flush_flags, test_num);
- failure_mssg1 = msg;
- }
- else if ( ( entry_ptr->loaded != expected_loaded ) ||
- ( entry_ptr->cleared != expected_cleared ) ||
- ( entry_ptr->flushed != expected_flushed ) ||
- ( entry_ptr->destroyed != expected_destroyed ) ) {
-
-#if 0 /* This is useful debugging code -- lets keep it for a while */
-
- 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);
-#endif
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected entry status after flush in single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( ( (flush_flags & H5C1__FLUSH_INVALIDATE_FLAG) == 0 )
- &&
- ( ( cache_ptr->index_len != 1 )
- ||
- ( cache_ptr->index_size != entry_sizes1[entry_type] )
- )
- )
- ||
- ( ( (flush_flags & H5C1__FLUSH_INVALIDATE_FLAG) != 0 )
- &&
- ( ( cache_ptr->index_len != 0 )
- ||
- ( cache_ptr->index_size != 0 )
- )
- )
- ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size after flush in single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- }
-
-
- /* clean up the cache to prep for the next test */
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__FLUSH_INVALIDATE_FLAG);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Flush failed on cleanup in single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size after cleanup in single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
-
- } else {
-
- entry_ptr->loaded = FALSE;
- entry_ptr->cleared = FALSE;
- entry_ptr->flushed = FALSE;
- entry_ptr->destroyed = FALSE;
- }
- }
-
- return;
-
-} /* check_flush_cache1__single_entry_test() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_cache1__pinned_single_entry_test()
- *
- * Purpose: Run a pinned single entry flush cache test.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 3/28/06
- *
- * Modifications:
- *
- * JRM -- 5/17/06
- * Added the pop_mark_dirty_prot and pop_mark_dirty_pinned
- * flags and supporting code to allow us to test the
- * H5C1_mark_pinned_or_protected_entry_dirty() call. Use the
- * call to mark the entry dirty while the entry is protected
- * if pop_mark_dirty_prot is TRUE, and to mark the entry
- * dirty while it is pinned if pop_mark_dirty_pinned is TRUE.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_cache1__pinned_single_entry_test(H5C1_t * cache_ptr,
- int test_num,
- int entry_type,
- int entry_idx,
- hbool_t dirty_flag,
- hbool_t mark_dirty,
- hbool_t pop_mark_dirty_prot,
- hbool_t pop_mark_dirty_pinned,
- 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_cache1__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 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "cache_ptr NULL on entry to pinned single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "cache not empty at beginning of pinned single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( entry_type < 0 ) || ( entry_type >= NUMBER_OF_ENTRY_TYPES ) ||
- ( entry_idx < 0 ) || ( entry_idx > max_indices1[entry_type] ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Bad parameters on entry to pinned single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
-
- if ( pass1 ) {
-
- base_addr = entries1[entry_type];
- entry_ptr = &(base_addr[entry_idx]);
-
- protect_entry1(cache_ptr, entry_type, entry_idx);
-
- if ( pop_mark_dirty_prot ) {
-
- mark_pinned_or_protected_entry_dirty1(cache_ptr,
- entry_type,
- entry_idx);
- }
-
- unprotect_entry1(cache_ptr, entry_type, entry_idx,
- (int)dirty_flag, (flags | H5C1__PIN_ENTRY_FLAG));
-
- if ( mark_dirty ) {
-
- mark_pinned_entry_dirty1(cache_ptr, entry_type, entry_idx,
- FALSE, (size_t)0);
- }
-
- if ( pop_mark_dirty_pinned ) {
-
- mark_pinned_or_protected_entry_dirty1(cache_ptr,
- entry_type,
- entry_idx);
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr, flush_flags);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "flush with flags 0x%x failed in pinned single entry test #%d.",
- flush_flags, test_num);
- failure_mssg1 = 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);
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected entry status after flush in pinned single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( ( (flush_flags & H5C1__FLUSH_INVALIDATE_FLAG) == 0 )
- &&
- ( ( cache_ptr->index_len != 1 )
- ||
- ( cache_ptr->index_size != entry_sizes1[entry_type] )
- )
- )
- ||
- ( ( (flush_flags & H5C1__FLUSH_INVALIDATE_FLAG) != 0 )
- &&
- ( ( cache_ptr->index_len != 0 )
- ||
- ( cache_ptr->index_size != 0 )
- )
- )
- ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size after flush in pinned single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- }
-
-
- /* clean up the cache to prep for the next test */
- if ( pass1 ) {
-
- if ( unprotect_unpin ) {
-
- protect_entry1(cache_ptr, entry_type, entry_idx);
-
- unprotect_entry1(cache_ptr, entry_type, entry_idx,
- (int)dirty_flag, H5C1__UNPIN_ENTRY_FLAG);
-
- } else {
-
- unpin_entry1(cache_ptr, entry_type, entry_idx);
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__FLUSH_INVALIDATE_FLAG);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Flush failed on cleanup in pinned single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- else if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected cache len/size after cleanup in pinned single entry test #%d.",
- test_num);
- failure_mssg1 = msg;
-
- } else {
-
- entry_ptr->loaded = FALSE;
- entry_ptr->cleared = FALSE;
- entry_ptr->flushed = FALSE;
- entry_ptr->destroyed = FALSE;
- }
- }
-
- return;
-
-} /* check_flush_cache1__pinned_single_entry_test() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_get_entry_status()
- *
- * Purpose: Verify that H5C1_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;
- hbool_t in_cache;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- size_t entry_size;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- TESTING("H5C1_get_entry_status() functionality");
-
- pass1 = TRUE;
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024 * 1024),
- (size_t)(1 * 1024 * 1024));
-
- base_addr = entries1[0];
- entry_ptr = &(base_addr[0]);
- }
-
- if ( pass1 ) {
-
- /* entry not in cache -- only in_cache should be touched by
- * the call. Thus, only check that boolean.
- */
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 1.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 1.");
- failure_mssg1 = msg;
- }
- }
-
- protect_entry1(cache_ptr, 0, 0);
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 2.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || is_dirty || is_protected || is_pinned ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 2.");
- failure_mssg1 = msg;
- }
- }
-
- protect_entry1(cache_ptr, 0, 0);
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 3.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || is_dirty || !is_protected || is_pinned ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 3.");
- failure_mssg1 = msg;
- }
- }
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__PIN_ENTRY_FLAG);
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 4.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || is_dirty || is_protected || !is_pinned ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 4.");
- failure_mssg1 = msg;
- }
- }
-
- mark_pinned_entry_dirty1(cache_ptr, 0, 0, FALSE, (size_t)0);
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 5.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || !is_pinned ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 5.");
- failure_mssg1 = msg;
- }
- }
-
- unpin_entry1(cache_ptr, 0, 0);
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 6.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || is_pinned ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 6.");
- failure_mssg1 = msg;
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_get_entry_status() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_expunge_entry1()
- *
- * Purpose: Verify that H5C1_expunge_entry() behaves as expected.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 7/5/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_expunge_entry1(void)
-{
- const char * fcn_name = "check_expunge_entry1";
- static char msg[128];
- herr_t result;
- hbool_t in_cache;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- size_t entry_size;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- TESTING("H5C1_expunge_entry() functionality");
-
- pass1 = TRUE;
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024 * 1024),
- (size_t)(1 * 1024 * 1024));
-
- base_addr = entries1[0];
- entry_ptr = &(base_addr[0]);
- }
-
- if ( pass1 ) {
-
- /* entry not in cache -- only in_cache should be touched by
- * the status call. Thus, only check that boolean.
- */
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected,
- &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 1.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 1.");
- failure_mssg1 = msg;
-
- } else if ( ( entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 1.");
- failure_mssg1 = msg;
-
- }
- }
-
- /* protect an entry to force the cache to load it, and then unprotect
- * it without marking it dirty.
- */
-
- protect_entry1(cache_ptr, 0, 0);
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 2.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || is_dirty || is_protected || is_pinned ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 2.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 2.");
- failure_mssg1 = msg;
-
- }
- }
-
- /* Expunge the entry and then verify that it is no longer in the cache.
- * Also verify that the entry was loaded, cleared, and destroyed, but
- * not flushed.
- */
- expunge_entry1(cache_ptr, 0, 0);
-
- if ( pass1 ) {
-
- /* entry shouldn't be in cache -- only in_cache should be touched
- * by the status call. Thus, only check that boolean.
- */
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 3.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 3.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( ! entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( ! entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 3.");
- failure_mssg1 = msg;
-
- }
- }
-
- /* now repeat the process with a different entry. On unprotect
- * mark the entry as dirty. Verify that it is not flushed.
- */
-
- base_addr = entries1[0];
- entry_ptr = &(base_addr[1]);
-
- if ( pass1 ) {
-
- /* entry not in cache -- only in_cache should be touched by
- * the status call. Thus, only check that boolean.
- */
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected,
- &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 4.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 4.");
- failure_mssg1 = msg;
-
- } else if ( ( entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 4.");
- failure_mssg1 = msg;
-
- }
- }
-
- /* protect the entry to force the cache to load it, and then unprotect
- * it with the dirty flag set.
- */
-
- protect_entry1(cache_ptr, 0, 1);
-
- unprotect_entry1(cache_ptr, 0, 1, TRUE, H5C1__NO_FLAGS_SET);
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected,
- &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 5.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || is_pinned ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 5.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 5.");
- failure_mssg1 = msg;
-
- }
- }
-
- /* Expunge the entry and then verify that it is no longer in the cache.
- * Also verify that the entry was loaded, cleared and destroyed, but not
- * flushed.
- */
- expunge_entry1(cache_ptr, 0, 1);
-
- if ( pass1 ) {
-
- /* entry shouldn't be in cache -- only in_cache should be touched
- * by the status call. Thus, only check that boolean.
- */
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected,
- &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 6.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 6.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( ! entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( ! entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 6.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_expunge_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_multiple_read_protect()
- *
- * Purpose: Verify that multiple, simultaneous read protects of a
- * single entry perform as expectd.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/1/07
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-
-static void
-check_multiple_read_protect(void)
-{
- const char * fcn_name = "check_multiple_read_protect()";
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
-
- TESTING("multiple read only protects on a single entry");
-
- pass1 = TRUE;
-
- /* allocate a cache. Should succeed.
- *
- * Then to start with, proceed as follows:
- *
- * Read protect an entry.
- *
- * Then read protect the entry again. Should succeed.
- *
- * Read protect yet again. Should succeed.
- *
- * Unprotect with no changes, and then read protect twice again.
- * Should succeed.
- *
- * Now unprotect three times. Should succeed.
- *
- * If stats are enabled, verify that correct stats are collected at
- * every step.
- *
- * Also, verify internal state of read protects at every step.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- entry_ptr = &((entries1[0])[0]);
-
- if ( ( entry_ptr->header.is_protected ) ||
- ( entry_ptr->header.is_read_only ) ||
- ( entry_ptr->header.ro_ref_count != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 1.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 0 ) ||
- ( cache_ptr->read_protects[0] != 0 ) ||
- ( cache_ptr->max_read_protects[0] != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 1.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
- if ( pass1 )
- {
- protect_entry_ro1(cache_ptr, 0, 0);
-
- if ( ( ! ( entry_ptr->header.is_protected ) ) ||
- ( ! ( entry_ptr->header.is_read_only ) ) ||
- ( entry_ptr->header.ro_ref_count != 1 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 2.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 0 ) ||
- ( cache_ptr->read_protects[0] != 1 ) ||
- ( cache_ptr->max_read_protects[0] != 1 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 2.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
- if ( pass1 )
- {
- protect_entry_ro1(cache_ptr, 0, 0);
-
- if ( ( ! ( entry_ptr->header.is_protected ) ) ||
- ( ! ( entry_ptr->header.is_read_only ) ) ||
- ( entry_ptr->header.ro_ref_count != 2 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 3.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 0 ) ||
- ( cache_ptr->read_protects[0] != 2 ) ||
- ( cache_ptr->max_read_protects[0] != 2 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 3.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
- if ( pass1 )
- {
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- if ( ( ! ( entry_ptr->header.is_protected ) ) ||
- ( ! ( entry_ptr->header.is_read_only ) ) ||
- ( entry_ptr->header.ro_ref_count != 1 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 4.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 0 ) ||
- ( cache_ptr->read_protects[0] != 2 ) ||
- ( cache_ptr->max_read_protects[0] != 2 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 4.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
- if ( pass1 )
- {
- protect_entry_ro1(cache_ptr, 0, 0);
-
- if ( ( ! ( entry_ptr->header.is_protected ) ) ||
- ( ! ( entry_ptr->header.is_read_only ) ) ||
- ( entry_ptr->header.ro_ref_count != 2 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 5.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 0 ) ||
- ( cache_ptr->read_protects[0] != 3 ) ||
- ( cache_ptr->max_read_protects[0] != 2 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 5.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
- if ( pass1 )
- {
- protect_entry_ro1(cache_ptr, 0, 0);
-
- if ( ( ! ( entry_ptr->header.is_protected ) ) ||
- ( ! ( entry_ptr->header.is_read_only ) ) ||
- ( entry_ptr->header.ro_ref_count != 3 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 6.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 0 ) ||
- ( cache_ptr->read_protects[0] != 4 ) ||
- ( cache_ptr->max_read_protects[0] != 3 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 6.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
- if ( pass1 )
- {
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- if ( ( ! ( entry_ptr->header.is_protected ) ) ||
- ( ! ( entry_ptr->header.is_read_only ) ) ||
- ( entry_ptr->header.ro_ref_count != 2 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 7.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 0 ) ||
- ( cache_ptr->read_protects[0] != 4 ) ||
- ( cache_ptr->max_read_protects[0] != 3 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 7.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
- if ( pass1 )
- {
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- if ( ( ! ( entry_ptr->header.is_protected ) ) ||
- ( ! ( entry_ptr->header.is_read_only ) ) ||
- ( entry_ptr->header.ro_ref_count != 1 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 8.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 0 ) ||
- ( cache_ptr->read_protects[0] != 4 ) ||
- ( cache_ptr->max_read_protects[0] != 3 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 8.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
- if ( pass1 )
- {
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- if ( ( entry_ptr->header.is_protected ) ||
- ( entry_ptr->header.is_read_only ) ||
- ( entry_ptr->header.ro_ref_count != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 9.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 0 ) ||
- ( cache_ptr->read_protects[0] != 4 ) ||
- ( cache_ptr->max_read_protects[0] != 3 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 9.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
-
- /* If we get this far, do a write protect and unprotect to verify
- * that the stats are getting collected properly here as well.
- */
-
- if ( pass1 )
- {
- protect_entry1(cache_ptr, 0, 0);
-
- if ( ( ! ( entry_ptr->header.is_protected ) ) ||
- ( entry_ptr->header.is_read_only ) ||
- ( entry_ptr->header.ro_ref_count != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 10.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 1 ) ||
- ( cache_ptr->read_protects[0] != 4 ) ||
- ( cache_ptr->max_read_protects[0] != 3 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 10.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
- if ( pass1 )
- {
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- if ( ( entry_ptr->header.is_protected ) ||
- ( entry_ptr->header.is_read_only ) ||
- ( entry_ptr->header.ro_ref_count != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected ro protected status 11.\n";
- }
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 1 ) ||
- ( cache_ptr->read_protects[0] != 4 ) ||
- ( cache_ptr->max_read_protects[0] != 3 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 11.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
-
- /* Finally, mix things up a little, using a mix of reads and
- * and writes on different entries. Also include a pin to verify
- * that it works as well.
- *
- * Stats are looking OK, so we will only test them one more time
- * at the end to ensure that all is at it should be.
- */
-
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, 0, 2); /* (0,2) write */
- protect_entry_ro1(cache_ptr, 0, 4); /* (0,4) read only (1) */
- protect_entry1(cache_ptr, 0, 6); /* (0,6) write */
-
- unprotect_entry1(cache_ptr, 0, 2, FALSE, /* (0,2) unprotect */
- H5C1__NO_FLAGS_SET);
-
- protect_entry_ro1(cache_ptr, 0, 2); /* (0,2) read only (1) */
- protect_entry1(cache_ptr, 0, 1); /* (0,1) write */
- protect_entry_ro1(cache_ptr, 0, 4); /* (0,4) read only (2) */
- protect_entry1(cache_ptr, 0, 0); /* (0,0) write */
- protect_entry_ro1(cache_ptr, 0, 2); /* (0,2) read only (2) */
-
- unprotect_entry1(cache_ptr, 0, 2, FALSE, /* (0,2) read only (1) pin */
- H5C1__PIN_ENTRY_FLAG);
- unprotect_entry1(cache_ptr, 0, 6, FALSE, /* (0,6) unprotect */
- H5C1__NO_FLAGS_SET);
-
- protect_entry_ro1(cache_ptr, 0, 4); /* (0,4) read only (3) */
-
- unprotect_entry1(cache_ptr, 0, 2, FALSE, /* (0,2) unprotect */
- H5C1__NO_FLAGS_SET);
- unprotect_entry1(cache_ptr, 0, 1, FALSE, /* (0,1) unprotect */
- H5C1__NO_FLAGS_SET);
-
- if ( pass1 ) {
-
- entry_ptr = &((entries1[0])[4]);
-
- if ( H5C1_pin_protected_entry(cache_ptr, (void *)entry_ptr) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_pin_protected_entry() failed.\n";
-
- } else if ( ! (entry_ptr->header.is_pinned) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "entry (0,4) not pinned.\n";
-
- } else {
-
- /* keep test bed sanity checks happy */
- entry_ptr->is_pinned = TRUE;
-
- }
- }
-
- unprotect_entry1(cache_ptr, 0, 4, FALSE, /* (0,4) read only (2) */
- H5C1__NO_FLAGS_SET);
- unprotect_entry1(cache_ptr, 0, 4, FALSE, /* (0,4) read only (1) */
- H5C1__UNPIN_ENTRY_FLAG);
-
- if ( ( pass1 ) && ( entry_ptr->header.is_pinned ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "enty (0,4) still pinned.\n";
-
- }
-
- unprotect_entry1(cache_ptr, 0, 4, FALSE, /* (0,4) unprotect */
- H5C1__NO_FLAGS_SET);
- unprotect_entry1(cache_ptr, 0, 0, FALSE, /* (0,0) unprotect */
- H5C1__NO_FLAGS_SET);
-
- unpin_entry1(cache_ptr, 0, 2);
- }
-
-#if H5C1_COLLECT_CACHE_STATS
- if ( ( cache_ptr->write_protects[0] != 5 ) ||
- ( cache_ptr->read_protects[0] != 9 ) ||
- ( cache_ptr->max_read_protects[0] != 3 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected protect stats 11.\n";
- }
-#endif /* H5C1_COLLECT_CACHE_STATS */
-
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_multiple_read_protect() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_rename_entry1()
- *
- * Purpose: Verify that H5C1_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_entry1(void)
-{
- const char * fcn_name = "check_rename_entry1";
- int i;
- H5C1_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("H5C1_rename_entry() functionality");
-
- pass1 = 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 ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024 * 1024),
- (size_t)(1 * 1024 * 1024));
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < 4 ) )
- {
- check_rename_entry1__run_test(cache_ptr, i, &(test_specs[i]));
- i++;
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_rename_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_rename_entry1__run_test()
- *
- * Purpose: Run a rename entry test.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/27/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_rename_entry1__run_test(H5C1_t * cache_ptr,
- int test_num,
- struct rename_entry_test_spec * spec_ptr)
-{
- /* const char * fcn_name = "check_rename_entry1__run_test"; */
- static char msg[128];
- unsigned int flags = H5C1__NO_FLAGS_SET;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr = NULL;
- H5C1_cache_entry_t * test_ptr = NULL;
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "cache_ptr NULL on entry to rename test #%d.",
- test_num);
- failure_mssg1 = msg;
-
- } else if ( spec_ptr == NULL ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "spec_ptr NULL on entry to rename test #%d.",
- test_num);
- failure_mssg1 = msg;
-
- }
-
- if ( pass1 ) {
-
- base_addr = entries1[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 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "bad entry_ptr in rename test #%d.",
- test_num);
- failure_mssg1 = msg;
-
- } else if ( spec_ptr->is_pinned ) {
-
- flags |= H5C1__PIN_ENTRY_FLAG;
- }
- }
-
- protect_entry1(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index);
-
- unprotect_entry1(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index,
- (int)(spec_ptr->is_dirty), flags);
-
- rename_entry1(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, FALSE);
-
- if ( pass1 ) {
-
- /* 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_entry1(), so we don't have to repeat it here.
- */
-
- if ( spec_ptr->is_pinned ) {
-
- if ( ! ( entry_ptr->header.is_pinned ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Pinned entry not pinned after rename in test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
-
- if ( pass1 ) {
-
- test_ptr = cache_ptr->pel_head_ptr;
-
- while ( ( test_ptr != NULL ) &&
- ( test_ptr != (H5C1_cache_entry_t *)entry_ptr ) )
- {
- test_ptr = test_ptr->next;
- }
-
- if ( test_ptr == NULL ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Pinned entry not in pel after rename in test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- }
-
- unpin_entry1(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index);
-
- } else {
-
- if ( entry_ptr->header.is_pinned ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unpinned entry pinned after rename in test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
-
- if ( ( entry_ptr->header.prev != NULL ) ||
- ( cache_ptr->LRU_head_ptr != (H5C1_cache_entry_t *)entry_ptr ) )
- {
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Entry not at head of LRU after rename in test #%d.",
- test_num);
- failure_mssg1 = msg;
- }
- }
- }
-
- /* put the entry back where it started from */
- rename_entry1(cache_ptr, spec_ptr->entry_type, spec_ptr->entry_index, TRUE);
-
- return;
-
-} /* check_rename_entry1__run_test() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_pin_protected_entry1()
- *
- * Purpose: Verify that H5C1_pin_protected_entry behaves as expected.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/28/06
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_pin_protected_entry1(void)
-{
- const char * fcn_name = "check_pin_protected_entry1";
- static char msg[128];
- herr_t result;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- TESTING("H5C1_pin_protected_entry() functionality");
-
- pass1 = TRUE;
-
- /* Create a cache, protect an entry, and then use H5C1_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 ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024 * 1024),
- (size_t)(1 * 1024 * 1024));
- }
-
- protect_entry1(cache_ptr, 0, 0);
-
- if ( pass1 ) {
-
- base_addr = entries1[0];
- entry_ptr = &(base_addr[0]);
-
- result = H5C1_pin_protected_entry(cache_ptr, (void *)entry_ptr);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5C1_pin_protected_entry() reports failure.");
- failure_mssg1 = msg;
-
- } else if ( ! ( entry_ptr->header.is_pinned ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "entry not pinned when it should be.");
- failure_mssg1 = msg;
-
- } else {
-
- entry_ptr->is_pinned = TRUE;
- }
- }
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__UNPIN_ENTRY_FLAG);
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_pin_protected_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_resize_entry1()
- *
- * Purpose: Verify that H5C1_resize_entry1() and H5C1_unprotect() resize
- * entries as expected.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 7/7/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_resize_entry1(void)
-{
- const char * fcn_name = "check_resize_entry1";
- static char msg[128];
- herr_t result;
- hbool_t in_cache;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- size_t entry_size;
- size_t reported_entry_size;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- TESTING("entry resize functionality");
-
- /* Setup a cache and verify that it is empty.
- *
- * Then force the load of an entry by protecting it, and verify that
- * the entry and cache have the expected sizes.
- *
- * Then unprotect the entry with the size changed flag and a reduced
- * size. Verify that the entry and cache have the expected expected
- * sizes.
- *
- * Use a second protect/unprotect cycle to restore the entry to
- * its original size. Verify that the entry and cache have the
- * expected sizes.
- *
- * Protect and unprotect the entry again to pin it. Use
- * H5C1_resize_entry1 to reduce its size. Verify that the entry
- * and cache have the expected sizes.
- *
- * Use H5C1_resize_entry1 again to restore the entry to its original
- * size. Verify that the entry and cache have the expected sizes.
- *
- * Use a protect / unprotect cycle to unpin and destroy the entry.
- * Verify that the entry and cache have the expected sizes.
- *
- *
- * Obesrve that all the above tests have been done with only one
- * entry in the cache. Repeat the tests with several entries in
- * the cache.
- */
-
- pass1 = TRUE;
-
- /* tests with only one entry in the cache: */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024 * 1024),
- (size_t)(1 * 1024 * 1024));
-
- base_addr = entries1[LARGE_ENTRY_TYPE];
- entry_ptr = &(base_addr[0]);
- entry_size = LARGE_ENTRY_SIZE;
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ||
- ( cache_ptr->slist_len != 0 ) ||
- ( cache_ptr->slist_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 1.");
- failure_mssg1 = msg;
-
- }
- }
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 1 ) ||
- ( cache_ptr->index_size != LARGE_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 0 ) ||
- ( cache_ptr->slist_size != 0 ) ) {
-
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 2.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 1.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || is_dirty || !is_protected || is_pinned ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 1.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 1.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr,
- &(types1[LARGE_ENTRY_TYPE]), entry_ptr->addr,
- (void *)entry_ptr,
- H5C1__SIZE_CHANGED_FLAG | H5C1__DIRTIED_FLAG,
- (LARGE_ENTRY_SIZE / 2));
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "H5C1_unprotect() reports failure 1.");
- failure_mssg1 = msg;
-
- } else {
-
- /* tidy up so we play nice with the standard protect / unprotect
- * calls.
- */
- entry_ptr->is_protected = FALSE;
- entry_ptr->is_dirty = TRUE;
- entry_ptr->size = LARGE_ENTRY_SIZE / 2;
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 1 ) ||
- ( cache_ptr->index_size != (LARGE_ENTRY_SIZE / 2) ) ||
- ( cache_ptr->slist_len != 1 ) ||
- ( cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 2) ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 3.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 2.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || is_pinned ||
- ( reported_entry_size != (LARGE_ENTRY_SIZE / 2) ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 2.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 2.");
- failure_mssg1 = msg;
-
- }
- }
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr,
- &(types1[LARGE_ENTRY_TYPE]), entry_ptr->addr,
- (void *)entry_ptr,
- (H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG),
- LARGE_ENTRY_SIZE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "H5C1_unprotect() reports failure 2.");
- failure_mssg1 = msg;
-
- } else {
-
- /* tidy up so we play nice with the standard protect / unprotect
- * calls.
- */
- entry_ptr->is_protected = FALSE;
- entry_ptr->is_dirty = TRUE;
- entry_ptr->size = LARGE_ENTRY_SIZE;
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 1 ) ||
- ( cache_ptr->index_size != LARGE_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 1 ) ||
- ( cache_ptr->slist_size != LARGE_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 4.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 3.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || is_pinned ||
- ( reported_entry_size != LARGE_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 3.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 3.");
- failure_mssg1 = msg;
-
- }
- }
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0);
-
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C1__PIN_ENTRY_FLAG);
-
- if ( pass1 ) {
-
- result = H5C1_resize_pinned_entry(cache_ptr, (void *)entry_ptr,
- (LARGE_ENTRY_SIZE / 4));
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5C1_resize_pinned_entry() reports failure 1.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 1 ) ||
- ( cache_ptr->index_size != (LARGE_ENTRY_SIZE / 4) ) ||
- ( cache_ptr->slist_len != 1 ) ||
- ( cache_ptr->slist_size != (LARGE_ENTRY_SIZE / 4) ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 5.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 4.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || ! is_pinned ||
- ( reported_entry_size != (LARGE_ENTRY_SIZE / 4) ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 4.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 4.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_resize_pinned_entry(cache_ptr, (void *)entry_ptr,
- LARGE_ENTRY_SIZE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5C1_resize_pinned_entry() reports failure 2.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 1 ) ||
- ( cache_ptr->index_size != LARGE_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 1 ) ||
- ( cache_ptr->slist_size != LARGE_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 6.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 5.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || ! is_pinned ||
- ( reported_entry_size != LARGE_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 5.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 5.");
- failure_mssg1 = msg;
-
- }
- }
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0);
-
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0, FALSE,
- H5C1__UNPIN_ENTRY_FLAG | H5C1__DELETED_FLAG);
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected,
- &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 6.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 6.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( ! entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( ! entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 6.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ||
- ( cache_ptr->slist_len != 0 ) ||
- ( cache_ptr->slist_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 7.");
- failure_mssg1 = msg;
-
- }
- }
-
-
- /* now repreat the above tests with several entries in the cache: */
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ||
- ( cache_ptr->slist_len != 0 ) ||
- ( cache_ptr->slist_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 8.");
- failure_mssg1 = msg;
-
- }
- base_addr = entries1[LARGE_ENTRY_TYPE];
- entry_ptr = &(base_addr[3]);
- entry_size = LARGE_ENTRY_SIZE;
- }
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 1);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 1, TRUE, H5C1__NO_FLAGS_SET);
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 2);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 2, FALSE, H5C1__NO_FLAGS_SET);
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 3 ) ||
- ( cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 1 ) ||
- ( cache_ptr->slist_size != LARGE_ENTRY_SIZE ) ) {
-
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 9.");
- failure_mssg1 = msg;
-
- }
- }
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 3);
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 1 ) ||
- ( cache_ptr->slist_size != LARGE_ENTRY_SIZE ) ) {
-
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 10.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 7.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || is_dirty || !is_protected || is_pinned ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 7.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 7.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr,
- &(types1[LARGE_ENTRY_TYPE]), entry_ptr->addr,
- (void *)entry_ptr,
- H5C1__SIZE_CHANGED_FLAG | H5C1__DIRTIED_FLAG,
- (LARGE_ENTRY_SIZE / 2));
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "H5C1_unprotect() reports failure 3.");
- failure_mssg1 = msg;
-
- } else {
-
- /* tidy up so we play nice with the standard protect / unprotect
- * calls.
- */
- entry_ptr->is_protected = FALSE;
- entry_ptr->is_dirty = TRUE;
- entry_ptr->size = LARGE_ENTRY_SIZE / 2;
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size !=
- ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 2)) ) ||
- ( cache_ptr->slist_len != 2 ) ||
- ( cache_ptr->slist_size !=
- (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 2)) ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 11.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 8.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || is_pinned ||
- ( reported_entry_size != (LARGE_ENTRY_SIZE / 2) ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 8.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 8.");
- failure_mssg1 = msg;
-
- }
- }
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 3);
-
- if ( pass1 ) {
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr,
- &(types1[LARGE_ENTRY_TYPE]), entry_ptr->addr,
- (void *)entry_ptr,
- (H5C1__DIRTIED_FLAG | H5C1__SIZE_CHANGED_FLAG),
- LARGE_ENTRY_SIZE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "H5C1_unprotect() reports failure 4.");
- failure_mssg1 = msg;
-
- } else {
-
- /* tidy up so we play nice with the standard protect / unprotect
- * calls.
- */
- entry_ptr->is_protected = FALSE;
- entry_ptr->is_dirty = TRUE;
- entry_ptr->size = LARGE_ENTRY_SIZE;
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 4 * LARGE_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 2 ) ||
- ( cache_ptr->slist_size != 2 * LARGE_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 12.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 9.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || is_pinned ||
- ( reported_entry_size != LARGE_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 9.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 9.");
- failure_mssg1 = msg;
-
- }
- }
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 3);
-
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 3, FALSE, H5C1__PIN_ENTRY_FLAG);
-
- if ( pass1 ) {
-
- result = H5C1_resize_pinned_entry(cache_ptr, (void *)entry_ptr,
- (LARGE_ENTRY_SIZE / 4));
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5C1_resize_pinned_entry() reports failure 3.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size !=
- ((3 * LARGE_ENTRY_SIZE) + (LARGE_ENTRY_SIZE / 4)) ) ||
- ( cache_ptr->slist_len != 2 ) ||
- ( cache_ptr->slist_size !=
- (LARGE_ENTRY_SIZE + (LARGE_ENTRY_SIZE / 4)) ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 13.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 10.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || ! is_pinned ||
- ( reported_entry_size != (LARGE_ENTRY_SIZE / 4) ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 10.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 10.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_resize_pinned_entry(cache_ptr, (void *)entry_ptr,
- LARGE_ENTRY_SIZE);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5C1_resize_pinned_entry() reports failure 4.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != (4 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->slist_len != 2 ) ||
- ( cache_ptr->slist_size != (2 * LARGE_ENTRY_SIZE) ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 14.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- &reported_entry_size, &in_cache,
- &is_dirty, &is_protected, &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 11.");
- failure_mssg1 = msg;
-
- } else if ( !in_cache || !is_dirty || is_protected || ! is_pinned ||
- ( reported_entry_size != LARGE_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 11.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 11.");
- failure_mssg1 = msg;
-
- }
- }
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 3);
-
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 3, FALSE,
- H5C1__UNPIN_ENTRY_FLAG | H5C1__DELETED_FLAG);
-
- if ( pass1 ) {
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr, &entry_size,
- &in_cache, &is_dirty, &is_protected,
- &is_pinned);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 12.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 12.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( ! entry_ptr->cleared ) ||
- ( entry_ptr->flushed ) ||
- ( ! entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 12.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 3 ) ||
- ( cache_ptr->index_size != (3 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->slist_len != 1 ) ||
- ( cache_ptr->slist_size != LARGE_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 15.");
- failure_mssg1 = msg;
-
- }
- }
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 2);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 2, FALSE, H5C1__DELETED_FLAG);
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 1);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 1, FALSE, H5C1__DELETED_FLAG);
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0, FALSE, H5C1__DELETED_FLAG);
-
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ||
- ( cache_ptr->slist_len != 0 ) ||
- ( cache_ptr->slist_size != 0 ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 16.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_resize_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_evictions_enabled()
- *
- * Purpose: Verify that H5C1_get_evictions_enabled() and
- * H5C1_set_evictions_enabled() functions perform as expected.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 8/2/07
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_evictions_enabled(void)
-{
- const char * fcn_name = "check_evictions_enabled";
- static char msg[128];
- herr_t result;
- hbool_t show_progress = FALSE;
- hbool_t evictions_enabled;
- hbool_t in_cache;
- int i;
- int mile_stone = 1;
- size_t entry_size;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- TESTING("evictions enabled/disabled functionality");
-
- /* Setup a cache and verify that it is empty.
- *
- * Use H5C1_get_evictions_enabled() to determine if evictions are
- * currently enabled -- they should be.
- *
- * Load entries until the cache is full. Load one more. Verify that
- * this caused an entry to be evicted.
- *
- * Insert an entry. Verify that this cases and entry to be evicted.
- *
- * Used H5C1_set_evictions_enabled() to disable evictions. Verify
- * with a call to H5C1_get_evictions_enabled().
- *
- * Load another entry -- verify that this does not cause an entry
- * to be evicted.
- *
- * Insert an entry -- verify that this does not cause an entry to
- * be evicted.
- *
- * Use H5C1_set_evictions_enabled() to re-enable evictions. Verify
- * with a call to H5C1_get_evictions_enabled().
- *
- * Protect and unprotect some of the entries in the cache. Verify
- * that there are no evictions (since we only try to make space
- * when we either insert or load a new entry).
- *
- * Protect an entry not in the cache. Verify that this causes
- * two evictions.
- *
- * Used H5C1_set_evictions_enabled() to disable evictions again.
- * Verify with a call to H5C1_get_evictions_enabled().
- *
- * Now flush and discard the cache -- should succeed.
- */
-
- pass1 = TRUE;
-
- if ( show_progress ) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* create the cache */
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(1 * 1024 * 1024),
- (size_t)( 512 * 1024));
-
- base_addr = entries1[MONSTER_ENTRY_TYPE];
- entry_size = MONSTER_ENTRY_SIZE;
- }
-
- if ( show_progress ) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verivy that it is empty */
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ||
- ( cache_ptr->slist_len != 0 ) ||
- ( cache_ptr->slist_size != 0 ) ||
- ( cache_ptr->evictions_enabled != TRUE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 1.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that H5C1_get_evictions_enabled() returns the expected value */
- if ( pass1 ) {
-
- result = H5C1_get_evictions_enabled(cache_ptr, &evictions_enabled);
-
- if ( ( result != SUCCEED ) || ( evictions_enabled != TRUE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected evictions enabled 1.");
- failure_mssg1 = msg;
- }
- }
-
- if ( show_progress ) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* fill the cache */
- for ( i = 0; i < 16 ; i++ )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- FALSE, H5C1__NO_FLAGS_SET);
- }
-
- if ( show_progress ) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that the cache is full */
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 16 ) ||
- ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 0 ) ||
- ( cache_ptr->slist_size != 0 ) ||
- ( cache_ptr->evictions_enabled != TRUE ) ) {
-
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 2.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* protect and unprotect another entry */
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 16);
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 16,
- FALSE, H5C1__NO_FLAGS_SET);
-
- if ( show_progress ) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that the an entry has been evicted */
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 16 ) ||
- ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 0 ) ||
- ( cache_ptr->slist_size != 0 ) ||
- ( cache_ptr->evictions_enabled != TRUE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 3.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- entry_ptr = &(base_addr[0]);
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- NULL, &in_cache, NULL, NULL, NULL);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 1.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 1.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( ! entry_ptr->flushed ) ||
- ( ! entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 1.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* insert an entry */
- insert_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 17, TRUE, H5C1__NO_FLAGS_SET);
-
- if ( show_progress ) /* 10 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that another entry has been evicted */
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 16 ) ||
- ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 1 ) ||
- ( cache_ptr->slist_size != MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->evictions_enabled != TRUE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 4.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 11 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- entry_ptr = &(base_addr[1]);
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- NULL, &in_cache, NULL, NULL, NULL);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 2.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 2.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( ! entry_ptr->flushed ) ||
- ( ! entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 2.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 12 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* disable evictions */
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "can't disable evictions 1.");
- failure_mssg1 = msg;
- }
- }
-
- if ( show_progress ) /* 13 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that evictions are disabled */
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 16 ) ||
- ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 1 ) ||
- ( cache_ptr->slist_size != MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->evictions_enabled != FALSE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 5.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 14 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* protect and unprotect another entry */
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 18);
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 18,
- FALSE, H5C1__NO_FLAGS_SET);
-
- if ( show_progress ) /* 15 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that no entry has been evicted */
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 17 ) ||
- ( cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 1 ) ||
- ( cache_ptr->slist_size != MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->evictions_enabled != FALSE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 6.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 16 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* insert another entry */
- insert_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 19, TRUE, H5C1__NO_FLAGS_SET);
-
- if ( show_progress ) /* 17 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that no entry has been evicted */
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 18 ) ||
- ( cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 2 ) ||
- ( cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->evictions_enabled != FALSE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 7.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 18 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* re-enable evictions */
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, TRUE);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "can't enable evictions 1.");
- failure_mssg1 = msg;
- }
- }
-
- if ( show_progress ) /* 19 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* protect and unprotect an entry that is in the cache */
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 19);
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 19,
- FALSE, H5C1__NO_FLAGS_SET);
-
- if ( show_progress ) /* 20 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that no entries have been evicted */
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 18 ) ||
- ( cache_ptr->index_size != 18 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 2 ) ||
- ( cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->evictions_enabled != TRUE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 8.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 21 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* protect and unprotect an entry that isn't in the cache */
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 20);
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 20,
- FALSE, H5C1__NO_FLAGS_SET);
-
- if ( show_progress ) /* 22 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that the entries have been evicted to bring the
- * cache back down to its normal size.
- */
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 16 ) ||
- ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 2 ) ||
- ( cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->evictions_enabled != TRUE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 9.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 23 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- entry_ptr = &(base_addr[2]);
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- NULL, &in_cache, NULL, NULL, NULL);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 3.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 3.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( ! entry_ptr->flushed ) ||
- ( ! entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 3.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 24 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- entry_ptr = &(base_addr[3]);
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- NULL, &in_cache, NULL, NULL, NULL);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 4.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 4.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( ! entry_ptr->flushed ) ||
- ( ! entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 4.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 25 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* disable evictions again */
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "can't disable evictions 2.");
- failure_mssg1 = msg;
- }
- }
-
- if ( show_progress ) /* 26 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* protect and unprotect an entry that isn't in the cache, forcing
- * the cache to grow.
- */
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 21);
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 21,
- FALSE, H5C1__NO_FLAGS_SET);
-
-
- if ( show_progress ) /* 27 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that the cache has grown */
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 17 ) ||
- ( cache_ptr->index_size != 17 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 2 ) ||
- ( cache_ptr->slist_size != 2 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->evictions_enabled != FALSE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 10.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 28 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* re-enable evictions again */
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, TRUE);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "can't enable evictions 2.");
- failure_mssg1 = msg;
- }
- }
-
- if ( show_progress ) /* 29 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* insert an entry */
- insert_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 22, TRUE, H5C1__NO_FLAGS_SET);
-
- if ( show_progress ) /* 30 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* verify that the cache has returned to its maximum size */
- if ( pass1 ) {
-
- if ( ( cache_ptr->index_len != 16 ) ||
- ( cache_ptr->index_size != 16 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->slist_len != 3 ) ||
- ( cache_ptr->slist_size != 3 * MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->evictions_enabled != TRUE ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected cache status 11.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 31 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- entry_ptr = &(base_addr[4]);
-
- result = H5C1_get_entry_status(cache_ptr, entry_ptr->addr,
- NULL, &in_cache, NULL, NULL, NULL);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5AC1_get_entry_status() reports failure 5.");
- failure_mssg1 = msg;
-
- } else if ( in_cache ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected status 5.");
- failure_mssg1 = msg;
-
- } else if ( ( ! entry_ptr->loaded ) ||
- ( entry_ptr->cleared ) ||
- ( ! entry_ptr->flushed ) ||
- ( ! entry_ptr->destroyed ) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Unexpected entry history 5.");
- failure_mssg1 = msg;
-
- }
- }
-
- if ( show_progress ) /* 32 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- /* disable evictions one last time before we shut down */
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, FALSE);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "can't disable evictions 3.");
- failure_mssg1 = msg;
- }
- }
-
- if ( show_progress ) /* 33 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( show_progress ) /* 34 */
- HDfprintf(stdout, "%s() - %0d -- pass1 = %d\n",
- fcn_name, mile_stone++, (int)pass1);
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_evictions_enabled() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_flush_protected_err()
- *
- * Purpose: Verify that an attempt to flush the cache when it contains
- * a protected entry will generate an error.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_flush_protected_err(void)
-{
- const char * fcn_name = "check_flush_protected_err";
- H5C1_t * cache_ptr = NULL;
-
- TESTING("flush cache with protected entry error");
-
- pass1 = TRUE;
-
- /* allocate a cache, protect an entry, and try to flush. This
- * should fail. Unprotect the entry and flush again -- should
- * succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry1(cache_ptr, 0, 0);
-
- if ( H5C1_flush_cache(NULL, -1, -1, cache_ptr, H5C1__NO_FLAGS_SET)
- >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "flush succeeded on cache with protected entry.\n";
-
- } else {
-
- unprotect_entry1(cache_ptr, 0, 0, TRUE, H5C1__NO_FLAGS_SET);
-
- if ( H5C1_flush_cache(NULL, -1, -1, cache_ptr, H5C1__NO_FLAGS_SET)
- < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "flush failed after unprotect.\n";
-
- } else {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
- }
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- 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()";
- H5C1_t * cache_ptr = NULL;
-
- TESTING("destroy cache with permanently pinned entry error");
-
- pass1 = 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 ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry1(cache_ptr, 0, 0);
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__PIN_ENTRY_FLAG);
-
- if ( H5C1_dest(NULL, -1, -1, cache_ptr) >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "destroy succeeded on cache with pinned entry.\n";
-
- } else {
-
- unpin_entry1(cache_ptr, 0, 0);
-
- if ( H5C1_dest(NULL, -1, -1, cache_ptr) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "destroy failed after unpin.\n";
-
- }
- }
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_destroy_pinned_err() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_destroy_protected_err()
- *
- * Purpose: Verify that an attempt to destroy the cache when it contains
- * a protected entry will generate an error.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_destroy_protected_err(void)
-{
- const char * fcn_name = "check_destroy_protected_err";
- H5C1_t * cache_ptr = NULL;
-
- TESTING("destroy cache with protected entry error");
-
- pass1 = TRUE;
-
- /* allocate a cache, protect an entry, and try to flush. This
- * should fail. Unprotect the entry and flush again -- should
- * succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry1(cache_ptr, 0, 0);
-
- if ( H5C1_dest(NULL, -1, -1, cache_ptr) >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "destroy succeeded on cache with protected entry.\n";
-
- } else {
-
- unprotect_entry1(cache_ptr, 0, 0, TRUE, H5C1__NO_FLAGS_SET);
-
- if ( H5C1_dest(NULL, -1, -1, cache_ptr) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "destroy failed after unprotect.\n";
-
- }
- }
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_destroy_protected_err() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_duplicate_insert_err()
- *
- * Purpose: Verify that an attempt to insert and entry that is
- * alread in the cache will generate an error.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_duplicate_insert_err(void)
-{
- const char * fcn_name = "check_duplicate_insert_err";
- herr_t result;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- TESTING("duplicate entry insertion error");
-
- pass1 = TRUE;
-
- /* allocate a cache, protect an entry, and then try to insert
- * the entry again. This should fail. Unprotect the entry and
- * destroy the cache -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry1(cache_ptr, 0, 0);
-
- if ( pass1 ) {
-
- base_addr = entries1[0];
- entry_ptr = &(base_addr[0]);
-
- result = H5C1_insert_entry(NULL, -1, -1, cache_ptr,
- &(types1[0]), entry_ptr->addr,
- (void *)entry_ptr, H5C1__NO_FLAGS_SET);
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "insert of duplicate entry succeeded.\n";
-
- } else {
-
- unprotect_entry1(cache_ptr, 0, 0, TRUE, H5C1__NO_FLAGS_SET);
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
- }
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s(): failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_duplicate_insert_err() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_rename_err()
- *
- * Purpose: Verify that an attempt to rename an entry to the address
- * of an existing entry will generate an error.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_rename_err(void)
-{
- const char * fcn_name = "check_rename_err()";
- herr_t result;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_0_0_ptr;
- test_entry_t * entry_0_1_ptr;
- test_entry_t * entry_1_0_ptr;
-
- TESTING("rename to existing entry errors");
-
- pass1 = TRUE;
-
- /* allocate a cache, and insert several entries. Try to rename
- * entries to other entries resident in the cache. This should
- * fail. Destroy the cache -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- insert_entry1(cache_ptr, 0, 0, TRUE, H5C1__NO_FLAGS_SET);
- insert_entry1(cache_ptr, 0, 1, TRUE, H5C1__NO_FLAGS_SET);
- insert_entry1(cache_ptr, 1, 0, TRUE, H5C1__NO_FLAGS_SET);
-
- entry_0_0_ptr = &((entries1[0])[0]);
- entry_0_1_ptr = &((entries1[0])[1]);
- entry_1_0_ptr = &((entries1[1])[0]);
- }
-
- if ( pass1 ) {
-
- result = H5C1_rename_entry(cache_ptr, &(types1[0]),
- entry_0_0_ptr->addr, entry_0_1_ptr->addr);
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "rename to addr of same type succeeded.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_rename_entry(cache_ptr, &(types1[0]),
- entry_0_0_ptr->addr, entry_1_0_ptr->addr);
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "rename to addr of different type succeeded.\n";
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- 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;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
-
- TESTING("pin a pinned entry error");
-
- pass1 = 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 ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry1(cache_ptr, 0, 0);
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__PIN_ENTRY_FLAG);
-
- protect_entry1(cache_ptr, 0, 0);
-
- entry_ptr = &((entries1[0])[0]);
- }
-
- if ( pass1 ) {
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr, &(types1[0]),
- entry_ptr->addr, (void *)entry_ptr,
- H5C1__PIN_ENTRY_FLAG, (size_t)0);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to pin a pinned entry succeeded.\n";
-
- } else {
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__UNPIN_ENTRY_FLAG);
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- 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;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
-
- TESTING("unpin an unpinned entry error");
-
- pass1 = TRUE;
-
- /* allocate a cache, protect an entry, unprotect it with the unpin flag.
- * -- This should fail.
- *
- * Try again with H5C1_unpin_entry -- this should also fail.
- *
- * Destroy the cache -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry1(cache_ptr, 0, 0);
-
- entry_ptr = &((entries1[0])[0]);
- }
-
- if ( pass1 ) {
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr, &(types1[0]),
- entry_ptr->addr, (void *)entry_ptr,
- H5C1__UNPIN_ENTRY_FLAG, (size_t)0);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to unpin an unpinned entry succeeded 1.\n";
-
- } else {
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_unpin_entry(cache_ptr, (void *)entry_ptr);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to unpin an unpinned entry succeeded 2.\n";
-
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_double_unpin_err() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_pin_entry_errs()
- *
- * Purpose: Verify that invalid calls to H5C1_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;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
-
- TESTING("pin entry related errors");
-
- pass1 = TRUE;
-
- /* Allocate a cache, protect an entry, unprotect it with no flags,
- * and then call H5C1_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 H5C1_pin_protected_entry() to pin it -- This
- * should fail also.
- *
- * Unprotect the entry with the unpin flag.
- *
- * Destroy the cache -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry1(cache_ptr, 0, 0);
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- entry_ptr = &((entries1[0])[0]);
- }
-
- if ( pass1 ) {
-
- result = H5C1_pin_protected_entry(cache_ptr, (void *)entry_ptr);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to pin an unprotected entry succeeded.\n";
-
- } else {
-
- protect_entry1(cache_ptr, 0, 0);
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__PIN_ENTRY_FLAG);
-
- protect_entry1(cache_ptr, 0, 0);
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_pin_protected_entry(cache_ptr, (void *)entry_ptr);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to pin a pinned, protected entry succeeded.\n";
-
- } else {
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__UNPIN_ENTRY_FLAG);
-
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_pin_entry_errs() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_double_protect_err()
- *
- * Purpose: Verify that an attempt to protect an entry that is already
- * protected will generate an error.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- * - Modified call to H5C1_protect() to pass1 H5C1__NO_FLAGS_SET in the
- * the new flags parameter.
- *
- * JRM -- 3/28/07
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_double_protect_err(void)
-{
- const char * fcn_name = "check_double_protect_err()";
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
- H5C1_cache_entry_t * cache_entry_ptr;
-
- TESTING("protect a protected entry error");
-
- pass1 = TRUE;
-
- /* allocate a cache, protect an entry, and then try to protect
- * the entry again. This should fail. Unprotect the entry and
- * destroy the cache -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry1(cache_ptr, 0, 0);
-
- entry_ptr = &((entries1[0])[0]);
- }
-
- if ( pass1 ) {
-
- cache_entry_ptr = H5C1_protect(NULL, -1, -1, cache_ptr, &(types1[0]),
- entry_ptr->addr, NULL, NULL,
- H5C1__NO_FLAGS_SET);
-
- if ( cache_entry_ptr != NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "attempt to protect a protected entry succeeded.\n";
- }
- }
-
- if ( pass1 ) {
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_double_protect_err() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_double_unprotect_err()
- *
- * Purpose: Verify that an attempt to unprotect an entry that is already
- * unprotected will generate an error.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- * JRM -- 6/17/05
- * Modified function to use the new dirtied parameter in
- * H5C1_unprotect().
- *
- * JRM -- 9/8/05
- * Updated function for the new size change parameter in
- * H5C1_unprotect(). We don't use them for now.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_double_unprotect_err(void)
-{
- const char * fcn_name = "check_double_unprotect_err()";
- herr_t result;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
-
- TESTING("unprotect an unprotected entry error");
-
- pass1 = TRUE;
-
- /* allocate a cache, protect an entry, unprotect it, and then try to
- * unprotect the entry again. This should fail. Destroy the cache
- * -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry1(cache_ptr, 0, 0);
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- entry_ptr = &((entries1[0])[0]);
- }
-
- if ( pass1 ) {
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr, &(types1[0]),
- entry_ptr->addr, (void *)entry_ptr,
- H5C1__NO_FLAGS_SET, (size_t)0);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to unprotect an unprotected entry succeeded 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_double_unprotect_err() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_mark_entry_dirty_errs()
- *
- * Purpose: Verify that:
- *
- * 1) a call to H5C1_mark_pinned_entry_dirty with an upinned
- * entry as the target will generate an error.
- *
- * 2) a call to H5C1_mark_pinned_entry_dirty with a protected
- * entry as the target will generate an error.
- *
- * 3) a call to H5C1_mark_pinned_or_protected_entry_dirty with
- * and unpinned and unprotected entry will generate an
- * error.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 5/17/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_mark_entry_dirty_errs(void)
-{
- const char * fcn_name = "check_mark_entry_dirty_errs()";
- herr_t result;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
-
- TESTING("mark entry dirty related errors");
-
- pass1 = TRUE;
-
- /* allocate a cache, protect an entry, and then attempt to mark it dirty
- * with the H5C1_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.
- *
- * Try it again using H5C1_mark_pinned_or_protected_entry_dirty -- this
- * should fail as well.
- *
- * Destroy the cache -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry1(cache_ptr, 0, 0);
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__PIN_ENTRY_FLAG);
-
- protect_entry1(cache_ptr, 0, 0);
-
- entry_ptr = &((entries1[0])[0]);
- }
-
- if ( pass1 ) {
-
- result = H5C1_mark_pinned_entry_dirty(cache_ptr, (void *)entry_ptr,
- FALSE, (size_t)0);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt dirty a pinned and protected entry succeeded.\n";
-
- } else {
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__UNPIN_ENTRY_FLAG);
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_mark_pinned_entry_dirty(cache_ptr, (void *)entry_ptr,
- FALSE, (size_t)0);
-
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to dirty a unpinned and unprotected entry succeeded 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_mark_pinned_or_protected_entry_dirty(cache_ptr,
- (void *)entry_ptr);
-
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to dirty a unpinned and unprotected entry succeeded 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_mark_entry_dirty_errs() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_expunge_entry1_errs()
- *
- * Purpose: Verify that invalid calls to H5C1_expunge_entry()
- * generate errors as expected.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 7/6/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_expunge_entry1_errs(void)
-{
- const char * fcn_name = "check_expunge_entry1_errs()";
- herr_t result;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
-
- TESTING("expunge entry related errors");
-
- pass1 = TRUE;
-
- /* Allocate a cache, protect an entry, and then call H5C1_expunge_entry()
- * to expunge it -- this should fail
- *
- * Unprotect the the entry with the pinned flag, and then call
- * H5C1_expunge_entry() again. This should fail too.
- *
- * Finally, unpin the entry and call H5C1_expunge_entry() yet again.
- * This should succeed.
- *
- * Destroy the cache -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- entry_ptr = &((entries1[0])[0]);
-
- protect_entry1(cache_ptr, 0, 0);
-
- }
-
- if ( pass1 ) {
-
- result = H5C1_expunge_entry(NULL, -1, -1, cache_ptr,
- &(types1[0]), entry_ptr->addr);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to expunge a protected entry succeeded.\n";
-
- } else {
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__PIN_ENTRY_FLAG);
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_expunge_entry(NULL, -1, -1, cache_ptr,
- &(types1[0]), entry_ptr->addr);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to expunge a pinned entry succeeded.\n";
-
- } else {
-
- unpin_entry1(cache_ptr, 0, 0);
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_expunge_entry(NULL, -1, -1, cache_ptr,
- &(types1[0]), entry_ptr->addr);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to expunge an unpinned and unprotected entry failed.\n";
-
- }
- }
-
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_expunge_entry1_errs() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_resize_entry1_errs()
- *
- * Purpose: Verify that invalid calls to H5C1_resize_pinned_entry()
- * generates errors as expected.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 7/7/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_resize_entry1_errs(void)
-{
- const char * fcn_name = "check_resize_entry1_errs()";
- herr_t result;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
-
- TESTING("resize entry related errors");
-
- pass1 = TRUE;
-
- /* Allocate a cache, protect an entry, and then call
- * H5C1_resize_pinned_entry() to resize it -- this should fail.
- *
- * Unprotect the the entry with the pinned flag, and then call
- * H5C1_resize_pinned_entry() again with new size of zero.
- * This should fail too.
- *
- * Finally, unpin the entry and destroy the cache.
- * This should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- entry_ptr = &((entries1[0])[0]);
-
- protect_entry1(cache_ptr, 0, 0);
-
- }
-
- if ( pass1 ) {
-
- result = H5C1_resize_pinned_entry(cache_ptr, (void *)entry_ptr, (size_t)1);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "Call to H5C1_resize_pinned_entry on a protected entry succeeded.\n";
-
- } else {
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__PIN_ENTRY_FLAG);
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_resize_pinned_entry(cache_ptr, (void *)entry_ptr, (size_t)0);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "Call to H5C1_resize_pinned_entry with 0 new size succeeded.\n";
-
- } else {
-
- unpin_entry1(cache_ptr, 0, 0);
-
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_resize_entry1_errs() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_unprotect_ro_dirty_err()
- *
- * Purpose: If an entry is protected read only, verify that unprotecting
- * it dirty will generate an error.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/3/07
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_unprotect_ro_dirty_err(void)
-{
- const char * fcn_name = "check_unprotect_ro_dirty_err()";
- herr_t result;
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
-
- TESTING("unprotect a read only entry dirty error");
-
- pass1 = TRUE;
-
- /* allocate a cache, protect an entry read only, and then unprotect it
- * with the dirtied flag set. This should fail. Destroy the cache
- * -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry_ro1(cache_ptr, 0, 0);
-
- entry_ptr = &((entries1[0])[0]);
- }
-
- if ( pass1 ) {
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr, &(types1[0]),
- entry_ptr->addr, (void *)entry_ptr,
- H5C1__DIRTIED_FLAG, (size_t)0);
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to unprotect a ro entry dirty succeeded 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- /* allocate a another cache, protect an entry read only twice, and
- * then unprotect it with the dirtied flag set. This should fail.
- * Unprotect it with no flags set twice and then destroy the cache.
- * This should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry_ro1(cache_ptr, 0, 0);
- protect_entry_ro1(cache_ptr, 0, 0);
-
- entry_ptr = &((entries1[0])[0]);
- }
-
- if ( pass1 ) {
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr, &(types1[0]),
- entry_ptr->addr, (void *)entry_ptr,
- H5C1__DIRTIED_FLAG, (size_t)0);
-
- if ( result > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "attempt to unprotect a ro entry dirty succeeded 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
-
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_unprotect_ro_dirty_err() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_protect_ro_rw_err()
- *
- * Purpose: If an entry is protected read only, verify that protecting
- * it rw will generate an error.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/9/07
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_protect_ro_rw_err(void)
-{
- const char * fcn_name = "check_protect_ro_rw_err()";
- H5C1_t * cache_ptr = NULL;
- test_entry_t * entry_ptr;
- void * thing_ptr = NULL;
-
- TESTING("protect a read only entry rw error");
-
- pass1 = TRUE;
-
- /* allocate a cache, protect an entry read only, and then try to protect
- * it again rw. This should fail.
- *
- * Unprotect the entry and destroy the cache -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
-
- protect_entry_ro1(cache_ptr, 0, 0);
-
- entry_ptr = &((entries1[0])[0]);
- }
-
- if ( pass1 ) {
-
- thing_ptr = H5C1_protect(NULL, -1, -1, cache_ptr, &(types1[0]),
- entry_ptr->addr, NULL, NULL, H5C1__NO_FLAGS_SET);
-
- if ( thing_ptr != NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "attempt to protect a ro entry rw succeeded.\n";
- }
- }
-
- if ( pass1 ) {
-
- unprotect_entry1(cache_ptr, 0, 0, FALSE, H5C1__NO_FLAGS_SET);
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_protect_ro_rw_err() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_evictions_enabled_err()
- *
- * Purpose: Verify that H5C1_get_evictions_enabled() and
- * H5C1_set_evictions_enabled() generate errors as expected.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 8/3/07
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_check_evictions_enabled_err(void)
-{
- const char * fcn_name = "check_evictions_enabled_err()";
- herr_t result;
- hbool_t evictions_enabled;
- H5C1_t * cache_ptr = NULL;
-
- TESTING("get/set evictions enabled errors");
-
- pass1 = TRUE;
-
- /* allocate a cache.
- *
- * Call H5C1_get_evictions_enabled(), pass1ing it a NULL cache_ptr,
- * should fail.
- *
- * Repeat with a NULL evictions_enabled_ptr, should fail as well.
- *
- * Configure the cache to use auto cache resize. Call
- * H5C1_set_evictions_enabled() to disable evictions. Should fail.
- *
- * Unprotect the entry and destroy the cache -- should succeed.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_evictions_enabled(NULL, &evictions_enabled);
-
- if ( result == SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_evictions_enabled succeeded() 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_evictions_enabled(cache_ptr, NULL);
-
- if ( result == SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_evictions_enabled succeeded() 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_set_evictions_enabled(cache_ptr, TRUE);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_evictions_enabled failed().\n";
-
- }
- }
-
- if ( pass1 ) {
-
- (cache_ptr->resize_ctl).incr_mode = H5C1_incr__threshold;
-
- result = H5C1_get_evictions_enabled(cache_ptr, FALSE);
-
- if ( result == SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_evictions_enabled succeeded() 1.\n";
-
- } else if ( cache_ptr->evictions_enabled == TRUE ) {
-
- }
-
- (cache_ptr->resize_ctl).incr_mode = H5C1_incr__off;
- }
-
- if ( pass1 ) {
-
- (cache_ptr->resize_ctl).decr_mode = H5C1_decr__threshold;
-
- result = H5C1_get_evictions_enabled(cache_ptr, FALSE);
-
- if ( result == SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_evictions_enabled succeeded() 2.\n";
- }
-
- (cache_ptr->resize_ctl).decr_mode = H5C1_decr__off;
- }
-
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_evictions_enabled_err() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_auto_cache_resize()
- *
- * Purpose: Exercise the automatic cache resizing functionality.
- * The objective is to operate the auto-resize code in
- * all possible modes. Unfortunately, there are quite
- * a few of them.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 10/29/04
- *
- * Modifications:
- *
- * John Mainzer 1/8/08
- * Added a basic set of tests for the flash cache size
- * increment code.
- *
- *-------------------------------------------------------------------------
- */
-
-hbool_t rpt_fcn_called = FALSE;
-enum H5C1_resize_status rpt_status;
-
-static void test_rpt_fcn(UNUSED H5C1_t * cache_ptr,
- UNUSED int32_t version,
- UNUSED double hit_rate,
- enum H5C1_resize_status status,
- UNUSED size_t old_max_cache_size,
- UNUSED size_t new_max_cache_size,
- UNUSED size_t old_min_clean_size,
- UNUSED size_t new_min_clean_size)
-{
- rpt_fcn_called = TRUE;
- rpt_status = status;
-}
-
-static void
-check_auto_cache_resize(void)
-{
- const char * fcn_name = "check_auto_cache_resize()";
- hbool_t show_progress = FALSE;
- herr_t result;
- int32_t i;
- int32_t checkpoint = 0;
- H5C1_t * cache_ptr = NULL;
- H5C1_auto_size_ctl_t auto_size_ctl =
- {
- /* int32_t version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ test_rpt_fcn,
-
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (512 * 1024),
-
- /* double min_clean_fraction = */ 0.5,
-
- /* size_t max_size = */ (14 * 1024 * 1024),
- /* size_t min_size = */ (512 * 1024),
-
- /* int64_t epoch_length = */ 1000,
-
-
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
-
- /* double lower_hr_threshold = */ 0.75,
-
- /* double increment = */ 2.0,
-
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
-
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
-
-
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__threshold,
-
- /* double upper_hr_threshold = */ 0.995,
-
- /* double decrement = */ 0.1,
-
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
-
- /* int32_t epochs_before_eviction = */ 3,
-
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05
- };
-
- TESTING("automatic cache resizing");
-
- pass1 = TRUE;
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* allocate a cache, enable automatic cache resizing, and then force
- * the cache through all its operational modes. Verify that all
- * performs as expected.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
- }
-
- if ( pass1 ) {
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after initialization.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache not full -- should result in not
- * full status.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, PICO_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, PICO_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != not_full ) ||
- ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 1.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full -- should result in increase
- * of cache size from .5 to 1 meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (1 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 2.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache not full -- should result in not
- * full status.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, PICO_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, PICO_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != not_full ) ||
- ( cache_ptr->max_cache_size != (1 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 3.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full again -- should result in increase
- * of cache size from 1 to 2 meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 4.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full again -- should result in increase
- * of cache size from 2 to 4 meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 5.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full again -- should result in increase
- * of cache size from 4 to 8 meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 6.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full again -- should result in increase
- * of cache size from 8 to 12 meg. Note that max increase reduced the
- * size of the increase.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (12 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (6 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 7.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full again -- should result in increase
- * of cache size from 12 to 14 meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (14 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (7 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 8.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full and at maximum size -- should
- * in no change in size and a result of at_max_size.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (14 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (7 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 9.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate with cache full and at maximum size -- should
- * result in a decrease from 14 to 13 Meg -- note that max decrease
- * reduced the size of the reduction
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (13 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (6 * 1024 * 1024 + 512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 10.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* the current cache configuration is inconvenient for testing cache
- * size reduction, so lets change it some something easier to work
- * with.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1000 * 1000 + 10;
-
- auto_size_ctl.min_clean_fraction = 0.1;
-
- auto_size_ctl.max_size = 8 * 1000 * 1000;
- auto_size_ctl.min_size = 500 * 1000;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1000 * 1000);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1000 * 1000);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1000 * 1000 + 10) ) ||
- ( cache_ptr->min_clean_size != (400 * 1000 + 1) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 1.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should result in a decrease from ~4 to ~3
- * M -- note that max decrease reduces the size of the reduction
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (3 * 1000 * 1000 + 10) ) ||
- ( cache_ptr->min_clean_size != (300 * 1000 + 1) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 11.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate again -- should result in a decrease from ~3
- * to ~2 M -- again note that max decrease reduces the size of the
- * reduction.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (2 * 1000 * 1000 + 10) ) ||
- ( cache_ptr->min_clean_size != (200 * 1000 + 1) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 12.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate again -- should result in a decrease from ~2
- * to ~1 M -- again note that max decrease reduces the size of the
- * reduction, but only by five bites.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (1 * 1000 * 1000 + 10) ) ||
- ( cache_ptr->min_clean_size != (100 * 1000 + 1) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 13.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate again -- should result in a decrease from ~1
- * to ~0.5 M -- max decrease is no longer a factor. New size is five
- * bytes above the minimum.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (500 * 1000 + 5) ) ||
- ( cache_ptr->min_clean_size != (50 * 1000) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 14.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate again -- should result in a decrease of five
- * bytes to the minimum cache size.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (500 * 1000) ) ||
- ( cache_ptr->min_clean_size != (50 * 1000) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 15.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate again -- Already at minimum size so no change in
- * cache size and result should be at_min_size.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_min_size ) ||
- ( cache_ptr->max_cache_size != (500 * 1000) ) ||
- ( cache_ptr->min_clean_size != (50 * 1000) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 16.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force in range hit rate -- should be no change in cache size,
- * and result should be in_spec.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 900 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i + 1000);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i + 1000,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (500 * 1000) ) ||
- ( cache_ptr->min_clean_size != (50 * 1000) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 17.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full -- should
- * increase cache size from .5 to 1 M.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (1 * 1000 * 1000) ) ||
- ( cache_ptr->min_clean_size != (100 * 1000) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 18.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should result in a decrease to the
- * minimum cache size.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (500 * 1000) ) ||
- ( cache_ptr->min_clean_size != (50 * 1000) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 19.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /******************************************************************
- * now do some tests with the maximum increase and decrease sizes
- * disabled.
- ******************************************************************/
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 4.0;
-
- auto_size_ctl.apply_max_increment = FALSE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.25;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 3.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 2.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should result in a decrease to the
- * minimum cache size.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (1 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 20.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full -- should increase cache size
- * from 1 to 4 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 21.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate again with cache full -- should increase cache
- * size from 4 to 16 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (16 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != ( 8 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 22.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should result in a decrease cache size from
- * 16 to 4 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 23.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /******************************************************************
- * We have tested the threshold increment and decrement modes.
- * must now test the ageout decrement mode.
- *
- * Reconfigure the cache for this testing.
- ******************************************************************/
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 8 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 8 * 1024 * 1024;
- auto_size_ctl.min_size = 512 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 4.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 3.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /* fill the cache with 1024 byte entries -- nothing should happen
- * for three epochs while the markers are inserted into the cache
- *
- * Note that hit rate will be zero, so the cache will attempt to
- * increase its size. Since we are already at max size, it will
- * not be able to.
- */
- if ( pass1 ) { /* first epoch */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 24.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* second epoch */
-
- rpt_fcn_called = FALSE;
- i = 1000;
- while ( ( pass1 ) && ( i < 2000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 25.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* third epoch */
-
- rpt_fcn_called = FALSE;
- i = 2000;
- while ( ( pass1 ) && ( i < 3000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 26.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fourth epoch -- If the hit rate were above the lower threshold,
- * we would see cache size reduction now. However, nothing will
- * happen until we get the hit rate above the lower threshold.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 27.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fifth epoch -- force the hit rate to 100%. We should see cache size
- * reduction now.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (2001 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(2001 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 28.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* sixth epoch -- force the hit rate to 100% again.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (1001 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(1001 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 29.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* seventh epoch -- force the hit rate to 100% again.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(1000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 30.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* eigth epoch -- force the hit rate to 100% again -- should be steady
- * state.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(1000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 31.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "*check point %d\n", checkpoint++);
-
- /* now just bang on one entry -- after three epochs, this should
- * get all entries other than the one evicted, and the cache size
- * should be decreased to the minimum.
- */
- if ( pass1 ) { /* ninth epoch */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(1000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 32.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* tenth epoch */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(1000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 33.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* eleventh epoch -- cache size reduction */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size !=
- MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 34.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* twelth epoch -- at minimum size so no more ageouts */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_min_size ) ||
- ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size !=
- MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 35.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /* repeat the above test, but with max_decrement enabled to see
- * if that features works as it should. Note that this will change
- * the structure of the test a bit.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 8 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 8 * 1024 * 1024;
- auto_size_ctl.min_size = 512 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 5.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 4.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /* fill the cache with 1024 byte entries -- nothing should happen
- * for three epochs while the markers are inserted into the cache
- *
- * Note that hit rate will be zero, so the cache will attempt to
- * increase its size. Since we are already at max size, it will
- * not be able to.
- */
- if ( pass1 ) { /* first epoch */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 36.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* second epoch */
-
- rpt_fcn_called = FALSE;
- i = 1000;
- while ( ( pass1 ) && ( i < 2000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 37.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* third epoch */
-
- rpt_fcn_called = FALSE;
- i = 2000;
- while ( ( pass1 ) && ( i < 3000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 38.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fourth epoch -- If the hit rate were above the lower threshold,
- * we would see cache size reduction now. However, nothing will
- * happen until we get the hit rate above the lower threshold.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 39.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fifth epoch -- force the hit rate to 100%. We should see cache size
- * reduction now.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (7 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (7 * 512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 40.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* sixth epoch -- force the hit rate to 100% again.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 2000;
- while ( ( pass1 ) && ( i < 3000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (6 * 512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 41.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* seventh epoch -- keep hit rate at 100%, and keep 2K entries active.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (5 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (5 * 512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 42.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* eigth epoch -- still 100% hit rate
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 2000;
- while ( ( pass1 ) && ( i < 3000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 43.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* ninth epoch --hit rate at 100%.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (3 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 44.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* tenth epoch -- still 100% hit rate
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 2000;
- while ( ( pass1 ) && ( i < 3000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 45.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* eleventh epoch -- hit rate at 100% -- starting to stableize
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (2000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(2000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 46.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* twelth epoch -- force the hit rate to 100% again -- should be steady
- * state.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 2000;
- while ( ( pass1 ) && ( i < 3000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (2000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(2000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 47.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* now just bang on one entry -- after three epochs, this should
- * get all entries other than the one evicted, and the cache size
- * should be decreased to the minimum.
- */
- if ( pass1 ) { /* thirteenth epoch */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (2000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(2000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 48.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* fourteenth epoch */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size !=
- (1001 * 1024 + MONSTER_ENTRY_SIZE) ) ||
- ( cache_ptr->min_clean_size !=
- (1001 * 512 + MONSTER_ENTRY_SIZE / 2) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 49.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* fifteenth epoch -- cache size reduction */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size !=
- MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 50.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* sixteenth epoch -- at minimum size so no more ageouts */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_min_size ) ||
- ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size !=
- MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 51.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /* repeat the test yet again, this time with empty reserve enabled.
- * Again, some structural changes in the test are necessary.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 8 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 8 * 1024 * 1024;
- auto_size_ctl.min_size = 512 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 6.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 5.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /* fill the cache with 1024 byte entries -- nothing should happen
- * for three epochs while the markers are inserted into the cache
- *
- * Note that hit rate will be zero, so the cache will attempt to
- * increase its size. Since we are already at max size, it will
- * not be able to.
- */
- if ( pass1 ) { /* first epoch */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 52.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* second epoch */
-
- rpt_fcn_called = FALSE;
- i = 1000;
- while ( ( pass1 ) && ( i < 2000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 53.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* third epoch */
-
- rpt_fcn_called = FALSE;
- i = 2000;
- while ( ( pass1 ) && ( i < 3000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 54.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fourth epoch -- If the hit rate were above the lower threshold,
- * we would see cache size reduction now. However, nothing will
- * happen until we get the hit rate above the lower threshold.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 55.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fifth epoch -- force the hit rate to 100%. We should see cache size
- * reduction now.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (4002 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(4002 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 56.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* sixth epoch -- force the hit rate to 100% again.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (2002 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(2002 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 57.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* seventh epoch -- force the hit rate to 100% again.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (2000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(2000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 58.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* eigth epoch -- force the hit rate to 100% again -- should be steady
- * state.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 3000;
- while ( ( pass1 ) && ( i < 4000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (2000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(2000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 59.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* now just bang on one entry -- after three epochs, this should
- * get all entries other than the one evicted, and the cache size
- * should be decreased to the minimum.
- */
- if ( pass1 ) { /* ninth epoch */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (2000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (int)(2000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 60.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* tenth epoch */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (2000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2000 * 512) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 61.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* eleventh epoch -- cache size reduction */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size !=
- MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 62.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* twelth epoch -- at minimum size so no more ageouts */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_min_size ) ||
- ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size !=
- MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 63.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /* Repeat the test again, this time using the age out with threshold
- * mode. To simplify the testing, set epochs to eviction to 1.
- *
- * Again, there are some minor structural changes in the test.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 8 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 8 * 1024 * 1024;
- auto_size_ctl.min_size = 512 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__off;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out_with_threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */
-
- auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 7.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 6.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /* fill the cache with 4K byte entries -- increment mode is off,
- * so cache size reduction should kick in as soon as we get the
- * hit rate above .999.
- */
- if ( pass1 ) { /* first epoch -- hit rate 0 */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 64.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* second epoch -- hit rate 0 */
-
- rpt_fcn_called = FALSE;
- i = 1000;
- while ( ( pass1 ) && ( i < 2000 ) )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 65.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* third epoch -- hit rate 1.0 -- should see decrease */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (1001 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->min_clean_size != (1001 * LARGE_ENTRY_SIZE / 2) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 66.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fourth epoch -- load up the cache again -- hit rate 0 */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (1001 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->min_clean_size != (1001 * LARGE_ENTRY_SIZE / 2) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 67.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fifth epoch -- still loading up the cache -- hit rate 0 */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 1000;
- while ( ( pass1 ) && ( i < 2000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (1001 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->min_clean_size != (1001 * LARGE_ENTRY_SIZE / 2) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 68.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* sixth epoch -- force hit rate to .998 -- should be no reduction */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 1002;
- while ( ( pass1 ) && ( i < 2002 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (1001 * LARGE_ENTRY_SIZE) ) ||
- ( cache_ptr->min_clean_size != (1001 * LARGE_ENTRY_SIZE / 2) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 69.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* seventh epoch -- force hit rate to .999 -- should see reduction
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 1003;
- while ( ( pass1 ) && ( i < 2003 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (1000 * MEDIUM_ENTRY_SIZE) ) ||
- ( cache_ptr->min_clean_size != (1000 * MEDIUM_ENTRY_SIZE / 2) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 70.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /* We have now tested all the major ageout modes individually.
- * Lets try them all together to look for unexpected interactions
- * and/or bugs.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 8 * 1000 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 8 * 1000 * 1024;
- auto_size_ctl.min_size = 512 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out_with_threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1000 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 8.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (8 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 7.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fill the cache with 4K byte entries -- increment mode is threshold,
- * so the decrease code will not be executed until the hit rate exceeds
- * .75.
- */
- if ( pass1 ) { /* first epoch -- hit rate 0 */
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 71.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { /* second epoch -- hit rate 0 */
-
- rpt_fcn_called = FALSE;
- i = 1000;
- while ( ( pass1 ) && ( i < 2000 ) )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 72.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* third epoch -- force the hit rate to 1.0. Should be no change
- * in the cache size due to the combination of the empty reserve
- * and the max decrease. Max decrease will limit the evictions
- * in any one epoch, and the empty reserve will not permit cache
- * size reduction unless the specified empty reserve is maintained.
- *
- * In this epoch, all we should see is a reduction in the index size.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (8 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (7 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 73.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fourth epoch -- hit rate still 1.0. Index size should decrease,
- * but otherwise no change expected.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (8 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (6 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 74.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fifth epoch -- hit rate still 1.0. Index size should decrease,
- * but otherwise no change expected.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (8 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (5 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 75.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* sixth epoch -- hit rate still 1.0. Index size should decrease,
- * but otherwise no change expected. Note that the cache size is
- * now just on the edge of meeting the clean reserve.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (8 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (4 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 76.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* seventh epoch -- hit rate still 1.0. No change in index size expected.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (8 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (4 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 77.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* eighth epoch -- start loading 1 KB entries. Hit rate 0 so
- * decrease code shouldn't be called.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != at_max_size ) ||
- ( cache_ptr->max_cache_size != (8 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (5 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 78.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* ninth epoch -- access the 1 KB entries again, driving the hit rate
- * to 1.0. Decrease code should be triggered, but the max decrease
- * should prevent the empty reserve from being met in this epoch.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (8 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (4 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 79.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* tenth epoch -- access the 1 KB entries yet again, forcing hit rate
- * to 1.0. Decrease code should be triggered, and the empty reserve
- * should finally be met.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (7 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (7 * 1000 * 1024 / 2) ) ||
- ( cache_ptr->index_size != (3 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 80.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* eleventh epoch -- access the 1 KB entries yet again, forcing hit rate
- * to 1.0. Decrease code should be triggered, and the empty reserve
- * should be met again.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (6 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (2 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 81.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* twelth epoch -- hit rate 1.0 -- decrease as before.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (5 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (5 * 1000 * 1024 / 2) ) ||
- ( cache_ptr->index_size != (1 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 82.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* thirteenth epoch -- hit rate 1.0 -- decrease as before.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (4 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (1 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 83.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fourteenth epoch -- hit rate 1.0 -- decrease as before.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (3 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1000 * 1024 / 2) ) ||
- ( cache_ptr->index_size != (1 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 84.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* fifteenth epoch -- hit rate 1.0 -- decrease as before.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (2 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (1 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 85.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* sixteenth epoch -- hit rate 1.0 -- should be stable now
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (2 * 1000 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1000 * 1024) ) ||
- ( cache_ptr->index_size != (1 * 1000 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 86.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- /* now test the flash cache size increment code. At least at present,
- * there should be no interaction between the regular auto-resize
- * code and the flash cache size increment code other than a reset
- * of the counter and stats collection used by the regular auto-resize
- * code. Thus we do only limited tests of the two pieces of code
- * operating together.
- *
- * Start with simple test to verify that the flash cache increment
- * code increases the cache size when and as expected.
- */
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* allocate a cache, enable the flash cache size increase code, and
- * then force the flash size increase code through all its operational
- * modes. Verify that all performs as expected.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* now repeat the above tests using the add space flash cache size
- * increment algorithm.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 64 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 1024 * 1024;
- auto_size_ctl.min_size = 5 * 1024;
-
- auto_size_ctl.epoch_length = 100;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (32 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__add_space;
- auto_size_ctl.flash_multiple = 1.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out_with_threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1000 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 12.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (64 * 1024) ) ||
- ( cache_ptr->min_clean_size != (32 * 1024) ) ||
- ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (0).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Load a huge entry into the cache */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, HUGE_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, HUGE_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) ||
- ( cache_ptr->min_clean_size != (32 * 1024) ) ||
- ( cache_ptr->index_len != 1 ) ||
- ( cache_ptr->index_size != HUGE_ENTRY_SIZE ) ||
- ( cache_ptr->cache_accesses != 1 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (1).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now load a monster entry. Since a monster entry is larger than
- * half the size of the cache, and there is not sufficient space
- * for a monster entry in the cache, we will add space to the
- * cache to make room for the entry.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (80 * 1024) ) ||
- ( cache_ptr->min_clean_size != (40 * 1024) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size != (HUGE_ENTRY_SIZE +
- MONSTER_ENTRY_SIZE) ) ||
- ( cache_ptr->cache_accesses != 1 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (2).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Load a second moster entry. Since the monster entry is larger
- * than half the size of the cache yet again, and there is not
- * sufficient space for the monster entry in the cache, we again
- * add space to the cache to make space for the entry.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 1);
-
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 1,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) ||
- ( cache_ptr->min_clean_size != ( 72 * 1024) ) ||
- ( cache_ptr->index_len != 3 ) ||
- ( cache_ptr->index_size != ((2 * MONSTER_ENTRY_SIZE) +
- HUGE_ENTRY_SIZE) ) ||
- ( cache_ptr->cache_accesses != 1 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (3).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Load a third moster entry. Should be no cache size increase this
- * time.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 2);
-
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 2,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) ||
- ( cache_ptr->min_clean_size != ( 72 * 1024) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size != (2 * MONSTER_ENTRY_SIZE) ) ||
- ( cache_ptr->cache_accesses != 2 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (4).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* delete existing entries to prepare for next test, and reset
- * the size of the cache.
- */
- if ( pass1 ) {
-
- expunge_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 1);
- expunge_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 2);
-
- if ( pass1 ) {
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 13.\n";
- }
- }
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) ||
- ( cache_ptr->min_clean_size != (32 * 1024) ) ||
- ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (5).\n";
- }
- }
-
- /* repeat the above basic test, only this time, use inserts to add
- * entries to the cache, not protects.
- */
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* insert a huge entry into the cache */
- if ( pass1 ) {
-
- insert_entry1(cache_ptr, HUGE_ENTRY_TYPE, 1, TRUE,
- H5C1__NO_FLAGS_SET);
- /* protect and unprotect a couple times to increment cache_accesses */
- protect_entry1(cache_ptr, HUGE_ENTRY_TYPE, 1);
- unprotect_entry1(cache_ptr, HUGE_ENTRY_TYPE, 1,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- protect_entry1(cache_ptr, HUGE_ENTRY_TYPE, 1);
- unprotect_entry1(cache_ptr, HUGE_ENTRY_TYPE, 1,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) ||
- ( cache_ptr->min_clean_size != (32 * 1024) ) ||
- ( cache_ptr->index_len != 1 ) ||
- ( cache_ptr->index_size != HUGE_ENTRY_SIZE ) ||
- ( cache_ptr->cache_accesses != 2 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (6).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now insert a monster entry. Since a monster entry is larger than
- * half the size of the cache, and there is not sufficient space
- * for a monster entry in the cache, we will add space to the
- * cache to make room for the entry.
- */
- if ( pass1 ) {
-
- insert_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 4, TRUE,
- H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (80 * 1024) ) ||
- ( cache_ptr->min_clean_size != (40 * 1024) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size !=
- HUGE_ENTRY_SIZE + MONSTER_ENTRY_SIZE ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (7).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Insert a second monster entry. Cache size should increase again.
- */
- if ( pass1 ) {
-
- insert_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 5, TRUE,
- H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) ||
- ( cache_ptr->min_clean_size != ( 72 * 1024) ) ||
- ( cache_ptr->index_len != 3 ) ||
- ( cache_ptr->index_size !=
- 2 * MONSTER_ENTRY_SIZE + HUGE_ENTRY_SIZE ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (8).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Insert a third monster entry. Should be no cache size increase this
- * time.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 6);
-
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 6,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (144 * 1024) ) ||
- ( cache_ptr->min_clean_size != ( 72 * 1024) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size != (2 * MONSTER_ENTRY_SIZE) ) ||
- ( cache_ptr->cache_accesses != 1 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (9).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* delete existing entries to prepare for next test, and reset
- * the size of the cache. We must also change the size of the needed
- * variable entries before we run the test, so will protect and
- * unprotect them now so as to get the correct initial size.
- */
- if ( pass1 ) {
-
- expunge_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 5);
- expunge_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 6);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 10,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 1024);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 11,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 1024);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 12,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 1024);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 13);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 13,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 1024);
-
- flush_cache1(cache_ptr, TRUE, FALSE, FALSE);
-
-
- if ( pass1 ) {
-
- auto_size_ctl.initial_size = 6 * 1024;
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 13.\n";
- }
- }
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024) ) ||
- ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (10).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now load the variable entries into the cache */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 13);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 13, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 4 * 1024 ) ||
- ( cache_ptr->cache_accesses != 4 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (11).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* protect a variable entry, and re-size it to 3K. Should be
- * no effect on the size of the cache.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 10,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 3 * 1024);
-
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 6 * 1024 ) ||
- ( cache_ptr->cache_accesses != 5 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (12).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* protect the variable entry again, and re-size it to 10K. Should
- * resize the cache to 13 KB. Note that cache_accesses will be 0
- * in this case, since cache_accesses is incremented on the protect.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 10,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 10 * 1024);
-
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (13 * 1024) ) ||
- ( cache_ptr->min_clean_size != (13 * 512) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 13 * 1024 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (13).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* protect a second variable entry, and re-size it to 10K. Should
- * resize to 22 KB.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 11,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 10 * 1024);
-
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) ||
- ( cache_ptr->min_clean_size != (11 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 22 * 1024 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (14).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* protect a third variable entry, and re-size it to 10K. Should
- * be no change in cache size.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 12,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 10 * 1024);
-
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) ||
- ( cache_ptr->min_clean_size != (11 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 31 * 1024 ) ||
- ( cache_ptr->cache_accesses != 1 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (15).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* re-size the variable entries back down to their initial size, and
- * restore the cache to its initial size as well, in preparation
- * for the next test.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 10,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 1 * 1024);
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 11,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 1 * 1024);
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 12,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 1 * 1024);
-
- if ( pass1 ) {
-
- auto_size_ctl.initial_size = 6 * 1024;
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 14.\n";
- }
- }
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 4 * 1024 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (16).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now test flash cache resizes with pinned entries...
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE,
- H5C1__PIN_ENTRY_FLAG);
- resize_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024, TRUE);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) ||
- ( cache_ptr->min_clean_size != (6 * 512) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 5 * 1024 ) ||
- ( cache_ptr->cache_accesses != 1 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (17).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- resize_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024, TRUE);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (13 * 1024) ) ||
- ( cache_ptr->min_clean_size != (13 * 512) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 13 * 1024 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (18).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE,
- H5C1__PIN_ENTRY_FLAG);
- resize_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024, TRUE);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) ||
- ( cache_ptr->min_clean_size != (11 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 22 * 1024 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (19).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE,
- H5C1__PIN_ENTRY_FLAG);
- resize_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024, TRUE);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) ||
- ( cache_ptr->min_clean_size != (11 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 31 * 1024 ) ||
- ( cache_ptr->cache_accesses != 1 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (20).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Unpin the entries. Note that no entries are evicted as we don't
- * load any entries.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE,
- H5C1__UNPIN_ENTRY_FLAG);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE,
- H5C1__UNPIN_ENTRY_FLAG);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE,
- H5C1__UNPIN_ENTRY_FLAG);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) ||
- ( cache_ptr->min_clean_size != (11 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 31 * 1024 ) ||
- ( cache_ptr->cache_accesses != 4 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (21).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* re-size the variable entries back down to their initial size, and
- * restore the cache to its initial size as well, in preparation
- * for the next test.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 10,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 1 * 1024);
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 11,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 1 * 1024);
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
- unprotect_entry1_with_size_change(cache_ptr, VARIABLE_ENTRY_TYPE, 12,
- H5C1__DIRTIED_FLAG|H5C1__SIZE_CHANGED_FLAG, 1 * 1024);
-
- if ( pass1 ) {
-
- auto_size_ctl.initial_size = 6 * 1024;
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 15.\n";
- }
- }
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 4 * 1024 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (22).\n";
- }
- }
-
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE,
- H5C1__PIN_ENTRY_FLAG);
- resize_pinned_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 2 * 1024);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (6 * 1024) ) ||
- ( cache_ptr->min_clean_size != (6 * 512) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 5 * 1024 ) ||
- ( cache_ptr->cache_accesses != 1 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (23).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- resize_pinned_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10, 10 * 1024);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (13 * 1024) ) ||
- ( cache_ptr->min_clean_size != (13 * 512) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 13 * 1024 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (24).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE,
- H5C1__PIN_ENTRY_FLAG);
- resize_pinned_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11, 10 * 1024);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) ||
- ( cache_ptr->min_clean_size != (11 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 22 * 1024 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (25).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE,
- H5C1__PIN_ENTRY_FLAG);
- resize_pinned_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12, 10 * 1024);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) ||
- ( cache_ptr->min_clean_size != (11 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 31 * 1024 ) ||
- ( cache_ptr->cache_accesses != 1 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (26).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Unpin the entries. Note that no entries are evicted as we don't
- * load any entries.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10, NO_CHANGE,
- H5C1__UNPIN_ENTRY_FLAG);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11, NO_CHANGE,
- H5C1__UNPIN_ENTRY_FLAG);
-
- protect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
- unprotect_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12, NO_CHANGE,
- H5C1__UNPIN_ENTRY_FLAG);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) ||
- ( cache_ptr->min_clean_size != (11 * 1024) ) ||
- ( cache_ptr->index_len != 4 ) ||
- ( cache_ptr->index_size != 31 * 1024 ) ||
- ( cache_ptr->cache_accesses != 4 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (27).\n";
- }
- }
-
- /* We have finished a basic check of the flash cache size increment
- * code. Tidy up for a more extensive test...
- */
- if ( pass1 ) {
-
- expunge_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 10);
- expunge_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 11);
- expunge_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 12);
- expunge_entry1(cache_ptr, VARIABLE_ENTRY_TYPE, 13);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (22 * 1024) ) ||
- ( cache_ptr->min_clean_size != (11 * 1024) ) ||
- ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ||
- ( cache_ptr->cache_accesses != 4 ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (28).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* ...and then reconfigure. Note that we change the flash_multiple
- * and flash_threshold just to make sure that such changed perform
- * as expected.
- */
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 20 * 1024;
- auto_size_ctl.min_size = 4 * 1024;
-
- auto_size_ctl.epoch_length = 100;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__add_space;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.4;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out_with_threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (2 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 1; /* for ease of testing */
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.5; /* for ease of testing */
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 15.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 512) ) ||
- ( cache_ptr->index_len != 0 ) ||
- ( cache_ptr->index_size != 0 ) ||
- ( cache_ptr->cache_accesses != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache after initialization 15.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* protect and unprotect a large entry -- no change in cache size since
- * a large entry will just fill the available space in the cache.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (4 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 512) ) ||
- ( cache_ptr->index_len != 1 ) ||
- ( cache_ptr->index_size != LARGE_ENTRY_SIZE ) ||
- ( cache_ptr->cache_accesses != 1 ) ||
- ( rpt_fcn_called == TRUE ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (29).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* protect and unprotect another a large entry -- should trigger a
- * flash cache size increase to 12 KB (remember that flash_multiple is
- * set to 2.0).
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 1);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 1, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (12 * 1024) ) ||
- ( cache_ptr->min_clean_size != (12 * 512) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size != 2 * LARGE_ENTRY_SIZE ) ||
- ( cache_ptr->cache_accesses != 1 ) ||
- ( rpt_fcn_called != TRUE ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (30).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* protect and unprotect two more large entries -- shouldnt trigger a
- * flash cache size increase.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 2);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 2, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 3);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 3, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (12 * 1024) ) ||
- ( cache_ptr->min_clean_size != (12 * 512) ) ||
- ( cache_ptr->index_len != 3 ) ||
- ( cache_ptr->index_size != 3 * LARGE_ENTRY_SIZE ) ||
- ( cache_ptr->cache_accesses != 3 ) ||
- ( rpt_fcn_called != FALSE ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (31).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* do many accesses of a single entry to talk the cache into reducing
- * its size to the minimum.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, TINY_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, TINY_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->max_cache_size != (4 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024) ) ||
- ( cache_ptr->index_size != (1 * TINY_ENTRY_SIZE) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (32).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Force another flash increase */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (4 * 1024 + 128) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 + 64) ) ||
- ( cache_ptr->index_len != 2 ) ||
- ( cache_ptr->index_size !=
- LARGE_ENTRY_SIZE + TINY_ENTRY_SIZE ) ||
- ( cache_ptr->cache_accesses != 1 ) ||
- ( rpt_fcn_called == FALSE ) ||
- ( rpt_status != flash_increase ) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (33).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force regular size increase up to maximum */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 500 ) )
- {
- protect_entry1(cache_ptr, TINY_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, TINY_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( cache_ptr->max_cache_size != (20 * 1024) ) ||
- ( cache_ptr->min_clean_size != (10 * 1024) ) ||
- ( rpt_fcn_called == FALSE ) ||
- ( rpt_status != at_max_size ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache config (34).\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_auto_cache_resize() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_auto_cache_resize_disable()
- *
- * Purpose: Test the various ways in which the resize code can
- * be disabled. Unfortunately, there are quite a few of them.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 12/16/04
- *
- * Modifications:
- *
- * Added code to include the flash cache size increment
- * code in this test.
- * JRM -- 1/10/08
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_auto_cache_resize_disable(void)
-{
- const char * fcn_name = "check_auto_cache_resize_disable()";
- hbool_t show_progress = FALSE;
- herr_t result;
- int32_t i;
- int32_t checkpoint = 0;
- H5C1_t * cache_ptr = NULL;
- H5C1_auto_size_ctl_t auto_size_ctl =
- {
- /* int32_t version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ test_rpt_fcn,
-
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (512 * 1024),
-
- /* double min_clean_fraction = */ 0.5,
-
- /* size_t max_size = */ (14 * 1024 * 1024),
- /* size_t min_size = */ (512 * 1024),
-
- /* int64_t epoch_length = */ 1000,
-
-
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
-
- /* double lower_hr_threshold = */ 0.75,
-
- /* double increment = */ 2.0,
-
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
-
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 1.0,
- /* double flash_threshold = */ 0.25,
-
-
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__threshold,
-
- /* double upper_hr_threshold = */ 0.995,
-
- /* double decrement = */ 0.1,
-
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
-
- /* int32_t epochs_before_eviction = */ 3,
-
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05
- };
-
- TESTING("automatic cache resize disable");
-
- pass1 = TRUE;
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* allocate a cache, enable automatic cache resizing, and then force
- * the cache through all its operational modes. Verify that all
- * performs as expected.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
- }
-
- if ( pass1 ) {
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after initialization.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /******************************************************************
- * So far, we have forced the auto cache resize through all modes
- * other than increase_disabled and decrease_disabled. Force these
- * modes now. Note that there are several ways we can reach these
- * modes.
- ******************************************************************/
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 1.0; /* disable size increases */
-
- auto_size_ctl.apply_max_increment = FALSE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 1.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full -- increase disabled so should
- * be no change in cache size, and result should be increase_disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( rpt_status != increase_disabled ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 1.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- make sure that we haven't disabled decreases.
- * should result in a decrease cache size from 4 to 2 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 2.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate again -- increase disabled so should
- * be no change in cache size, and result should be increase_disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( rpt_status != increase_disabled ) ||
- ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 3.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Repeat the above tests, disabling increase through the lower
- * threshold instead of the increment.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increases */
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = FALSE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 3.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 2.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full -- increase disabled so should
- * be no change in cache size, and result should be in_spec.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 4.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- make sure that we haven't disabled decreases.
- * should result in a decrease cache size from 4 to 2 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 5.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate again -- increase disabled so should
- * be no change in cache size, and result should be increase_disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 6.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Repeat the above tests yet again, disabling increase through the
- * incr_mode.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__off;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = FALSE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 4.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 3.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate with cache full -- increase disabled so should
- * be no change in cache size, and result should be in_spec.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 7.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- make sure that we haven't disabled decreases.
- * should result in a decrease cache size from 4 to 2 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 8.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate again -- increase disabled so should
- * be no change in cache size, and result should be increase_disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 9.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now, disable size decreases, and repeat the above tests.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 1.0; /* disable size decreases */
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 5.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 4.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should be no change in cache size,
- * and result should be decrease_disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease_disabled ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 10.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- cache size should increase from 4 to 6 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 11.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate again -- should be no change in cache size,
- * and result should be decrease_disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease_disabled ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 12.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Repeat the above tests, disabling decrease through the upper
- * threshold instead of the decrement.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decreases */
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 6.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 5.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should be no change in cache size,
- * and result should be in_spec.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 13.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- cache size should increase from 4 to 6 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 14.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate again -- should be no change in cache size,
- * and result should be in_spec.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 15.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Repeat the above tests, disabling decrease through the decr_mode.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__off;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 7.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 6.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should be no change in cache size,
- * and result should be in_spec.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 16.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- cache size should increase from 4 to 6 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 17.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate again -- should be no change in cache size,
- * and result should be in_spec.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 18.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now do tests disabling size decrement in age out mode.
- *
- * Start by disabling size decrement by setting max_decrement to zero.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = 0; /* disable decrement */
-
- auto_size_ctl.epochs_before_eviction = 1;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 8.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 7.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* flush the cache and destroy all entries so we start from a known point */
- flush_cache1(cache_ptr, TRUE, FALSE, FALSE);
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* load up the cache with small entries. Note that it will take an
- * epoch for the ageout code to initialize itself if it is enabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != not_full ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 19.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Load up some more small entries.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 1000;
- while ( ( pass1 ) && ( i < 2000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != not_full ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 20.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now force a high hit rate so that the size increase code is
- * is satisfied. We would see a decrease here if decrease were
- * possible.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != decrease_disabled ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 21.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- cache size should increase from 4 to 6 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 22.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* just bang on a single entry. This will see to it that there are
- * many entries that could be aged out were decreases enabled.
- * Should be no change in cache size, and result should be
- * decrease_disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != decrease_disabled ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 23.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now disable size decrement in age out mode via the empty reserve.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 1;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 1.0; /* disable decrement */
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 9.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 8.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* flush the cache and destroy all entries so we start from a known point */
- flush_cache1(cache_ptr, TRUE, FALSE, FALSE);
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* load up the cache with small entries. Note that it will take an
- * epoch for the ageout code to initialize itself if it is enabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != not_full ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 24.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Load up some more small entries.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 1000;
- while ( ( pass1 ) && ( i < 2000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != not_full ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 25.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now force a high hit rate so that the size increase code is
- * is satisfied. We would see a decrease here if decrease were
- * possible.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != decrease_disabled ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 26.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- cache size should increase from 4 to 6 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 27.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* just bang on a single entry. This will see to it that there are
- * many entries that could be aged out were decreases enabled.
- * Should be no change in cache size, and result should be
- * decrease_disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != decrease_disabled ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 28.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now work with age out with threshold. One can argue that we should
- * repeat the above age out tests with age out with threshold, but the
- * same code is executed in both cases so I don't see the point. If
- * that ever changes, this test should be updated.
- *
- * There is only one way of disabling decrements that is peculiar
- * to age out with threshold, which is to set the upper threshold
- * to 1.0. Test this now.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out_with_threshold;
-
- auto_size_ctl.upper_hr_threshold = 1.0;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 1;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 10.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 9.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* flush the cache and destroy all entries so we start from a known point */
- flush_cache1(cache_ptr, TRUE, FALSE, FALSE);
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* load up the cache with small entries. Note that it will take an
- * epoch for the ageout code to initialize itself if it is enabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != not_full ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 29.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Load up some more small entries.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 1000;
- while ( ( pass1 ) && ( i < 2000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != not_full ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 30.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now force a high hit rate so that the size increase code is
- * is satisfied. We would see a decrease here if decrease were
- * possible, but the upper threshold cannot be met, so no decrease.
- *
- * rpt_status should be decrease_disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != decrease_disabled ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->index_len != 2000 ) ||
- ( cache_ptr->index_size != 2000 * SMALL_ENTRY_SIZE ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 31.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- cache size should increase from 4 to 6 Meg.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != increase ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 32.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* just bang on a single entry. This keeps the hit rate high, and sees
- * to it that there are many entries that could be aged out were
- * decreases enabled.
- *
- * Should be no change in cache size, and result should be
- * decrease_disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 999);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 999,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( rpt_status != decrease_disabled ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 33.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /*********************************************************************
- * Finally, use the auto cache resize code to set the size of the
- * cache and keep it there. Again, due to the complexity of the
- * interface, there are lots of ways of doing this. We have to
- * check them all.
- *********************************************************************/
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 2 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increases */
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decreases */
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 11.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 10.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 34.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (2 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 35.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.25;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 1.0; /* disable size increment */
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 1.0; /* disable size decrement */
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 12.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 11.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 36.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 37.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = FALSE;
- auto_size_ctl.initial_size = 2 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 6 * 1024 * 1024; /* no resize */
- auto_size_ctl.min_size = 6 * 1024 * 1024; /* no resize */
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 13.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 12.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 38.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (6 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (3 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 39.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.25;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 1.0; /* disable size increment */
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decrement */
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 14.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 13.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 40.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (1 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 41.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increment */
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 1.0; /* disable size decrement */
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 15.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 14.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 42.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 43.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 16 * 1024 * 1024;
- auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__off;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__off;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 16.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 15.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force low hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 44.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* force high hit rate -- should be no response as the auto-resize
- * code should be disabled.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( rpt_fcn_called ) ||
- ( cache_ptr->resize_enabled ) ||
- ( cache_ptr->size_increase_possible ) ||
- ( cache_ptr->size_decrease_possible ) ||
- ( cache_ptr->max_cache_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (2 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 45.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now test the flash cache size increment code to verify that it
- * is disabled when it should be.
- *
- * Since the flash size increase code doesn't look at hit rate, or
- * use epochs (other than to start a new epoch if a flash cache size
- * increase is triggered), we go about these tests somewhat differently
- * than the rest of the tests in this function.
- *
- * As of this writing, there is only one flash cache size increment
- * mode (add space), which is triggered whenever the size of a newly
- * loaded or inserted entry, or the delta between old and new entry
- * sizes exceeds some fraction of the current maximum cache size, and
- * the cache doesn't have enough free space to accomodate the new/
- * resize entry without performing evictions. The range of permissible
- * values for the flash_threshold (0.1 to 1.0 as of this writing), and
- * for the flash_multiple (0.1 to 10.0) do not permit the facility to
- * be turned off by configuration. Thus, flash cache size increases
- * can be disabled only via the flash_incr_mode, and by setting the
- * current max_cache_size equal to max_size.
- *
- * We have already tested the latter in check_auto_cache_resize(), so
- * we need only thest the former here. Do this by disabling flash
- * cache size increments via the flash_incr_mode, and then creating
- * situations that would trigger flash cache size increases were that
- * code enabled.
- */
-
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 64 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 256 * 1024;
- auto_size_ctl.min_size = 32 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (2 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 1.0;
- auto_size_ctl.flash_threshold = 0.25;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out_with_threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = TRUE;
- auto_size_ctl.max_decrement = (1 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 3;
-
- auto_size_ctl.apply_empty_reserve = TRUE;
- auto_size_ctl.empty_reserve = 0.05;
-
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 17.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (64 * 1024) ) ||
- ( cache_ptr->min_clean_size != (32 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 16.\n";
- }
- }
-
- /* We have reduced the max cache size to well below the current index
- * size. Protect and unprotect an entry to allow the cache to evict
- * entries and get within bounds
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
-
- protect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0);
- unprotect_entry1(cache_ptr, LARGE_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) ||
- ( cache_ptr->min_clean_size != (32 * 1024) ) ||
- ( cache_ptr->index_len != 1 ) ||
- ( cache_ptr->index_size != LARGE_ENTRY_SIZE ) ||
- ( rpt_fcn_called != FALSE ) ) ) ) {
-
- HDfprintf(stdout, "\nmax_cache_size = %ld.\n",
- (long)(cache_ptr->max_cache_size));
- HDfprintf(stdout, "min_clean_size = %ld.\n",
- (long)(cache_ptr->min_clean_size));
- HDfprintf(stdout, "index_len = %ld.\n",
- (long)(cache_ptr->index_len));
- HDfprintf(stdout, "index_size = %ld.\n",
- (long)(cache_ptr->index_size));
- HDfprintf(stdout, "rpt_fcn_called = %ld.\n",
- (long)(rpt_fcn_called));
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 46.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Now protect and unprotect a monster entry. If the flash cache
- * size increment code was active, this would trigger an increase.
- * Verify that it doesn't.
- *
- * This finishes the additional tests needed for the flash cache
- * size increase code.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
-
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
-
- if ( ( pass1 ) &&
- ( ( ( cache_ptr->max_cache_size != (64 * 1024) ) ||
- ( cache_ptr->min_clean_size != (32 * 1024) ) ||
- ( cache_ptr->index_len != 1 ) ||
- ( cache_ptr->index_size != MONSTER_ENTRY_SIZE ) ||
- ( rpt_fcn_called != FALSE ) ) ) ) {
-
- HDfprintf(stdout, "\nmax_cache_size = %ld.\n",
- (long)(cache_ptr->max_cache_size));
- HDfprintf(stdout, "min_clean_size = %ld.\n",
- (long)(cache_ptr->min_clean_size));
- HDfprintf(stdout, "index_len = %ld.\n",
- (long)(cache_ptr->index_len));
- HDfprintf(stdout, "index_size = %ld.\n",
- (long)(cache_ptr->index_size));
- HDfprintf(stdout, "rpt_fcn_called = %ld.\n",
- (long)(rpt_fcn_called));
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 47.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_auto_cache_resize_disable() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_auto_cache_resize_epoch_markers()
- *
- * Purpose: Verify that the auto-resize code manages epoch markers
- * correctly.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 12/16/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_auto_cache_resize_epoch_markers(void)
-{
- const char * fcn_name = "check_auto_cache_resize_epoch_markers()";
- hbool_t show_progress = FALSE;
- herr_t result;
- int32_t i;
- int32_t j;
- int32_t checkpoint = 0;
- H5C1_t * cache_ptr = NULL;
- H5C1_auto_size_ctl_t auto_size_ctl =
- {
- /* int32_t version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ test_rpt_fcn,
-
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (512 * 1024),
-
- /* double min_clean_fraction = */ 0.5,
-
- /* size_t max_size = */ (14 * 1024 * 1024),
- /* size_t min_size = */ (512 * 1024),
-
- /* int64_t epoch_length = */ 1000,
-
-
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
-
- /* double lower_hr_threshold = */ 0.75,
-
- /* double increment = */ 2.0,
-
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
-
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
-
-
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__threshold,
-
- /* double upper_hr_threshold = */ 0.995,
-
- /* double decrement = */ 0.1,
-
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
-
- /* int32_t epochs_before_eviction = */ 3,
-
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05
- };
-
- TESTING("automatic cache resize epoch marker management");
-
- pass1 = TRUE;
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
- }
-
- if ( pass1 ) {
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after initialization.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- /* Now make sure that we are managing the epoch markers correctly.
- */
-
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 8 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 8 * 1024 * 1024;
- auto_size_ctl.min_size = 512 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__off;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 10;
-
- auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 1.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Since we just created the cache, there should be no epoch markers
- * active. Verify that this is true.
- */
-
- if ( pass1 ) {
-
- if ( cache_ptr->epoch_markers_active != 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected # of epoch markers 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MEDIUM_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ||
- ( cache_ptr->index_size != (1 * 1000 * MEDIUM_ENTRY_SIZE) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 0.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
-
- if ( pass1 ) {
-
- j = 2;
- while ( ( pass1 ) && ( j <= 10 ) )
- {
-
- rpt_fcn_called = FALSE;
- i = (j - 2) * 1000;
- while ( ( pass1 ) && ( i < (j - 1) * 1000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->epoch_markers_active != j ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected # of epoch markers 2.\n";
- }
-
- j++;
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* we now have a full complement of epoch markers -- see if
- * we get the expected reduction.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 9000;
- while ( ( pass1 ) && ( i < 10000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size !=
- (10 * 1000 * SMALL_ENTRY_SIZE + MEDIUM_ENTRY_SIZE) ) ||
- ( cache_ptr->min_clean_size !=
- ((10 * 1000 * SMALL_ENTRY_SIZE + MEDIUM_ENTRY_SIZE) / 2) ) ||
- ( cache_ptr->index_size !=
- (10 * 1000 * SMALL_ENTRY_SIZE + MEDIUM_ENTRY_SIZE) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 1.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* now reduce the epochs before eviction, and see if the cache
- * deletes the extra markers
- */
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 8 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 8 * 1024 * 1024;
- auto_size_ctl.min_size = 512 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__off;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 1;
-
- auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 3.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 2.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* There should be exactly one active epoch marker at present.
- */
- if ( pass1 ) {
-
- if ( cache_ptr->epoch_markers_active != 1 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected # of epoch markers 3.\n";
- }
- }
-
- /* Now do an epochs worth of accesses, and verify that everything
- * not accessed in this epoch gets evicted, and the cache size
- * is reduced.
- */
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 9000;
- while ( ( pass1 ) && ( i < 10000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != decrease ) ||
- ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ||
- ( cache_ptr->index_size != (1 * 1000 * SMALL_ENTRY_SIZE) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 2.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* There should be exactly one active epoch marker at present...
- */
- if ( pass1 ) {
-
- if ( cache_ptr->epoch_markers_active != 1 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected # of epoch markers 4.\n";
- }
- }
-
- /* shift the decrement mode to threshold, and verify that we remove
- * all epoch markers.
- */
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 8 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 8 * 1024 * 1024;
- auto_size_ctl.min_size = 512 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__off;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 1;
-
- auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 4.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after set resize re-config 3.\n";
- }
- }
-
- /* ... and now there should be none.
- */
- if ( pass1 ) {
-
- if ( cache_ptr->epoch_markers_active != 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected # of epoch markers 5.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* shift the decrement mode to age out with threshold. Set epochs
- * before eviction to 10 again.
- */
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 8 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 8 * 1024 * 1024;
- auto_size_ctl.min_size = 512 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__off;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__age_out_with_threshold;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 10;
-
- auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 5.\n";
- }
- }
-
- /* Verify that there are no active epoch markers.
- */
- if ( pass1 ) {
-
- if ( cache_ptr->epoch_markers_active != 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected # of epoch markers 6.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* build up a full set of epoch markers. */
- if ( pass1 ) {
-
- j = 1;
- while ( ( pass1 ) && ( j <= 10 ) )
- {
-
- rpt_fcn_called = FALSE;
- i = (j - 1) * 1000;
- while ( ( pass1 ) && ( i < j * 1000 ) )
- {
- protect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i);
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, SMALL_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
-
- if ( ( ! rpt_fcn_called ) ||
- ( rpt_status != in_spec ) ||
- ( cache_ptr->epoch_markers_active != j ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected # of epoch markers 7.\n";
- }
-
- j++;
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* Verify that there are now 10 active epoch markers.
- */
- if ( pass1 ) {
-
- if ( cache_ptr->epoch_markers_active != 10 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected # of epoch markers 8.\n";
- }
- }
-
- /* shift the decrement mode to off. This should cause all epoch
- * markers to be removed.
- */
- if ( pass1 ) {
-
- auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- auto_size_ctl.rpt_fcn = test_rpt_fcn;
-
- auto_size_ctl.set_initial_size = TRUE;
- auto_size_ctl.initial_size = 8 * 1024 * 1024;
-
- auto_size_ctl.min_clean_fraction = 0.5;
-
- auto_size_ctl.max_size = 8 * 1024 * 1024;
- auto_size_ctl.min_size = 512 * 1024;
-
- auto_size_ctl.epoch_length = 1000;
-
-
- auto_size_ctl.incr_mode = H5C1_incr__off;
-
- auto_size_ctl.lower_hr_threshold = 0.75;
-
- auto_size_ctl.increment = 2.0;
-
- auto_size_ctl.apply_max_increment = TRUE;
- auto_size_ctl.max_increment = (4 * 1024 * 1024);
-
- auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- auto_size_ctl.flash_multiple = 2.0;
- auto_size_ctl.flash_threshold = 0.5;
-
-
- auto_size_ctl.decr_mode = H5C1_decr__off;
-
- auto_size_ctl.upper_hr_threshold = 0.995;
-
- auto_size_ctl.decrement = 0.5;
-
- auto_size_ctl.apply_max_decrement = FALSE;
- auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- auto_size_ctl.epochs_before_eviction = 10;
-
- auto_size_ctl.apply_empty_reserve = FALSE;
- auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 6.\n";
- }
- }
-
- /* Verify that there are now no active epoch markers.
- */
- if ( pass1 ) {
-
- if ( cache_ptr->epoch_markers_active != 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected # of epoch markers 9.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- /* verify that we still have the expected number of entries in the cache,
- * and that the cache is of the expected size.
- */
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (4 * 1024 * 1024) )||
- ( cache_ptr->index_size != (10 * 1000 * SMALL_ENTRY_SIZE) ) ||
- ( cache_ptr->index_len != 10000 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache size change results 3.\n";
- }
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++);
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_auto_cache_resize_epoch_markers() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_auto_cache_resize_input_errs()
- *
- * Purpose: Verify that H5C1_set_cache_auto_resize_config() detects
- * and rejects invalid input.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 10/29/04
- *
- * Modifications:
- *
- * Added code to verify that errors in the flash cache size
- * increment related fields are caught as well.
- *
- * JRM -- 1/17/08
- *
- *-------------------------------------------------------------------------
- */
-
-#define RESIZE_CONFIGS_ARE_EQUAL(a, b, compare_init) \
-( ( (a).version == (b).version ) && \
- ( (a).rpt_fcn == (b).rpt_fcn ) && \
- ( ( ! compare_init ) || \
- ( (a).set_initial_size == (b).set_initial_size ) ) && \
- ( ( ! compare_init ) || \
- ( (a).initial_size == (b).initial_size ) ) && \
- ( (a).min_clean_fraction == (b).min_clean_fraction ) && \
- ( (a).max_size == (b).max_size ) && \
- ( (a).min_size == (b).min_size ) && \
- ( (a).epoch_length == (b).epoch_length ) && \
- ( (a).incr_mode == (b).incr_mode ) && \
- ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \
- ( (a).increment == (b).increment ) && \
- ( (a).apply_max_increment == (b).apply_max_increment ) && \
- ( (a).max_increment == (b).max_increment ) && \
- ( (a).flash_incr_mode == (b).flash_incr_mode ) && \
- ( (a).flash_multiple == (b).flash_multiple ) && \
- ( (a).flash_threshold == (b).flash_threshold ) && \
- ( (a).decr_mode == (b).decr_mode ) && \
- ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \
- ( (a).flash_incr_mode == (b).flash_incr_mode ) && \
- ( (a).flash_multiple == (b).flash_multiple ) && \
- ( (a).flash_threshold == (b).flash_threshold ) && \
- ( (a).decrement == (b).decrement ) && \
- ( (a).apply_max_decrement == (b).apply_max_decrement ) && \
- ( (a).max_decrement == (b).max_decrement ) && \
- ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \
- ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
- ( (a).empty_reserve == (b).empty_reserve ) )
-
-static void
-check_auto_cache_resize_input_errs(void)
-{
- const char * fcn_name = "check_auto_cache_resize_input_errs()";
- herr_t result;
- H5C1_t * cache_ptr = NULL;
- H5C1_auto_size_ctl_t ref_auto_size_ctl =
- {
- /* int32_t version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ test_rpt_fcn,
-
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (512 * 1024),
-
- /* double min_clean_fraction = */ 0.5,
-
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ (512 * 1024),
-
- /* int64_t epoch_length = */ 1000,
-
-
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
-
- /* double lower_hr_threshold = */ 0.75,
-
- /* double increment = */ 2.0,
-
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
-
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
-
-
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__threshold,
-
- /* double upper_hr_threshold = */ 0.995,
-
- /* double decrement = */ 0.1,
-
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
-
- /* int32_t epochs_before_eviction = */ 3,
-
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05
- };
-
- H5C1_auto_size_ctl_t invalid_auto_size_ctl;
- H5C1_auto_size_ctl_t test_auto_size_ctl;
-
- TESTING("automatic cache resize input errors");
-
- pass1 = TRUE;
-
- /* allocate a cache, and set a reference automatic cache control
- * configuration. Then feed H5C1_set_cache_auto_resize_config()
- * invalid input, and verify that the correct error is returned,
- * and that the configuration is not modified.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
- }
-
- if ( pass1 ) {
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &ref_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (512 * 1024) ) ||
- ( cache_ptr->min_clean_size != (256 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after initialization.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 1.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 1.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.5;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.7;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(NULL,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted NULL cache_ptr.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 2.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 2.";
- }
- }
-
-
- /* check bad version rejection. */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = -1; /* INVALID */
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.5;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.7;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad version.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 3.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 3.";
- }
- }
-
-
- /* check bad initial size rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 16 * 1024 * 1024 + 1;
- /* INVALID */
-
- invalid_auto_size_ctl.min_clean_fraction = 0.5;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad init size 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 4.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 4.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 1 * 1024 * 1024 - 1;
- /* INVALID */
-
- invalid_auto_size_ctl.min_clean_fraction = 0.5;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad init size 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 5.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 5.";
- }
- }
-
-
- /* test for invalid min clean fraction rejection. */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 1.00001; /* INVALID */
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad min clean frac 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 6.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 6.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = -0.00001; /* INVALID */
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad min clean frac 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 7.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 7.";
- }
- }
-
-
- /* test for invalid max_size and/or min_size rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.5;
-
- invalid_auto_size_ctl.max_size = H5C1__MAX_MAX_CACHE_SIZE + 1;
- /* INVALID */
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad max_size.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 8.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 8.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.5;
-
- invalid_auto_size_ctl.max_size = 1 * 1024 * 1024;/* INVALID */
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024 + 1;/*PAIR */
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad size pair.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 9.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 9.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.5;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = H5C1__MIN_MAX_CACHE_SIZE - 1;
- /* INVALID */
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad min_size.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 10.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 10.";
- }
- }
-
-
- /* test for invalid epoch_length rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = H5C1__MAX_AR_EPOCH_LENGTH + 1;
- /* INVALID */
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad epoch len 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 11.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 11.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = H5C1__MIN_AR_EPOCH_LENGTH - 1;
- /* INVALID */
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad epoch len 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 12.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 12.";
- }
- }
-
-
- /* test for bad incr_mode rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode =
- (enum H5C1_cache_incr_mode) -1; /* INVALID */
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad incr_mode 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 13.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 13.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode =
- (enum H5C1_cache_incr_mode) 2; /* INVALID */
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad incr_mode 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 14.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 14.";
- }
- }
-
-
- /* check for bad upper and/or lower threshold rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.5;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.7;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 1.01; /* INVALID */
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad upper threshold.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 15.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 15.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.5;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.8; /* INVALID */
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.7; /* INVALID */
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad threshold pair.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 16.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 16.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.5;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = -0.0001; /* INVALID */
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad lower threshold.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 17.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 17.";
- }
- }
-
-
- /* test for bad increment rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 0.99999; /* INVALID */
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.5;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad increment.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 18.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 18.";
- }
- }
-
-
- /* test for bad flash_incr_mode rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode =
- (enum H5C1_cache_flash_incr_mode) -1; /* INVALID */
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad flash_incr_mode.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 19.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 19.";
- }
- }
-
- /* test for bad flash_multiple rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode =
- H5C1_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 0.09; /* INVALID */
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad flash_multiple(1).\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 20.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 20.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode =
- H5C1_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 10.01; /* INVALID */
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad flash_multiple(2).\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 21.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 21.";
- }
- }
-
- /* test for bad flash_threshold rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode =
- H5C1_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 1.0;
- invalid_auto_size_ctl.flash_threshold = 0.09; /* INVALID */
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad flash_threshold(1).\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 22.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 22.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode =
- H5C1_flash_incr__add_space;
- invalid_auto_size_ctl.flash_multiple = 1.0;
- invalid_auto_size_ctl.flash_threshold = 1.001; /* INVALID */
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad flash_threshold(2).\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 23.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 23.";
- }
- }
-
- /* test for bad decr_mode rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode =
- (enum H5C1_cache_decr_mode) -1; /* INVALID */
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad decr_mode 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 24.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 24.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode =
- (enum H5C1_cache_decr_mode) 4; /* INVALID */
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad decr_mode 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 25.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 25.";
- }
- }
-
-
- /* check for bad decrement rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 1.000001; /* INVALID */
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad decrement 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 26.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 26.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = -0.000001; /* INVALID */
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_set_cache_auto_resize_config accepted bad decrement 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 27.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 27.";
- }
- }
-
-
- /* check for rejection of bad epochs_before_eviction */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__age_out;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 0; /* INVALID */
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config accepted bad epochs_before_eviction 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 28.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 28.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__age_out_with_threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction =
- H5C1__MAX_EPOCH_MARKERS + 1; /* INVALID */
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config accepted bad epochs_before_eviction 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 29.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 29.";
- }
- }
-
-
- /* Check for bad apply_empty_reserve rejection */
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__age_out;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction = 3;
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = -0.0000001; /* INVALID */
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config accepted bad empty_reserve 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 30.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 30.";
- }
- }
-
- if ( pass1 ) {
-
- invalid_auto_size_ctl.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- invalid_auto_size_ctl.rpt_fcn = NULL;
-
- invalid_auto_size_ctl.set_initial_size = TRUE;
- invalid_auto_size_ctl.initial_size = 4 * 1024 * 1024;
-
- invalid_auto_size_ctl.min_clean_fraction = 0.1;
-
- invalid_auto_size_ctl.max_size = 16 * 1024 * 1024;
- invalid_auto_size_ctl.min_size = 1 * 1024 * 1024;
-
- invalid_auto_size_ctl.epoch_length = 5000;
-
-
- invalid_auto_size_ctl.incr_mode = H5C1_incr__threshold;
-
- invalid_auto_size_ctl.lower_hr_threshold = 0.75;
-
- invalid_auto_size_ctl.increment = 2.0;
-
- invalid_auto_size_ctl.apply_max_increment = TRUE;
- invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024);
-
- invalid_auto_size_ctl.flash_incr_mode = H5C1_flash_incr__off;
- invalid_auto_size_ctl.flash_multiple = 2.0;
- invalid_auto_size_ctl.flash_threshold = 0.5;
-
-
- invalid_auto_size_ctl.decr_mode = H5C1_decr__age_out_with_threshold;
-
- invalid_auto_size_ctl.upper_hr_threshold = 0.999;
-
- invalid_auto_size_ctl.decrement = 0.9;
-
- invalid_auto_size_ctl.apply_max_decrement = TRUE;
- invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024);
-
- invalid_auto_size_ctl.epochs_before_eviction =
- H5C1__MAX_EPOCH_MARKERS + 1; /* INVALID */
-
- invalid_auto_size_ctl.apply_empty_reserve = TRUE;
- invalid_auto_size_ctl.empty_reserve = 0.05;
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &invalid_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config accepted bad empty_reserve 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr,
- &test_auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_auto_resize_config failed 31.";
-
- } else if ( ! RESIZE_CONFIGS_ARE_EQUAL(test_auto_size_ctl, \
- ref_auto_size_ctl, FALSE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected auto resize config 31.";
- }
- }
-
-
- /* finally, before we finish, try feeding
- * H5C1_get_cache_auto_resize_config invalid data.
- */
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(NULL, &test_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_auto_resize_config accepted NULL cache_ptr.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config((H5C1_t *)&test_auto_size_ctl,
- &test_auto_size_ctl);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_auto_resize_config accepted bad cache_ptr.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_auto_resize_config(cache_ptr, NULL);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_auto_resize_config accepted NULL config ptr.\n";
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_auto_cache_resize_input_errs() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_auto_cache_resize_aux_fcns()
- *
- * Purpose: Verify that the auxilary functions associated with
- * the automatic cache resize capability are operating
- * correctly. These functions are:
- *
- * H5C1_get_cache_size()
- * H5C1_get_cache_hit_rate()
- * H5C1_reset_cache_hit_rate_stats()
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 11/4/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_auto_cache_resize_aux_fcns(void)
-{
- const char * fcn_name = "check_auto_cache_resize_aux_fcns()";
- herr_t result;
- int32_t i;
- H5C1_t * cache_ptr = NULL;
- double hit_rate;
- size_t max_size;
- size_t min_clean_size;
- size_t cur_size;
- int32_t cur_num_entries;
- H5C1_auto_size_ctl_t auto_size_ctl =
- {
- /* int32_t version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
-#if 1
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ NULL,
-#else
- /* H5C1_auto_resize_report_fcn rpt_fcn = */ H5C1_def_auto_resize_rpt_fcn,
-#endif
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
-
- /* double min_clean_fraction = */ 0.5,
-
- /* size_t max_size = */ (16 * 1024 * 1025),
- /* size_t min_size = */ (512 * 1024),
-
- /* int64_t epoch_length = */ 50000,
-
-
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__off,
-
- /* double lower_hr_threshold = */ 0.75,
-
- /* double increment = */ 2.0,
-
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
-
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
-
-
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__off,
-
- /* double upper_hr_threshold = */ 0.995,
-
- /* double decrement = */ 0.9,
-
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
-
- /* int32_t epochs_before_eviction = */ 3,
-
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.5
- };
-
-
- TESTING("automatic cache resize auxilary functions");
-
- pass1 = TRUE;
-
- /* allocate a cache, and then test the various auxilary functions.
- */
-
- if ( pass1 ) {
-
- reset_entries1();
-
- cache_ptr = setup_cache1((size_t)(2 * 1024),
- (size_t)(1 * 1024));
- }
-
- if ( pass1 ) {
-
- result = H5C1_set_cache_auto_resize_config(cache_ptr,
- &auto_size_ctl);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_set_cache_auto_resize_config failed 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( ( cache_ptr->max_cache_size != (1 * 1024 * 1024) ) ||
- ( cache_ptr->min_clean_size != (512 * 1024) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "bad cache size after initialization.\n";
- }
- }
-
- /* lets start with the H5C1_get_cache_hit_rate(),
- * H5C1_reset_cache_hit_rate_stats() pair.
- */
-
- if ( pass1 ) {
-
- if ( ( H5C1_get_cache_hit_rate(NULL, &hit_rate) != FAIL ) ||
- ( H5C1_get_cache_hit_rate(cache_ptr, NULL) != FAIL ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_hit_rate accepts bad params.\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_hit_rate(cache_ptr, &hit_rate);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_hit_rate failed.\n";
-
- } else if ( hit_rate != 0.0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_hit_rate returned unexpected hit rate 1.\n";
- }
- }
-
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, PICO_ENTRY_TYPE, i);
-
- if ( pass1 ) {
-
- unprotect_entry1(cache_ptr, PICO_ENTRY_TYPE, i,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_hit_rate(cache_ptr, &hit_rate);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_hit_rate failed.\n";
-
- } else if ( hit_rate != 0.0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_hit_rate returned unexpected hit rate 2.\n";
-
- } else if ( ( cache_ptr->cache_accesses != 1000 ) ||
- ( cache_ptr->cache_hits != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache hit rate stats.\n";
-
- } else if ( rpt_fcn_called ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Report function called?.\n";
-
- }
- }
-
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, PICO_ENTRY_TYPE, 0);
-
- if ( pass1 ) {
-
- unprotect_entry1(cache_ptr, PICO_ENTRY_TYPE, 0,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_hit_rate(cache_ptr, &hit_rate);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_hit_rate failed.\n";
-
- } else if ( hit_rate != 0.5 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_hit_rate returned unexpected hit rate 3.\n";
-
- } else if ( ( cache_ptr->cache_accesses != 2000 ) ||
- ( cache_ptr->cache_hits != 1000 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache hit rate stats.\n";
-
- } else if ( rpt_fcn_called ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Report function called?.\n";
-
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_reset_cache_hit_rate_stats(NULL);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_reset_cache_hit_rate_stats accepted NULL cache_ptr.\n";
-
- } else if ( ( cache_ptr->cache_accesses != 2000 ) ||
- ( cache_ptr->cache_hits != 1000 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "Failed call to H5C1_reset_cache_hit_rate_stats altered stats?\n";
- }
- }
-
- if ( pass1 ) {
-
- result = H5C1_reset_cache_hit_rate_stats(cache_ptr);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_reset_cache_hit_rate_stats failed.\n";
-
- } else if ( ( cache_ptr->cache_accesses != 0 ) ||
- ( cache_ptr->cache_hits != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache hit rate stats.\n";
-
- }
- }
-
- if ( pass1 ) {
-
- rpt_fcn_called = FALSE;
- i = 0;
- while ( ( pass1 ) && ( i < 1000 ) )
- {
- protect_entry1(cache_ptr, PICO_ENTRY_TYPE, i + 500);
-
- if ( pass1 ) {
-
- unprotect_entry1(cache_ptr, PICO_ENTRY_TYPE, i + 500,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- }
- i++;
- }
- }
-
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_hit_rate(cache_ptr, &hit_rate);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_hit_rate failed.\n";
-
- } else if ( hit_rate != 0.5 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_hit_rate returned unexpected hit rate 4.\n";
-
- } else if ( ( cache_ptr->cache_accesses != 1000 ) ||
- ( cache_ptr->cache_hits != 500 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected cache hit rate stats.\n";
-
- } else if ( rpt_fcn_called ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Report function called?.\n";
-
- }
- }
-
- /***************************************************
- * So much for testing H5C1_get_cache_hit_rate() and
- * H5C1_reset_cache_hit_rate_stats(). Now on to
- * H5C1_get_cache_size().
- ***************************************************/
-
- if ( pass1 ) {
-
- result = H5C1_get_cache_size(NULL, &max_size, &min_clean_size,
- &cur_size, &cur_num_entries);
-
- if ( result != FAIL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_size accepted NULL cache_ptr.\n";
- }
- }
-
- if ( pass1 ) {
-
- max_size = 0;
- min_clean_size = 0;
- cur_size = 0;
- cur_num_entries = 0;
-
- result = H5C1_get_cache_size(cache_ptr, &max_size, &min_clean_size,
- &cur_size, &cur_num_entries);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_size failed 1.\n";
-
- } else if ( max_size != (1 * 1024 * 1024) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected max_size 1.\n";
-
- } else if ( min_clean_size != (512 * 1024) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected min_clean_size 1.\n";
-
- } else if ( cur_size != (1500 * PICO_ENTRY_SIZE) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected cur_size 1.\n";
-
- } else if ( cur_num_entries != 1500 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected cur_num_entries 1.\n";
- }
- }
-
- /* read a larger entry so that cur_size and cur_num_entries will be
- * different.
- */
- if ( pass1 ) {
-
- protect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0);
- }
-
- if ( pass1 ) {
- unprotect_entry1(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
- }
-
- if ( pass1 ) {
-
- max_size = 0;
- min_clean_size = 0;
- cur_size = 0;
- cur_num_entries = 0;
-
- result = H5C1_get_cache_size(cache_ptr, &max_size, &min_clean_size,
- &cur_size, &cur_num_entries);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_size failed 2.\n";
-
- } else if ( max_size != (1 * 1024 * 1024) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected max_size 2.\n";
-
- } else if ( min_clean_size != (512 * 1024) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected min_clean_size 2.\n";
-
- } else if ( cur_size !=
- ((1500 * PICO_ENTRY_SIZE) + MONSTER_ENTRY_SIZE) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected cur_size 2.\n";
-
- } else if ( cur_num_entries != 1501 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected cur_num_entries 2.\n";
- }
- }
-
- if ( pass1 ) {
-
- max_size = 0;
- min_clean_size = 0;
- cur_size = 0;
- cur_num_entries = 0;
-
- result = H5C1_get_cache_size(cache_ptr, &max_size, NULL, NULL, NULL);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_size failed 3.\n";
-
- } else if ( max_size != (1 * 1024 * 1024) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected max_size 3.\n";
-
- } else if ( ( min_clean_size != 0 ) ||
- ( cur_size != 0 ) ||
- ( cur_num_entries != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Phantom returns from H5C1_get_cache_size?\n";
-
- }
- }
-
- if ( pass1 ) {
-
- max_size = 0;
- min_clean_size = 0;
- cur_size = 0;
- cur_num_entries = 0;
-
- result = H5C1_get_cache_size(cache_ptr, NULL, &min_clean_size,
- NULL, NULL);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_size failed 4.\n";
-
- } else if ( min_clean_size != (512 * 1024) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected min_clean_size 4.\n";
-
- } else if ( ( max_size != 0 ) ||
- ( cur_size != 0 ) ||
- ( cur_num_entries != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Phantom returns from H5C1_get_cache_size?\n";
-
- }
- }
-
- if ( pass1 ) {
-
- max_size = 0;
- min_clean_size = 0;
- cur_size = 0;
- cur_num_entries = 0;
-
- result = H5C1_get_cache_size(cache_ptr, NULL, NULL, &cur_size, NULL);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_size failed 5.\n";
-
- } else if ( cur_size !=
- ((1500 * PICO_ENTRY_SIZE) + MONSTER_ENTRY_SIZE) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected cur_size 5.\n";
-
- } else if ( ( max_size != 0 ) ||
- ( min_clean_size != 0 ) ||
- ( cur_num_entries != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Phantom returns from H5C1_get_cache_size?\n";
-
- }
- }
-
- if ( pass1 ) {
-
- max_size = 0;
- min_clean_size = 0;
- cur_size = 0;
- cur_num_entries = 0;
-
- result = H5C1_get_cache_size(cache_ptr, NULL, NULL, NULL,
- &cur_num_entries);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_get_cache_size failed 6.\n";
-
- } else if ( cur_num_entries != 1501 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5C1_get_cache_size reports unexpected cur_num_entries 2.\n";
-
- } else if ( ( max_size != 0 ) ||
- ( min_clean_size != 0 ) ||
- ( cur_size != 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Phantom returns from H5C1_get_cache_size?\n";
-
- }
- }
-
- if ( pass1 ) {
-
- takedown_cache1(cache_ptr, FALSE, FALSE);
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 ) {
-
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
- }
-
- return;
-
-} /* check_auto_cache_resize_aux_fcns() */
-
-
-/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Run tests on the cache code contained in H5C.c
- *
- * Return: Success:
- *
- * Failure:
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-int
-main(void)
-{
- H5open();
-
- skip_long_tests1 = FALSE;
-
-#ifdef NDEBUG
- run_full_test1 = TRUE;
-#else /* NDEBUG */
- run_full_test1 = FALSE;
-#endif /* NDEBUG */
-
-#if 0
- run_full_test1 = TRUE;
-#endif
-
-#if 1
- smoke_check_1();
- smoke_check_2();
- smoke_check_3();
- smoke_check_4();
- smoke_check_5();
- smoke_check_6();
- smoke_check_7();
- smoke_check_8();
- smoke_check_9();
- smoke_check_10();
-#endif
-
- write_permitted1_check();
- check_insert_entry1();
- check_flush_cache1();
- check_get_entry_status();
- check_expunge_entry1();
- check_multiple_read_protect();
- check_rename_entry1();
- check_pin_protected_entry1();
- check_resize_entry1();
- check_evictions_enabled();
- 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_entry_dirty_errs();
- check_expunge_entry1_errs();
- check_resize_entry1_errs();
- check_unprotect_ro_dirty_err();
- check_protect_ro_rw_err();
- check_check_evictions_enabled_err();
- 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();
-
- return(0);
-
-} /* main() */
diff --git a/test/cache1_api.c b/test/cache1_api.c
deleted file mode 100644
index 8fe57ec..0000000
--- a/test/cache1_api.c
+++ /dev/null
@@ -1,4058 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* Programmer: John Mainzer
- * 11/10/05
- *
- * This file contains tests for the API calls associated
- * with the cache implemented in H5C.c
- */
-
-#include "h5test.h"
-#include "H5Iprivate.h"
-#include "H5AC1private.h"
-#include "cache1_common.h"
-
-/* global variable declarations: */
-
-const char *FILENAME1[] = {
- "cache1_api",
- NULL
-};
-
-/* macro definitions */
-
-#define RESIZE_CONFIGS_ARE_EQUAL(a, b, compare_init) \
-( ( (a).version == (b).version ) && \
- ( (a).rpt_fcn == (b).rpt_fcn ) && \
- ( ( ! compare_init ) || \
- ( (a).set_initial_size == (b).set_initial_size ) ) && \
- ( ( ! compare_init ) || \
- ( (a).initial_size == (b).initial_size ) ) && \
- ( (a).min_clean_fraction == (b).min_clean_fraction ) && \
- ( (a).max_size == (b).max_size ) && \
- ( (a).min_size == (b).min_size ) && \
- ( (a).epoch_length == (b).epoch_length ) && \
- ( (a).incr_mode == (b).incr_mode ) && \
- ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \
- ( (a).increment == (b).increment ) && \
- ( (a).apply_max_increment == (b).apply_max_increment ) && \
- ( (a).max_increment == (b).max_increment ) && \
- ( (a).flash_incr_mode == (b).flash_incr_mode ) && \
- ( (a).flash_multiple == (b).flash_multiple ) && \
- ( (a).flash_threshold == (b).flash_threshold ) && \
- ( (a).decr_mode == (b).decr_mode ) && \
- ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \
- ( (a).decrement == (b).decrement ) && \
- ( (a).apply_max_decrement == (b).apply_max_decrement ) && \
- ( (a).max_decrement == (b).max_decrement ) && \
- ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \
- ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
- ( (a).empty_reserve == (b).empty_reserve ) )
-
-
-/* private function declarations: */
-
-static void check_fapl_mdc_api_calls(void);
-
-static void validate_mdc_config(hid_t file_id,
- H5AC1_cache_config_t * ext_config_ptr,
- hbool_t compare_init,
- int test_num);
-
-static void check_file_mdc_api_calls(void);
-
-static void check_and_validate_cache_hit_rate(hid_t file_id,
- double * hit_rate_ptr,
- hbool_t dump_data,
- int64_t min_accesses,
- double min_hit_rate);
-
-static void check_and_validate_cache_size(hid_t file_id,
- size_t * max_size_ptr,
- size_t * min_clean_size_ptr,
- size_t * cur_size_ptr,
- int32_t * cur_num_entries_ptr,
- hbool_t dump_data);
-
-static void mdc_api_call_smoke_check(int express_test1);
-
-static void check_fapl_mdc_api_errs(void);
-
-static void check_file_mdc_api_errs(void);
-
-
-/**************************************************************************/
-/**************************************************************************/
-/********************************* tests: *********************************/
-/**************************************************************************/
-/**************************************************************************/
-
-/*-------------------------------------------------------------------------
- * Function: check_fapl_mdc_api_calls()
- *
- * Purpose: Verify that the file access property list related
- * metadata cache related API calls are functioning
- * correctly.
- *
- * Since we have tested the H5C code elsewhere, it should
- * be sufficient to verify that the desired configuration
- * data is getting to the cache.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/12/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-#define CACHE_CONFIGS_EQUAL(a, b, cmp_set_init, cmp_init_size) \
- ( ( (a).version == (b).version ) && \
- ( (a).rpt_fcn_enabled == (b).rpt_fcn_enabled ) && \
- ( (a).open_trace_file == (b).open_trace_file ) && \
- ( (a).close_trace_file == (b).close_trace_file ) && \
- ( ( (a).open_trace_file == FALSE ) || \
- ( strcmp((a).trace_file_name, (b).trace_file_name) == 0 ) ) && \
- ( (a).evictions_enabled == (b).evictions_enabled ) && \
- ( ( ! cmp_set_init ) || \
- ( (a).set_initial_size == (b).set_initial_size ) ) && \
- ( ( ! cmp_init_size ) || \
- ( (a).initial_size == (b).initial_size ) ) && \
- ( (a).min_clean_fraction == (b).min_clean_fraction ) && \
- ( (a).max_size == (b).max_size ) && \
- ( (a).min_size == (b).min_size ) && \
- ( (a).epoch_length == (b).epoch_length ) && \
- ( (a).incr_mode == (b).incr_mode ) && \
- ( (a).lower_hr_threshold == (b).lower_hr_threshold ) && \
- ( (a).increment == (b).increment ) && \
- ( (a).apply_max_increment == (b).apply_max_increment ) && \
- ( (a).max_increment == (b).max_increment ) && \
- ( (a).flash_incr_mode == (b).flash_incr_mode ) && \
- ( (a).flash_multiple == (b).flash_multiple ) && \
- ( (a).flash_threshold == (b).flash_threshold ) && \
- ( (a).decr_mode == (b).decr_mode ) && \
- ( (a).upper_hr_threshold == (b).upper_hr_threshold ) && \
- ( (a).decrement == (b).decrement ) && \
- ( (a).apply_max_decrement == (b).apply_max_decrement ) && \
- ( (a).max_decrement == (b).max_decrement ) && \
- ( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \
- ( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
- ( (a).empty_reserve == (b).empty_reserve ) )
-
-#define XLATE_EXT_TO_INT_MDC_CONFIG(i, e) \
-{ \
- (i).version = H5C1__CURR_AUTO_SIZE_CTL_VER; \
- if ( (e).rpt_fcn_enabled ) \
- (i).rpt_fcn = H5C1_def_auto_resize_rpt_fcn; \
- else \
- (i).rpt_fcn = NULL; \
- (i).set_initial_size = (e).set_initial_size; \
- (i).initial_size = (e).initial_size; \
- (i).min_clean_fraction = (e).min_clean_fraction; \
- (i).max_size = (e).max_size; \
- (i).min_size = (e).min_size; \
- (i).epoch_length = (long int)((e).epoch_length); \
- (i).incr_mode = (e).incr_mode; \
- (i).lower_hr_threshold = (e).lower_hr_threshold; \
- (i).increment = (e).increment; \
- (i).apply_max_increment = (e).apply_max_increment; \
- (i).max_increment = (e).max_increment; \
- (i).flash_incr_mode = (e).flash_incr_mode; \
- (i).flash_multiple = (e).flash_multiple; \
- (i).flash_threshold = (e).flash_threshold; \
- (i).decr_mode = (e).decr_mode; \
- (i).upper_hr_threshold = (e).upper_hr_threshold; \
- (i).flash_incr_mode = (e).flash_incr_mode; \
- (i).flash_multiple = (e).flash_multiple; \
- (i).flash_threshold = (e).flash_threshold; \
- (i).decrement = (e).decrement; \
- (i).apply_max_decrement = (e).apply_max_decrement; \
- (i).max_decrement = (e).max_decrement; \
- (i).epochs_before_eviction = (int)((e).epochs_before_eviction); \
- (i).apply_empty_reserve = (e).apply_empty_reserve; \
- (i).empty_reserve = (e).empty_reserve; \
-}
-
-static void
-check_fapl_mdc_api_calls(void)
-{
- const char * fcn_name = "check_fapl_mdc_api_calls()";
- char filename[512];
- herr_t result;
- hid_t fapl_id = -1;
- hid_t test_fapl_id = -1;
- hid_t file_id = -1;
- H5F_t * file_ptr = NULL;
- H5C1_t * cache_ptr = NULL;
- H5AC1_cache_config_t default_config = H5AC1__DEFAULT_CACHE_CONFIG;
- H5AC1_cache_config_t mod_config =
- {
- /* int version = */
- H5AC1__CURR_CACHE_CONFIG_VERSION,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024 + 1),
- /* double min_clean_fraction = */ 0.2,
- /* size_t max_size = */ (16 * 1024 * 1024 + 1),
- /* size_t min_size = */ ( 1 * 1024 * 1024 + 1),
- /* long int epoch_length = */ 50001,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.91,
- /* double increment = */ 2.1,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024 + 1),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out,
- /* double upper_hr_threshold = */ 0.998,
- /* double decrement = */ 0.91,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024 - 1),
- /* int epochs_before_eviction = */ 4,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- };
- H5AC1_cache_config_t scratch;
- H5C1_auto_size_ctl_t default_auto_size_ctl;
- H5C1_auto_size_ctl_t mod_auto_size_ctl;
-
- TESTING("MDC/FAPL related API calls");
-
- pass1 = TRUE;
-
- XLATE_EXT_TO_INT_MDC_CONFIG(default_auto_size_ctl, default_config)
- XLATE_EXT_TO_INT_MDC_CONFIG(mod_auto_size_ctl, mod_config)
-
- /* Create a FAPL and verify that it contains the default
- * initial mdc configuration
- */
-
- if ( pass1 ) {
-
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
-
- if ( fapl_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pcreate(H5P_FILE_ACCESS) failed.\n";
- }
- }
-
- if ( pass1 ) {
-
- scratch.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
-
- result = H5Pget_mdc_config(fapl_id, &scratch);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pget_mdc_config() failed.\n";
-
- } else if (!CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE)) {
-
- pass1 = FALSE;
- failure_mssg1 = "retrieved config doesn't match default.";
- }
- }
-
-
- /* Modify the initial mdc configuration in a FAPL, and verify that
- * the changes can be read back
- */
-
- if ( pass1 ) {
-
- result = H5Pset_mdc_config(fapl_id, &mod_config);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pset_mdc_config() failed.\n";
- }
- }
-
- if ( pass1 ) {
-
- scratch.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
-
- result = H5Pget_mdc_config(fapl_id, &scratch);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pget_mdc_config() failed.\n";
-
- } else if ( ! CACHE_CONFIGS_EQUAL(mod_config, scratch, TRUE, TRUE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "retrieved config doesn't match mod config.";
- }
- }
-
- if ( pass1 ) {
-
- if ( H5Pclose(fapl_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pclose() failed.\n";
- }
- }
-
- /* Open a file using the default FAPL. Verify that the resulting
- * metadata cache uses the default configuration as well. Get a
- * copy of the FAPL from the file, and verify that it contains the
- * default initial meta data cache configuration. Close and delete
- * the file.
- */
-
- /* setup the file name */
- if ( pass1 ) {
-
- if ( h5_fixname(FILENAME1[0], H5P_DEFAULT, filename, sizeof(filename))
- == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "h5_fixname() failed.\n";
- }
- }
-
- /* create the file using the default FAPL */
- if ( pass1 ) {
-
- file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-
- if ( file_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fcreate() failed.\n";
- }
- }
-
- /* get a pointer to the files internal data structure */
- if ( pass1 ) {
-
- file_ptr = H5I_object_verify(file_id, H5I_FILE);
-
- if ( file_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Can't get file_ptr.\n";
-
- } else {
-
- cache_ptr = file_ptr->shared->cache1;
- }
- }
-
- /* verify that we can access the internal version of the cache config */
- if ( pass1 ) {
-
- if ( ( cache_ptr == NULL ) ||
- ( cache_ptr->magic != H5C1__H5C1_T_MAGIC ) ||
- ( cache_ptr->resize_ctl.version != H5C1__CURR_AUTO_SIZE_CTL_VER ) ){
-
- pass1 = FALSE;
- failure_mssg1 = "Can't access cache resize_ctl.\n";
- }
- }
-
- /* conpare the cache's internal configuration with the expected value */
- if ( pass1 ) {
-
- if ( ! RESIZE_CONFIGS_ARE_EQUAL(default_auto_size_ctl, \
- cache_ptr->resize_ctl, TRUE) ) {
-
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected value(s) in cache resize_ctl.\n";
- }
- }
-
- /* get a copy of the files FAPL */
- if ( pass1 ) {
-
- fapl_id = H5Fget_access_plist(file_id);
-
- if ( fapl_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_access_plist() failed.\n";
- }
- }
-
- /* compare the initial cache config from the copy of the file's FAPL
- * to the expected value. If all goes well, close the copy of the FAPL.
- */
- if ( pass1 ) {
-
- scratch.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
-
- result = H5Pget_mdc_config(fapl_id, &scratch);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pget_mdc_config() failed.\n";
-
- } else if (!CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE)) {
-
- pass1 = FALSE;
- failure_mssg1 = "config retrieved from file doesn't match default.";
-
- } else if ( H5Pclose(fapl_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pclose() failed.\n";
- }
- }
-
- /* close the file and delete it */
- if ( pass1 ) {
-
- if ( H5Fclose(file_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fclose() failed.\n";
-
- } else if ( HDremove(filename) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "HDremove() failed.\n";
- }
- }
-
-
- /* Open a file using a FAPL with a modified initial metadata cache
- * configuration. Verify that the resulting metadata cache uses the
- * modified configuration as well. Get a copy of the FAPL from the
- * file, and verify that it contains the modified initial meta data
- * cache configuration. Close and delete the file.
- */
-
- /* Create a FAPL */
- if ( pass1 ) {
-
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
-
- if ( fapl_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pcreate(H5P_FILE_ACCESS) failed.\n";
- }
- }
-
- /* Modify the initial mdc configuration in the FAPL. */
-
- if ( pass1 ) {
-
- result = H5Pset_mdc_config(fapl_id, &mod_config);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pset_mdc_config() failed.\n";
- }
- }
-
- /* setup the file name */
- if ( pass1 ) {
-
- if ( h5_fixname(FILENAME1[0], H5P_DEFAULT, filename, sizeof(filename))
- == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "h5_fixname() failed.\n";
- }
- }
-
- /* create the file using the modified FAPL */
- if ( pass1 ) {
-
- file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
-
- if ( file_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fcreate() failed.\n";
- }
- }
-
- /* get a pointer to the files internal data structure */
- if ( pass1 ) {
-
- file_ptr = H5I_object_verify(file_id, H5I_FILE);
-
- if ( file_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Can't get file_ptr.\n";
-
- } else {
-
- cache_ptr = file_ptr->shared->cache1;
- }
- }
-
- /* verify that we can access the internal version of the cache config */
- if ( pass1 ) {
-
- if ( ( cache_ptr == NULL ) ||
- ( cache_ptr->magic != H5C1__H5C1_T_MAGIC ) ||
- ( cache_ptr->resize_ctl.version != H5C1__CURR_AUTO_SIZE_CTL_VER ) ){
-
- pass1 = FALSE;
- failure_mssg1 = "Can't access cache resize_ctl.\n";
- }
- }
-
- /* conpare the cache's internal configuration with the expected value */
- if ( pass1 ) {
-
- if ( ! RESIZE_CONFIGS_ARE_EQUAL(mod_auto_size_ctl, \
- cache_ptr->resize_ctl, TRUE) ) {
-
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpected value(s) in cache resize_ctl.\n";
- }
- }
-
- /* get a copy of the files FAPL */
- if ( pass1 ) {
-
- test_fapl_id = H5Fget_access_plist(file_id);
-
- if ( test_fapl_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_access_plist() failed.\n";
- }
- }
-
- /* compare the initial cache config from the copy of the file's FAPL
- * to the expected value. If all goes well, close the copy of the FAPL.
- */
- if ( pass1 ) {
-
- scratch.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
-
- result = H5Pget_mdc_config(test_fapl_id, &scratch);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pget_mdc_config() failed.\n";
-
- } else if ( ! CACHE_CONFIGS_EQUAL(mod_config, scratch, TRUE, TRUE) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "config retrieved from file doesn't match.";
-
- } else if ( H5Pclose(test_fapl_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pclose() failed.\n";
- }
- }
-
- /* close the fapl used to create the file */
- if ( pass1 ) {
-
- if ( H5Pclose(fapl_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pclose() failed.\n";
- }
- }
-
- /* close the file and delete it */
- if ( pass1 ) {
-
- if ( H5Fclose(file_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fclose() failed.\n";
-
- } else if ( HDremove(filename) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "HDremove() failed.\n";
- }
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 )
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
-
-} /* check_fapl_mdc_api_calls() */
-
-
-/*-------------------------------------------------------------------------
- * Function: validate_mdc_config()
- *
- * Purpose: Verify that the file indicated by the file_id parameter
- * has both internal and external configuration matching
- * *config_ptr.
- *
- * Do nothin on success. On failure, set pass1 to FALSE, and
- * load an error message into failue_mssg. Note that
- * failure_msg is assumed to be at least 128 bytes in length.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/14/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-validate_mdc_config(hid_t file_id,
- H5AC1_cache_config_t * ext_config_ptr,
- hbool_t compare_init,
- int test_num)
-{
- /* const char * fcn_name = "validate_mdc_config()"; */
- static char msg[256];
- H5F_t * file_ptr = NULL;
- H5C1_t * cache_ptr = NULL;
- H5AC1_cache_config_t scratch;
- H5C1_auto_size_ctl_t int_config;
-
- XLATE_EXT_TO_INT_MDC_CONFIG(int_config, (*ext_config_ptr))
-
- /* get a pointer to the files internal data structure */
- if ( pass1 ) {
-
- file_ptr = H5I_object_verify(file_id, H5I_FILE);
-
- if ( file_ptr == NULL ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128, "Can't get file_ptr #%d.", test_num);
- failure_mssg1 = msg;
-
- } else {
-
- cache_ptr = file_ptr->shared->cache1;
- }
- }
-
- /* verify that we can access the internal version of the cache config */
- if ( pass1 ) {
-
- if ( ( cache_ptr == NULL ) ||
- ( cache_ptr->magic != H5C1__H5C1_T_MAGIC ) ||
- ( cache_ptr->resize_ctl.version != H5C1__CURR_AUTO_SIZE_CTL_VER ) ){
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Can't access cache resize_ctl #%d.", test_num);
- failure_mssg1 = msg;
- }
- }
-
- /* compare the cache's internal configuration with the expected value */
- if ( pass1 ) {
-
- if ( ! RESIZE_CONFIGS_ARE_EQUAL(int_config, cache_ptr->resize_ctl,
- compare_init) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected internal config #%d.", test_num);
- failure_mssg1 = msg;
- }
- }
-
- /* obtain external cache config */
- if ( pass1 ) {
-
- scratch.version = H5AC1__CURR_CACHE_CONFIG_VERSION;
-
- if ( H5Fget_mdc_config(file_id, &scratch) < 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5Fget_mdc_config() failed #%d.", test_num);
- failure_mssg1 = msg;
- }
- }
-
- if ( pass1 ) {
-
- /* Recall that in any configuration supplied by the cache
- * at run time, the set_initial_size field will always
- * be FALSE, regardless of the value pass1ed in. Thus we
- * always presume that this field need not match that of
- * the supplied external configuration.
- *
- * The cache also sets the initial_size field to the current
- * cache max size instead of the value initialy supplied.
- * Depending on circumstances, this may or may not match
- * the original. Hence the compare_init parameter.
- */
- if ( ! CACHE_CONFIGS_EQUAL((*ext_config_ptr), scratch, \
- FALSE, compare_init) ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "Unexpected external config #%d.", test_num);
- failure_mssg1 = msg;
- }
- }
-
- return;
-
-} /* validate_mdc_config() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_file_mdc_api_calls()
- *
- * Purpose: Verify that the file related metadata cache API calls are
- * functioning correctly.
- *
- * Since we have tested the H5C code elsewhere, it should
- * be sufficient to verify that the desired configuration
- * data is getting in and out of the cache. Similarly,
- * we need only verify that the cache monitoring calls
- * return the data that the cache thinks they should return.
- * We shouldn't need to verify data correctness beyond that
- * point.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/14/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_file_mdc_api_calls(void)
-{
- const char * fcn_name = "check_file_mdc_api_calls()";
- char filename[512];
- hid_t file_id = -1;
- size_t max_size;
- size_t min_clean_size;
- size_t cur_size;
- int cur_num_entries;
- double hit_rate;
- H5AC1_cache_config_t default_config = H5AC1__DEFAULT_CACHE_CONFIG;
- H5AC1_cache_config_t mod_config_1 =
- {
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024 + 1),
- /* double min_clean_fraction = */ 0.2,
- /* size_t max_size = */ (16 * 1024 * 1024 + 1),
- /* size_t min_size = */ ( 1 * 1024 * 1024 + 1),
- /* long int epoch_length = */ 50001,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.91,
- /* double increment = */ 2.1,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024 + 1),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out,
- /* double upper_hr_threshold = */ 0.998,
- /* double decrement = */ 0.91,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024 - 1),
- /* int epochs_before_eviction = */ 4,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- };
- H5AC1_cache_config_t mod_config_2 =
- {
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ TRUE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (512 * 1024),
- /* double min_clean_fraction = */ 0.1,
- /* size_t max_size = */ ( 8 * 1024 * 1024),
- /* size_t min_size = */ ( 512 * 1024),
- /* long int epoch_length = */ 25000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (2 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 1.5,
- /* double flash_threshold = */ 0.4,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__threshold,
- /* double upper_hr_threshold = */ 0.9995,
- /* double decrement = */ 0.95,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (512 * 1024),
- /* int epochs_before_eviction = */ 4,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- };
- H5AC1_cache_config_t mod_config_3 =
- {
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.2,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__off,
- /* double lower_hr_threshold = */ 0.90,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.1,
- /* double flash_threshold = */ 0.6,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__off,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ FALSE,
- /* size_t max_decrement = */ (1 * 1024 * 1024 - 1),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ FALSE,
- /* double empty_reserve = */ 0.05,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- };
- H5AC1_cache_config_t mod_config_4 =
- {
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.15,
- /* size_t max_size = */ (20 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 75000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (2 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 1.1,
- /* double flash_threshold = */ 0.3,
- /* enum H5C1_cache_decr_mode decr_mode = */
- H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- };
-
- TESTING("MDC/FILE related API calls");
-
- pass1 = TRUE;
-
- /* Open a file with the default FAPL. Verify that the cache is
- * configured as per the default both by looking at its internal
- * configuration, and via the H5Fget_mdc_config() call.
- *
- * Then set serveral different configurations, and verify that
- * they took as per above.
- */
-
- /* setup the file name */
- if ( pass1 ) {
-
- if ( h5_fixname(FILENAME1[0], H5P_DEFAULT, filename, sizeof(filename))
- == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "h5_fixname() failed.\n";
- }
- }
-
- /* create the file using the default FAPL */
- if ( pass1 ) {
-
- file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-
- if ( file_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fcreate() failed.\n";
- }
- }
-
- /* verify that the cache is set to the default config */
- validate_mdc_config(file_id, &default_config, TRUE, 1);
-
- /* set alternate config 1 */
- if ( pass1 ) {
-
- if ( H5Fset_mdc_config(file_id, &mod_config_1) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fset_mdc_config() failed 1.\n";
- }
- }
-
- /* verify that the cache is now set to the alternate config */
- validate_mdc_config(file_id, &mod_config_1, TRUE, 2);
-
- /* set alternate config 2 */
- if ( pass1 ) {
-
- if ( H5Fset_mdc_config(file_id, &mod_config_2) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fset_mdc_config() failed 2.\n";
- }
- }
-
- /* verify that the cache is now set to the alternate config */
- validate_mdc_config(file_id, &mod_config_2, TRUE, 3);
-
- /* set alternate config 3 */
- if ( pass1 ) {
-
- if ( H5Fset_mdc_config(file_id, &mod_config_3) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fset_mdc_config() failed 3.\n";
- }
- }
-
- /* verify that the cache is now set to the alternate config */
- validate_mdc_config(file_id, &mod_config_3, TRUE, 4);
-
- /* set alternate config 4 */
- if ( pass1 ) {
-
- if ( H5Fset_mdc_config(file_id, &mod_config_4) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fset_mdc_config() failed 4.\n";
- }
- }
-
- /* verify that the cache is now set to the alternate config */
- validate_mdc_config(file_id, &mod_config_4, TRUE, 5);
-
-
- /* Run some quick smoke checks on the cache status monitoring
- * calls -- no interesting data as the cache hasn't had a
- * chance to do much yet.
- */
-
- if ( pass1 ) {
-
- if ( H5Fget_mdc_hit_rate(file_id, &hit_rate) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_hit_rate() failed 1.\n";
-
- } else if ( hit_rate != 0.0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5Fget_mdc_hit_rate() returned unexpected hit rate.\n";
-
- }
-#if 0 /* this may be useful now and then -- keep it around */
- else {
-
- HDfprintf(stdout,
- "H5Fget_mdc_hit_rate() reports hit_rate = %lf:\n",
- hit_rate);
- }
-#endif
- }
-
- if ( pass1 ) {
-
- if ( H5Fget_mdc_size(file_id, &max_size, &min_clean_size,
- &cur_size, &cur_num_entries) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_size() failed 1.\n";
-
- } else if ( ( mod_config_4.initial_size != max_size ) ||
- ( min_clean_size != (size_t)
- ((double)max_size * mod_config_4.min_clean_fraction) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_size() returned unexpected value(s).\n";
-
- }
-#if 0 /* this may be useful now and then -- keep it around */
- else {
-
- HDfprintf(stdout, "H5Fget_mdc_size() reports:\n");
- HDfprintf(stdout, " max_size: %ld, min_clean_size: %ld\n",
- (long)max_size, (long)min_clean_size);
- HDfprintf(stdout, " cur_size: %ld, cur_num_entries: %d\n",
- (long)cur_size, cur_num_entries);
- }
-#endif
- }
-
- /* close the file and delete it */
- if ( pass1 ) {
-
- if ( H5Fclose(file_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fclose() failed.\n";
-
- } else if ( HDremove(filename) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "HDremove() failed.\n";
- }
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 )
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
-
-} /* check_file_mdc_api_calls() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_and_validate_cache_hit_rate()
- *
- * Purpose: Use the API functions to get and reset the cache hit rate.
- * Verify that the value returned by the API call agrees with
- * the cache internal data structures.
- *
- * If the number of cache accesses exceeds the value provided
- * in the min_accesses parameter, and the hit rate is less than
- * min_hit_rate, set pass1 to FALSE, and set failure_mssg1 to
- * a string indicating that hit rate was unexpectedly low.
- *
- * Return hit rate in *hit_rate_ptr, and print the data to
- * stdout if requested.
- *
- * If an error is detected, set pass1 to FALSE, and set
- * failure_mssg1 to an appropriate value.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/18/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_and_validate_cache_hit_rate(hid_t file_id,
- double * hit_rate_ptr,
- hbool_t dump_data,
- int64_t min_accesses,
- double min_hit_rate)
-{
- /* const char * fcn_name = "check_and_validate_cache_hit_rate()"; */
- herr_t result;
- int64_t cache_hits = 0;
- int64_t cache_accesses = 0;
- double expected_hit_rate;
- double hit_rate;
- H5F_t * file_ptr = NULL;
- H5C1_t * cache_ptr = NULL;
-
- /* get a pointer to the files internal data structure */
- if ( pass1 ) {
-
- file_ptr = H5I_object_verify(file_id, H5I_FILE);
-
- if ( file_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Can't get file_ptr.";
-
- } else {
-
- cache_ptr = file_ptr->shared->cache1;
- }
- }
-
- /* verify that we can access the cache data structure */
- if ( pass1 ) {
-
- if ( ( cache_ptr == NULL ) ||
- ( cache_ptr->magic != H5C1__H5C1_T_MAGIC ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Can't access cache resize_ctl.";
- }
- }
-
- /* compare the cache's internal configuration with the expected value */
- if ( pass1 ) {
-
- cache_hits = cache_ptr->cache_hits;
- cache_accesses = cache_ptr->cache_accesses;
-
- if ( cache_accesses > 0 ) {
-
- expected_hit_rate = ((double)cache_hits) / ((double)cache_accesses);
-
- } else {
-
- expected_hit_rate = 0.0;
- }
-
- result = H5Fget_mdc_hit_rate(file_id, &hit_rate);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_hit_rate() failed.";
-
- } else if ( hit_rate != expected_hit_rate ) {
-
- pass1 = FALSE;
- failure_mssg1 = "unexpected hit rate.";
- }
- }
-
- if ( pass1 ) { /* reset the hit rate */
-
- result = H5Freset_mdc_hit_rate_stats(file_id);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Freset_mdc_hit_rate_stats() failed.";
- }
- }
-
- /* set *hit_rate_ptr if appropriate */
- if ( ( pass1 ) && ( hit_rate_ptr != NULL ) ) {
-
- *hit_rate_ptr = hit_rate;
- }
-
- /* dump data to stdout if requested */
- if ( ( pass1 ) && ( dump_data ) ) {
-
- HDfprintf(stdout,
- "cache_hits: %ld, cache_accesses: %ld, hit_rate: %lf\n",
- (long)cache_hits, (long)cache_accesses, hit_rate);
- }
-
- if ( ( pass1 ) &&
- ( cache_accesses > min_accesses ) &&
- ( hit_rate < min_hit_rate ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Unexpectedly low hit rate.";
- }
-
- return;
-
-} /* check_and_validate_cache_hit_rate() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_and_validate_cache_size()
- *
- * Purpose: Use the API function to get the cache size data. Verify
- * that the values returned by the API call agree with
- * the cache internal data structures.
- *
- * Return size data in the locations specified by the pointer
- * parameters if these parameters are not NULL. Print the
- * data to stdout if requested.
- *
- * If an error is detected, set pass1 to FALSE, and set
- * failure_mssg1 to an appropriate value.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/18/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_and_validate_cache_size(hid_t file_id,
- size_t * max_size_ptr,
- size_t * min_clean_size_ptr,
- size_t * cur_size_ptr,
- int32_t * cur_num_entries_ptr,
- hbool_t dump_data)
-{
- /* const char * fcn_name = "check_and_validate_cache_size()"; */
- herr_t result;
- size_t expected_max_size;
- size_t max_size;
- size_t expected_min_clean_size;
- size_t min_clean_size;
- size_t expected_cur_size;
- size_t cur_size;
- int32_t expected_cur_num_entries;
- int cur_num_entries;
- H5F_t * file_ptr = NULL;
- H5C1_t * cache_ptr = NULL;
-
- /* get a pointer to the files internal data structure */
- if ( pass1 ) {
-
- file_ptr = H5I_object_verify(file_id, H5I_FILE);
-
- if ( file_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Can't get file_ptr.";
-
- } else {
-
- cache_ptr = file_ptr->shared->cache1;
- }
- }
-
- /* verify that we can access the cache data structure */
- if ( pass1 ) {
-
- if ( ( cache_ptr == NULL ) ||
- ( cache_ptr->magic != H5C1__H5C1_T_MAGIC ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "Can't access cache data structure.";
- }
- }
-
- /* compare the cache's internal configuration with the expected value */
- if ( pass1 ) {
-
- expected_max_size = cache_ptr->max_cache_size;
- expected_min_clean_size = cache_ptr->min_clean_size;
- expected_cur_size = cache_ptr->index_size;
- expected_cur_num_entries = cache_ptr->index_len;
-
- result = H5Fget_mdc_size(file_id,
- &max_size,
- &min_clean_size,
- &cur_size,
- &cur_num_entries);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_size() failed.";
-
- } else if ( ( max_size != expected_max_size ) ||
- ( min_clean_size != expected_min_clean_size ) ||
- ( cur_size != expected_cur_size ) ||
- ( cur_num_entries != (int)expected_cur_num_entries ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_size() returned unexpected value(s).";
-
- }
- }
-
- /* return size values if requested */
- if ( ( pass1 ) && ( max_size_ptr != NULL ) ) {
-
- *max_size_ptr = max_size;
- }
-
- if ( ( pass1 ) && ( min_clean_size_ptr != NULL ) ) {
-
- *min_clean_size_ptr = min_clean_size;
- }
-
- if ( ( pass1 ) && ( cur_size_ptr != NULL ) ) {
-
- *cur_size_ptr = cur_size;
- }
-
- if ( ( pass1 ) && ( cur_num_entries_ptr != NULL ) ) {
-
- *cur_num_entries_ptr = cur_num_entries;
- }
-
-
- /* dump data to stdout if requested */
- if ( ( pass1 ) && ( dump_data ) ) {
-
- HDfprintf(stdout,
- "max_sz: %ld, min_clean_sz: %ld, cur_sz: %ld, cur_ent: %ld\n",
- (long)max_size, (long)min_clean_size, (long)cur_size,
- (long)cur_num_entries);
- }
-
- return;
-
-} /* check_and_validate_cache_size() */
-
-
-/*-------------------------------------------------------------------------
- * Function: mdc_api_call_smoke_check()
- *
- * Purpose:
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/14/04
- *
- * Modifications:
- *
- * JRM -- 7/12/06
- * Added progress reporting code.
- *
- *-------------------------------------------------------------------------
- */
-
-#define CHUNK_SIZE 2
-#define DSET_SIZE (200 * CHUNK_SIZE)
-#define NUM_DSETS 6
-#define NUM_RANDOM_ACCESSES 200000
-
-static void
-mdc_api_call_smoke_check(int express_test1)
-{
- const char * fcn_name = "mdc_api_call_smoke_check()";
- char filename[512];
- hbool_t valid_chunk;
- hbool_t report_progress = FALSE;
- hbool_t dump_hit_rate = FALSE;
- int64_t min_accesses = 1000;
- double min_hit_rate = 0.90;
- hbool_t dump_cache_size = FALSE;
- hid_t file_id = -1;
- hid_t dataspace_id = -1;
- hid_t filespace_ids[NUM_DSETS];
- hid_t memspace_id = -1;
- hid_t dataset_ids[NUM_DSETS];
- hid_t properties;
- char dset_name[64];
- int i, j, k, l, m, n;
- int progress_counter;
- herr_t status;
- hsize_t dims[2];
- hsize_t a_size[2];
- hsize_t offset[2];
- hsize_t chunk_size[2];
- int data_chunk[CHUNK_SIZE][CHUNK_SIZE];
- H5AC1_cache_config_t default_config = H5AC1__DEFAULT_CACHE_CONFIG;
- H5AC1_cache_config_t mod_config_1 =
- {
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ 500000,
- /* double min_clean_fraction = */ 0.1,
- /* size_t max_size = */ 16000000,
- /* size_t min_size = */ 250000,
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__off,
- /* double lower_hr_threshold = */ 0.95,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ FALSE,
- /* size_t max_increment = */ 4000000,
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__off,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ FALSE,
- /* size_t max_decrement = */ 1000000,
- /* int epochs_before_eviction = */ 2,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- };
- H5AC1_cache_config_t mod_config_2 =
- {
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ 12000000,
- /* double min_clean_fraction = */ 0.1,
- /* size_t max_size = */ 16000000,
- /* size_t min_size = */ 250000,
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__off,
- /* double lower_hr_threshold = */ 0.95,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ FALSE,
- /* size_t max_increment = */ 4000000,
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__off,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ FALSE,
- /* size_t max_decrement = */ 1000000,
- /* int epochs_before_eviction = */ 2,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- };
- H5AC1_cache_config_t mod_config_3 =
- {
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ 2000000,
- /* double min_clean_fraction = */ 0.1,
- /* size_t max_size = */ 16000000,
- /* size_t min_size = */ 250000,
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__off,
- /* double lower_hr_threshold = */ 0.95,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ FALSE,
- /* size_t max_increment = */ 4000000,
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__off,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ FALSE,
- /* size_t max_decrement = */ 1000000,
- /* int epochs_before_eviction = */ 2,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.05,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- };
-
- TESTING("MDC API smoke check");
-
- if ( express_test1 > 0 ) {
-
- SKIPPED();
-
- HDfprintf(stdout, " Long tests disabled.\n");
-
- return;
- }
-
- pass1 = TRUE;
-
- /* Open a file with the default FAPL. Verify that the cache is
- * configured as per the default both by looking at its internal
- * configuration, and via the H5Fget_mdc_config() call.
- *
- * Then set the cache to mod_config_1, which fixes cache size at
- * 500000 bytes, and turns off automatic cache resize.
- */
-
- /* setup the file name */
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout,"\nSetting up file ... ");
- HDfflush(stdout);
- }
-
- if ( pass1 ) {
-
- if ( h5_fixname(FILENAME1[0], H5P_DEFAULT, filename, sizeof(filename))
- == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "h5_fixname() failed.\n";
- }
- }
-
- /* create the file using the default FAPL */
- if ( pass1 ) {
-
- file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-
- if ( file_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fcreate() failed.\n";
- }
- }
-
- /* verify that the cache is set to the default config */
- validate_mdc_config(file_id, &default_config, TRUE, 1);
-
- /* set alternate config 1 */
- if ( pass1 ) {
-
- if ( H5Fset_mdc_config(file_id, &mod_config_1) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fset_mdc_config() failed 1.\n";
- }
- }
-
- /* verify that the cache is now set to the alternate config */
- validate_mdc_config(file_id, &mod_config_1, TRUE, 2);
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout,"Done.\n"); /* setting up file */
- HDfflush(stdout);
- }
-
-
- /* create the datasets */
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout,"Creating datasets ... ");
- HDfflush(stdout);
- }
-
- if ( pass1 ) {
-
- i = 0;
-
- while ( ( pass1 ) && ( i < NUM_DSETS ) )
- {
- /* create a dataspace for the chunked dataset */
- dims[0] = DSET_SIZE;
- dims[1] = DSET_SIZE;
- dataspace_id = H5Screate_simple(2, dims, NULL);
-
- if ( dataspace_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Screate_simple() failed.";
- }
-
- /* set the dataset creation plist to specify that the raw data is
- * to be partioned into 10X10 element chunks.
- */
-
- if ( pass1 ) {
-
- chunk_size[0] = CHUNK_SIZE;
- chunk_size[1] = CHUNK_SIZE;
- properties = H5Pcreate(H5P_DATASET_CREATE);
-
- if ( properties < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pcreate() failed.";
- }
- }
-
- if ( pass1 ) {
-
- if ( H5Pset_chunk(properties, 2, chunk_size) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pset_chunk() failed.";
- }
- }
-
- /* create the dataset */
- if ( pass1 ) {
-
- sprintf(dset_name, "/dset%03d", i);
- dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE,
- dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT);
-
- if ( dataset_ids[i] < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Dcreate2() failed.";
- }
- }
-
- /* get the file space ID */
- if ( pass1 ) {
-
- filespace_ids[i] = H5Dget_space(dataset_ids[i]);
-
- if ( filespace_ids[i] < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Dget_space() failed.";
- }
- }
-
- i++;
- }
- }
-
- /* create the mem space to be used to read and write chunks */
- if ( pass1 ) {
-
- dims[0] = CHUNK_SIZE;
- dims[1] = CHUNK_SIZE;
- memspace_id = H5Screate_simple(2, dims, NULL);
-
- if ( memspace_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Screate_simple() failed.";
- }
- }
-
- /* select in memory hyperslab */
- if ( pass1 ) {
-
- offset[0] = 0; /*offset of hyperslab in memory*/
- offset[1] = 0;
- a_size[0] = CHUNK_SIZE; /*size of hyperslab*/
- a_size[1] = CHUNK_SIZE;
- status = H5Sselect_hyperslab(memspace_id, H5S_SELECT_SET, offset, NULL,
- a_size, NULL);
-
- if ( status < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Sselect_hyperslab() failed.";
- }
- }
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout,"Done.\n");
- HDfflush(stdout);
- }
-
- /* initialize all datasets on a round robin basis */
- i = 0;
- progress_counter = 0;
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout, "Initializing datasets ");
- HDfflush(stdout);
- }
-
- while ( ( pass1 ) && ( i < DSET_SIZE ) )
- {
- j = 0;
- while ( ( pass1 ) && ( j < DSET_SIZE ) )
- {
- m = 0;
- while ( ( pass1 ) && ( m < NUM_DSETS ) )
- {
- /* initialize the slab */
- for ( k = 0; k < CHUNK_SIZE; k++ )
- {
- for ( l = 0; l < CHUNK_SIZE; l++ )
- {
- data_chunk[k][l] = (DSET_SIZE * DSET_SIZE * m) +
- (DSET_SIZE * (i + k)) + j + l;
- }
- }
-
- /* select on disk hyperslab */
- offset[0] = i; /*offset of hyperslab in file*/
- offset[1] = j;
- a_size[0] = CHUNK_SIZE; /*size of hyperslab*/
- a_size[1] = CHUNK_SIZE;
- status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
- offset, NULL, a_size, NULL);
-
- if ( status < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "disk H5Sselect_hyperslab() failed.";
- }
-
- /* write the chunk to file */
- status = H5Dwrite(dataset_ids[m], H5T_NATIVE_INT, memspace_id,
- filespace_ids[m], H5P_DEFAULT, data_chunk);
-
- if ( status < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Dwrite() failed.";
- }
- m++;
- }
- j += CHUNK_SIZE;
- }
-
- /* check the cache hit rate, and reset the counters.
- * Hit rate should be just about unity here, so we will just
- * get the data and (possibly) print it without checking it
- * beyond ensuring that it agrees with the cache internal
- * data structures.
- *
- * similarly, check cache size.
- */
-
- if ( ( pass1 ) && ( i % (DSET_SIZE / 4) == 0 ) ) {
-
- check_and_validate_cache_hit_rate(file_id, NULL, dump_hit_rate,
- min_accesses, min_hit_rate);
-
- check_and_validate_cache_size(file_id, NULL, NULL, NULL, NULL,
- dump_cache_size);
- }
-
- i += CHUNK_SIZE;
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- progress_counter += CHUNK_SIZE;
-
- if ( progress_counter >= DSET_SIZE / 20 ) {
-
- progress_counter = 0;
- HDfprintf(stdout, ".");
- HDfflush(stdout);
- }
- }
- }
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout," Done.\n"); /* initializing data sets */
- HDfflush(stdout);
- }
-
- /* set alternate config 2 */
- if ( pass1 ) {
-
- if ( H5Fset_mdc_config(file_id, &mod_config_2) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fset_mdc_config() failed 2.\n";
- }
- }
-
- /* verify that the cache is now set to the alternate config */
- validate_mdc_config(file_id, &mod_config_2, TRUE, 3);
-
- /* do random reads on all datasets */
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout, "Doing random reads on all datasets ");
- HDfflush(stdout);
- }
-
- n = 0;
- progress_counter = 0;
- while ( ( pass1 ) && ( n < NUM_RANDOM_ACCESSES ) )
- {
- m = rand() % NUM_DSETS;
- i = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE;
- j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE;
-
- /* select on disk hyperslab */
- offset[0] = i; /*offset of hyperslab in file*/
- offset[1] = j;
- a_size[0] = CHUNK_SIZE; /*size of hyperslab*/
- a_size[1] = CHUNK_SIZE;
- status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
- offset, NULL, a_size, NULL);
-
- if ( status < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "disk hyperslab create failed.";
- }
-
- /* read the chunk from file */
- if ( pass1 ) {
-
- status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, memspace_id,
- filespace_ids[m], H5P_DEFAULT, data_chunk);
-
- if ( status < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "disk hyperslab create failed.";
- }
- }
-
- /* validate the slab */
- if ( pass1 ) {
-
- valid_chunk = TRUE;
- for ( k = 0; k < CHUNK_SIZE; k++ )
- {
- for ( l = 0; l < CHUNK_SIZE; l++ )
- {
- if ( data_chunk[k][l]
- !=
- ((DSET_SIZE * DSET_SIZE * m) +
- (DSET_SIZE * (i + k)) + j + l) ) {
-
- valid_chunk = FALSE;
-#if 0 /* this will be useful from time to time -- lets keep it*/
- HDfprintf(stdout,
- "data_chunk[%0d][%0d] = %0d, expect %0d.\n",
- k, l, data_chunk[k][l],
- ((DSET_SIZE * DSET_SIZE * m) +
- (DSET_SIZE * (i + k)) + j + l));
- HDfprintf(stdout,
- "m = %d, i = %d, j = %d, k = %d, l = %d\n",
- m, i, j, k, l);
-#endif
- }
- }
- }
-
- if ( ! valid_chunk ) {
-#if 1
- pass1 = FALSE;
- failure_mssg1 = "slab validation failed.";
-#else /* as above */
- fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n",
- i, j, m);
-#endif
- }
- }
-
- if ( ( pass1 ) && ( n % (NUM_RANDOM_ACCESSES / 4) == 0 ) ) {
-
- check_and_validate_cache_hit_rate(file_id, NULL, dump_hit_rate,
- min_accesses, min_hit_rate);
-
- check_and_validate_cache_size(file_id, NULL, NULL, NULL, NULL,
- dump_cache_size);
- }
-
- n++;
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- progress_counter++;
-
- if ( progress_counter >= NUM_RANDOM_ACCESSES / 20 ) {
-
- progress_counter = 0;
- HDfprintf(stdout, ".");
- HDfflush(stdout);
- }
- }
- }
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout, " Done.\n"); /* random reads on all data sets */
- HDfflush(stdout);
- }
-
-
- /* close the file spaces we are done with */
- i = 1;
- while ( ( pass1 ) && ( i < NUM_DSETS ) )
- {
- if ( H5Sclose(filespace_ids[i]) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Sclose() failed.";
- }
- i++;
- }
-
-
- /* close the datasets we are done with */
- i = 1;
- while ( ( pass1 ) && ( i < NUM_DSETS ) )
- {
- if ( H5Dclose(dataset_ids[i]) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Dclose() failed.";
- }
- i++;
- }
-
- /* set alternate config 3 */
- if ( pass1 ) {
-
- if ( H5Fset_mdc_config(file_id, &mod_config_3) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fset_mdc_config() failed 3.\n";
- }
- }
-
- /* verify that the cache is now set to the alternate config */
- validate_mdc_config(file_id, &mod_config_3, TRUE, 4);
-
- /* do random reads on data set 0 only */
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout, "Doing random reads on dataset 0 ");
- HDfflush(stdout);
- }
-
- m = 0;
- n = 0;
- progress_counter = 0;
- while ( ( pass1 ) && ( n < NUM_RANDOM_ACCESSES ) )
- {
- i = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE;
- j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE;
-
- /* select on disk hyperslab */
- offset[0] = i; /*offset of hyperslab in file*/
- offset[1] = j;
- a_size[0] = CHUNK_SIZE; /*size of hyperslab*/
- a_size[1] = CHUNK_SIZE;
- status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
- offset, NULL, a_size, NULL);
-
- if ( status < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "disk hyperslab create failed.";
- }
-
- /* read the chunk from file */
- if ( pass1 ) {
-
- status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, memspace_id,
- filespace_ids[m], H5P_DEFAULT, data_chunk);
-
- if ( status < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "disk hyperslab create failed.";
- }
- }
-
- /* validate the slab */
- if ( pass1 ) {
-
- valid_chunk = TRUE;
- for ( k = 0; k < CHUNK_SIZE; k++ )
- {
- for ( l = 0; l < CHUNK_SIZE; l++ )
- {
- if ( data_chunk[k][l]
- !=
- ((DSET_SIZE * DSET_SIZE * m) +
- (DSET_SIZE * (i + k)) + j + l) ) {
-
- valid_chunk = FALSE;
- }
-#if 0 /* this will be useful from time to time -- lets keep it */
- HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n",
- k, l, data_chunk[k][l],
- ((DSET_SIZE * DSET_SIZE * m) +
- (DSET_SIZE * (i + k)) + j + l));
-#endif
- }
- }
-
- if ( ! valid_chunk ) {
-
- pass1 = FALSE;
- failure_mssg1 = "slab validation failed.";
-#if 0 /* as above */
- fprintf(stdout, "Chunk (%0d, %0d) in /dset%03d is invalid.\n",
- i, j, m);
-#endif
- }
- }
-
- if ( ( pass1 ) && ( n % (NUM_RANDOM_ACCESSES / 4) == 0 ) ) {
-
- check_and_validate_cache_hit_rate(file_id, NULL, dump_hit_rate,
- min_accesses, min_hit_rate);
-
- check_and_validate_cache_size(file_id, NULL, NULL, NULL, NULL,
- dump_cache_size);
- }
-
- n++;
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- progress_counter++;
-
- if ( progress_counter >= NUM_RANDOM_ACCESSES / 20 ) {
-
- progress_counter = 0;
- HDfprintf(stdout, ".");
- HDfflush(stdout);
- }
- }
- }
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout, " Done.\n"); /* random reads data set 0 */
- HDfflush(stdout);
- }
-
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout,"Shutting down ... ");
- HDfflush(stdout);
- }
-
-
- /* close file space 0 */
- if ( pass1 ) {
-
- if ( H5Sclose(filespace_ids[0]) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Sclose(filespace_ids[0]) failed.";
- }
- }
-
- /* close the data space */
- if ( pass1 ) {
-
- if ( H5Sclose(dataspace_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Sclose(dataspace) failed.";
- }
- }
-
- /* close the mem space */
- if ( pass1 ) {
-
- if ( H5Sclose(memspace_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Sclose(memspace_id) failed.";
- }
- }
-
- /* close dataset 0 */
- if ( pass1 ) {
-
- if ( H5Dclose(dataset_ids[0]) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Dclose(dataset_ids[0]) failed.";
- }
- }
-
- /* close the file and delete it */
- if ( pass1 ) {
-
- if ( H5Fclose(file_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fclose() failed.\n";
-
- }
- else if ( HDremove(filename) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "HDremove() failed.\n";
- }
- }
-
- if ( ( pass1 ) && ( report_progress ) ) {
-
- HDfprintf(stdout,"Done.\n"); /* shutting down */
- HDfflush(stdout);
- }
-
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 )
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
-
-} /* mdc_api_call_smoke_check() */
-
-
-/* The following array of invalid external MDC cache configurations is
- * used to test error rejection in the MDC related API calls.
- */
-
-#define NUM_INVALID_CONFIGS 41
-
-H5AC1_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
-{
- {
- /* 0 -- bad version */
- /* int version = */ -1,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 1 -- bad rpt_fcn_enabled */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ (hbool_t)-1,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 2 -- bad open_trace_file */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ (hbool_t)-1,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 3 -- bad close_trace_file */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ (hbool_t)-1,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 4 -- open_trace_file == TRUE and empty trace_file_name */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ TRUE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 5 -- bad set_initial_size */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ 2,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 6 -- max_size too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ H5C1__MAX_MAX_CACHE_SIZE + 1,
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 7 -- min_size too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ H5C1__MIN_MAX_CACHE_SIZE - 1,
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 8 -- min_size > max_size */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ FALSE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ (16 * 1024 * 1024 + 1),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 9 -- initial size out of range (too big) */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (16 * 1024 * 1024 + 1),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 10 -- initial_size out of range (too small) */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024 - 1),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 11 -- min_clean_fraction too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 1.000001,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 12 -- min_clean_fraction too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ -0.00000001,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 13 -- epoch_length too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ H5C1__MIN_AR_EPOCH_LENGTH - 1,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 14 -- epoch_length too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ H5C1__MAX_AR_EPOCH_LENGTH + 1,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 15 -- invalid incr_mode */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ -1,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 16 -- lower_hr_threshold too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ -0.000001,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 17 -- lower_hr_threshold too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 1.00000001,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 18 -- increment too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 0.999999999999,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 19 -- bad apply_max_increment */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ (hbool_t)-1,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 20 -- invalid flash_incr_mode */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ -1,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 21 -- flash_multiple too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__add_space,
- /* double flash_multiple = */ 0.09,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 22 -- flash_multiple too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__add_space,
- /* double flash_multiple = */ 10.001,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 23 -- flash_threshold too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__add_space,
- /* double flash_multiple = */ 1.0,
- /* double flash_threshold = */ 0.099,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 24 -- flash_threshold too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__add_space,
- /* double flash_multiple = */ 1.0,
- /* double flash_threshold = */ 1.001,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 25 -- bad decr_mode */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ -1,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 26 -- upper_hr_threshold too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__threshold,
- /* double upper_hr_threshold = */ 1.00001,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 27 -- decrement too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ -0.0000000001,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 28 -- decrement too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 1.0000000001,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 29 -- epochs_before_eviction too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 0,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 30 -- epochs_before_eviction too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ H5C1__MAX_EPOCH_MARKERS + 1,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 31 -- invalid apply_empty_reserve */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ 2,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 32 -- empty_reserve too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ -0.0000000001,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 33 -- empty_reserve too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 1.00000000001,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 34 -- upper_hr_threshold too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ -0.000000001,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 35 -- upper_hr_threshold too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 1.00000001,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 36 -- upper_hr_threshold <= lower_hr_threshold */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.9,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 37 -- dirty_bytes_threshold too small */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.999,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (H5C1__MIN_MAX_CACHE_SIZE / 2) - 1
- },
- {
- /* 38 -- dirty_bytes_threshold too big */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ TRUE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out_with_threshold,
- /* double upper_hr_threshold = */ 0.9,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (H5C1__MAX_MAX_CACHE_SIZE / 4) + 1
- },
- {
- /* 39 -- attempt to disable evictions when auto incr enabled */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ FALSE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__off,
- /* double upper_hr_threshold = */ 0.9,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- },
- {
- /* 40 -- attempt to disable evictions when auto decr enabled */
- /* int version = */ H5C1__CURR_AUTO_SIZE_CTL_VER,
- /* hbool_t rpt_fcn_enabled = */ FALSE,
- /* hbool_t open_trace_file = */ FALSE,
- /* hbool_t close_trace_file = */ FALSE,
- /* char trace_file_name[] = */ "",
- /* hbool_t evictions_enabled = */ FALSE,
- /* hbool_t set_initial_size = */ TRUE,
- /* size_t initial_size = */ (1 * 1024 * 1024),
- /* double min_clean_fraction = */ 0.25,
- /* size_t max_size = */ (16 * 1024 * 1024),
- /* size_t min_size = */ ( 1 * 1024 * 1024),
- /* long int epoch_length = */ 50000,
- /* enum H5C1_cache_incr_mode incr_mode = */ H5C1_incr__threshold,
- /* double lower_hr_threshold = */ 0.9,
- /* double increment = */ 2.0,
- /* hbool_t apply_max_increment = */ TRUE,
- /* size_t max_increment = */ (4 * 1024 * 1024),
- /* enum H5C1_cache_flash_incr_mode */
- /* flash_incr_mode = */ H5C1_flash_incr__off,
- /* double flash_multiple = */ 2.0,
- /* double flash_threshold = */ 0.5,
- /* enum H5C1_cache_decr_mode decr_mode = */ H5C1_decr__age_out,
- /* double upper_hr_threshold = */ 0.9,
- /* double decrement = */ 0.9,
- /* hbool_t apply_max_decrement = */ TRUE,
- /* size_t max_decrement = */ (1 * 1024 * 1024),
- /* int epochs_before_eviction = */ 3,
- /* hbool_t apply_empty_reserve = */ TRUE,
- /* double empty_reserve = */ 0.1,
- /* int dirty_bytes_threshold = */ (256 * 1024)
- }
-};
-
-
-/*-------------------------------------------------------------------------
- * Function: check_fapl_mdc_api_errs()
- *
- * Purpose: Verify that the FAPL related MDC API calls reject input
- * errors gracefully.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/19/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_fapl_mdc_api_errs(void)
-{
- const char * fcn_name = "check_fapl_mdc_api_errs()";
- static char msg[128];
- int i;
- herr_t result;
- hid_t fapl_id = -1;
- H5AC1_cache_config_t default_config = H5AC1__DEFAULT_CACHE_CONFIG;
- H5AC1_cache_config_t scratch;
-
- TESTING("MDC/FAPL related API input errors");
-
- pass1 = TRUE;
-
-
- /* first test H5Pget_mdc_config().
- */
-
- scratch.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- if ( pass1 ) {
-
- H5E_BEGIN_TRY { result = H5Pget_mdc_config(-1, &scratch); } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pget_mdc_config() accepted invalid plist_id.";
- }
- }
-
- /* Create a FAPL for test purposes, and verify that it contains the
- * default MDC configuration.
- */
-
- if ( pass1 ) {
-
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
-
- if ( fapl_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pcreate(H5P_FILE_ACCESS) failed.\n";
- }
- }
-
- scratch.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- if ( ( pass1 ) &&
- ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0 ) ||
- ( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "New FAPL has unexpected metadata cache config?!?!?.\n";
- }
-
- if ( pass1 ) {
-
- H5E_BEGIN_TRY {
- result = H5Pget_mdc_config(fapl_id, NULL);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pget_mdc_config() accepted NULL config_ptr.";
- }
- }
-
- /* one last test for H5Pget_mdc_config() */
-
- scratch.version = -1; /* a convenient, invalid value */
- if ( pass1 ) {
-
- H5E_BEGIN_TRY {
- result = H5Pget_mdc_config(fapl_id, &scratch);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pget_mdc_config() accepted bad config version.";
- }
- }
-
-
- /* now test H5Pset_mdc_config()
- */
-
- scratch.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- if ( pass1 ) {
-
- H5E_BEGIN_TRY {
- result = H5Pset_mdc_config(-1, &default_config);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pset_mdc_config() accepted bad invalid plist_id.";
- }
- }
-
- if ( pass1 ) {
-
- H5E_BEGIN_TRY {
- result = H5Pset_mdc_config(fapl_id, NULL);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Pset_mdc_config() accepted NULL config_ptr.";
- }
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < NUM_INVALID_CONFIGS ) )
- {
- H5E_BEGIN_TRY {
- result = H5Pset_mdc_config(fapl_id, &(invalid_configs[i]));
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5Pset_mdc_config() accepted invalid_configs[%d].", i);
- failure_mssg1 = msg;
- }
- i++;
- }
-
- /* verify that none of the above calls to H5Pset_mdc_config() changed
- * the configuration in the FAPL.
- */
- scratch.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- if ( ( pass1 ) &&
- ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0 ) ||
- ( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "FAPL metadata cache config changed???.\n";
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 )
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
-
-} /* check_fapl_mdc_api_errs() */
-
-
-/*-------------------------------------------------------------------------
- * Function: check_file_mdc_api_errs()
- *
- * Purpose: Verify that the file related MDC API calls reject input
- * errors gracefully.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/19/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static void
-check_file_mdc_api_errs(void)
-{
- const char * fcn_name = "check_file_mdc_api_errs()";
- char filename[512];
- static char msg[128];
- hbool_t show_progress = FALSE;
- int i;
- herr_t result;
- hid_t file_id = -1;
- size_t max_size;
- size_t min_clean_size;
- size_t cur_size;
- int cur_num_entries;
- double hit_rate;
- H5AC1_cache_config_t default_config = H5AC1__DEFAULT_CACHE_CONFIG;
- H5AC1_cache_config_t scratch;
-
- TESTING("MDC/FILE related API input errors");
-
- pass1 = TRUE;
-
- /* Create a file for test purposes, and veify that its metadata cache
- * set to the default MDC configuration.
- */
-
- /* setup the file name */
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: calling h5_fixname().\n", fcn_name);
- }
-
- if ( h5_fixname(FILENAME1[0], H5P_DEFAULT, filename, sizeof(filename))
- == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "h5_fixname() failed.\n";
- }
- }
-
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: calling H5Fcreate().\n", fcn_name);
- }
-
- file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-
- if ( file_id < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fcreate() failed.\n";
- }
- }
-
- validate_mdc_config(file_id, &default_config, TRUE, 1);
-
-
- /* test H5Fget_mdc_config(). */
-
- scratch.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", fcn_name);
- }
-
- H5E_BEGIN_TRY {
- result = H5Fget_mdc_config(-1, &scratch);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_config() accepted invalid file_id.";
- }
- }
-
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", fcn_name);
- }
-
- H5E_BEGIN_TRY {
- result = H5Fget_mdc_config(file_id, NULL);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_config() accepted NULL config_ptr.";
- }
- }
-
- scratch.version = -1; /* a convenient, invalid value */
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", fcn_name);
- }
-
- H5E_BEGIN_TRY {
- result = H5Fget_mdc_config(file_id, &scratch);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_config() accepted bad config version.";
- }
- }
-
-
- /* test H5Fset_mdc_config() */
-
- scratch.version = H5C1__CURR_AUTO_SIZE_CTL_VER;
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", fcn_name);
- }
-
- H5E_BEGIN_TRY {
- result = H5Fset_mdc_config(-1, &default_config);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fset_mdc_config() accepted bad invalid file_id.";
- }
- }
-
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", fcn_name);
- }
-
- H5E_BEGIN_TRY {
- result = H5Fset_mdc_config(file_id, NULL);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fset_mdc_config() accepted NULL config_ptr.";
- }
- }
-
- i = 0;
- while ( ( pass1 ) && ( i < NUM_INVALID_CONFIGS ) )
- {
- if ( show_progress ) {
-
- HDfprintf(stdout,
- "%s: testing H5Fset_mdc_config() with invalid config %d.\n",
- fcn_name, i);
- }
-
- H5E_BEGIN_TRY {
- result = H5Fset_mdc_config(file_id, &(invalid_configs[i]));
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- HDsnprintf(msg, (size_t)128,
- "H5Fset_mdc_config() accepted invalid_configs[%d].", i);
- failure_mssg1 = msg;
- }
- i++;
- }
-
- /* verify that none of the above calls to H5Fset_mdc_config() changed
- * the configuration in the FAPL.
- */
- validate_mdc_config(file_id, &default_config, TRUE, 2);
-
-
- /* test H5Fget_mdc_hit_rate() */
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n",
- fcn_name);
- }
-
- H5E_BEGIN_TRY {
- result = H5Fget_mdc_hit_rate(-1, &hit_rate);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_hit_rate() accepted bad file_id.";
- }
- }
-
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n",
- fcn_name);
- }
-
- H5E_BEGIN_TRY {
- result = H5Fget_mdc_hit_rate(file_id, NULL);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_hit_rate() accepted NULL hit_rate_ptr.";
- }
- }
-
-
- /* test H5Freset_mdc_hit_rate_stats() */
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n",
- fcn_name);
- }
-
- H5E_BEGIN_TRY {
- result = H5Freset_mdc_hit_rate_stats(-1);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "H5Freset_mdc_hit_rate_stats() accepted bad file_id.";
- }
- }
-
-
- /* test H5Fget_mdc_size() */
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", fcn_name);
- }
-
- H5E_BEGIN_TRY {
- result = H5Fget_mdc_size(-1, &max_size, &min_clean_size,
- &cur_size, &cur_num_entries);
- } H5E_END_TRY;
-
- if ( result >= 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_size() accepted bad file_id.";
- }
- }
-
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", fcn_name);
- }
-
- if ( ( H5Fget_mdc_size(file_id, &max_size, NULL, NULL, NULL) < 0 ) ||
- ( H5Fget_mdc_size(file_id, NULL, &min_clean_size,
- NULL, NULL) < 0 ) ||
- ( H5Fget_mdc_size(file_id, NULL, NULL, &cur_size, NULL) < 0 ) ||
- ( H5Fget_mdc_size(file_id, NULL, NULL, NULL,
- &cur_num_entries) < 0 ) ||
- ( H5Fget_mdc_size(file_id, NULL, NULL, NULL, NULL) < 0 ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fget_mdc_size() failed to handle NULL params.";
- }
- }
-
-
- /* close the file and delete it */
- if ( pass1 ) {
-
- if ( show_progress ) {
-
- HDfprintf(stdout, "%s: cleaning up from tests.\n", fcn_name);
- }
-
- if ( H5Fclose(file_id) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5Fclose() failed.\n";
-
- } else if ( HDremove(filename) < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "HDremove() failed.\n";
- }
- }
-
- if ( pass1 ) { PASSED(); } else { H5_FAILED(); }
-
- if ( ! pass1 )
- HDfprintf(stdout, "%s: failure_mssg1 = \"%s\".\n",
- fcn_name, failure_mssg1);
-
-} /* check_file_mdc_api_errs() */
-
-
-/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Run tests on the cache code contained in H5C.c
- *
- * Return: Success:
- *
- * Failure:
- *
- * Programmer: John Mainzer
- * 6/24/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-int
-main(void)
-{
- int express_test1;
-
- H5open();
-
- express_test1 = GetTestExpress();
-
-#if 1
- check_fapl_mdc_api_calls();
-#endif
-#if 1
- check_file_mdc_api_calls();
-#endif
-#if 1
- mdc_api_call_smoke_check(express_test1);
-#endif
-#if 1
- check_fapl_mdc_api_errs();
-#endif
-#if 1
- check_file_mdc_api_errs();
-#endif
-
- return(0);
-
-} /* main() */
diff --git a/test/cache1_common.c b/test/cache1_common.c
deleted file mode 100644
index 584c9c1..0000000
--- a/test/cache1_common.c
+++ /dev/null
@@ -1,4613 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* Programmer: John Mainzer
- * 10/27/05
- *
- * This file contains common code for tests of the cache
- * implemented in H5C.c
- */
-#include "h5test.h"
-#include "H5Iprivate.h"
-#include "H5AC1private.h"
-#include "cache1_common.h"
-
-
-/* global variable declarations: */
-
-hbool_t write_permitted1 = TRUE;
-hbool_t pass1 = TRUE; /* set to false on error */
-hbool_t skip_long_tests1 = TRUE;
-hbool_t run_full_test1 = TRUE;
-const char *failure_mssg1 = NULL;
-
-test_entry_t pico_entries1[NUM_PICO_ENTRIES];
-test_entry_t nano_entries1[NUM_NANO_ENTRIES];
-test_entry_t micro_entries1[NUM_MICRO_ENTRIES];
-test_entry_t tiny_entries1[NUM_TINY_ENTRIES];
-test_entry_t small_entries1[NUM_SMALL_ENTRIES];
-test_entry_t medium_entries1[NUM_MEDIUM_ENTRIES];
-test_entry_t large_entries1[NUM_LARGE_ENTRIES];
-test_entry_t huge_entries1[NUM_HUGE_ENTRIES];
-test_entry_t monster_entries1[NUM_MONSTER_ENTRIES];
-test_entry_t variable_entries1[NUM_VARIABLE_ENTRIES];
-
-test_entry_t * entries1[NUMBER_OF_ENTRY_TYPES] =
-{
- pico_entries1,
- nano_entries1,
- micro_entries1,
- tiny_entries1,
- small_entries1,
- medium_entries1,
- large_entries1,
- huge_entries1,
- monster_entries1,
- variable_entries1
-};
-
-const int32_t max_indices1[NUMBER_OF_ENTRY_TYPES] =
-{
- NUM_PICO_ENTRIES - 1,
- NUM_NANO_ENTRIES - 1,
- NUM_MICRO_ENTRIES - 1,
- NUM_TINY_ENTRIES - 1,
- NUM_SMALL_ENTRIES - 1,
- NUM_MEDIUM_ENTRIES - 1,
- NUM_LARGE_ENTRIES - 1,
- NUM_HUGE_ENTRIES - 1,
- NUM_MONSTER_ENTRIES - 1,
- NUM_VARIABLE_ENTRIES - 1
-};
-
-const size_t entry_sizes1[NUMBER_OF_ENTRY_TYPES] =
-{
- PICO_ENTRY_SIZE,
- NANO_ENTRY_SIZE,
- MICRO_ENTRY_SIZE,
- TINY_ENTRY_SIZE,
- SMALL_ENTRY_SIZE,
- MEDIUM_ENTRY_SIZE,
- LARGE_ENTRY_SIZE,
- HUGE_ENTRY_SIZE,
- MONSTER_ENTRY_SIZE,
- VARIABLE_ENTRY_SIZE
-};
-
-const haddr_t base_addrs1[NUMBER_OF_ENTRY_TYPES] =
-{
- PICO_BASE_ADDR,
- NANO_BASE_ADDR,
- MICRO_BASE_ADDR,
- TINY_BASE_ADDR,
- SMALL_BASE_ADDR,
- MEDIUM_BASE_ADDR,
- LARGE_BASE_ADDR,
- HUGE_BASE_ADDR,
- MONSTER_BASE_ADDR,
- VARIABLE_BASE_ADDR
-};
-
-const haddr_t alt_base_addrs1[NUMBER_OF_ENTRY_TYPES] =
-{
- PICO_ALT_BASE_ADDR,
- NANO_ALT_BASE_ADDR,
- MICRO_ALT_BASE_ADDR,
- TINY_ALT_BASE_ADDR,
- SMALL_ALT_BASE_ADDR,
- MEDIUM_ALT_BASE_ADDR,
- LARGE_ALT_BASE_ADDR,
- HUGE_ALT_BASE_ADDR,
- MONSTER_ALT_BASE_ADDR,
- VARIABLE_ALT_BASE_ADDR
-};
-
-const char * entry_type_names1[NUMBER_OF_ENTRY_TYPES] =
-{
- "pico entries -- 1 B",
- "nano entries -- 4 B",
- "micro entries -- 16 B",
- "tiny entries -- 64 B",
- "small entries -- 256 B",
- "medium entries -- 1 KB",
- "large entries -- 4 KB",
- "huge entries -- 16 KB",
- "monster entries -- 64 KB",
- "variable entries -- 1B - 10KB"
-};
-
-
-/* callback table declaration */
-
-const H5C1_class_t types1[NUMBER_OF_ENTRY_TYPES] =
-{
- {
- PICO_ENTRY_TYPE,
- (H5C1_load_func_t)pico_load,
- (H5C1_flush_func_t)pico_flush,
- (H5C1_dest_func_t)pico_dest,
- (H5C1_clear_func_t)pico_clear,
- (H5C1_size_func_t)pico_size
- },
- {
- NANO_ENTRY_TYPE,
- (H5C1_load_func_t)nano_load,
- (H5C1_flush_func_t)nano_flush,
- (H5C1_dest_func_t)nano_dest,
- (H5C1_clear_func_t)nano_clear,
- (H5C1_size_func_t)nano_size
- },
- {
- MICRO_ENTRY_TYPE,
- (H5C1_load_func_t)micro_load,
- (H5C1_flush_func_t)micro_flush,
- (H5C1_dest_func_t)micro_dest,
- (H5C1_clear_func_t)micro_clear,
- (H5C1_size_func_t)micro_size
- },
- {
- TINY_ENTRY_TYPE,
- (H5C1_load_func_t)tiny_load,
- (H5C1_flush_func_t)tiny_flush,
- (H5C1_dest_func_t)tiny_dest,
- (H5C1_clear_func_t)tiny_clear,
- (H5C1_size_func_t)tiny_size
- },
- {
- SMALL_ENTRY_TYPE,
- (H5C1_load_func_t)small_load,
- (H5C1_flush_func_t)small_flush,
- (H5C1_dest_func_t)small_dest,
- (H5C1_clear_func_t)small_clear,
- (H5C1_size_func_t)small_size
- },
- {
- MEDIUM_ENTRY_TYPE,
- (H5C1_load_func_t)medium_load,
- (H5C1_flush_func_t)medium_flush,
- (H5C1_dest_func_t)medium_dest,
- (H5C1_clear_func_t)medium_clear,
- (H5C1_size_func_t)medium_size
- },
- {
- LARGE_ENTRY_TYPE,
- (H5C1_load_func_t)large_load,
- (H5C1_flush_func_t)large_flush,
- (H5C1_dest_func_t)large_dest,
- (H5C1_clear_func_t)large_clear,
- (H5C1_size_func_t)large_size
- },
- {
- HUGE_ENTRY_TYPE,
- (H5C1_load_func_t)huge_load,
- (H5C1_flush_func_t)huge_flush,
- (H5C1_dest_func_t)huge_dest,
- (H5C1_clear_func_t)huge_clear,
- (H5C1_size_func_t)huge_size
- },
- {
- MONSTER_ENTRY_TYPE,
- (H5C1_load_func_t)monster_load,
- (H5C1_flush_func_t)monster_flush,
- (H5C1_dest_func_t)monster_dest,
- (H5C1_clear_func_t)monster_clear,
- (H5C1_size_func_t)monster_size
- },
- {
- VARIABLE_ENTRY_TYPE,
- (H5C1_load_func_t)variable_load,
- (H5C1_flush_func_t)variable_flush,
- (H5C1_dest_func_t)variable_dest,
- (H5C1_clear_func_t)variable_clear,
- (H5C1_size_func_t)variable_size
- }
-};
-
-static herr_t clear(H5F_t * f, void * thing, hbool_t dest);
-static herr_t destroy(H5F_t * f, void * thing);
-static herr_t flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned UNUSED * flags_ptr);
-static void * load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-static herr_t size(H5F_t * f, void * thing, size_t * size_ptr);
-
-
-
-/* address translation funtions: */
-
-/*-------------------------------------------------------------------------
- * Function: addr_to_type_and_index1
- *
- * Purpose: Given an address, compute the type and index of the
- * associated entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-void
-addr_to_type_and_index1(haddr_t addr,
- int32_t * type_ptr,
- int32_t * index_ptr)
-{
- int i;
- int32_t type;
- int32_t idx;
-
- HDassert( type_ptr );
- HDassert( index_ptr );
-
- /* we only have a small number of entry types1, so just do a
- * linear search. If NUMBER_OF_ENTRY_TYPES grows, we may want
- * to do a binary search instead.
- */
- i = 1;
- if ( addr >= PICO_ALT_BASE_ADDR ) {
-
- while ( ( i < NUMBER_OF_ENTRY_TYPES ) &&
- ( addr >= alt_base_addrs1[i] ) )
- {
- i++;
- }
-
- } else {
-
- while ( ( i < NUMBER_OF_ENTRY_TYPES ) &&
- ( addr >= base_addrs1[i] ) )
- {
- i++;
- }
- }
-
- type = i - 1;
-
- HDassert( ( type >= 0 ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
-
- if ( addr >= PICO_ALT_BASE_ADDR ) {
-
- idx = (int32_t)((addr - alt_base_addrs1[type]) / entry_sizes1[type]);
- HDassert( ( idx >= 0 ) && ( idx <= max_indices1[type] ) );
- HDassert( !((entries1[type])[idx].at_main_addr) );
- HDassert( addr == (entries1[type])[idx].alt_addr );
-
- } else {
-
- idx = (int32_t)((addr - base_addrs1[type]) / entry_sizes1[type]);
- HDassert( ( idx >= 0 ) && ( idx <= max_indices1[type] ) );
- HDassert( (entries1[type])[idx].at_main_addr );
- HDassert( addr == (entries1[type])[idx].main_addr );
- }
-
- HDassert( addr == (entries1[type])[idx].addr );
-
- *type_ptr = type;
- *index_ptr = idx;
-
- return;
-
-} /* addr_to_type_and_index1() */
-
-
-#if 0 /* This function has never been used, but we may want it
- * some time. Lets keep it for now.
- */
-/*-------------------------------------------------------------------------
- * Function: type_and_index_to_addr1
- *
- * Purpose: Given a type and index of an entry, compute the associated
- * addr and return that value.
- *
- * Return: computed addr
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-haddr_t
-type_and_index_to_addr1(int32_t type,
- int32_t idx)
-{
- haddr_t addr;
-
- HDassert( ( type >= 0 ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( idx >= 0 ) && ( idx <= max_indices1[type] ) );
-
- addr = base_addrs1[type] + (((haddr_t)idx) * entry_sizes1[type]);
-
- HDassert( addr == (entries1[type])[idx].addr );
-
- if ( (entries1[type])[idx].at_main_addr ) {
-
- HDassert( addr == (entries1[type])[idx].main_addr );
-
- } else {
-
- HDassert( addr == (entries1[type])[idx].alt_addr );
- }
-
- return(addr);
-
-} /* type_and_index_to_addr1() */
-
-#endif
-
-
-/* Call back functions: */
-
-/*-------------------------------------------------------------------------
- *
- * Function: check_if_write_permitted1
- *
- * Purpose: Determine if a write is permitted under the current
- * circumstances, and set *write_permitted1_ptr accordingly.
- * As a general rule it is, but when we are running in parallel
- * mode with collective I/O, we must ensure that a read cannot
- * cause a write.
- *
- * In the event of failure, the value of *write_permitted1_ptr
- * is undefined.
- *
- * Return: Non-negative on success/Negative on failure.
- *
- * Programmer: John Mainzer, 5/15/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-herr_t
-check_write_permitted1(const H5F_t UNUSED * f,
- hid_t UNUSED dxpl_id,
- hbool_t * write_permitted1_ptr)
-{
-
- HDassert( write_permitted1_ptr );
- *write_permitted1_ptr = write_permitted1;
-
- return(SUCCEED);
-
-} /* check_write_permitted1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: clear & friends
- *
- * Purpose: clear the entry. The helper functions verify that the
- * correct version of clear is being called, and then call
- * clear proper.
- *
- * Return: SUCCEED
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- * Added variable_clear. -- JRM 8/30/06
- *
- *-------------------------------------------------------------------------
- */
-
-herr_t
-clear(H5F_t * f,
- void * thing,
- hbool_t dest)
-{
- test_entry_t * entry_ptr;
- test_entry_t * base_addr;
-
- HDassert( thing );
-
- entry_ptr = (test_entry_t *)thing;
- base_addr = entries1[entry_ptr->type];
-
- HDassert( entry_ptr->index >= 0 );
- HDassert( entry_ptr->index <= max_indices1[entry_ptr->type] );
- HDassert( entry_ptr == &(base_addr[entry_ptr->index]) );
- HDassert( entry_ptr == entry_ptr->self );
- HDassert( entry_ptr->header.addr == entry_ptr->addr );
- HDassert( entry_ptr->header.size == entry_ptr->size );
- HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) ||
- ( entry_ptr->size == entry_sizes1[entry_ptr->type] ) );
-
- entry_ptr->header.is_dirty = FALSE;
- entry_ptr->is_dirty = FALSE;
-
- entry_ptr->cleared = TRUE;
-
- if ( dest ) {
-
- destroy(f, thing);
-
- }
-
- return(SUCCEED);
-
-} /* clear() */
-
-herr_t
-pico_clear(H5F_t * f, void * thing, hbool_t dest)
-{
- HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE );
- return(clear(f, thing, dest));
-}
-
-herr_t
-nano_clear(H5F_t * f, void * thing, hbool_t dest)
-{
- HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE );
- return(clear(f, thing, dest));
-}
-
-herr_t
-micro_clear(H5F_t * f, void * thing, hbool_t dest)
-{
- HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE );
- return(clear(f, thing, dest));
-}
-
-herr_t
-tiny_clear(H5F_t * f, void * thing, hbool_t dest)
-{
- HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE );
- return(clear(f, thing, dest));
-}
-
-herr_t
-small_clear(H5F_t * f, void * thing, hbool_t dest)
-{
- HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE );
- return(clear(f, thing, dest));
-}
-
-herr_t
-medium_clear(H5F_t * f, void * thing, hbool_t dest)
-{
- HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE );
- return(clear(f, thing, dest));
-}
-
-herr_t
-large_clear(H5F_t * f, void * thing, hbool_t dest)
-{
- HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE );
- return(clear(f, thing, dest));
-}
-
-herr_t
-huge_clear(H5F_t * f, void * thing, hbool_t dest)
-{
- HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE );
- return(clear(f, thing, dest));
-}
-
-herr_t
-monster_clear(H5F_t * f, void * thing, hbool_t dest)
-{
- HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE );
- return(clear(f, thing, dest));
-}
-
-herr_t
-variable_clear(H5F_t * f, void * thing, hbool_t dest)
-{
- HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE );
- return(clear(f, thing, dest));
-}
-
-
-
-/*-------------------------------------------------------------------------
- * Function: dest & friends
- *
- * Purpose: Destroy the entry. The helper functions verify that the
- * correct version of dest is being called, and then call
- * dest proper.
- *
- * Return: SUCCEED
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * 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.
- *
- * JRM -- 8/30/06
- * Added variable_destroy().
- *
- *-------------------------------------------------------------------------
- */
-
-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 = entries1[entry_ptr->type];
-
- HDassert( entry_ptr->index >= 0 );
- HDassert( entry_ptr->index <= max_indices1[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 == H5C1__H5C1_T_MAGIC );
- HDassert( ( entry_ptr->header.destroy_in_progress ) ||
- ( entry_ptr->header.addr == entry_ptr->addr ) );
- HDassert( entry_ptr->header.size == entry_ptr->size );
- HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) ||
- ( entry_ptr->size == entry_sizes1[entry_ptr->type] ) );
-
- 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 = entries1[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_indices1[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_entry1(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);
-
-} /* dest() */
-
-herr_t
-pico_dest(H5F_t * f, void * thing)
-{
- HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE );
- return(destroy(f, thing));
-}
-
-herr_t
-nano_dest(H5F_t * f, void * thing)
-{
- HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE );
- return(destroy(f, thing));
-}
-
-herr_t
-micro_dest(H5F_t * f, void * thing)
-{
- HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE );
- return(destroy(f, thing));
-}
-
-herr_t
-tiny_dest(H5F_t * f, void * thing)
-{
- HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE );
- return(destroy(f, thing));
-}
-
-herr_t
-small_dest(H5F_t * f, void * thing)
-{
- HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE );
- return(destroy(f, thing));
-}
-
-herr_t
-medium_dest(H5F_t * f, void * thing)
-{
- HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE );
- return(destroy(f, thing));
-}
-
-herr_t
-large_dest(H5F_t * f, void * thing)
-{
- HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE );
- return(destroy(f, thing));
-}
-
-herr_t
-huge_dest(H5F_t * f, void * thing)
-{
- HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE );
- return(destroy(f, thing));
-}
-
-herr_t
-monster_dest(H5F_t * f, void * thing)
-{
- HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE );
- return(destroy(f, thing));
-}
-
-herr_t
-variable_dest(H5F_t * f, void * thing)
-{
- HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE );
- return(destroy(f, thing));
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: flush & friends
- *
- * Purpose: flush the entry and mark it as clean. The helper functions
- * verify that the correct version of flush is being called,
- * and then call flush proper.
- *
- * Return: SUCCEED
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- * JRM -- 8/30/06
- * Added variable_flush() and flags_ptr parameter.
- *
- * JRM -- 9/1/06
- * Added support for flush operations.
- *
- *-------------------------------------------------------------------------
- */
-
-herr_t
-flush(H5F_t *f,
- hid_t UNUSED dxpl_id,
- hbool_t dest,
- haddr_t
-#ifdef NDEBUG
- UNUSED
-#endif /* NDEBUG */
- addr,
- void *thing,
- unsigned * flags_ptr)
-{
- int i;
- test_entry_t * entry_ptr;
- test_entry_t * base_addr;
-
- HDassert( thing );
-
- entry_ptr = (test_entry_t *)thing;
- base_addr = entries1[entry_ptr->type];
-
- HDassert( entry_ptr->index >= 0 );
- HDassert( entry_ptr->index <= max_indices1[entry_ptr->type] );
- HDassert( entry_ptr == &(base_addr[entry_ptr->index]) );
- HDassert( entry_ptr == entry_ptr->self );
- HDassert( entry_ptr->header.addr == entry_ptr->addr );
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->header.size == entry_ptr->size );
- HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) ||
- ( entry_ptr->size == entry_sizes1[entry_ptr->type] ) );
- HDassert( entry_ptr->header.is_dirty == entry_ptr->is_dirty );
- HDassert( entry_ptr->cache_ptr != NULL );
- HDassert( entry_ptr->cache_ptr->magic == H5C1__H5C1_T_MAGIC );
- HDassert( entry_ptr->num_flush_ops >= 0 );
- HDassert( entry_ptr->num_flush_ops < MAX_FLUSH_OPS );
-
- if ( entry_ptr->num_flush_ops > 0 ) {
-
- for ( i = 0; i < entry_ptr->num_flush_ops; i++ )
- {
- execute_flush_op1(entry_ptr->cache_ptr,
- entry_ptr,
- &((entry_ptr->flush_ops)[i]),
- flags_ptr);
- }
- entry_ptr->num_flush_ops = 0;
- entry_ptr->flush_op_self_resize_in_progress = FALSE;
- }
-
- entry_ptr->flushed = TRUE;
-
- if ( ( ! write_permitted1 ) && ( entry_ptr->is_dirty ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "called flush when write_permitted1 is FALSE.";
- }
-
- if ( entry_ptr->is_dirty ) {
-
- (entry_ptr->writes)++;
- entry_ptr->is_dirty = FALSE;
- entry_ptr->header.is_dirty = FALSE;
- }
-
- if ( dest ) {
-
- destroy(f, thing);
-
- }
-
- return(SUCCEED);
-
-} /* flush() */
-
-herr_t
-pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
- void *thing, unsigned * flags_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE );
- return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
-}
-
-herr_t
-nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
- void *thing, unsigned * flags_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE );
- return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
-}
-
-herr_t
-micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
- void *thing, unsigned * flags_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE );
- return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
-}
-
-herr_t
-tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
- void *thing, unsigned * flags_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE );
- return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
-}
-
-herr_t
-small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
- void *thing, unsigned * flags_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE );
- return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
-}
-
-herr_t
-medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
- void *thing, unsigned * flags_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE );
- return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
-}
-
-herr_t
-large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
- void *thing, unsigned * flags_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE );
- return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
-}
-
-herr_t
-huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
- void *thing, unsigned * flags_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE );
- return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
-}
-
-herr_t
-monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
- void *thing, unsigned * flags_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE );
- return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
-}
-
-herr_t
-variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
- void *thing, unsigned * flags_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE );
- return(flush(f, dxpl_id, dest, addr, thing, flags_ptr));
-}
-
-
-
-/*-------------------------------------------------------------------------
- * Function: load & friends
- *
- * Purpose: "load" the requested entry and mark it as clean. The
- * helper functions verify that the correct version of load
- * is being called, and then call load proper.
- *
- * Return: SUCCEED
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- * JRM -- 8/30/06
- * Added variable_load().
- *
- *-------------------------------------------------------------------------
- */
-
-void *
-load(H5F_t UNUSED *f,
- hid_t UNUSED dxpl_id,
- haddr_t addr,
- const void UNUSED *udata1,
- void UNUSED *udata2)
-{
- int32_t type;
- int32_t idx;
- test_entry_t * entry_ptr;
- test_entry_t * base_addr;
-
- addr_to_type_and_index1(addr, &type, &idx);
-
- base_addr = entries1[type];
- entry_ptr = &(base_addr[idx]);
-
- HDassert( entry_ptr->type == type );
- HDassert( entry_ptr->type >= 0 );
- HDassert( entry_ptr->type < NUMBER_OF_ENTRY_TYPES );
- HDassert( entry_ptr->index == idx );
- HDassert( entry_ptr->index >= 0 );
- HDassert( entry_ptr->index <= max_indices1[type] );
- HDassert( entry_ptr == entry_ptr->self );
- HDassert( entry_ptr->addr == addr );
-#if 1 /* JRM */
- if ( ! ( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) ||
- ( entry_ptr->size == entry_sizes1[type] ) ) ) {
-
- HDfprintf(stdout, "entry type/index/size = %d/%d/%ld\n",
- (int)(entry_ptr->type),
- (int)(entry_ptr->index),
- (long)(entry_ptr->size));
- }
-#endif /* JRM */
- HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) ||
- ( entry_ptr->size == entry_sizes1[type] ) );
-
- entry_ptr->loaded = TRUE;
-
- entry_ptr->header.is_dirty = FALSE;
- entry_ptr->is_dirty = FALSE;
-
- (entry_ptr->reads)++;
-
- return(entry_ptr);
-
-} /* load() */
-
-void *
-pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2)
-{
- return(load(f, dxpl_id, addr, udata1, udata2));
-}
-
-void *
-nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2)
-{
- return(load(f, dxpl_id, addr, udata1, udata2));
-}
-
-void *
-micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2)
-{
- return(load(f, dxpl_id, addr, udata1, udata2));
-}
-
-void *
-tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2)
-{
- return(load(f, dxpl_id, addr, udata1, udata2));
-}
-
-void *
-small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2)
-{
- return(load(f, dxpl_id, addr, udata1, udata2));
-}
-
-void *
-medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2)
-{
- return(load(f, dxpl_id, addr, udata1, udata2));
-}
-
-void *
-large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2)
-{
- return(load(f, dxpl_id, addr, udata1, udata2));
-}
-
-void *
-huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2)
-{
- return(load(f, dxpl_id, addr, udata1, udata2));
-}
-
-void *
-monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2)
-{
- return(load(f, dxpl_id, addr, udata1, udata2));
-}
-
-void *
-variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2)
-{
- return(load(f, dxpl_id, addr, udata1, udata2));
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: size & friends
- *
- * Purpose: Get the size of the specified entry. The helper functions
- * verify that the correct version of size is being called,
- * and then call size proper.
- *
- * Return: SUCCEED
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- * JRM -- 8/30/06
- * Added variable_size().
- *
- *-------------------------------------------------------------------------
- */
-
-herr_t
-size(H5F_t UNUSED * f,
- void * thing,
- size_t * size_ptr)
-{
- test_entry_t * entry_ptr;
- test_entry_t * base_addr;
-
- HDassert( size_ptr );
- HDassert( thing );
-
- entry_ptr = (test_entry_t *)thing;
- base_addr = entries1[entry_ptr->type];
-
- HDassert( entry_ptr->index >= 0 );
- HDassert( entry_ptr->index <= max_indices1[entry_ptr->type] );
- HDassert( entry_ptr == &(base_addr[entry_ptr->index]) );
- HDassert( entry_ptr == entry_ptr->self );
- HDassert( entry_ptr->header.addr == entry_ptr->addr );
- HDassert( ( entry_ptr->type == VARIABLE_ENTRY_TYPE ) || \
- ( entry_ptr->size == entry_sizes1[entry_ptr->type] ) );
-
- *size_ptr = entry_ptr->size;
-
- return(SUCCEED);
-
-} /* size() */
-
-herr_t
-pico_size(H5F_t * f, void * thing, size_t * size_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE );
- return(size(f, thing, size_ptr));
-}
-
-herr_t
-nano_size(H5F_t * f, void * thing, size_t * size_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE );
- return(size(f, thing, size_ptr));
-}
-
-herr_t
-micro_size(H5F_t * f, void * thing, size_t * size_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE );
- return(size(f, thing, size_ptr));
-}
-
-herr_t
-tiny_size(H5F_t * f, void * thing, size_t * size_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE );
- return(size(f, thing, size_ptr));
-}
-
-herr_t
-small_size(H5F_t * f, void * thing, size_t * size_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE );
- return(size(f, thing, size_ptr));
-}
-
-herr_t
-medium_size(H5F_t * f, void * thing, size_t * size_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE );
- return(size(f, thing, size_ptr));
-}
-
-herr_t
-large_size(H5F_t * f, void * thing, size_t * size_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE );
- return(size(f, thing, size_ptr));
-}
-
-herr_t
-huge_size(H5F_t * f, void * thing, size_t * size_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE );
- return(size(f, thing, size_ptr));
-}
-
-herr_t
-monster_size(H5F_t * f, void * thing, size_t * size_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE );
- return(size(f, thing, size_ptr));
-}
-
-herr_t
-variable_size(H5F_t * f, void * thing, size_t * size_ptr)
-{
- HDassert ( ((test_entry_t *)thing)->type == VARIABLE_ENTRY_TYPE );
- return(size(f, thing, size_ptr));
-}
-
-
-
-/**************************************************************************/
-/**************************************************************************/
-/************************** test utility functions: ***********************/
-/**************************************************************************/
-/**************************************************************************/
-
-/*-------------------------------------------------------------------------
- * Function: add_flush_op1
- *
- * Purpose: Do noting if pass1 is FALSE on entry.
- *
- * Otherwise, add the specified flush operation to the
- * target instance of test_entry_t.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 9/1/06
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-void
-add_flush_op1(int target_type,
- int target_idx,
- int op_code,
- int type,
- int idx,
- hbool_t flag,
- size_t new_size)
-{
- int i;
- test_entry_t * target_base_addr;
- test_entry_t * target_entry_ptr;
-
- HDassert( ( 0 <= target_type ) && ( target_type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= target_idx ) &&
- ( target_idx <= max_indices1[target_type] ) );
- HDassert( ( 0 <= op_code ) && ( op_code <= FLUSH_OP__MAX_OP ) );
- HDassert( ( op_code != FLUSH_OP__RESIZE ) ||
- ( type == VARIABLE_ENTRY_TYPE ) );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
- HDassert( ( flag == TRUE ) || ( flag == FALSE ) );
- HDassert( new_size <= VARIABLE_ENTRY_SIZE );
-
- if ( pass1 ) {
-
- target_base_addr = entries1[target_type];
- target_entry_ptr = &(target_base_addr[target_idx]);
-
- HDassert( target_entry_ptr->index == target_idx );
- HDassert( target_entry_ptr->type == target_type );
- HDassert( target_entry_ptr == target_entry_ptr->self );
- HDassert( target_entry_ptr->num_flush_ops < MAX_FLUSH_OPS );
-
- i = (target_entry_ptr->num_flush_ops)++;
- (target_entry_ptr->flush_ops)[i].op_code = op_code;
- (target_entry_ptr->flush_ops)[i].type = type;
- (target_entry_ptr->flush_ops)[i].idx = idx;
- (target_entry_ptr->flush_ops)[i].flag = flag;
- (target_entry_ptr->flush_ops)[i].size = new_size;
-
- }
-
- return;
-
-} /* add_flush_op1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: create_pinned_entry_dependency1
- *
- * Purpose: Do noting if pass1 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 types1 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_dependency1(H5C1_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 ( pass1 ) {
-
- HDassert( ( 0 <= pinning_type ) &&
- ( pinning_type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= pinning_idx ) &&
- ( pinning_idx <= max_indices1[pinning_type] ) );
- HDassert( ( 0 <= pinned_type ) &&
- ( pinned_type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= pinned_idx ) &&
- ( pinned_idx <= max_indices1[pinned_type] ) );
-
- pinning_base_addr = entries1[pinning_type];
- pinning_entry_ptr = &(pinning_base_addr[pinning_idx]);
-
- pinned_base_addr = entries1[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_entry1(cache_ptr, pinned_type, pinned_idx);
- unprotect_entry1(cache_ptr, pinned_type, pinned_idx, FALSE,
- H5C1__PIN_ENTRY_FLAG);
- }
-
- (pinned_entry_ptr->pinning_ref_count)++;
- }
-
- return;
-
-} /* create_pinned_entry_dependency1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: dirty_entry1
- *
- * Purpose: Given a pointer to a cache, an entry type, and an index,
- * dirty the target entry.
- *
- * If the dirty_pin parameter is true, verify that the
- * target entry is in the cache and is pinned. If it
- * isn't, scream and die. If it is, use the
- * H5C1_mark_pinned_entry_dirty() call to dirty it.
- *
- * Do nothing if pass1 is false on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-dirty_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- hbool_t dirty_pin)
-{
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- if ( pass1 ) {
-
- if ( dirty_pin ) {
-
- if ( ! entry_in_cache1(cache_ptr, type, idx) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "entry to be dirty pinned is not in cache.";
-
- } else {
-
- base_addr = entries1[type];
- entry_ptr = &(base_addr[idx]);
-
- HDassert( entry_ptr->index == idx );
- HDassert( entry_ptr->type == type );
- HDassert( entry_ptr == entry_ptr->self );
-
- if ( ! ( (entry_ptr->header).is_pinned ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "entry to be dirty pinned is not pinned.";
-
- } else {
-
- mark_pinned_entry_dirty1(cache_ptr, type, idx, FALSE, (size_t)0);
-
- }
- }
- } else {
-
- protect_entry1(cache_ptr, type, idx);
- unprotect_entry1(cache_ptr, type, idx, TRUE, H5C1__NO_FLAGS_SET);
- }
- }
-
- return;
-
-} /* dirty_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: execute_flush_op1
- *
- * Purpose: Given a pointer to an instance of struct flush_op, execute
- * it.
- *
- * Do nothing if pass1 is false on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 9/1/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-execute_flush_op1(H5C1_t * cache_ptr,
- struct test_entry_t * entry_ptr,
- struct flush_op * op_ptr,
- unsigned * flags_ptr)
-{
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C1__H5C1_T_MAGIC );
- HDassert( entry_ptr != NULL );
- HDassert( entry_ptr = entry_ptr->self );
- HDassert( entry_ptr->header.addr == entry_ptr->addr );
- HDassert( ( entry_ptr->flush_op_self_resize_in_progress ) ||
- ( entry_ptr->header.size == entry_ptr->size ) );
- HDassert( op_ptr != NULL );
- HDassert( ( 0 <= entry_ptr->type ) &&
- ( entry_ptr->type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= entry_ptr->index ) &&
- ( entry_ptr->index <= max_indices1[entry_ptr->type] ) );
- HDassert( ( 0 <= op_ptr->type ) &&
- ( op_ptr->type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= op_ptr->idx ) &&
- ( op_ptr->idx <= max_indices1[op_ptr->type] ) );
- HDassert( ( op_ptr->flag == FALSE ) || ( op_ptr->flag == TRUE ) );
- HDassert( flags_ptr != NULL );
-
- if ( pass1 ) {
-
- switch ( op_ptr->op_code )
- {
- case FLUSH_OP__NO_OP:
- break;
-
- case FLUSH_OP__DIRTY:
- HDassert( ( entry_ptr->type != op_ptr->type ) ||
- ( entry_ptr->index != op_ptr->idx ) );
-
- dirty_entry1(cache_ptr, op_ptr->type, op_ptr->idx, op_ptr->flag);
- break;
-
- case FLUSH_OP__RESIZE:
- if ( ( entry_ptr->type == op_ptr->type ) &&
- ( entry_ptr->index == op_ptr->idx ) ) {
-
- /* the flush operation is acting on the entry to
- * which it is attached. Handle this here:
- */
- HDassert( entry_ptr->type == VARIABLE_ENTRY_TYPE );
- HDassert( op_ptr->size > 0 );
- HDassert( op_ptr->size <= VARIABLE_ENTRY_SIZE );
-
- entry_ptr->size = op_ptr->size;
- (*flags_ptr) |= H5C1_CALLBACK__SIZE_CHANGED_FLAG;
- entry_ptr->flush_op_self_resize_in_progress = TRUE;
-
- /* if the entry is in the process of being destroyed,
- * set the header size to match the entry size so as
- * to avoid a spurious failure in the destroy callback.
- */
- if ( entry_ptr->header.destroy_in_progress ) {
-
- entry_ptr->header.size = entry_ptr->size;
- }
-
- } else {
-
- /* change the size of some other entry */
-
- resize_entry1(cache_ptr, op_ptr->type, op_ptr->idx,
- op_ptr->size, op_ptr->flag);
- }
- break;
-
- case FLUSH_OP__RENAME:
- rename_entry1(cache_ptr, op_ptr->type, op_ptr->idx,
- op_ptr->flag);
- break;
-
- default:
- pass1 = FALSE;
- failure_mssg1 = "Undefined flush op code.";
- break;
- }
- }
-
- return;
-
-} /* execute_flush_op1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: entry_in_cache1
- *
- * Purpose: Given a pointer to a cache, an entry type, and an index,
- * determine if the entry is currently in the cache.
- *
- * Return: TRUE if the entry is in the cache, and FALSE otherwise.
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- * JRM - 10/12/04
- * Removed references to local_H5C1_t, as we now get direct
- * access to the definition of H5C1_t via H5Cpkg.h.
- *
- *-------------------------------------------------------------------------
- */
-
-hbool_t
-entry_in_cache1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx)
-{
- hbool_t in_cache = FALSE; /* will set to TRUE if necessary */
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
- H5C1_cache_entry_t * test_ptr = NULL;
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- base_addr = entries1[type];
- entry_ptr = &(base_addr[idx]);
-
- HDassert( entry_ptr->index == idx );
- HDassert( entry_ptr->type == type );
- HDassert( entry_ptr == entry_ptr->self );
-
- H5C1__SEARCH_INDEX(cache_ptr, entry_ptr->addr, test_ptr)
-
- if ( test_ptr != NULL ) {
-
- in_cache = TRUE;
- HDassert( test_ptr == (H5C1_cache_entry_t *)entry_ptr );
- HDassert( entry_ptr->addr == entry_ptr->header.addr );
- }
-
- return(in_cache);
-
-} /* entry_in_cache1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: reset_entries1
- *
- * Purpose: reset the contents of the entries arrays to know values.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- * JRM -- 3/31/06
- * Added initialization for new pinned entry test related
- * fields.
- *
- * JRM -- 4/1/07
- * Added initialization for the new is_read_only, and
- * ro_ref_count fields.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-reset_entries1(void)
-
-{
- int i;
- int j;
- int k;
- int32_t max_index;
- haddr_t addr = 0;
- haddr_t alt_addr = PICO_ALT_BASE_ADDR;
- size_t entry_size;
- test_entry_t * base_addr;
-
- for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ )
- {
- entry_size = entry_sizes1[i];
- max_index = max_indices1[i];
- base_addr = entries1[i];
-
- HDassert( base_addr );
-
- for ( j = 0; j <= max_index; j++ )
- {
- /* one can argue that we should fill the header with garbage.
- * If this is desired, we can simply comment out the header
- * initialization - the headers will be full of garbage soon
- * enough.
- */
-
- base_addr[j].header.addr = (haddr_t)0;
- base_addr[j].header.size = (size_t)0;
- base_addr[j].header.type = NULL;
- base_addr[j].header.is_dirty = FALSE;
- base_addr[j].header.is_protected = FALSE;
- base_addr[j].header.is_read_only = FALSE;
- base_addr[j].header.ro_ref_count = FALSE;
- base_addr[j].header.next = NULL;
- base_addr[j].header.prev = NULL;
- base_addr[j].header.aux_next = NULL;
- 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;
- base_addr[j].alt_addr = alt_addr;
- base_addr[j].size = entry_size;
- base_addr[j].type = i;
- base_addr[j].index = j;
- base_addr[j].reads = 0;
- base_addr[j].writes = 0;
- base_addr[j].is_dirty = FALSE;
- base_addr[j].is_protected = FALSE;
- base_addr[j].is_read_only = FALSE;
- base_addr[j].ro_ref_count = 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].num_flush_ops = 0;
- for ( k = 0; k < MAX_FLUSH_OPS; k++ )
- {
- base_addr[j].flush_ops[k].op_code = FLUSH_OP__NO_OP;
- base_addr[j].flush_ops[k].type = -1;
- base_addr[j].flush_ops[k].idx = -1;
- base_addr[j].flush_ops[k].flag = FALSE;
- base_addr[j].flush_ops[k].size = 0;
- }
- base_addr[j].flush_op_self_resize_in_progress = FALSE;
-
- base_addr[j].loaded = FALSE;
- base_addr[j].cleared = FALSE;
- base_addr[j].flushed = FALSE;
- base_addr[j].destroyed = FALSE;
-
- addr += (haddr_t)entry_size;
- alt_addr += (haddr_t)entry_size;
- }
- }
-
- return;
-
-} /* reset_entries1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: resize_entry1
- *
- * Purpose: Given a pointer to a cache, an entry type, an index, and
- * a size, set the size of the target entry to the size. Note
- * that at present, the type of the entry must be
- * VARIABLE_ENTRY_TYPE.
- *
- * If the resize_pin parameter is true, verify that the
- * target entry is in the cache and is pinned. If it
- * isn't, scream and die. If it is, use the
- * H5C1_mark_pinned_entry_dirty() call to resize it.
- *
- * Do nothing if pass1 is false on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-resize_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- size_t new_size,
- hbool_t resize_pin)
-{
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( type == VARIABLE_ENTRY_TYPE );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
- HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes1[type] ) );
-
- if ( pass1 ) {
-
- base_addr = entries1[type];
- entry_ptr = &(base_addr[idx]);
-
- HDassert( entry_ptr->index == idx );
- HDassert( entry_ptr->type == type );
- HDassert( entry_ptr == entry_ptr->self );
-
- if ( resize_pin ) {
-
- if ( ! entry_in_cache1(cache_ptr, type, idx) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "entry to be resized pinned is not in cache.";
-
- } else {
-
- if ( ! ( (entry_ptr->header).is_pinned ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "entry to be resized pinned is not pinned.";
-
- } else {
-
- mark_pinned_entry_dirty1(cache_ptr, type, idx,
- TRUE, new_size);
- }
- }
- } else {
-
- protect_entry1(cache_ptr, type, idx);
- unprotect_entry1_with_size_change(cache_ptr, type, idx,
- H5C1__SIZE_CHANGED_FLAG, new_size);
- }
- }
-
- return;
-
-} /* resize_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: resize_pinned_entry1
- *
- * Purpose: Given a pointer to a cache, an entry type, an index, and
- * a new size, change the size of the target pinned entry
- * to match the supplied new size.
- *
- * Do nothing if pass1 is false on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 1/11/08
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-resize_pinned_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- size_t new_size)
-{
- herr_t result;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
- HDassert( type = VARIABLE_ENTRY_TYPE ) ;
- HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes1[type] ) );
-
- if ( pass1 ) {
-
- if ( ! entry_in_cache1(cache_ptr, type, idx) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "entry not in cache.";
-
- } else {
-
- base_addr = entries1[type];
- entry_ptr = &(base_addr[idx]);
-
- HDassert( entry_ptr->index == idx );
- HDassert( entry_ptr->type == type );
- HDassert( entry_ptr == entry_ptr->self );
-
- if ( ! ( (entry_ptr->header).is_pinned ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "entry to be resized is not pinned.";
-
- } else {
-
- entry_ptr->size = new_size;
-
- result = H5C1_resize_pinned_entry(cache_ptr,
- (void *)entry_ptr,
- new_size);
-
- if ( result != SUCCEED ) {
-
- pass1 = FALSE;
- failure_mssg1 = "error(s) in H5C1_resize_pinned_entry().";
-
- } else {
-
- HDassert( entry_ptr->size = (entry_ptr->header).size );
-
- }
- }
- }
- }
-
- return;
-
-} /* resize_pinned_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: verify_clean1
- *
- * Purpose: Verify that all cache entries are marked as clean. If any
- * are not, set pass1 to FALSE.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-void
-verify_clean1(void)
-
-{
- int i;
- int j;
- int dirty_count = 0;
- int32_t max_index;
- test_entry_t * base_addr;
-
- if ( pass1 ) {
-
- for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ )
- {
- max_index = max_indices1[i];
- base_addr = entries1[i];
-
- HDassert( base_addr );
-
- for ( j = 0; j <= max_index; j++ )
- {
- if ( ( base_addr[j].header.is_dirty ) ||
- ( base_addr[j].is_dirty ) ) {
-
- dirty_count++;
- }
- }
- }
-
- if ( dirty_count > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "verify_clean1() found dirty entry(s).";
- }
- }
-
- return;
-
-} /* verify_clean1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: verify_entry_status1
- *
- * Purpose: Verify that a list of entries have the expected status.
- * If any discrepencies are found, set the failure message
- * and set pass1 to FALSE.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 10/8/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-void
-verify_entry_status1(H5C1_t * cache_ptr,
- int tag,
- int num_entries,
- struct expected_entry_status expected[])
-{
- static char msg[128];
- hbool_t in_cache = FALSE; /* will set to TRUE if necessary */
- int i;
- test_entry_t * entry_ptr;
- test_entry_t * base_addr;
-
- i = 0;
- while ( ( pass1 ) && ( i < num_entries ) )
- {
- base_addr = entries1[expected[i].entry_type];
- entry_ptr = &(base_addr[expected[i].entry_index]);
-
- if ( ( ! expected[i].in_cache ) &&
- ( ( expected[i].is_dirty ) ||
- ( expected[i].is_protected ) ||
- ( expected[i].is_pinned ) ) ) {
-
- pass1 = FALSE;
- sprintf(msg, "Contradictory data in expected[%d].\n", i);
- failure_mssg1 = msg;
- }
-
- if ( pass1 ) {
-
- in_cache = entry_in_cache1(cache_ptr, expected[i].entry_type,
- expected[i].entry_index);
-
- if ( in_cache != expected[i].in_cache ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) in cache actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)in_cache,
- (int)expected[i].in_cache);
- failure_mssg1 = msg;
- }
- }
-
- if ( pass1 ) {
-
- if ( entry_ptr->size != expected[i].size ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) size actualexpected = %ld/%ld.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (long)(entry_ptr->size),
- (long)expected[i].size);
- failure_mssg1 = msg;
- }
- }
-
- if ( ( pass1 ) && ( in_cache ) ) {
-
- if ( entry_ptr->header.size != expected[i].size ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) header size actual/expected = %ld/%ld.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (long)(entry_ptr->header.size),
- (long)expected[i].size);
- failure_mssg1 = msg;
- }
- }
-
- if ( pass1 ) {
-
- if ( entry_ptr->at_main_addr != expected[i].at_main_addr ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) at main addr actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->at_main_addr),
- (int)expected[i].at_main_addr);
- failure_mssg1 = msg;
- }
- }
-
- if ( pass1 ) {
-
- if ( entry_ptr->is_dirty != expected[i].is_dirty ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) is_dirty actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->is_dirty),
- (int)expected[i].is_dirty);
- failure_mssg1 = msg;
- }
- }
-
- if ( ( pass1 ) && ( in_cache ) ) {
-
- if ( entry_ptr->header.is_dirty != expected[i].is_dirty ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) header is_dirty actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->header.is_dirty),
- (int)expected[i].is_dirty);
- failure_mssg1 = msg;
- }
- }
-
- if ( pass1 ) {
-
- if ( entry_ptr->is_protected != expected[i].is_protected ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) is_protected actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->is_protected),
- (int)expected[i].is_protected);
- failure_mssg1 = msg;
- }
- }
-
- if ( ( pass1 ) && ( in_cache ) ) {
-
- if ( entry_ptr->header.is_protected != expected[i].is_protected ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) header is_protected actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->header.is_protected),
- (int)expected[i].is_protected);
- failure_mssg1 = msg;
- }
- }
-
- if ( pass1 ) {
-
- if ( entry_ptr->is_pinned != expected[i].is_pinned ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) is_pinned actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->is_pinned),
- (int)expected[i].is_pinned);
- failure_mssg1 = msg;
- }
- }
-
- if ( ( pass1 ) && ( in_cache ) ) {
-
- if ( entry_ptr->header.is_pinned != expected[i].is_pinned ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d, %d) header is_pinned actual/expected = %d/%d.\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->header.is_pinned),
- (int)expected[i].is_pinned);
- failure_mssg1 = msg;
- }
- }
-
- if ( pass1 ) {
-
- if ( ( entry_ptr->loaded != expected[i].loaded ) ||
- ( entry_ptr->cleared != expected[i].cleared ) ||
- ( entry_ptr->flushed != expected[i].flushed ) ||
- ( entry_ptr->destroyed != expected[i].destroyed ) ) {
-
- pass1 = FALSE;
- sprintf(msg,
- "%d entry (%d,%d) loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n",
- tag,
- (int)expected[i].entry_type,
- (int)expected[i].entry_index,
- (int)(entry_ptr->loaded),
- (int)(expected[i].loaded),
- (int)(entry_ptr->cleared),
- (int)(expected[i].cleared),
- (int)(entry_ptr->flushed),
- (int)(expected[i].flushed),
- (int)(entry_ptr->destroyed),
- (int)(expected[i].destroyed));
- failure_mssg1 = msg;
- }
- }
- i++;
- } /* while */
-
- return;
-
-} /* verify_entry_status1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: verify_unprotected1
- *
- * Purpose: Verify that no cache entries are marked as protected. If
- * any are, set pass1 to FALSE.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/10/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-void
-verify_unprotected1(void)
-
-{
- int i;
- int j;
- int protected_count = 0;
- int32_t max_index;
- test_entry_t * base_addr;
-
- if ( pass1 ) {
-
- for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ )
- {
- max_index = max_indices1[i];
- base_addr = entries1[i];
-
- HDassert( base_addr );
-
- for ( j = 0; j <= max_index; j++ )
- {
- HDassert( base_addr[j].header.is_protected ==
- base_addr[j].is_protected );
-
- if ( ( base_addr[j].header.is_protected ) ||
- ( base_addr[j].is_protected ) ) {
-
- protected_count++;
- }
- }
- }
-
- if ( protected_count > 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "verify_unprotected1() found protected entry(s).";
- }
- }
-
- return;
-
-} /* verify_unprotected1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: setup_cache1()
- *
- * Purpose: Allocate a cache of the desired size and configure it for
- * use in the test bed. Return a pointer to the new cache
- * structure.
- *
- * Return: Pointer to new cache, or NULL on failure.
- *
- * Programmer: John Mainzer
- * 6/11/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-H5C1_t *
-setup_cache1(size_t max_cache_size,
- size_t min_clean_size)
-{
- H5C1_t * cache_ptr = NULL;
-
- cache_ptr = H5C1_create(max_cache_size,
- min_clean_size,
- (NUMBER_OF_ENTRY_TYPES - 1),
- (const char **)entry_type_names1,
- check_write_permitted1,
- TRUE,
- NULL,
- NULL);
-
- if ( cache_ptr == NULL ) {
-
- pass1 = FALSE;
- failure_mssg1 = "H5C1_create() returned NULL.";
-
- } else {
-
- H5C1_set_skip_flags(cache_ptr, TRUE, TRUE);
- }
-
- return(cache_ptr);
-
-} /* setup_cache1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: takedown_cache1()
- *
- * Purpose: Flush the specified cache and disable it. If requested,
- * dump stats first. If pass1 is FALSE, do nothing.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/11/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-void
-takedown_cache1(H5C1_t * cache_ptr,
- hbool_t dump_stats,
- hbool_t dump_detailed_stats)
-{
- HDassert(cache_ptr);
-
- if ( pass1 ) {
-
- if ( dump_stats ) {
-
- H5C1_stats(cache_ptr, "test cache", dump_detailed_stats);
- }
-
- H5C1_dest(NULL, -1, -1, cache_ptr);
- }
-
- return;
-
-} /* takedown_cache1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: expunge_entry1()
- *
- * Purpose: Expunge the entry indicated by the type and index.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 7/6/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-expunge_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx)
-{
- /* const char * fcn_name = "expunge_entry1()"; */
- herr_t result;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- if ( pass1 ) {
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- base_addr = entries1[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->is_protected ) );
- HDassert( ! ( entry_ptr->header.is_pinned ) );
- HDassert( ! ( entry_ptr->is_pinned ) );
-
- result = H5C1_expunge_entry(NULL, -1, -1, cache_ptr, &(types1[type]),
- entry_ptr->addr);
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "error in H5C1_expunge_entry().";
-
- }
- }
-
- return;
-
-} /* expunge_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: flush_cache1()
- *
- * Purpose: Flush the specified cache, destroying all entries if
- requested. If requested, dump stats first.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/23/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-void
-flush_cache1(H5C1_t * cache_ptr,
- hbool_t destroy_entries,
- hbool_t dump_stats,
- hbool_t dump_detailed_stats)
-{
- herr_t result = 0;
-
- HDassert(cache_ptr);
-
- verify_unprotected1();
-
- if ( pass1 ) {
-
- if ( destroy_entries ) {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__FLUSH_INVALIDATE_FLAG);
-
- } else {
-
- result = H5C1_flush_cache(NULL, -1, -1, cache_ptr,
- H5C1__NO_FLAGS_SET);
- }
- }
-
- if ( dump_stats ) {
-
- H5C1_stats(cache_ptr, "test cache", dump_detailed_stats);
- }
-
- if ( result < 0 ) {
-
- pass1 = FALSE;
- failure_mssg1 = "error in H5C1_flush_cache().";
- }
-
- return;
-
-} /* flush_cache1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: insert_entry1()
- *
- * Purpose: Insert the entry indicated by the type and index. Mark
- * it clean or dirty as indicated.
- *
- * Note that I don't see much practical use for inserting
- * a clean entry, but the interface permits it so we should
- * test it.
- *
- * Do nothing if pass1 is false.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/16/04
- *
- * Modifications:
- *
- * JRM -- 1/13/05
- * Updated function for the flags parameter in
- * H5C1_insert_entry(), and to allow access to this parameter.
- *
- * JRM -- 6/17/05
- * 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.
- *
- * JRM -- 8/10/06
- * Updated to reflect the fact that entries can now be
- * inserted pinned.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-insert_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- hbool_t UNUSED dirty,
- unsigned int flags)
-{
- herr_t result;
- hbool_t insert_pinned;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- if ( pass1 ) {
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- base_addr = entries1[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->is_protected) );
-
- insert_pinned = ((flags & H5C1__PIN_ENTRY_FLAG) != 0 );
-
- entry_ptr->is_dirty = TRUE;
-
- result = H5C1_insert_entry(NULL, -1, -1, cache_ptr, &(types1[type]),
- entry_ptr->addr, (void *)entry_ptr, flags);
-
- if ( ( result < 0 ) ||
- ( entry_ptr->header.is_protected ) ||
- ( entry_ptr->header.type != &(types1[type]) ) ||
- ( entry_ptr->size != entry_ptr->header.size ) ||
- ( entry_ptr->addr != entry_ptr->header.addr ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "error in H5C1_insert().";
-
-#if 0 /* This is useful debugging code. Lets keep it around. */
-
- 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 != &(types1[type]) = %d\n",
- (int)(entry_ptr->header.type != &(types1[type])));
- HDfprintf(stdout,
- "entry_ptr->size != entry_ptr->header.size = %d\n",
- (int)(entry_ptr->size != entry_ptr->header.size));
- HDfprintf(stdout,
- "entry_ptr->addr != entry_ptr->header.addr = %d\n",
- (int)(entry_ptr->addr != entry_ptr->header.addr));
-#endif
- }
- HDassert( entry_ptr->cache_ptr == NULL );
-
- entry_ptr->cache_ptr = cache_ptr;
-
- if ( insert_pinned ) {
-
- HDassert( entry_ptr->header.is_pinned );
- entry_ptr->is_pinned = TRUE;
-
- } else {
-
- HDassert( ! ( entry_ptr->header.is_pinned ) );
- entry_ptr->is_pinned = FALSE;
-
- }
- HDassert( entry_ptr->header.is_dirty );
- HDassert( ((entry_ptr->header).type)->id == type );
- }
-
- return;
-
-} /* insert_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: mark_pinned_entry_dirty1()
- *
- * Purpose: Mark the specified entry as dirty.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 3/28/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-mark_pinned_entry_dirty1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- hbool_t size_changed,
- size_t new_size)
-{
- /* const char * fcn_name = "mark_pinned_entry_dirty1()"; */
- herr_t result;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- if ( pass1 ) {
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- base_addr = entries1[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;
-
- if ( size_changed ) {
-
- /* update entry size now to keep the sanity checks happy */
- entry_ptr->size = new_size;
- }
-
- result = H5C1_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 != &(types1[type]) ) ||
- ( entry_ptr->size != entry_ptr->header.size ) ||
- ( entry_ptr->addr != entry_ptr->header.addr ) ) {
-
-#if 0 /* This is useful debugging code -- keep it around */
- HDfprintf(stdout, "result = %ld.\n", (long)result);
- HDfprintf(stdout, "entry_ptr->header.is_dirty = %d.\n",
- (int)(entry_ptr->header.is_dirty));
- HDfprintf(stdout, "entry_ptr->header.is_pinned = %d.\n",
- (int)(entry_ptr->header.is_pinned));
- HDfprintf(stdout,
- "(entry_ptr->header.type != &(types1[type])) = %d.\n",
- (int)(entry_ptr->header.type != &(types1[type])));
- HDfprintf(stdout,
- "entry_ptr->size = %ld, entry_ptr->header.size = %ld.\n",
- (long)(entry_ptr->size), (long)(entry_ptr->header.size));
- HDfprintf(stdout,
- "entry_ptr->addr = %ld, entry_ptr->header.addr = %ld.\n",
- (long)(entry_ptr->addr), (long)(entry_ptr->header.addr));
-#endif
- pass1 = FALSE;
- failure_mssg1 = "error in H5C1_mark_pinned_entry_dirty().";
-
- }
-
- HDassert( ((entry_ptr->header).type)->id == type );
-
- }
-
- return;
-
-} /* mark_pinned_entry_dirty1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: mark_pinned_or_protected_entry_dirty1()
- *
- * Purpose: Mark the specified entry as dirty.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 5/17/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-mark_pinned_or_protected_entry_dirty1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx)
-{
- /* const char * fcn_name = "mark_pinned_or_protected_entry_dirty1()"; */
- herr_t result;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- if ( pass1 ) {
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- base_addr = entries1[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 ||
- entry_ptr->header.is_pinned );
-
- entry_ptr->is_dirty = TRUE;
-
- result = H5C1_mark_pinned_or_protected_entry_dirty(cache_ptr,
- (void *)entry_ptr);
-
- if ( ( result < 0 )
- ||
- ( ( ! (entry_ptr->header.is_protected) )
- &&
- ( ! (entry_ptr->header.is_pinned) )
- )
- ||
- ( ( entry_ptr->header.is_protected )
- &&
- ( ! ( entry_ptr->header.dirtied ) )
- )
- ||
- ( ( ! ( entry_ptr->header.is_protected ) )
- &&
- ( ! ( entry_ptr->header.is_dirty ) )
- )
- ||
- ( entry_ptr->header.type != &(types1[type]) )
- ||
- ( entry_ptr->size != entry_ptr->header.size )
- ||
- ( entry_ptr->addr != entry_ptr->header.addr ) ) {
-
- pass1 = FALSE;
- failure_mssg1 =
- "error in H5C1_mark_pinned_or_protected_entry_dirty().";
-
- }
-
- HDassert( ((entry_ptr->header).type)->id == type );
-
- }
-
- return;
-
-} /* mark_pinned_or_protected_entry_dirty1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: rename_entry1()
- *
- * Purpose: Rename the entry indicated by the type and index to its
- * main or alternate address as indicated. If the entry is
- * already at the desired entry, do nothing.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/21/04
- *
- * Modifications:
- *
- * JRM -- 6/17/05
- * Updated code to reflect the fact that renames automatically
- * dirty entries.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-rename_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- hbool_t main_addr)
-{
- herr_t result;
- hbool_t done = TRUE; /* will set to FALSE if we have work to do */
- haddr_t old_addr = HADDR_UNDEF;
- haddr_t new_addr = HADDR_UNDEF;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- base_addr = entries1[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->is_protected) );
- HDassert( !(entry_ptr->header.is_protected) );
-
-
- if ( entry_ptr->at_main_addr && !main_addr ) {
-
- /* rename to alt addr */
-
- HDassert( entry_ptr->addr == entry_ptr->main_addr );
-
- done = FALSE;
- old_addr = entry_ptr->addr;
- new_addr = entry_ptr->alt_addr;
-
- } else if ( !(entry_ptr->at_main_addr) && main_addr ) {
-
- /* rename to main addr */
-
- HDassert( entry_ptr->addr == entry_ptr->alt_addr );
-
- done = FALSE;
- old_addr = entry_ptr->addr;
- new_addr = entry_ptr->main_addr;
- }
-
- if ( ! done ) {
-
- entry_ptr->is_dirty = TRUE;
-
- result = H5C1_rename_entry(cache_ptr, &(types1[type]),
- old_addr, new_addr);
- }
-
- if ( ! done ) {
-
- if ( ( result < 0 ) ||
- ( ( ! ( entry_ptr->header.destroy_in_progress ) ) &&
- ( entry_ptr->header.addr != new_addr ) ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "error in H5C1_rename_entry().";
-
- } else {
-
- entry_ptr->addr = new_addr;
- entry_ptr->at_main_addr = main_addr;
- }
- }
-
- HDassert( ((entry_ptr->header).type)->id == type );
-
- HDassert( entry_ptr->header.is_dirty );
- HDassert( entry_ptr->is_dirty );
-
- return;
-
-} /* rename_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: protect_entry1()
- *
- * Purpose: Protect the entry indicated by the type and index.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/11/04
- *
- * Modifications:
- *
- * - Modified call to H5C1_protect to pass1 H5C1__NO_FLAGS_SET in the
- * new flags parameter.
- * JRM -- 3/28/07
- *
- *-------------------------------------------------------------------------
- */
-
-void
-protect_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx)
-{
- /* const char * fcn_name = "protect_entry1()"; */
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
- H5C1_cache_entry_t * cache_entry_ptr;
-
- if ( pass1 ) {
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- base_addr = entries1[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->is_protected) );
-
- cache_entry_ptr = H5C1_protect(NULL, -1, -1, cache_ptr, &(types1[type]),
- entry_ptr->addr, NULL, NULL,
- H5C1__NO_FLAGS_SET);
-
- if ( ( cache_entry_ptr != (void *)entry_ptr ) ||
- ( !(entry_ptr->header.is_protected) ) ||
- ( entry_ptr->header.type != &(types1[type]) ) ||
- ( entry_ptr->size != entry_ptr->header.size ) ||
- ( entry_ptr->addr != entry_ptr->header.addr ) ) {
-
-#if 0
- /* I've written the following debugging code several times
- * now. Lets keep it around so I don't have to write it
- * again.
- * - JRM
- */
- HDfprintf(stdout, "( cache_entry_ptr != (void *)entry_ptr ) = %d\n",
- (int)( cache_entry_ptr != (void *)entry_ptr ));
- HDfprintf(stdout, "cache_entry_ptr = 0x%lx, entry_ptr = 0x%lx\n",
- (long)cache_entry_ptr, (long)entry_ptr);
- HDfprintf(stdout, "entry_ptr->header.is_protected = %d\n",
- (int)(entry_ptr->header.is_protected));
- HDfprintf(stdout,
- "( entry_ptr->header.type != &(types1[type]) ) = %d\n",
- (int)( entry_ptr->header.type != &(types1[type]) ));
- HDfprintf(stdout,
- "entry_ptr->size = %d, entry_ptr->header.size = %d\n",
- (int)(entry_ptr->size), (int)(entry_ptr->header.size));
- HDfprintf(stdout,
- "entry_ptr->addr = %d, entry_ptr->header.addr = %d\n",
- (int)(entry_ptr->addr), (int)(entry_ptr->header.addr));
-#endif
- pass1 = FALSE;
- failure_mssg1 = "error in H5C1_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;
-
- }
-
- HDassert( ((entry_ptr->header).type)->id == type );
- }
-
- return;
-
-} /* protect_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: protect_entry_ro1()
- *
- * Purpose: Do a read only protect the entry indicated by the type
- * and index.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 4/1/07
- *
- * Modifications:
- *
- * - None.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-protect_entry_ro1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx)
-{
- /* const char * fcn_name = "protect_entry_ro1()"; */
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
- H5C1_cache_entry_t * cache_entry_ptr;
-
- if ( pass1 ) {
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- base_addr = entries1[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->is_protected ) ) ||
- ( ( entry_ptr->is_read_only ) &&
- ( entry_ptr->ro_ref_count > 0 ) ) );
-
- cache_entry_ptr = H5C1_protect(NULL, -1, -1, cache_ptr, &(types1[type]),
- entry_ptr->addr, NULL, NULL,
- H5C1__READ_ONLY_FLAG);
-
- if ( ( cache_entry_ptr != (void *)entry_ptr ) ||
- ( !(entry_ptr->header.is_protected) ) ||
- ( !(entry_ptr->header.is_read_only) ) ||
- ( entry_ptr->header.ro_ref_count <= 0 ) ||
- ( entry_ptr->header.type != &(types1[type]) ) ||
- ( entry_ptr->size != entry_ptr->header.size ) ||
- ( entry_ptr->addr != entry_ptr->header.addr ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "error in read only H5C1_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;
- entry_ptr->is_read_only = TRUE;
- entry_ptr->ro_ref_count++;
- }
-
- HDassert( ((entry_ptr->header).type)->id == type );
- }
-
- return;
-
-} /* protect_entry_ro1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: unpin_entry1()
- *
- * Purpose: Unpin the entry indicated by the type and index.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 3/28/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-unpin_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx)
-{
- /* const char * fcn_name = "unpin_entry1()"; */
- herr_t result;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- if ( pass1 ) {
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- base_addr = entries1[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 = H5C1_unpin_entry(cache_ptr, (void *)entry_ptr);
-
- if ( ( result < 0 ) ||
- ( entry_ptr->header.is_pinned ) ||
- ( entry_ptr->header.type != &(types1[type]) ) ||
- ( entry_ptr->size != entry_ptr->header.size ) ||
- ( entry_ptr->addr != entry_ptr->header.addr ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "error in H5C1_unpin().";
-
- }
-
- entry_ptr->is_pinned = FALSE;
-
- HDassert( ((entry_ptr->header).type)->id == type );
-
- }
-
- return;
-
-} /* unpin_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: unprotect_entry1()
- *
- * Purpose: Unprotect the entry indicated by the type and index.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/12/04
- *
- * Modifications:
- *
- * JRM -- 1/7/05
- * Updated for the replacement of the deleted parameter in
- * H5C1_unprotect() with the new flags parameter.
- *
- * JRM - 6/17/05
- * Modified function to use the new dirtied parameter of
- * H5C1_unprotect().
- *
- * JRM -- 9/8/05
- * Update for new entry size parameter in H5C1_unprotect().
- * We don't use them here for now.
- *
- * JRM -- 3/31/06
- * Update for pinned entries.
- *
- * JRM -- 4/1/07
- * Updated for new multiple read protects.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-unprotect_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- int dirty,
- unsigned int flags)
-{
- /* const char * fcn_name = "unprotect_entry1()"; */
- herr_t result;
- hbool_t pin_flag_set;
- hbool_t unpin_flag_set;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- if ( pass1 ) {
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
-
- base_addr = entries1[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->is_protected );
-
- pin_flag_set = ((flags & H5C1__PIN_ENTRY_FLAG) != 0 );
- unpin_flag_set = ((flags & H5C1__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 ? H5C1__DIRTIED_FLAG : H5C1__NO_FLAGS_SET);
- entry_ptr->is_dirty = (entry_ptr->is_dirty || dirty);
- }
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr, &(types1[type]),
- entry_ptr->addr, (void *)entry_ptr,
- flags, (size_t)0);
-
- if ( ( result < 0 ) ||
- ( ( entry_ptr->header.is_protected ) &&
- ( ( ! ( entry_ptr->is_read_only ) ) ||
- ( entry_ptr->ro_ref_count <= 0 ) ) ) ||
- ( entry_ptr->header.type != &(types1[type]) ) ||
- ( entry_ptr->size != entry_ptr->header.size ) ||
- ( entry_ptr->addr != entry_ptr->header.addr ) ) {
-
-#if 1 /* JRM */
- if ( result < 0 ) {
- HDfprintf(stdout, "result is negative.\n");
- }
- if ( ( entry_ptr->header.is_protected ) &&
- ( ( ! ( entry_ptr->is_read_only ) ) ||
- ( entry_ptr->ro_ref_count <= 0 ) ) ) {
- HDfprintf(stdout, "protected and not RO or refcnt <= 0.\n");
- }
- if ( entry_ptr->header.type != &(types1[type]) ) {
- HDfprintf(stdout, "type disagreement.\n");
- }
- if ( entry_ptr->size != entry_ptr->header.size ) {
- HDfprintf(stdout, "size disagreement.\n");
- }
- if ( entry_ptr->addr != entry_ptr->header.addr ) {
- HDfprintf(stdout, "addr disagreement.\n");
- }
-#endif /* JRM */
-
- pass1 = FALSE;
- failure_mssg1 = "error in H5C1_unprotect().";
-
- }
- else
- {
- if ( entry_ptr->ro_ref_count > 1 ) {
-
- entry_ptr->ro_ref_count--;
-
- } else if ( entry_ptr->ro_ref_count == 1 ) {
-
- entry_ptr->is_protected = FALSE;
- entry_ptr->is_read_only = FALSE;
- entry_ptr->ro_ref_count = 0;
-
- } 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 );
-
- if ( ( flags & H5C1__DIRTIED_FLAG ) != 0
- && ( (flags & H5C1__DELETED_FLAG) == 0 ) ) {
-
- HDassert( entry_ptr->header.is_dirty );
- HDassert( entry_ptr->is_dirty );
- }
-
- HDassert( entry_ptr->header.is_protected == entry_ptr->is_protected );
- HDassert( entry_ptr->header.is_read_only == entry_ptr->is_read_only );
- HDassert( entry_ptr->header.ro_ref_count == entry_ptr->ro_ref_count );
- }
-
- return;
-
-} /* unprotect_entry1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: unprotect_entry1_with_size_change()
- *
- * Purpose: Version of unprotect_entry1() that allow access to the new
- * size change parameters in H5C1_unprotect_entry1()
- *
- * At present, only the sizes of VARIABLE_ENTRY_TYPE entries
- * can be changed. Thus this function will scream and die
- * if the H5C1__SIZE_CHANGED_FLAG is set and the type is not
- * VARIABLE_ENTRY_TYPE.
- *
- * Do nothing if pass1 is FALSE on entry.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 8/31/06
- *
- * Modifications:
- *
- * None.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-unprotect_entry1_with_size_change(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- unsigned int flags,
- size_t new_size)
-{
- /* const char * fcn_name = "unprotect_entry1_with_size_change()"; */
- herr_t result;
- hbool_t dirty_flag_set;
- hbool_t pin_flag_set;
- hbool_t unpin_flag_set;
- hbool_t size_changed_flag_set;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
-
- if ( pass1 ) {
-
- HDassert( cache_ptr );
- HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= idx ) && ( idx <= max_indices1[type] ) );
- HDassert( new_size <= entry_sizes1[type] );
-
- base_addr = entries1[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->is_protected );
-
- dirty_flag_set = ((flags & H5C1__DIRTIED_FLAG) != 0 );
- pin_flag_set = ((flags & H5C1__PIN_ENTRY_FLAG) != 0 );
- unpin_flag_set = ((flags & H5C1__UNPIN_ENTRY_FLAG) != 0 );
- size_changed_flag_set = ((flags & H5C1__SIZE_CHANGED_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 ) );
- HDassert ( ( ! size_changed_flag_set ) || ( new_size > 0 ) );
- HDassert ( ( ! size_changed_flag_set ) ||
- ( type == VARIABLE_ENTRY_TYPE ) );
-
- entry_ptr->is_dirty = (entry_ptr->is_dirty || dirty_flag_set);
-
- if ( size_changed_flag_set ) {
-
- entry_ptr->is_dirty = TRUE;
- entry_ptr->size = new_size;
- }
-
- result = H5C1_unprotect(NULL, -1, -1, cache_ptr, &(types1[type]),
- entry_ptr->addr, (void *)entry_ptr,
- flags, new_size);
-
- if ( ( result < 0 ) ||
- ( entry_ptr->header.is_protected ) ||
- ( entry_ptr->header.type != &(types1[type]) ) ||
- ( entry_ptr->size != entry_ptr->header.size ) ||
- ( entry_ptr->addr != entry_ptr->header.addr ) ) {
-
- pass1 = FALSE;
- failure_mssg1 = "error in H5C1_unprotect().";
-
- }
- 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 );
-
- if ( ( flags & H5C1__DIRTIED_FLAG ) != 0
- && ( (flags & H5C1__DELETED_FLAG) == 0 ) ) {
-
- HDassert( entry_ptr->header.is_dirty );
- HDassert( entry_ptr->is_dirty );
- }
- }
-
- return;
-
-} /* unprotect_entry1_with_size_change() */
-
-
-/*-------------------------------------------------------------------------
- * Function: row_major_scan_forward1()
- *
- * Purpose: Do a sequence of inserts, protects, unprotects, renames,
- * destroys while scanning through the set of entries. If
- * pass1 is false on entry, do nothing.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/12/04
- *
- * Modifications:
- *
- * JRM -- 4/4/07
- * Added code supporting multiple read only protects.
- * Note that this increased the minimum lag to 10.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-row_major_scan_forward1(H5C1_t * cache_ptr,
- int32_t lag,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- hbool_t do_renames,
- hbool_t rename_to_main_addr,
- hbool_t do_destroys,
- hbool_t do_mult_ro_protects,
- int dirty_destroys,
- int dirty_unprotects)
-{
- const char * fcn_name = "row_major_scan_forward1";
- int32_t type;
- int32_t idx;
-
- if ( verbose )
- HDfprintf(stdout, "%s(): entering.\n", fcn_name);
-
- HDassert( lag >= 10 );
-
- type = 0;
-
- if ( ( pass1 ) && ( reset_stats ) ) {
-
- H5C1_stats__reset(cache_ptr);
- }
-
- while ( ( pass1 ) && ( type < NUMBER_OF_ENTRY_TYPES ) )
- {
- idx = -lag;
-
- while ( ( pass1 ) && ( idx <= (max_indices1[type] + lag) ) )
- {
- if ( verbose ) {
-
- HDfprintf(stdout, "%d:%d: ", type, idx);
- }
-
- if ( ( pass1 ) && ( do_inserts ) && ( (idx + lag) >= 0 ) &&
- ( (idx + lag) <= max_indices1[type] ) &&
- ( ((idx + lag) % 2) == 0 ) &&
- ( ! entry_in_cache1(cache_ptr, type, (idx + lag)) ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag));
-
- insert_entry1(cache_ptr, type, (idx + lag), dirty_inserts,
- H5C1__NO_FLAGS_SET);
- }
-
-
- if ( ( pass1 ) && ( (idx + lag - 1) >= 0 ) &&
- ( (idx + lag - 1) <= max_indices1[type] ) &&
- ( ( (idx + lag - 1) % 3 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, (idx + lag - 1));
-
- protect_entry1(cache_ptr, type, (idx + lag - 1));
- }
-
- if ( ( pass1 ) && ( (idx + lag - 2) >= 0 ) &&
- ( (idx + lag - 2) <= max_indices1[type] ) &&
- ( ( (idx + lag - 2) % 3 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2));
-
- unprotect_entry1(cache_ptr, type, idx+lag-2, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
- }
-
-
- if ( ( pass1 ) && ( do_renames ) && ( (idx + lag - 2) >= 0 ) &&
- ( (idx + lag - 2) <= max_indices1[type] ) &&
- ( ( (idx + lag - 2) % 3 ) == 0 ) ) {
-
- rename_entry1(cache_ptr, type, (idx + lag - 2),
- rename_to_main_addr);
- }
-
-
- if ( ( pass1 ) && ( (idx + lag - 3) >= 0 ) &&
- ( (idx + lag - 3) <= max_indices1[type] ) &&
- ( ( (idx + lag - 3) % 5 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, (idx + lag - 3));
-
- protect_entry1(cache_ptr, type, (idx + lag - 3));
- }
-
- if ( ( pass1 ) && ( (idx + lag - 5) >= 0 ) &&
- ( (idx + lag - 5) <= max_indices1[type] ) &&
- ( ( (idx + lag - 5) % 5 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 5));
-
- unprotect_entry1(cache_ptr, type, idx+lag-5, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
- }
-
- if ( do_mult_ro_protects )
- {
- if ( ( pass1 ) && ( (idx + lag - 5) >= 0 ) &&
- ( (idx + lag - 5) < max_indices1[type] ) &&
- ( (idx + lag - 5) % 9 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p-ro, %d, %d) ", type,
- (idx + lag - 5));
-
- protect_entry_ro1(cache_ptr, type, (idx + lag - 5));
- }
-
- if ( ( pass1 ) && ( (idx + lag - 6) >= 0 ) &&
- ( (idx + lag - 6) < max_indices1[type] ) &&
- ( (idx + lag - 6) % 11 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p-ro, %d, %d) ", type,
- (idx + lag - 6));
-
- protect_entry_ro1(cache_ptr, type, (idx + lag - 6));
- }
-
- if ( ( pass1 ) && ( (idx + lag - 7) >= 0 ) &&
- ( (idx + lag - 7) < max_indices1[type] ) &&
- ( (idx + lag - 7) % 13 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p-ro, %d, %d) ", type,
- (idx + lag - 7));
-
- protect_entry_ro1(cache_ptr, type, (idx + lag - 7));
- }
-
- if ( ( pass1 ) && ( (idx + lag - 7) >= 0 ) &&
- ( (idx + lag - 7) < max_indices1[type] ) &&
- ( (idx + lag - 7) % 9 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u-ro, %d, %d) ", type,
- (idx + lag - 7));
-
- unprotect_entry1(cache_ptr, type, (idx + lag - 7),
- FALSE, H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) && ( (idx + lag - 8) >= 0 ) &&
- ( (idx + lag - 8) < max_indices1[type] ) &&
- ( (idx + lag - 8) % 11 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u-ro, %d, %d) ", type,
- (idx + lag - 8));
-
- unprotect_entry1(cache_ptr, type, (idx + lag - 8),
- FALSE, H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) && ( (idx + lag - 9) >= 0 ) &&
- ( (idx + lag - 9) < max_indices1[type] ) &&
- ( (idx + lag - 9) % 13 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u-ro, %d, %d) ", type,
- (idx + lag - 9));
-
- unprotect_entry1(cache_ptr, type, (idx + lag - 9),
- FALSE, H5C1__NO_FLAGS_SET);
- }
- } /* if ( do_mult_ro_protects ) */
-
- if ( ( pass1 ) && ( idx >= 0 ) && ( idx <= max_indices1[type] ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, idx);
-
- protect_entry1(cache_ptr, type, idx);
- }
-
- if ( ( pass1 ) && ( (idx - lag + 2) >= 0 ) &&
- ( (idx - lag + 2) <= max_indices1[type] ) &&
- ( ( (idx - lag + 2) % 7 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2));
-
- unprotect_entry1(cache_ptr, type, idx-lag+2, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) && ( (idx - lag + 1) >= 0 ) &&
- ( (idx - lag + 1) <= max_indices1[type] ) &&
- ( ( (idx - lag + 1) % 7 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, (idx - lag + 1));
-
- protect_entry1(cache_ptr, type, (idx - lag + 1));
- }
-
-
- if ( do_destroys ) {
-
- if ( ( pass1 ) && ( (idx - lag) >= 0 ) &&
- ( ( idx - lag) <= max_indices1[type] ) ) {
-
- switch ( (idx - lag) %4 ) {
-
- case 0: /* we just did an insert */
- unprotect_entry1(cache_ptr, type, idx - lag,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- break;
-
- case 1:
- if ( (entries1[type])[idx-lag].is_dirty ) {
-
- unprotect_entry1(cache_ptr, type, idx - lag,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- } else {
-
- unprotect_entry1(cache_ptr, type, idx - lag,
- dirty_unprotects,
- H5C1__NO_FLAGS_SET);
- }
- break;
-
- case 2: /* we just did an insrt */
- unprotect_entry1(cache_ptr, type, idx - lag,
- NO_CHANGE, H5C1__DELETED_FLAG);
- break;
-
- case 3:
- if ( (entries1[type])[idx-lag].is_dirty ) {
-
- unprotect_entry1(cache_ptr, type, idx - lag,
- NO_CHANGE, H5C1__DELETED_FLAG);
- } else {
-
- unprotect_entry1(cache_ptr, type, idx - lag,
- dirty_destroys,
- H5C1__DELETED_FLAG);
- }
- break;
-
- default:
- HDassert(0); /* this can't happen... */
- break;
- }
- }
-
- } else {
-
- if ( ( pass1 ) && ( (idx - lag) >= 0 ) &&
- ( ( idx - lag) <= max_indices1[type] ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag));
-
- unprotect_entry1(cache_ptr, type, idx - lag,
- dirty_unprotects, H5C1__NO_FLAGS_SET);
- }
- }
-
- if ( verbose )
- HDfprintf(stdout, "\n");
-
- idx++;
- }
- type++;
- }
-
- if ( ( pass1 ) && ( display_stats ) ) {
-
- H5C1_stats(cache_ptr, "test cache", display_detailed_stats);
- }
-
- return;
-
-} /* row_major_scan_forward1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: hl_row_major_scan_forward1()
- *
- * Purpose: Do a high locality sequence of inserts, protects, and
- * unprotects while scanning through the set of entries.
- * If pass1 is false on entry, do nothing.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 10/21/04
- *
- * Modifications:
- *
- * JRM -- 1/21/05
- * Added the max_index parameter to allow the caller to
- * throttle the size of the inner loop, and thereby the
- * execution time of the function.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-hl_row_major_scan_forward1(H5C1_t * cache_ptr,
- int32_t max_index,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts)
-{
- const char * fcn_name = "hl_row_major_scan_forward1";
- int32_t type;
- int32_t idx;
- int32_t i;
- int32_t lag = 100;
- int32_t local_max_index;
-
- if ( verbose )
- HDfprintf(stdout, "%s(): entering.\n", fcn_name);
-
- HDassert( lag > 5 );
- HDassert( max_index >= 200 );
- HDassert( max_index <= MAX_ENTRIES );
-
- type = 0;
-
- if ( ( pass1 ) && ( reset_stats ) ) {
-
- H5C1_stats__reset(cache_ptr);
- }
-
- while ( ( pass1 ) && ( type < NUMBER_OF_ENTRY_TYPES ) )
- {
- idx = -lag;
-
- local_max_index = MIN(max_index, max_indices1[type]);
-
- while ( ( pass1 ) && ( idx <= (local_max_index + lag) ) )
- {
- if ( ( pass1 ) && ( do_inserts ) && ( (idx + lag) >= 0 ) &&
- ( (idx + lag) <= max_indices1[type] ) &&
- ( ((idx + lag) % 2) == 0 ) &&
- ( ! entry_in_cache1(cache_ptr, type, (idx + lag)) ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag));
-
- insert_entry1(cache_ptr, type, (idx + lag), dirty_inserts,
- H5C1__NO_FLAGS_SET);
- }
-
- i = idx;
-
- while ( ( pass1 ) && ( i >= idx - lag ) && ( i >= 0 ) )
- {
- if ( ( pass1 ) && ( i >= 0 ) && ( i <= local_max_index ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, i);
-
- protect_entry1(cache_ptr, type, i);
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, i);
-
- unprotect_entry1(cache_ptr, type, i, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
- }
- i--;
- }
-
- if ( verbose )
- HDfprintf(stdout, "\n");
-
- idx++;
- }
- type++;
- }
-
- if ( ( pass1 ) && ( display_stats ) ) {
-
- H5C1_stats(cache_ptr, "test cache", display_detailed_stats);
- }
-
- return;
-
-} /* hl_row_major_scan_forward1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: row_major_scan_backward1()
- *
- * Purpose: Do a sequence of inserts, protects, unprotects, renames,
- * destroys while scanning backwards through the set of
- * entries. If pass1 is false on entry, do nothing.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/12/04
- *
- * Modifications:
- *
- * JRM -- 4/4/07
- * Added code supporting multiple read only protects.
- * Note that this increased the minimum lag to 10.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-row_major_scan_backward1(H5C1_t * cache_ptr,
- int32_t lag,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- hbool_t do_renames,
- hbool_t rename_to_main_addr,
- hbool_t do_destroys,
- hbool_t do_mult_ro_protects,
- int dirty_destroys,
- int dirty_unprotects)
-{
- const char * fcn_name = "row_major_scan_backward1";
- int32_t type;
- int32_t idx;
-
- if ( verbose )
- HDfprintf(stdout, "%s(): Entering.\n", fcn_name);
-
- HDassert( lag >= 10 );
-
- type = NUMBER_OF_ENTRY_TYPES - 1;
-
- if ( ( pass1 ) && ( reset_stats ) ) {
-
- H5C1_stats__reset(cache_ptr);
- }
-
- while ( ( pass1 ) && ( type >= 0 ) )
- {
- idx = max_indices1[type] + lag;
-
- while ( ( pass1 ) && ( idx >= -lag ) )
- {
- if ( ( pass1 ) && ( do_inserts ) && ( (idx - lag) >= 0 ) &&
- ( (idx - lag) <= max_indices1[type] ) &&
- ( ((idx - lag) % 2) == 1 ) &&
- ( ! entry_in_cache1(cache_ptr, type, (idx - lag)) ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(i, %d, %d) ", type, (idx - lag));
-
- insert_entry1(cache_ptr, type, (idx - lag), dirty_inserts,
- H5C1__NO_FLAGS_SET);
- }
-
-
- if ( ( pass1 ) && ( (idx - lag + 1) >= 0 ) &&
- ( (idx - lag + 1) <= max_indices1[type] ) &&
- ( ( (idx - lag + 1) % 3 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, (idx - lag + 1));
-
- protect_entry1(cache_ptr, type, (idx - lag + 1));
- }
-
- if ( ( pass1 ) && ( (idx - lag + 2) >= 0 ) &&
- ( (idx - lag + 2) <= max_indices1[type] ) &&
- ( ( (idx - lag + 2) % 3 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2));
-
- unprotect_entry1(cache_ptr, type, idx-lag+2, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
- }
-
-
- if ( ( pass1 ) && ( do_renames ) && ( (idx - lag + 2) >= 0 ) &&
- ( (idx - lag + 2) <= max_indices1[type] ) &&
- ( ( (idx - lag + 2) % 3 ) == 0 ) ) {
-
- rename_entry1(cache_ptr, type, (idx - lag + 2),
- rename_to_main_addr);
- }
-
-
- if ( ( pass1 ) && ( (idx - lag + 3) >= 0 ) &&
- ( (idx - lag + 3) <= max_indices1[type] ) &&
- ( ( (idx - lag + 3) % 5 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, (idx - lag + 3));
-
- protect_entry1(cache_ptr, type, (idx - lag + 3));
- }
-
- if ( ( pass1 ) && ( (idx - lag + 5) >= 0 ) &&
- ( (idx - lag + 5) <= max_indices1[type] ) &&
- ( ( (idx - lag + 5) % 5 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 5));
-
- unprotect_entry1(cache_ptr, type, idx-lag+5, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
- }
-
- if ( do_mult_ro_protects )
- {
- if ( ( pass1 ) && ( (idx - lag + 5) >= 0 ) &&
- ( (idx - lag + 5) < max_indices1[type] ) &&
- ( (idx - lag + 5) % 9 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p-ro, %d, %d) ", type,
- (idx - lag + 5));
-
- protect_entry_ro1(cache_ptr, type, (idx - lag + 5));
- }
-
- if ( ( pass1 ) && ( (idx - lag + 6) >= 0 ) &&
- ( (idx - lag + 6) < max_indices1[type] ) &&
- ( (idx - lag + 6) % 11 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p-ro, %d, %d) ", type,
- (idx - lag + 6));
-
- protect_entry_ro1(cache_ptr, type, (idx - lag + 6));
- }
-
- if ( ( pass1 ) && ( (idx - lag + 7) >= 0 ) &&
- ( (idx - lag + 7) < max_indices1[type] ) &&
- ( (idx - lag + 7) % 13 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p-ro, %d, %d) ", type,
- (idx - lag + 7));
-
- protect_entry_ro1(cache_ptr, type, (idx - lag + 7));
- }
-
- if ( ( pass1 ) && ( (idx - lag + 7) >= 0 ) &&
- ( (idx - lag + 7) < max_indices1[type] ) &&
- ( (idx - lag + 7) % 9 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u-ro, %d, %d) ", type,
- (idx - lag + 7));
-
- unprotect_entry1(cache_ptr, type, (idx - lag + 7),
- FALSE, H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) && ( (idx - lag + 8) >= 0 ) &&
- ( (idx - lag + 8) < max_indices1[type] ) &&
- ( (idx - lag + 8) % 11 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u-ro, %d, %d) ", type,
- (idx - lag + 8));
-
- unprotect_entry1(cache_ptr, type, (idx - lag + 8),
- FALSE, H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) && ( (idx - lag + 9) >= 0 ) &&
- ( (idx - lag + 9) < max_indices1[type] ) &&
- ( (idx - lag + 9) % 13 == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u-ro, %d, %d) ", type,
- (idx - lag + 9));
-
- unprotect_entry1(cache_ptr, type, (idx - lag + 9),
- FALSE, H5C1__NO_FLAGS_SET);
- }
- } /* if ( do_mult_ro_protects ) */
-
- if ( ( pass1 ) && ( idx >= 0 ) && ( idx <= max_indices1[type] ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, idx);
-
- protect_entry1(cache_ptr, type, idx);
- }
-
-
- if ( ( pass1 ) && ( (idx + lag - 2) >= 0 ) &&
- ( (idx + lag - 2) <= max_indices1[type] ) &&
- ( ( (idx + lag - 2) % 7 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2));
-
- unprotect_entry1(cache_ptr, type, idx+lag-2, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) && ( (idx + lag - 1) >= 0 ) &&
- ( (idx + lag - 1) <= max_indices1[type] ) &&
- ( ( (idx + lag - 1) % 7 ) == 0 ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, (idx + lag - 1));
-
- protect_entry1(cache_ptr, type, (idx + lag - 1));
- }
-
-
- if ( do_destroys ) {
-
- if ( ( pass1 ) && ( (idx + lag) >= 0 ) &&
- ( ( idx + lag) <= max_indices1[type] ) ) {
-
- switch ( (idx + lag) %4 ) {
-
- case 0:
- if ( (entries1[type])[idx+lag].is_dirty ) {
-
- unprotect_entry1(cache_ptr, type, idx + lag,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- } else {
-
- unprotect_entry1(cache_ptr, type, idx + lag,
- dirty_unprotects,
- H5C1__NO_FLAGS_SET);
- }
- break;
-
- case 1: /* we just did an insert */
- unprotect_entry1(cache_ptr, type, idx + lag,
- NO_CHANGE, H5C1__NO_FLAGS_SET);
- break;
-
- case 2:
- if ( (entries1[type])[idx + lag].is_dirty ) {
-
- unprotect_entry1(cache_ptr, type, idx + lag,
- NO_CHANGE, H5C1__DELETED_FLAG);
- } else {
-
- unprotect_entry1(cache_ptr, type, idx + lag,
- dirty_destroys,
- H5C1__DELETED_FLAG);
- }
- break;
-
- case 3: /* we just did an insrt */
- unprotect_entry1(cache_ptr, type, idx + lag,
- NO_CHANGE, H5C1__DELETED_FLAG);
- break;
-
- default:
- HDassert(0); /* this can't happen... */
- break;
- }
- }
- } else {
-
- if ( ( pass1 ) && ( (idx + lag) >= 0 ) &&
- ( ( idx + lag) <= max_indices1[type] ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag));
-
- unprotect_entry1(cache_ptr, type, idx + lag,
- dirty_unprotects, H5C1__NO_FLAGS_SET);
- }
- }
-
- if ( verbose )
- HDfprintf(stdout, "\n");
-
- idx--;
- }
- type--;
- }
-
- if ( ( pass1 ) && ( display_stats ) ) {
-
- H5C1_stats(cache_ptr, "test cache", display_detailed_stats);
- }
-
- return;
-
-} /* row_major_scan_backward1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: hl_row_major_scan_backward1()
- *
- * Purpose: Do a high locality sequence of inserts, protects, and
- * unprotects while scanning through the set of entries.
- * If pass1 is false on entry, do nothing.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 10/21/04
- *
- * Modifications:
- *
- * JRM -- 1/21/05
- * Added the max_index parameter to allow the caller to
- * throttle the size of the inner loop, and thereby the
- * execution time of the function.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-hl_row_major_scan_backward1(H5C1_t * cache_ptr,
- int32_t max_index,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts)
-{
- const char * fcn_name = "hl_row_major_scan_backward1";
- int32_t type;
- int32_t idx;
- int32_t i;
- int32_t lag = 100;
- int32_t local_max_index;
-
- if ( verbose )
- HDfprintf(stdout, "%s(): entering.\n", fcn_name);
-
- HDassert( lag > 5 );
- HDassert( max_index >= 200 );
- HDassert( max_index <= MAX_ENTRIES );
-
- type = NUMBER_OF_ENTRY_TYPES - 1;
-
- if ( ( pass1 ) && ( reset_stats ) ) {
-
- H5C1_stats__reset(cache_ptr);
- }
-
- while ( ( pass1 ) && ( type >= 0 ) )
- {
- idx = max_indices1[type] + lag;
-
- local_max_index = MIN(max_index, max_indices1[type]);
-
- while ( ( pass1 ) && ( idx >= -lag ) )
- {
- if ( ( pass1 ) && ( do_inserts ) && ( (idx + lag) >= 0 ) &&
- ( (idx + lag) <= local_max_index ) &&
- ( ((idx + lag) % 2) == 0 ) &&
- ( ! entry_in_cache1(cache_ptr, type, (idx + lag)) ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag));
-
- insert_entry1(cache_ptr, type, (idx + lag), dirty_inserts,
- H5C1__NO_FLAGS_SET);
- }
-
- i = idx;
-
- while ( ( pass1 ) && ( i >= idx - lag ) && ( i >= 0 ) )
- {
- if ( ( pass1 ) && ( i >= 0 ) && ( i <= local_max_index ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, i);
-
- protect_entry1(cache_ptr, type, i);
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, i);
-
- unprotect_entry1(cache_ptr, type, i, NO_CHANGE,
- H5C1__NO_FLAGS_SET);
- }
- i--;
- }
-
- if ( verbose )
- HDfprintf(stdout, "\n");
-
- idx--;
- }
- type--;
- }
-
- if ( ( pass1 ) && ( display_stats ) ) {
-
- H5C1_stats(cache_ptr, "test cache", display_detailed_stats);
- }
-
- return;
-
-} /* hl_row_major_scan_backward1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: col_major_scan_forward1()
- *
- * Purpose: Do a sequence of inserts, protects, and unprotects
- * while scanning through the set of entries. If
- * pass1 is false on entry, do nothing.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/23/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-void
-col_major_scan_forward1(H5C1_t * cache_ptr,
- int32_t lag,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- int dirty_unprotects)
-{
- const char * fcn_name = "col_major_scan_forward1()";
- int32_t type;
- int32_t idx;
-
- if ( verbose )
- HDfprintf(stdout, "%s: entering.\n", fcn_name);
-
- HDassert( lag > 5 );
-
- type = 0;
-
- if ( ( pass1 ) && ( reset_stats ) ) {
-
- H5C1_stats__reset(cache_ptr);
- }
-
- idx = -lag;
-
- while ( ( pass1 ) && ( (idx - lag) <= MAX_ENTRIES ) )
- {
- type = 0;
-
- while ( ( pass1 ) && ( type < NUMBER_OF_ENTRY_TYPES ) )
- {
- if ( ( pass1 ) && ( do_inserts ) && ( (idx + lag) >= 0 ) &&
- ( (idx + lag) <= max_indices1[type] ) &&
- ( ((idx + lag) % 3) == 0 ) &&
- ( ! entry_in_cache1(cache_ptr, type, (idx + lag)) ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag));
-
- insert_entry1(cache_ptr, type, (idx + lag), dirty_inserts,
- H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) && ( idx >= 0 ) && ( idx <= max_indices1[type] ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, idx);
-
- protect_entry1(cache_ptr, type, idx);
- }
-
- if ( ( pass1 ) && ( (idx - lag) >= 0 ) &&
- ( (idx - lag) <= max_indices1[type] ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag));
-
- unprotect_entry1(cache_ptr, type, idx - lag,
- dirty_unprotects, H5C1__NO_FLAGS_SET);
- }
-
- if ( verbose )
- HDfprintf(stdout, "\n");
-
- type++;
- }
-
- idx++;
- }
-
- if ( ( pass1 ) && ( display_stats ) ) {
-
- H5C1_stats(cache_ptr, "test cache", display_detailed_stats);
- }
-
- return;
-
-} /* col_major_scan_forward1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: hl_col_major_scan_forward1()
- *
- * Purpose: Do a high locality sequence of inserts, protects, and
- * unprotects while scanning through the set of entries. If
- * pass1 is false on entry, do nothing.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 19/25/04
- *
- * Modifications:
- *
- * JRM -- 1/21/05
- * Added the max_index parameter to allow the caller to
- * throttle the size of the inner loop, and thereby the
- * execution time of the function.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-hl_col_major_scan_forward1(H5C1_t * cache_ptr,
- int32_t max_index,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- int dirty_unprotects)
-{
- const char * fcn_name = "hl_col_major_scan_forward1()";
- int32_t type;
- int32_t idx;
- int32_t lag = 200;
- int32_t i;
- int32_t local_max_index;
-
- if ( verbose )
- HDfprintf(stdout, "%s: entering.\n", fcn_name);
-
- HDassert( lag > 5 );
- HDassert( max_index >= 500 );
- HDassert( max_index <= MAX_ENTRIES );
-
- type = 0;
-
- if ( ( pass1 ) && ( reset_stats ) ) {
-
- H5C1_stats__reset(cache_ptr);
- }
-
- idx = 0;
-
- local_max_index = MIN(max_index, MAX_ENTRIES);
-
- while ( ( pass1 ) && ( idx <= local_max_index ) )
- {
-
- i = idx;
-
- while ( ( pass1 ) && ( i >= 0 ) && ( i >= (idx - lag) ) ) {
-
- type = 0;
-
- while ( ( pass1 ) && ( type < NUMBER_OF_ENTRY_TYPES ) )
- {
- if ( ( pass1 ) && ( do_inserts ) && ( i == idx ) &&
- ( i <= local_max_index ) &&
- ( (i % 3) == 0 ) &&
- ( ! entry_in_cache1(cache_ptr, type, i) ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(i, %d, %d) ", type, i);
-
- insert_entry1(cache_ptr, type, i, dirty_inserts,
- H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) && ( i >= 0 ) && ( i <= local_max_index ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, i);
-
- protect_entry1(cache_ptr, type, i);
- }
-
- if ( ( pass1 ) && ( i >= 0 ) &&
- ( i <= max_indices1[type] ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, i);
-
- unprotect_entry1(cache_ptr, type, i,
- dirty_unprotects, H5C1__NO_FLAGS_SET);
- }
-
- if ( verbose )
- HDfprintf(stdout, "\n");
-
- type++;
- }
-
- i--;
- }
-
- idx++;
- }
-
- if ( ( pass1 ) && ( display_stats ) ) {
-
- H5C1_stats(cache_ptr, "test cache", display_detailed_stats);
- }
-
- return;
-
-} /* hl_col_major_scan_forward1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: col_major_scan_backward1()
- *
- * Purpose: Do a sequence of inserts, protects, and unprotects
- * while scanning backwards through the set of
- * entries. If pass1 is false on entry, do nothing.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 6/23/04
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-void
-col_major_scan_backward1(H5C1_t * cache_ptr,
- int32_t lag,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- int dirty_unprotects)
-{
- const char * fcn_name = "col_major_scan_backward1()";
- int mile_stone = 1;
- int32_t type;
- int32_t idx;
-
- if ( verbose )
- HDfprintf(stdout, "%s: entering.\n", fcn_name);
-
- HDassert( lag > 5 );
-
- if ( ( pass1 ) && ( reset_stats ) ) {
-
- H5C1_stats__reset(cache_ptr);
- }
-
- idx = MAX_ENTRIES + lag;
-
- if ( verbose ) /* 1 */
- HDfprintf(stdout, "%s: point %d.\n", fcn_name, mile_stone++);
-
-
- while ( ( pass1 ) && ( (idx + lag) >= 0 ) )
- {
- type = NUMBER_OF_ENTRY_TYPES - 1;
-
- while ( ( pass1 ) && ( type >= 0 ) )
- {
- if ( ( pass1 ) && ( do_inserts) && ( (idx - lag) >= 0 ) &&
- ( (idx - lag) <= max_indices1[type] ) &&
- ( ((idx - lag) % 3) == 0 ) &&
- ( ! entry_in_cache1(cache_ptr, type, (idx - lag)) ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(i, %d, %d) ", type, (idx - lag));
-
- insert_entry1(cache_ptr, type, (idx - lag), dirty_inserts,
- H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) && ( idx >= 0 ) && ( idx <= max_indices1[type] ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, idx);
-
- protect_entry1(cache_ptr, type, idx);
- }
-
- if ( ( pass1 ) && ( (idx + lag) >= 0 ) &&
- ( (idx + lag) <= max_indices1[type] ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag));
-
- unprotect_entry1(cache_ptr, type, idx + lag,
- dirty_unprotects, H5C1__NO_FLAGS_SET);
- }
-
- if ( verbose )
- HDfprintf(stdout, "\n");
-
- type--;
- }
-
- idx--;
- }
-
- if ( verbose ) /* 2 */
- HDfprintf(stdout, "%s: point %d.\n", fcn_name, mile_stone++);
-
- if ( ( pass1 ) && ( display_stats ) ) {
-
- H5C1_stats(cache_ptr, "test cache", display_detailed_stats);
- }
-
- if ( verbose )
- HDfprintf(stdout, "%s: exiting.\n", fcn_name);
-
- return;
-
-} /* col_major_scan_backward1() */
-
-
-/*-------------------------------------------------------------------------
- * Function: hl_col_major_scan_backward1()
- *
- * Purpose: Do a high locality sequence of inserts, protects, and
- * unprotects while scanning backwards through the set of
- * entries. If pass1 is false on entry, do nothing.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 10/25/04
- *
- * Modifications:
- *
- * JRM -- 1/21/05
- * Added the max_index parameter to allow the caller to
- * throttle the size of the inner loop, and thereby the
- * execution time of the function.
- *
- *-------------------------------------------------------------------------
- */
-
-void
-hl_col_major_scan_backward1(H5C1_t * cache_ptr,
- int32_t max_index,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- int dirty_unprotects)
-{
- const char * fcn_name = "hl_col_major_scan_backward1()";
- int32_t type;
- int32_t idx;
- int32_t lag = 50;
- int32_t i;
- int32_t local_max_index;
-
- if ( verbose )
- HDfprintf(stdout, "%s: entering.\n", fcn_name);
-
- HDassert( lag > 5 );
- HDassert( max_index >= 500 );
- HDassert( max_index <= MAX_ENTRIES );
-
- type = 0;
-
- local_max_index = MIN(max_index, MAX_ENTRIES);
-
- if ( ( pass1 ) && ( reset_stats ) ) {
-
- H5C1_stats__reset(cache_ptr);
- }
-
- idx = local_max_index;
-
- while ( ( pass1 ) && ( idx >= 0 ) )
- {
-
- i = idx;
-
- while ( ( pass1 ) && ( i <= local_max_index ) && ( i <= (idx + lag) ) ) {
-
- type = 0;
-
- while ( ( pass1 ) && ( type < NUMBER_OF_ENTRY_TYPES ) )
- {
- if ( ( pass1 ) && ( do_inserts ) && ( i == idx ) &&
- ( i <= local_max_index ) &&
- ( ! entry_in_cache1(cache_ptr, type, i) ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(i, %d, %d) ", type, i);
-
- insert_entry1(cache_ptr, type, i, dirty_inserts,
- H5C1__NO_FLAGS_SET);
- }
-
- if ( ( pass1 ) && ( i >= 0 ) && ( i <= local_max_index ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(p, %d, %d) ", type, i);
-
- protect_entry1(cache_ptr, type, i);
- }
-
- if ( ( pass1 ) && ( i >= 0 ) &&
- ( i <= local_max_index ) ) {
-
- if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, i);
-
- unprotect_entry1(cache_ptr, type, i,
- dirty_unprotects, H5C1__NO_FLAGS_SET);
- }
-
- if ( verbose )
- HDfprintf(stdout, "\n");
-
- type++;
- }
-
- i++;
- }
-
- idx--;
- }
-
- if ( ( pass1 ) && ( display_stats ) ) {
-
- H5C1_stats(cache_ptr, "test cache", display_detailed_stats);
- }
-
- return;
-
-} /* hl_col_major_scan_backward1() */
-
diff --git a/test/cache1_common.h b/test/cache1_common.h
deleted file mode 100644
index ac9c680..0000000
--- a/test/cache1_common.h
+++ /dev/null
@@ -1,786 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* Programmer: John Mainzer
- * 10/27/05
- *
- * This file contains common #defines, type definitions, and
- * externs for tests of the cache implemented in H5C.c
- */
-#include "h5test.h"
-#include "H5Iprivate.h"
-#include "H5AC1private.h"
-
-#define H5C1_PACKAGE /*suppress error about including H5Cpkg */
-
-#include "H5C1pkg.h"
-
-#define H5F_PACKAGE /*suppress error about including H5Fpkg */
-
-#include "H5Fpkg.h"
-
-#define NO_CHANGE -1
-
-/* with apologies for the abuse of terminology... */
-
-#define PICO_ENTRY_TYPE 0
-#define NANO_ENTRY_TYPE 1
-#define MICRO_ENTRY_TYPE 2
-#define TINY_ENTRY_TYPE 3
-#define SMALL_ENTRY_TYPE 4
-#define MEDIUM_ENTRY_TYPE 5
-#define LARGE_ENTRY_TYPE 6
-#define HUGE_ENTRY_TYPE 7
-#define MONSTER_ENTRY_TYPE 8
-#define VARIABLE_ENTRY_TYPE 9
-
-#define NUMBER_OF_ENTRY_TYPES 10
-
-#define PICO_ENTRY_SIZE (size_t)1
-#define NANO_ENTRY_SIZE (size_t)4
-#define MICRO_ENTRY_SIZE (size_t)16
-#define TINY_ENTRY_SIZE (size_t)64
-#define SMALL_ENTRY_SIZE (size_t)256
-#define MEDIUM_ENTRY_SIZE (size_t)1024
-#define LARGE_ENTRY_SIZE (size_t)(4 * 1024)
-#define HUGE_ENTRY_SIZE (size_t)(16 * 1024)
-#define MONSTER_ENTRY_SIZE (size_t)(64 * 1024)
-#define VARIABLE_ENTRY_SIZE (size_t)(10 * 1024)
-
-#define NUM_PICO_ENTRIES (10 * 1024)
-#define NUM_NANO_ENTRIES (10 * 1024)
-#define NUM_MICRO_ENTRIES (10 * 1024)
-#define NUM_TINY_ENTRIES (10 * 1024)
-#define NUM_SMALL_ENTRIES (10 * 1024)
-#define NUM_MEDIUM_ENTRIES (10 * 1024)
-#define NUM_LARGE_ENTRIES (10 * 1024)
-#define NUM_HUGE_ENTRIES (10 * 1024)
-#define NUM_MONSTER_ENTRIES (10 * 1024)
-#define NUM_VARIABLE_ENTRIES (10 * 1024)
-
-#define MAX_ENTRIES (10 * 1024)
-
-#define PICO_BASE_ADDR (haddr_t)0
-#define NANO_BASE_ADDR (haddr_t)(PICO_BASE_ADDR + \
- (PICO_ENTRY_SIZE * NUM_PICO_ENTRIES))
-#define MICRO_BASE_ADDR (haddr_t)(NANO_BASE_ADDR + \
- (NANO_ENTRY_SIZE * NUM_NANO_ENTRIES))
-#define TINY_BASE_ADDR (haddr_t)(MICRO_BASE_ADDR + \
- (MICRO_ENTRY_SIZE * NUM_MICRO_ENTRIES))
-#define SMALL_BASE_ADDR (haddr_t)(TINY_BASE_ADDR + \
- (TINY_ENTRY_SIZE * NUM_TINY_ENTRIES))
-#define MEDIUM_BASE_ADDR (haddr_t)(SMALL_BASE_ADDR + \
- (SMALL_ENTRY_SIZE * NUM_SMALL_ENTRIES))
-#define LARGE_BASE_ADDR (haddr_t)(MEDIUM_BASE_ADDR + \
- (MEDIUM_ENTRY_SIZE * NUM_MEDIUM_ENTRIES))
-#define HUGE_BASE_ADDR (haddr_t)(LARGE_BASE_ADDR + \
- (LARGE_ENTRY_SIZE * NUM_LARGE_ENTRIES))
-#define MONSTER_BASE_ADDR (haddr_t)(HUGE_BASE_ADDR + \
- (HUGE_ENTRY_SIZE * NUM_HUGE_ENTRIES))
-#define VARIABLE_BASE_ADDR (haddr_t)(MONSTER_BASE_ADDR + \
- (MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES))
-
-#define PICO_ALT_BASE_ADDR (haddr_t)(VARIABLE_BASE_ADDR + \
- (VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES))
-#define NANO_ALT_BASE_ADDR (haddr_t)(PICO_ALT_BASE_ADDR + \
- (PICO_ENTRY_SIZE * NUM_PICO_ENTRIES))
-#define MICRO_ALT_BASE_ADDR (haddr_t)(NANO_ALT_BASE_ADDR + \
- (NANO_ENTRY_SIZE * NUM_NANO_ENTRIES))
-#define TINY_ALT_BASE_ADDR (haddr_t)(MICRO_ALT_BASE_ADDR + \
- (MICRO_ENTRY_SIZE * NUM_MICRO_ENTRIES))
-#define SMALL_ALT_BASE_ADDR (haddr_t)(TINY_ALT_BASE_ADDR + \
- (TINY_ENTRY_SIZE * NUM_TINY_ENTRIES))
-#define MEDIUM_ALT_BASE_ADDR (haddr_t)(SMALL_ALT_BASE_ADDR + \
- (SMALL_ENTRY_SIZE * NUM_SMALL_ENTRIES))
-#define LARGE_ALT_BASE_ADDR (haddr_t)(MEDIUM_ALT_BASE_ADDR + \
- (MEDIUM_ENTRY_SIZE * NUM_MEDIUM_ENTRIES))
-#define HUGE_ALT_BASE_ADDR (haddr_t)(LARGE_ALT_BASE_ADDR + \
- (LARGE_ENTRY_SIZE * NUM_LARGE_ENTRIES))
-#define MONSTER_ALT_BASE_ADDR (haddr_t)(HUGE_ALT_BASE_ADDR + \
- (HUGE_ENTRY_SIZE * NUM_HUGE_ENTRIES))
-#define VARIABLE_ALT_BASE_ADDR (haddr_t)(MONSTER_ALT_BASE_ADDR + \
- (MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES))
-
-#define MAX_PINS 8 /* Maximum number of entries that can be
- * directly pinned by a single entry.
- */
-
-#define FLUSH_OP__NO_OP 0
-#define FLUSH_OP__DIRTY 1
-#define FLUSH_OP__RESIZE 2
-#define FLUSH_OP__RENAME 3
-#define FLUSH_OP__MAX_OP 3
-
-#define MAX_FLUSH_OPS 10 /* Maximum number of flush operations
- * that can be associated with a
- * cache entry.
- */
-
-typedef struct flush_op
-{
- int op_code; /* integer op code indicating the
- * operation to be performed. At
- * present it must be one of:
- *
- * FLUSH_OP__NO_OP
- * FLUSH_OP__DIRTY
- * FLUSH_OP__RESIZE
- * FLUSH_OP__RENAME
- */
- int type; /* type code of the cache entry that
- * is the target of the operation.
- * This value is pass1ed into the
- * function implementing the flush
- * operation.
- */
- int idx; /* index of the cache entry that
- * is the target of the operation.
- * This value is pass1ed into the
- * function implementing the flush
- * operation.
- */
- hbool_t flag; /* boolean flag pass1ed into the
- * function implementing the flush
- * operation. The meaning of the
- * flag is dependant upon the flush
- * operation:
- *
- * FLUSH_OP__DIRTY: TRUE iff the
- * target is pinned, and is to
- * be dirtied via the
- * H5C1_mark_pinned_entry_dirty()
- * call.
- *
- * FLUSH_OP__RESIZE: TRUE iff the
- * target is pinned, and is to
- * be resized via the
- * H5C1_mark_pinned_entry_dirty()
- * call.
- *
- * FLUSH_OP__RENAME: TRUE iff the
- * target is to be renamed to
- * its main address.
- */
- size_t size; /* New target size in the
- * FLUSH_OP__RENAME operation.
- * Unused elsewhere.
- */
-} flush_op;
-
-typedef struct test_entry_t
-{
- H5C1_cache_entry_t header; /* entry data used by the cache
- * -- must be first
- */
- struct test_entry_t * self; /* pointer to this entry -- used for
- * sanity checking.
- */
- H5C1_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
- */
- hbool_t at_main_addr; /* boolean flag indicating whether
- * the entry is supposed to be at
- * either its main or alternate
- * address.
- */
- haddr_t main_addr; /* initial location of the entry
- */
- haddr_t alt_addr; /* location to which the entry
- * can be relocated or "renamed"
- */
- size_t size; /* how big the cache thinks this
- * entry is
- */
- int32_t type; /* indicates which entry array this
- * entry is in
- */
- int32_t index; /* index in its entry array
- */
- int32_t reads; /* number of times this entry has
- * been loaded.
- */
- int32_t writes; /* number of times this entry has
- * been written
- */
- hbool_t is_dirty; /* entry has been modified since
- * last write
- */
- hbool_t is_protected; /* entry should currently be on
- * the cache's protected list.
- */
- hbool_t is_read_only; /* TRUE iff the entry should be
- * protected read only.
- */
- int ro_ref_count; /* Number of outstanding read only
- * protects on the entry.
- */
- 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 types1 of entries
- * pinned by this entry.
- */
- int pin_idx[MAX_PINS]; /* array of the indicies of
- * entries pinned by this entry.
- */
- int num_flush_ops; /* integer field containing the
- * number of flush operations to
- * be executed when the entry is
- * flushed. This value must lie in
- * the closed interval
- * [0, MAX_FLUSH_OPS].
- */
- struct flush_op flush_ops[MAX_FLUSH_OPS]; /* Array of instances
- * of struct flush_op detailing the
- * flush operations (if any) that
- * are to be executed when the entry
- * is flushed from the cache.
- *
- * num_flush_ops contains the number
- * of valid entries in this array.
- */
- hbool_t flush_op_self_resize_in_progress; /* Boolean flag
- * that is set to TRUE iff this
- * entry is being flushed, it has
- * been resized by a resize flush
- * op, and the flush function has
- * not yet returned, This field is
- * used to turn off overactive santity
- * checking code that would otherwise
- * cause a false test failure.
- */
- hbool_t loaded; /* entry has been loaded since the
- * last time it was reset.
- */
- hbool_t cleared; /* entry has been cleared since the
- * last time it was reset.
- */
- hbool_t flushed; /* entry has been flushed since the
- * last time it was reset.
- */
- hbool_t destroyed; /* entry has been destroyed since the
- * last time it was reset.
- */
-} test_entry_t;
-
-/* The following is a cut down copy of the hash table manipulation
- * macros from H5C.c, which have been further modified to avoid references
- * to the error reporting macros. Needless to say, these macros must be
- * updated as necessary.
- */
-
-#define H5C1__HASH_MASK ((size_t)(H5C1__HASH_TABLE_LEN - 1) << 3)
-#define H5C1__HASH_FCN(x) (int)(((x) & H5C1__HASH_MASK) >> 3)
-
-#define H5C1__PRE_HT_SEARCH_SC(cache_ptr, Addr) \
-if ( ( (cache_ptr) == NULL ) || \
- ( (cache_ptr)->magic != H5C1__H5C1_T_MAGIC ) || \
- ( ! H5F_addr_defined(Addr) ) || \
- ( H5C1__HASH_FCN(Addr) < 0 ) || \
- ( H5C1__HASH_FCN(Addr) >= H5C1__HASH_TABLE_LEN ) ) { \
- HDfprintf(stdout, "Pre HT search SC failed.\n"); \
-}
-
-#define H5C1__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k) \
-if ( ( (cache_ptr) == NULL ) || \
- ( (cache_ptr)->magic != H5C1__H5C1_T_MAGIC ) || \
- ( (cache_ptr)->index_len < 1 ) || \
- ( (entry_ptr) == NULL ) || \
- ( (cache_ptr)->index_size < (entry_ptr)->size ) || \
- ( H5F_addr_ne((entry_ptr)->addr, (Addr)) ) || \
- ( (entry_ptr)->size <= 0 ) || \
- ( ((cache_ptr)->index)[k] == NULL ) || \
- ( ( ((cache_ptr)->index)[k] != (entry_ptr) ) && \
- ( (entry_ptr)->ht_prev == NULL ) ) || \
- ( ( ((cache_ptr)->index)[k] == (entry_ptr) ) && \
- ( (entry_ptr)->ht_prev != NULL ) ) || \
- ( ( (entry_ptr)->ht_prev != NULL ) && \
- ( (entry_ptr)->ht_prev->ht_next != (entry_ptr) ) ) || \
- ( ( (entry_ptr)->ht_next != NULL ) && \
- ( (entry_ptr)->ht_next->ht_prev != (entry_ptr) ) ) ) { \
- HDfprintf(stdout, "Post successful HT search SC failed.\n"); \
-}
-
-
-#define H5C1__SEARCH_INDEX(cache_ptr, Addr, entry_ptr) \
-{ \
- int k; \
- int depth = 0; \
- H5C1__PRE_HT_SEARCH_SC(cache_ptr, Addr) \
- k = H5C1__HASH_FCN(Addr); \
- entry_ptr = ((cache_ptr)->index)[k]; \
- while ( ( entry_ptr ) && ( H5F_addr_ne(Addr, (entry_ptr)->addr) ) ) \
- { \
- (entry_ptr) = (entry_ptr)->ht_next; \
- (depth)++; \
- } \
- if ( entry_ptr ) \
- { \
- H5C1__POST_SUC_HT_SEARCH_SC(cache_ptr, entry_ptr, Addr, k) \
- if ( entry_ptr != ((cache_ptr)->index)[k] ) \
- { \
- if ( (entry_ptr)->ht_next ) \
- { \
- (entry_ptr)->ht_next->ht_prev = (entry_ptr)->ht_prev; \
- } \
- HDassert( (entry_ptr)->ht_prev != NULL ); \
- (entry_ptr)->ht_prev->ht_next = (entry_ptr)->ht_next; \
- ((cache_ptr)->index)[k]->ht_prev = (entry_ptr); \
- (entry_ptr)->ht_next = ((cache_ptr)->index)[k]; \
- (entry_ptr)->ht_prev = NULL; \
- ((cache_ptr)->index)[k] = (entry_ptr); \
- } \
- } \
-}
-
-
-/* misc type definitions */
-
-struct flush_cache_test_spec
-{
- int entry_num;
- int entry_type;
- int entry_index;
- hbool_t insert_flag;
- hbool_t dirty_flag;
- unsigned int flags;
- hbool_t expected_loaded;
- hbool_t expected_cleared;
- hbool_t expected_flushed;
- 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 fo_flush_entry_check
-{
- int entry_num;
- int entry_type;
- int entry_index;
- size_t expected_size;
- hbool_t in_cache;
- hbool_t at_main_addr;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- hbool_t expected_loaded;
- hbool_t expected_cleared;
- hbool_t expected_flushed;
- hbool_t expected_destroyed;
-};
-
-struct fo_flush_cache_test_spec
-{
- int entry_num;
- int entry_type;
- int entry_index;
- hbool_t insert_flag;
- unsigned int flags;
- size_t new_size;
- int num_pins;
- int pin_type[MAX_PINS];
- int pin_idx[MAX_PINS];
- int num_flush_ops;
- struct flush_op flush_ops[MAX_FLUSH_OPS];
- 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;
-};
-
-struct expected_entry_status
-{
- int entry_type;
- int entry_index;
- size_t size;
- hbool_t in_cache;
- hbool_t at_main_addr;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- hbool_t loaded;
- hbool_t cleared;
- hbool_t flushed;
- hbool_t destroyed;
-};
-
-
-
-
-/* global variable externs: */
-
-extern const char *FILENAME[];
-
-extern hbool_t write_permitted1;
-extern hbool_t pass1; /* set to false on error */
-extern hbool_t skip_long_tests1;
-extern hbool_t run_full_test1;
-extern const char *failure_mssg1;
-
-extern test_entry_t pico_entries1[NUM_PICO_ENTRIES];
-extern test_entry_t nano_entries1[NUM_NANO_ENTRIES];
-extern test_entry_t micro_entries1[NUM_MICRO_ENTRIES];
-extern test_entry_t tiny_entries1[NUM_TINY_ENTRIES];
-extern test_entry_t small_entries1[NUM_SMALL_ENTRIES];
-extern test_entry_t medium_entries1[NUM_MEDIUM_ENTRIES];
-extern test_entry_t large_entries1[NUM_LARGE_ENTRIES];
-extern test_entry_t huge_entries1[NUM_HUGE_ENTRIES];
-extern test_entry_t monster_entries1[NUM_MONSTER_ENTRIES];
-
-extern test_entry_t * entries1[NUMBER_OF_ENTRY_TYPES];
-extern const int32_t max_indices1[NUMBER_OF_ENTRY_TYPES];
-extern const size_t entry_sizes1[NUMBER_OF_ENTRY_TYPES];
-extern const haddr_t base_addrs1[NUMBER_OF_ENTRY_TYPES];
-extern const haddr_t alt_base_addrs1[NUMBER_OF_ENTRY_TYPES];
-extern const char * entry_type_names1[NUMBER_OF_ENTRY_TYPES];
-
-
-/* call back function declarations: */
-
-herr_t check_write_permitted1(const H5F_t * f,
- hid_t dxpl_id,
- hbool_t * write_permitted1_ptr);
-
-herr_t pico_clear(H5F_t * f, void * thing, hbool_t dest);
-herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest);
-herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest);
-herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest);
-herr_t small_clear(H5F_t * f, void * thing, hbool_t dest);
-herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest);
-herr_t large_clear(H5F_t * f, void * thing, hbool_t dest);
-herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest);
-herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest);
-herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest);
-
-
-herr_t pico_dest(H5F_t * f, void * thing);
-herr_t nano_dest(H5F_t * f, void * thing);
-herr_t micro_dest(H5F_t * f, void * thing);
-herr_t tiny_dest(H5F_t * f, void * thing);
-herr_t small_dest(H5F_t * f, void * thing);
-herr_t medium_dest(H5F_t * f, void * thing);
-herr_t large_dest(H5F_t * f, void * thing);
-herr_t huge_dest(H5F_t * f, void * thing);
-herr_t monster_dest(H5F_t * f, void * thing);
-herr_t variable_dest(H5F_t * f, void * thing);
-
-
-herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned * flags_ptr);
-herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned * flags_ptr);
-herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned * flags_ptr);
-herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned * flags_ptr);
-herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned * flags_ptr);
-herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned * flags_ptr);
-herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned * flags_ptr);
-herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned * flags_ptr);
-herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned * flags_ptr);
-herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
- haddr_t addr, void *thing, unsigned * flags_ptr);
-
-
-void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr,
- const void *udata1, void *udata2);
-
-
-herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr);
-herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr);
-herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr);
-herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr);
-herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr);
-herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr);
-herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr);
-herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr);
-herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr);
-herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr);
-
-/* callback table extern */
-
-extern const H5C1_class_t types1[NUMBER_OF_ENTRY_TYPES];
-
-
-/* function declarations: */
-
-void add_flush_op1(int target_type,
- int target_idx,
- int op_code,
- int type,
- int idx,
- hbool_t flag,
- size_t size);
-
-
-void addr_to_type_and_index1(haddr_t addr,
- int32_t * type_ptr,
- int32_t * index_ptr);
-
-#if 0 /* keep this for a while -- it may be useful */
-haddr_t type_and_index_to_addr1(int32_t type,
- int32_t idx);
-#endif
-
-void dirty_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- hbool_t dirty_pin);
-
-void expunge_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx);
-
-void insert_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- hbool_t dirty,
- unsigned int flags);
-
-void mark_pinned_entry_dirty1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- hbool_t size_changed,
- size_t new_size);
-
-void mark_pinned_or_protected_entry_dirty1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx);
-
-void rename_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- hbool_t main_addr);
-
-void protect_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx);
-
-void protect_entry_ro1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx);
-
-hbool_t entry_in_cache1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx);
-
-void create_pinned_entry_dependency1(H5C1_t * cache_ptr,
- int pinning_type,
- int pinning_idx,
- int pinned_type,
- int pinned_idx);
-
-void execute_flush_op1(H5C1_t * cache_ptr,
- struct test_entry_t * entry_ptr,
- struct flush_op * op_ptr,
- unsigned * flags_ptr);
-
-void reset_entries1(void);
-
-void resize_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- size_t new_size,
- hbool_t resize_pin);
-
-void resize_pinned_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- size_t new_size);
-
-H5C1_t * setup_cache1(size_t max_cache_size, size_t min_clean_size);
-
-void row_major_scan_forward1(H5C1_t * cache_ptr,
- int32_t lag,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- hbool_t do_renames,
- hbool_t rename_to_main_addr,
- hbool_t do_destroys,
- hbool_t do_mult_ro_protects,
- int dirty_destroys,
- int dirty_unprotects);
-
-void hl_row_major_scan_forward1(H5C1_t * cache_ptr,
- int32_t max_index,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts);
-
-void row_major_scan_backward1(H5C1_t * cache_ptr,
- int32_t lag,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- hbool_t do_renames,
- hbool_t rename_to_main_addr,
- hbool_t do_destroys,
- hbool_t do_mult_ro_protects,
- int dirty_destroys,
- int dirty_unprotects);
-
-void hl_row_major_scan_backward1(H5C1_t * cache_ptr,
- int32_t max_index,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts);
-
-void col_major_scan_forward1(H5C1_t * cache_ptr,
- int32_t lag,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- int dirty_unprotects);
-
-void hl_col_major_scan_forward1(H5C1_t * cache_ptr,
- int32_t max_index,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- int dirty_unprotects);
-
-void col_major_scan_backward1(H5C1_t * cache_ptr,
- int32_t lag,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- int dirty_unprotects);
-
-void hl_col_major_scan_backward1(H5C1_t * cache_ptr,
- int32_t max_index,
- hbool_t verbose,
- hbool_t reset_stats,
- hbool_t display_stats,
- hbool_t display_detailed_stats,
- hbool_t do_inserts,
- hbool_t dirty_inserts,
- int dirty_unprotects);
-
-void takedown_cache1(H5C1_t * cache_ptr,
- hbool_t dump_stats,
- hbool_t dump_detailed_stats);
-
-void flush_cache1(H5C1_t * cache_ptr,
- hbool_t destroy_entries,
- hbool_t dump_stats,
- hbool_t dump_detailed_stats);
-
-void unpin_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx);
-
-void unprotect_entry1(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- int dirty,
- unsigned int flags);
-
-void unprotect_entry1_with_size_change(H5C1_t * cache_ptr,
- int32_t type,
- int32_t idx,
- unsigned int flags,
- size_t new_size);
-
-void verify_clean1(void);
-
-void verify_entry_status1(H5C1_t * cache_ptr,
- int tag,
- int num_entries,
- struct expected_entry_status expected[]);
-
-void verify_unprotected1(void);
-
diff --git a/test/cache_api.c b/test/cache_api.c
index 3a7a56d..3d5db5e 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -156,7 +156,7 @@ check_fapl_mdc_api_calls(void)
scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER;
- result = H5Pget_mdc_config(fapl_id, (H5AC1_cache_config_t *)&scratch);
+ result = H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch);
if ( result < 0 ) {
@@ -179,7 +179,7 @@ check_fapl_mdc_api_calls(void)
if ( pass ) {
- result = H5Pset_mdc_config(fapl_id, (H5AC1_cache_config_t *)&mod_config);
+ result = H5Pset_mdc_config(fapl_id, (H5AC_cache_config_t *)&mod_config);
if ( result < 0 ) {
@@ -194,7 +194,7 @@ check_fapl_mdc_api_calls(void)
scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER;
- result = H5Pget_mdc_config(fapl_id, (H5AC1_cache_config_t *)&scratch);
+ result = H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch);
if ( result < 0 ) {
@@ -322,7 +322,7 @@ check_fapl_mdc_api_calls(void)
scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER;
- result = H5Pget_mdc_config(fapl_id, (H5AC1_cache_config_t *)&scratch);
+ result = H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch);
if ( result < 0 ) {
@@ -386,7 +386,7 @@ check_fapl_mdc_api_calls(void)
if ( pass ) {
- result = H5Pset_mdc_config(fapl_id, (H5AC1_cache_config_t *)&mod_config);
+ result = H5Pset_mdc_config(fapl_id, (H5AC_cache_config_t *)&mod_config);
if ( result < 0 ) {
@@ -491,7 +491,7 @@ check_fapl_mdc_api_calls(void)
scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER;
- result = H5Pget_mdc_config(test_fapl_id, (H5AC1_cache_config_t *)&scratch);
+ result = H5Pget_mdc_config(test_fapl_id, (H5AC_cache_config_t *)&scratch);
if ( result < 0 ) {
@@ -763,7 +763,7 @@ check_file_mdc_api_calls(void)
/* set alternate config 1 */
if ( pass ) {
- if ( H5Fset_mdc_config(file_id, (H5AC1_cache_config_t *)&mod_config_1) < 0 ) {
+ if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_1) < 0 ) {
pass = FALSE;
failure_mssg = "H5Fset_mdc_config() failed 1.\n";
@@ -776,7 +776,7 @@ check_file_mdc_api_calls(void)
/* set alternate config 2 */
if ( pass ) {
- if ( H5Fset_mdc_config(file_id, (H5AC1_cache_config_t *)&mod_config_2) < 0 ) {
+ if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_2) < 0 ) {
pass = FALSE;
failure_mssg = "H5Fset_mdc_config() failed 2.\n";
@@ -789,7 +789,7 @@ check_file_mdc_api_calls(void)
/* set alternate config 3 */
if ( pass ) {
- if ( H5Fset_mdc_config(file_id, (H5AC1_cache_config_t *)&mod_config_3) < 0 ) {
+ if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_3) < 0 ) {
pass = FALSE;
failure_mssg = "H5Fset_mdc_config() failed 3.\n";
@@ -802,7 +802,7 @@ check_file_mdc_api_calls(void)
/* set alternate config 4 */
if ( pass ) {
- if ( H5Fset_mdc_config(file_id, (H5AC1_cache_config_t *)&mod_config_4) < 0 ) {
+ if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_4) < 0 ) {
pass = FALSE;
failure_mssg = "H5Fset_mdc_config() failed 4.\n";
@@ -1103,7 +1103,7 @@ mdc_api_call_smoke_check(void)
/* set alternate config 1 */
if ( pass ) {
- if ( H5Fset_mdc_config(file_id, (H5AC1_cache_config_t *)&mod_config_1)
+ if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_1)
< 0 ) {
pass = FALSE;
@@ -1338,7 +1338,7 @@ mdc_api_call_smoke_check(void)
/* set alternate config 2 */
if ( pass ) {
- if ( H5Fset_mdc_config(file_id, (H5AC1_cache_config_t *)&mod_config_2)
+ if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_2)
< 0 ) {
pass = FALSE;
@@ -1490,7 +1490,7 @@ mdc_api_call_smoke_check(void)
/* set alternate config 3 */
if ( pass ) {
- if ( H5Fset_mdc_config(file_id, (H5AC1_cache_config_t *)&mod_config_3) < 0 ) {
+ if ( H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&mod_config_3) < 0 ) {
pass = FALSE;
failure_mssg = "H5Fset_mdc_config() failed 3.\n";
@@ -3094,7 +3094,7 @@ check_fapl_mdc_api_errs(void)
if ( pass ) {
H5E_BEGIN_TRY {
- result = H5Pget_mdc_config(-1, (H5AC1_cache_config_t *)&scratch);
+ result = H5Pget_mdc_config(-1, (H5AC_cache_config_t *)&scratch);
} H5E_END_TRY;
if ( result >= 0 ) {
@@ -3121,7 +3121,7 @@ check_fapl_mdc_api_errs(void)
scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER;
if ( ( pass ) &&
- ( ( H5Pget_mdc_config(fapl_id, (H5AC1_cache_config_t *)&scratch) < 0) ||
+ ( ( H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch) < 0) ||
( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) {
pass = FALSE;
@@ -3147,7 +3147,7 @@ check_fapl_mdc_api_errs(void)
if ( pass ) {
H5E_BEGIN_TRY {
- result = H5Pget_mdc_config(fapl_id, (H5AC1_cache_config_t *)&scratch);
+ result = H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch);
} H5E_END_TRY;
if ( result >= 0 ) {
@@ -3165,7 +3165,7 @@ check_fapl_mdc_api_errs(void)
if ( pass ) {
H5E_BEGIN_TRY {
- result = H5Pset_mdc_config(-1, (H5AC1_cache_config_t *)&default_config);
+ result = H5Pset_mdc_config(-1, (H5AC_cache_config_t *)&default_config);
} H5E_END_TRY;
if ( result >= 0 ) {
@@ -3192,7 +3192,7 @@ check_fapl_mdc_api_errs(void)
while ( ( pass ) && ( i < NUM_INVALID_CONFIGS ) )
{
H5E_BEGIN_TRY {
- result = H5Pset_mdc_config(fapl_id, (H5AC1_cache_config_t *)&(invalid_configs[i]));
+ result = H5Pset_mdc_config(fapl_id, (H5AC_cache_config_t *)&(invalid_configs[i]));
} H5E_END_TRY;
if ( result >= 0 ) {
@@ -3210,7 +3210,7 @@ check_fapl_mdc_api_errs(void)
*/
scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER;
if ( ( pass ) &&
- ( ( H5Pget_mdc_config(fapl_id, (H5AC1_cache_config_t *)&scratch) < 0 ) ||
+ ( ( H5Pget_mdc_config(fapl_id, (H5AC_cache_config_t *)&scratch) < 0 ) ||
( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) {
pass = FALSE;
@@ -3317,7 +3317,7 @@ check_file_mdc_api_errs(void)
}
H5E_BEGIN_TRY {
- result = H5Fget_mdc_config(-1, (H5AC1_cache_config_t *)&scratch);
+ result = H5Fget_mdc_config(-1, (H5AC_cache_config_t *)&scratch);
} H5E_END_TRY;
if ( result >= 0 ) {
@@ -3354,7 +3354,7 @@ check_file_mdc_api_errs(void)
}
H5E_BEGIN_TRY {
- result = H5Fget_mdc_config(file_id, (H5AC1_cache_config_t *)&scratch);
+ result = H5Fget_mdc_config(file_id, (H5AC_cache_config_t *)&scratch);
} H5E_END_TRY;
if ( result >= 0 ) {
@@ -3376,7 +3376,7 @@ check_file_mdc_api_errs(void)
}
H5E_BEGIN_TRY {
- result = H5Fset_mdc_config(-1, (H5AC1_cache_config_t *)&default_config);
+ result = H5Fset_mdc_config(-1, (H5AC_cache_config_t *)&default_config);
} H5E_END_TRY;
if ( result >= 0 ) {
@@ -3416,7 +3416,7 @@ check_file_mdc_api_errs(void)
H5E_BEGIN_TRY {
result =
- H5Fset_mdc_config(file_id, (H5AC1_cache_config_t *)&(invalid_configs[i]));
+ H5Fset_mdc_config(file_id, (H5AC_cache_config_t *)&(invalid_configs[i]));
} H5E_END_TRY;
if ( result >= 0 ) {
diff --git a/test/cache_common.c b/test/cache_common.c
index c4ae165..39fce27 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -1092,120 +1092,100 @@ free_icr(test_entry_t *entry_ptr)
} /* free_icr() */
herr_t
-pico_free_icr(haddr_t addr, size_t len, void * thing)
+pico_free_icr(void * thing)
{
test_entry_t * entry_ptr = (test_entry_t *)thing;
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->size == len );
HDassert( entry_ptr->type == PICO_ENTRY_TYPE );
return(free_icr(entry_ptr));
}
herr_t
-nano_free_icr(haddr_t addr, size_t len, void * thing)
+nano_free_icr(void * thing)
{
test_entry_t * entry_ptr = (test_entry_t *)thing;
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->size == len );
HDassert( entry_ptr->type == NANO_ENTRY_TYPE );
return(free_icr(entry_ptr));
}
herr_t
-micro_free_icr(haddr_t addr, size_t len, void * thing)
+micro_free_icr(void * thing)
{
test_entry_t * entry_ptr = (test_entry_t *)thing;
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->size == len );
HDassert( entry_ptr->type == MICRO_ENTRY_TYPE );
return(free_icr(entry_ptr));
}
herr_t
-tiny_free_icr(haddr_t addr, size_t len, void * thing)
+tiny_free_icr(void * thing)
{
test_entry_t * entry_ptr = (test_entry_t *)thing;
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->size == len );
HDassert( entry_ptr->type == TINY_ENTRY_TYPE );
return(free_icr(entry_ptr));
}
herr_t
-small_free_icr(haddr_t addr, size_t len, void * thing)
+small_free_icr(void * thing)
{
test_entry_t * entry_ptr = (test_entry_t *)thing;
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->size == len );
HDassert( entry_ptr->type == SMALL_ENTRY_TYPE );
return(free_icr(entry_ptr));
}
herr_t
-medium_free_icr(haddr_t addr, size_t len, void * thing)
+medium_free_icr(void * thing)
{
test_entry_t * entry_ptr = (test_entry_t *)thing;
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->size == len );
HDassert( entry_ptr->type == MEDIUM_ENTRY_TYPE );
return(free_icr(entry_ptr));
}
herr_t
-large_free_icr(haddr_t addr, size_t len, void * thing)
+large_free_icr(void * thing)
{
test_entry_t * entry_ptr = (test_entry_t *)thing;
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->size == len );
HDassert( entry_ptr->type == LARGE_ENTRY_TYPE );
return(free_icr(entry_ptr));
}
herr_t
-huge_free_icr(haddr_t addr, size_t len, void * thing)
+huge_free_icr(void * thing)
{
test_entry_t * entry_ptr = (test_entry_t *)thing;
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->size == len );
HDassert( entry_ptr->type == HUGE_ENTRY_TYPE );
return(free_icr(entry_ptr));
}
herr_t
-monster_free_icr(haddr_t addr, size_t len, void * thing)
+monster_free_icr(void * thing)
{
test_entry_t * entry_ptr = (test_entry_t *)thing;
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->size == len );
HDassert( entry_ptr->type == MONSTER_ENTRY_TYPE );
return(free_icr(entry_ptr));
}
herr_t
-variable_free_icr(haddr_t addr, size_t len, void * thing)
+variable_free_icr(void * thing)
{
test_entry_t * entry_ptr = (test_entry_t *)thing;
- HDassert( entry_ptr->addr == addr );
- HDassert( entry_ptr->size == len );
HDassert( entry_ptr->type == VARIABLE_ENTRY_TYPE );
return(free_icr(entry_ptr));
@@ -5838,7 +5818,7 @@ validate_mdc_config(hid_t file_id,
scratch.version = H5AC__CURR_CACHE_CONFIG_VERSION;
- if ( H5Fget_mdc_config(file_id, (H5AC1_cache_config_t *)&scratch) < 0 ) {
+ if ( H5Fget_mdc_config(file_id, (H5AC_cache_config_t *)&scratch) < 0 ) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
diff --git a/test/cache_common.h b/test/cache_common.h
index 00aa1e3..6fe8ae4 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -718,16 +718,16 @@ herr_t variable_serialize(const H5F_t *f, hid_t dxpl_id, haddr_t addr,
haddr_t * new_addr_ptr, size_t * new_len_ptr,
void ** new_image_ptr_ptr);
-herr_t pico_free_icr(haddr_t addr, size_t len, void * thing);
-herr_t nano_free_icr(haddr_t addr, size_t len, void * thing);
-herr_t micro_free_icr(haddr_t addr, size_t len, void * thing);
-herr_t tiny_free_icr(haddr_t addr, size_t len, void * thing);
-herr_t small_free_icr(haddr_t addr, size_t len, void * thing);
-herr_t medium_free_icr(haddr_t addr, size_t len, void * thing);
-herr_t large_free_icr(haddr_t addr, size_t len, void * thing);
-herr_t huge_free_icr(haddr_t addr, size_t len, void * thing);
-herr_t monster_free_icr(haddr_t addr, size_t len, void * thing);
-herr_t variable_free_icr(haddr_t addr, size_t len, void * thing);
+herr_t pico_free_icr(void * thing);
+herr_t nano_free_icr(void * thing);
+herr_t micro_free_icr(void * thing);
+herr_t tiny_free_icr(void * thing);
+herr_t small_free_icr(void * thing);
+herr_t medium_free_icr(void * thing);
+herr_t large_free_icr(void * thing);
+herr_t huge_free_icr(void * thing);
+herr_t monster_free_icr(void * thing);
+herr_t variable_free_icr(void * thing);
/* callback table extern */
diff --git a/test/cache_jnl_file_marking.c b/test/cache_jnl_file_marking.c
index 646f71b..a5c7649 100644
--- a/test/cache_jnl_file_marking.c
+++ b/test/cache_jnl_file_marking.c
@@ -682,7 +682,7 @@ setup_cache_for_journaling(const char * hdf_file_name,
if ( pass ) {
- result = H5Pset_mdc_config(fapl_id, (H5AC1_cache_config_t *)&mdj_config);
+ result = H5Pset_mdc_config(fapl_id, (H5AC_cache_config_t *)&mdj_config);
if ( result < 0 ) {
diff --git a/test/cache_journal.c b/test/cache_journal.c
index 49340fa..a39515c 100644
--- a/test/cache_journal.c
+++ b/test/cache_journal.c
@@ -2465,7 +2465,7 @@ setup_cache_for_journaling(const char * hdf_file_name,
if ( pass ) {
- result = H5Pset_mdc_config(fapl_id, (H5AC1_cache_config_t *)&mdj_config);
+ result = H5Pset_mdc_config(fapl_id, (H5AC_cache_config_t *)&mdj_config);
if ( result < 0 ) {