summaryrefslogtreecommitdiffstats
path: root/test/cache_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/cache_common.c')
-rw-r--r--test/cache_common.c137
1 files changed, 101 insertions, 36 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index 68803ad..868b4d9 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -64,20 +64,93 @@ hbool_t try_core_file_driver = FALSE;
hbool_t core_file_driver_failed = FALSE;
const char *failure_mssg = NULL;
-test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES];
-test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES];
-test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES];
-test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES];
-test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES];
-test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES];
-test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES];
-test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES];
-test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES];
-test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES];
-test_entry_t notify_entries[NUM_NOTIFY_ENTRIES], orig_notify_entries[NUM_NOTIFY_ENTRIES];
+static test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES];
+static test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES];
+static test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES];
+static test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES];
+static test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES];
+static test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES];
+static test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES];
+static test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES];
+static test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES];
+static test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES];
+static test_entry_t notify_entries[NUM_NOTIFY_ENTRIES], orig_notify_entries[NUM_NOTIFY_ENTRIES];
hbool_t orig_entry_arrays_init = FALSE;
+static herr_t pico_clear(H5F_t * f, void * thing, hbool_t dest);
+static herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest);
+static herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest);
+static herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest);
+static herr_t small_clear(H5F_t * f, void * thing, hbool_t dest);
+static herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest);
+static herr_t large_clear(H5F_t * f, void * thing, hbool_t dest);
+static herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest);
+static herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest);
+static herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest);
+static herr_t notify_clear(H5F_t * f, void * thing, hbool_t dest);
+
+static herr_t pico_dest(H5F_t * f, void * thing);
+static herr_t nano_dest(H5F_t * f, void * thing);
+static herr_t micro_dest(H5F_t * f, void * thing);
+static herr_t tiny_dest(H5F_t * f, void * thing);
+static herr_t small_dest(H5F_t * f, void * thing);
+static herr_t medium_dest(H5F_t * f, void * thing);
+static herr_t large_dest(H5F_t * f, void * thing);
+static herr_t huge_dest(H5F_t * f, void * thing);
+static herr_t monster_dest(H5F_t * f, void * thing);
+static herr_t variable_dest(H5F_t * f, void * thing);
+static herr_t notify_dest(H5F_t * f, void * thing);
+
+static herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+static herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+static herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+static herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+static herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+static herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+static herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+static herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+static herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+static herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+static herr_t notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest,
+ haddr_t addr, void *thing, unsigned * flags_ptr);
+
+static void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+static void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+static void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+static void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+static void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+static void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+static void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+static void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+static void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+static void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+static void * notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata);
+
+static herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr);
+static herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr);
+static herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr);
+static herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr);
+static herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr);
+static herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr);
+static herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr);
+static herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr);
+static herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr);
+static herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr);
+static herr_t notify_size(H5F_t * f, void * thing, size_t * size_ptr);
+
+static herr_t notify_notify(H5C_notify_action_t action, void *thing);
+
test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] =
{
pico_entries,
@@ -304,6 +377,7 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr,
/* address translation funtions: */
+
/*-------------------------------------------------------------------------
* Function: addr_to_type_and_index
*
@@ -1816,25 +1890,20 @@ reset_entries(void)
/*-------------------------------------------------------------------------
- * Function: resize_entry
+ * Function: resize_entry
*
- * Purpose: Given a pointer to a cache, an entry type, an index, and
+ * Purpose: Given a pointer to a cache, an entry type, an index, and
* a new size, set the size of the target entry to the new size.
*
* Note that at present, the type of the entry must be
* VARIABLE_ENTRY_TYPE.
*
- * If the in_cache parameter is true, verify that the
- * target entry is in the cache. If it
- * isn't, scream and die. If it is, use the
- * H5C_resize_entry() call to resize it.
- *
- * Do nothing if pass is false on entry.
+ * Do nothing if pass is false on entry.
*
- * Return: void
+ * Return: void
*
- * Programmer: John Mainzer
- * 6/10/04
+ * Programmer: John Mainzer
+ * 1/11/08
*
*-------------------------------------------------------------------------
*/
@@ -1843,7 +1912,7 @@ void
resize_entry(H5F_t * file_ptr,
int32_t type,
int32_t idx,
- size_t new_size,
+ size_t new_size,
hbool_t in_cache)
{
test_entry_t * base_addr;
@@ -1898,8 +1967,8 @@ resize_entry(H5F_t * file_ptr,
HDassert( entry_ptr->size = (entry_ptr->header).size );
}
- }
- }
+ }
+ }
} else {
protect_entry(file_ptr, type, idx);
@@ -2574,7 +2643,7 @@ setup_cache(size_t max_cache_size,
cache_ptr = H5C_create(max_cache_size,
min_clean_size,
(NUMBER_OF_ENTRY_TYPES - 1),
- (const char **)entry_type_names,
+ (const char **)entry_type_names,
check_write_permitted,
TRUE,
NULL,
@@ -2675,7 +2744,7 @@ setup_cache(size_t max_cache_size,
* Return: void
*
* Programmer: John Mainzer
- * 6/11/04
+ * 9/14/07
*
*-------------------------------------------------------------------------
*/
@@ -3279,10 +3348,9 @@ protect_entry_ro(H5F_t * file_ptr,
int32_t type,
int32_t idx)
{
- /* const char * fcn_name = "protect_entry_ro()"; */
H5C_t *cache_ptr;
- test_entry_t * base_addr;
- test_entry_t * entry_ptr;
+ test_entry_t *base_addr;
+ test_entry_t *entry_ptr;
H5C_cache_entry_t * cache_entry_ptr;
if ( pass ) {
@@ -3416,7 +3484,6 @@ void
unpin_entry(int32_t type,
int32_t idx)
{
- /* const char * fcn_name = "unpin_entry()"; */
herr_t result;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -3437,7 +3504,7 @@ unpin_entry(int32_t type,
HDassert( entry_ptr->is_pinned );
HDassert( entry_ptr->pinned_from_client );
- result = H5C_unpin_entry((void *)entry_ptr);
+ result = H5C_unpin_entry(entry_ptr);
if ( ( result < 0 ) ||
( entry_ptr->header.pinned_from_client ) ||
@@ -4244,7 +4311,7 @@ row_major_scan_backward(H5F_t * file_ptr,
} else {
unprotect_entry(file_ptr, type, idx + lag,
- (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET));
+ (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET));
}
break;
@@ -4279,7 +4346,7 @@ row_major_scan_backward(H5F_t * file_ptr,
( ( idx + lag) <= max_indices[type] ) ) {
if ( verbose )
- HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag));
+ HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag));
unprotect_entry(file_ptr, type, idx + lag,
(dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET));
@@ -4422,8 +4489,6 @@ hl_row_major_scan_backward(H5F_t * file_ptr,
* Programmer: John Mainzer
* 6/23/04
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/