summaryrefslogtreecommitdiffstats
path: root/testpar/t_cache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-27 22:57:29 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-27 22:57:29 (GMT)
commite4246519c9d59a5f837f2b1009471533b729b778 (patch)
tree0ed23bfb58157edccfa11487a6c9f293b9e97670 /testpar/t_cache.c
parentfc3de1ec794584b1bdc6e615d8d2afc15f5bb5ec (diff)
downloadhdf5-e4246519c9d59a5f837f2b1009471533b729b778.zip
hdf5-e4246519c9d59a5f837f2b1009471533b729b778.tar.gz
hdf5-e4246519c9d59a5f837f2b1009471533b729b778.tar.bz2
[svn-r18920] Description:
Bring r18917 from trunk to 1.8 branch: Bring r18911 (plus some adaptions to match the code on the trunk) from the metadata journaling "merging" branch to the trunk: More general changes to align trunk with eventual changes from metadata journaling branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode
Diffstat (limited to 'testpar/t_cache.c')
-rw-r--r--testpar/t_cache.c360
1 files changed, 155 insertions, 205 deletions
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index d579c86..25cfb30 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -341,40 +341,33 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] =
/* test utility functions */
-void expunge_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx);
+void expunge_entry(H5F_t * file_ptr, int32_t idx);
void insert_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
int32_t idx, unsigned int flags);
-void local_pin_and_unpin_random_entries(H5C_t * cache_ptr, H5F_t * file_ptr,
- int min_idx, int max_idx,
- int min_count, int max_count);
-void local_pin_random_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
- int min_idx, int max_idx);
-void local_unpin_all_entries(H5C_t * cache_ptr, H5F_t * file_ptr,
- hbool_t via_unprotect);
-int local_unpin_next_pinned_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
- int start_idx, hbool_t via_unprotect);
-void lock_and_unlock_random_entries(H5C_t * cache_ptr, H5F_t * file_ptr,
- int min_idx, int max_idx,
+void local_pin_and_unpin_random_entries(H5F_t * file_ptr, int min_idx,
+ int max_idx, int min_count,
+ int max_count);
+void local_pin_random_entry(H5F_t * file_ptr, int min_idx, int max_idx);
+void local_unpin_all_entries(H5F_t * file_ptr, hbool_t via_unprotect);
+int local_unpin_next_pinned_entry(H5F_t * file_ptr, int start_idx,
+ hbool_t via_unprotect);
+void lock_and_unlock_random_entries(H5F_t * file_ptr, int min_idx, int max_idx,
int min_count, int max_count);
-void lock_and_unlock_random_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
+void lock_and_unlock_random_entry(H5F_t * file_ptr,
int min_idx, int max_idx);
-void lock_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx);
-void mark_entry_dirty(H5C_t * cache_ptr, H5F_t * file_ptr,
- int32_t idx);
-void pin_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx,
- hbool_t global, hbool_t dirty);
+void lock_entry(H5F_t * file_ptr, int32_t idx);
+void mark_entry_dirty(int32_t idx);
+void pin_entry(H5F_t * file_ptr, int32_t idx, hbool_t global, hbool_t dirty);
void pin_protected_entry(int32_t idx, hbool_t global);
-void move_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
- int32_t old_idx, int32_t new_idx);
+void move_entry(H5F_t * file_ptr, int32_t old_idx, int32_t new_idx);
void resize_entry(int32_t idx, size_t new_size);
hbool_t setup_cache_for_test(hid_t * fid_ptr, H5F_t ** file_ptr_ptr,
H5C_t ** cache_ptr_ptr);
void setup_rand(void);
hbool_t take_down_cache(hid_t fid);
-void unlock_entry(H5C_t * cache_ptr, H5F_t * file_ptr,
- int32_t type, unsigned int flags);
-void unpin_entry(H5C_t * cache_ptr, H5F_t * file_ptr, int32_t idx,
- hbool_t global, hbool_t dirty, hbool_t via_unprotect);
+void unlock_entry(H5F_t * file_ptr, int32_t type, unsigned int flags);
+void unpin_entry(H5F_t * file_ptr, int32_t idx, hbool_t global,
+ hbool_t dirty, hbool_t via_unprotect);
/* test functions */
@@ -1656,6 +1649,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
/**************************** Call back functions ****************************/
/*****************************************************************************/
+
/*-------------------------------------------------------------------------
* Function: clear_datum
*
@@ -2183,8 +2177,7 @@ size_datum(H5F_t UNUSED * f,
*****************************************************************************/
void
-expunge_entry(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+expunge_entry(H5F_t * file_ptr,
int32_t idx)
{
const char * fcn_name = "expunge_entry()";
@@ -2192,7 +2185,6 @@ expunge_entry(H5C_t * cache_ptr,
herr_t result;
struct datum * entry_ptr;
- HDassert( cache_ptr );
HDassert( file_ptr );
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
HDassert( idx < virt_num_data_entries );
@@ -2294,8 +2286,8 @@ insert_entry(H5C_t * cache_ptr,
(entry_ptr->ver)++;
entry_ptr->dirty = TRUE;
- result = H5AC_set(file_ptr, -1, &(types[0]), entry_ptr->base_addr,
- (void *)(&(entry_ptr->header)), flags);
+ result = H5AC_set(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[0]),
+ entry_ptr->base_addr, (void *)(&(entry_ptr->header)), flags);
if ( ( result < 0 ) ||
( entry_ptr->header.type != &(types[0]) ) ||
@@ -2374,8 +2366,7 @@ insert_entry(H5C_t * cache_ptr,
*****************************************************************************/
void
-local_pin_and_unpin_random_entries(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+local_pin_and_unpin_random_entries(H5F_t * file_ptr,
int min_idx,
int max_idx,
int min_count,
@@ -2390,7 +2381,6 @@ local_pin_and_unpin_random_entries(H5C_t * cache_ptr,
int i;
int idx;
- HDassert( cache_ptr );
HDassert( file_ptr );
HDassert( 0 <= min_idx );
HDassert( min_idx < max_idx );
@@ -2406,7 +2396,7 @@ local_pin_and_unpin_random_entries(H5C_t * cache_ptr,
for ( i = 0; i < count; i++ )
{
- local_pin_random_entry(cache_ptr, file_ptr, min_idx, max_idx);
+ local_pin_random_entry(file_ptr, min_idx, max_idx);
}
count = (HDrand() % (max_count - min_count)) + min_count;
@@ -2420,8 +2410,7 @@ local_pin_and_unpin_random_entries(H5C_t * cache_ptr,
while ( ( i < count ) && ( idx >= 0 ) )
{
via_unprotect = ( (((unsigned)i) & 0x0001) == 0 );
- idx = local_unpin_next_pinned_entry(cache_ptr, file_ptr,
- idx, via_unprotect);
+ idx = local_unpin_next_pinned_entry(file_ptr, idx, via_unprotect);
i++;
}
}
@@ -2451,8 +2440,7 @@ local_pin_and_unpin_random_entries(H5C_t * cache_ptr,
*****************************************************************************/
void
-local_pin_random_entry(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+local_pin_random_entry(H5F_t * file_ptr,
int min_idx,
int max_idx)
{
@@ -2461,7 +2449,6 @@ local_pin_random_entry(H5C_t * cache_ptr,
if ( nerrors == 0 ) {
- HDassert( cache_ptr );
HDassert( file_ptr );
HDassert( 0 <= min_idx );
HDassert( min_idx < max_idx );
@@ -2476,7 +2463,7 @@ local_pin_random_entry(H5C_t * cache_ptr,
}
while ( data[idx].global_pinned || data[idx].local_pinned );
- pin_entry(cache_ptr, file_ptr, idx, FALSE, FALSE);
+ pin_entry(file_ptr, idx, FALSE, FALSE);
}
return;
@@ -2501,8 +2488,7 @@ local_pin_random_entry(H5C_t * cache_ptr,
*****************************************************************************/
void
-local_unpin_all_entries(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+local_unpin_all_entries(H5F_t * file_ptr,
hbool_t via_unprotect)
{
/* const char * fcn_name = "local_unpin_all_entries()"; */
@@ -2511,14 +2497,13 @@ local_unpin_all_entries(H5C_t * cache_ptr,
int idx;
- HDassert( cache_ptr );
HDassert( file_ptr );
idx = 0;
while ( idx >= 0 )
{
- idx = local_unpin_next_pinned_entry(cache_ptr, file_ptr,
+ idx = local_unpin_next_pinned_entry(file_ptr,
idx, via_unprotect);
}
}
@@ -2548,8 +2533,7 @@ local_unpin_all_entries(H5C_t * cache_ptr,
*****************************************************************************/
int
-local_unpin_next_pinned_entry(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+local_unpin_next_pinned_entry(H5F_t * file_ptr,
int start_idx,
hbool_t via_unprotect)
{
@@ -2559,7 +2543,6 @@ local_unpin_next_pinned_entry(H5C_t * cache_ptr,
if ( nerrors == 0 ) {
- HDassert( cache_ptr );
HDassert( file_ptr );
HDassert( 0 <= start_idx );
HDassert( start_idx < NUM_DATA_ENTRIES );
@@ -2579,7 +2562,7 @@ local_unpin_next_pinned_entry(H5C_t * cache_ptr,
if ( data[idx].local_pinned ) {
- unpin_entry(cache_ptr, file_ptr, idx, FALSE, FALSE, via_unprotect);
+ unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect);
} else {
@@ -2611,8 +2594,7 @@ local_unpin_next_pinned_entry(H5C_t * cache_ptr,
*****************************************************************************/
void
-lock_and_unlock_random_entries(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+lock_and_unlock_random_entries(H5F_t * file_ptr,
int min_idx,
int max_idx,
int min_count,
@@ -2624,7 +2606,6 @@ lock_and_unlock_random_entries(H5C_t * cache_ptr,
if ( nerrors == 0 ) {
- HDassert( cache_ptr );
HDassert( file_ptr );
HDassert( 0 <= min_count );
HDassert( min_count < max_count );
@@ -2636,7 +2617,7 @@ lock_and_unlock_random_entries(H5C_t * cache_ptr,
for ( i = 0; i < count; i++ )
{
- lock_and_unlock_random_entry(cache_ptr, file_ptr, min_idx, max_idx);
+ lock_and_unlock_random_entry(file_ptr, min_idx, max_idx);
}
}
@@ -2663,8 +2644,7 @@ lock_and_unlock_random_entries(H5C_t * cache_ptr,
*****************************************************************************/
void
-lock_and_unlock_random_entry(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+lock_and_unlock_random_entry(H5F_t * file_ptr,
int min_idx,
int max_idx)
{
@@ -2673,7 +2653,6 @@ lock_and_unlock_random_entry(H5C_t * cache_ptr,
if ( nerrors == 0 ) {
- HDassert( cache_ptr );
HDassert( file_ptr );
HDassert( 0 <= min_idx );
HDassert( min_idx < max_idx );
@@ -2685,8 +2664,8 @@ lock_and_unlock_random_entry(H5C_t * cache_ptr,
HDassert( min_idx <= idx );
HDassert( idx <= max_idx );
- lock_entry(cache_ptr, file_ptr, idx);
- unlock_entry(cache_ptr, file_ptr, idx, H5AC__NO_FLAGS_SET);
+ lock_entry(file_ptr, idx);
+ unlock_entry(file_ptr, idx, H5AC__NO_FLAGS_SET);
}
return;
@@ -2715,8 +2694,7 @@ lock_and_unlock_random_entry(H5C_t * cache_ptr,
*****************************************************************************/
void
-lock_entry(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+lock_entry(H5F_t * file_ptr,
int32_t idx)
{
const char * fcn_name = "lock_entry()";
@@ -2725,7 +2703,6 @@ lock_entry(H5C_t * cache_ptr,
if ( nerrors == 0 ) {
- HDassert( cache_ptr );
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
HDassert( idx < virt_num_data_entries );
@@ -2776,9 +2753,7 @@ lock_entry(H5C_t * cache_ptr,
*****************************************************************************/
void
-mark_entry_dirty(H5C_t * cache_ptr,
- H5F_t * file_ptr,
- int32_t idx)
+mark_entry_dirty(int32_t idx)
{
const char * fcn_name = "mark_entry_dirty()";
herr_t result;
@@ -2786,8 +2761,6 @@ mark_entry_dirty(H5C_t * cache_ptr,
if ( nerrors == 0 ) {
- HDassert( file_ptr );
- HDassert( cache_ptr );
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
HDassert( idx < virt_num_data_entries );
@@ -2838,8 +2811,7 @@ mark_entry_dirty(H5C_t * cache_ptr,
*****************************************************************************/
void
-pin_entry(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+pin_entry(H5F_t * file_ptr,
int32_t idx,
hbool_t global,
hbool_t dirty)
@@ -2850,7 +2822,6 @@ pin_entry(H5C_t * cache_ptr,
if ( nerrors == 0 ) {
- HDassert( cache_ptr );
HDassert( file_ptr );
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
HDassert( idx < virt_num_data_entries );
@@ -2861,14 +2832,14 @@ pin_entry(H5C_t * cache_ptr,
HDassert ( ! (entry_ptr->local_pinned) );
HDassert ( ! ( dirty && ( ! global ) ) );
- lock_entry(cache_ptr, file_ptr, idx);
+ lock_entry(file_ptr, idx);
if ( dirty ) {
flags |= H5AC__DIRTIED_FLAG;
}
- unlock_entry(cache_ptr, file_ptr, idx, flags);
+ unlock_entry(file_ptr, idx, flags);
HDassert( (entry_ptr->header).is_pinned );
HDassert( ( ! dirty ) || ( (entry_ptr->header).is_dirty ) );
@@ -2991,10 +2962,9 @@ pin_protected_entry(int32_t idx,
*****************************************************************************/
void
-move_entry(H5C_t * cache_ptr,
- H5F_t * file_ptr,
- int32_t old_idx,
- int32_t new_idx)
+move_entry(H5F_t * file_ptr,
+ int32_t old_idx,
+ int32_t new_idx)
{
const char * fcn_name = "move_entry()";
herr_t result;
@@ -3007,7 +2977,6 @@ move_entry(H5C_t * cache_ptr,
if ( ( nerrors == 0 ) && ( old_idx != new_idx ) ) {
- HDassert( cache_ptr );
HDassert( file_ptr );
HDassert( ( 0 <= old_idx ) && ( old_idx < NUM_DATA_ENTRIES ) );
HDassert( old_idx < virt_num_data_entries );
@@ -3257,7 +3226,7 @@ setup_cache_for_test(hid_t * fid_ptr,
config.rpt_fcn_enabled = TRUE;
if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
+ != SUCCEED ) {
HDfprintf(stdout,
"%d:%s: H5AC_set_cache_auto_resize_config() failed.\n",
@@ -3558,8 +3527,7 @@ take_down_cache(hid_t fid)
*****************************************************************************/
void
-unlock_entry(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+unlock_entry(H5F_t * file_ptr,
int32_t idx,
unsigned int flags)
{
@@ -3570,7 +3538,6 @@ unlock_entry(H5C_t * cache_ptr,
if ( nerrors == 0 ) {
- HDassert( cache_ptr );
HDassert( file_ptr );
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
HDassert( idx < virt_num_data_entries );
@@ -3647,8 +3614,7 @@ unlock_entry(H5C_t * cache_ptr,
*****************************************************************************/
void
-unpin_entry(H5C_t * cache_ptr,
- H5F_t * file_ptr,
+unpin_entry(H5F_t * file_ptr,
int32_t idx,
hbool_t global,
hbool_t dirty,
@@ -3661,7 +3627,6 @@ unpin_entry(H5C_t * cache_ptr,
if ( nerrors == 0 ) {
- HDassert( cache_ptr );
HDassert( file_ptr );
HDassert( ( 0 <= idx ) && ( idx < NUM_DATA_ENTRIES ) );
HDassert( idx < virt_num_data_entries );
@@ -3676,20 +3641,20 @@ unpin_entry(H5C_t * cache_ptr,
if ( via_unprotect ) {
- lock_entry(cache_ptr, file_ptr, idx);
+ lock_entry(file_ptr, idx);
if ( dirty ) {
flags |= H5AC__DIRTIED_FLAG;
}
- unlock_entry(cache_ptr, file_ptr, idx, flags);
+ unlock_entry(file_ptr, idx, flags);
} else {
if ( dirty ) {
- mark_entry_dirty(cache_ptr, file_ptr, idx);
+ mark_entry_dirty(idx);
}
@@ -4021,26 +3986,24 @@ smoke_check_1(void)
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
}
- /* move the first half of the entries... */
+ /* Move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(cache_ptr, file_ptr, i,
- (i + (virt_num_data_entries / 2)));
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
}
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(cache_ptr, file_ptr, i,
- (i + (virt_num_data_entries / 2)));
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
}
if ( fid >= 0 ) {
@@ -4189,8 +4152,7 @@ smoke_check_2(void)
if ( i > 100 ) {
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
- (i - 100), i, 0, 10);
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i, 0, 10);
}
}
@@ -4198,44 +4160,43 @@ smoke_check_2(void)
{
/* Make sure we don't step on any locally pinned entries */
if ( data[i].local_pinned ) {
- unpin_entry(cache_ptr, file_ptr, i, FALSE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
}
- pin_entry(cache_ptr, file_ptr, i, TRUE, FALSE);
+ pin_entry(file_ptr, i, TRUE, FALSE);
}
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-=2 )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- lock_and_unlock_random_entries(cache_ptr, file_ptr, 0,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ lock_and_unlock_random_entries(file_ptr, 0,
(virt_num_data_entries / 20),
0, 100);
- local_pin_and_unpin_random_entries(cache_ptr, file_ptr, 0,
+ local_pin_and_unpin_random_entries(file_ptr, 0,
(virt_num_data_entries / 4),
0, 3);
}
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG);
- lock_and_unlock_random_entries(cache_ptr, file_ptr, 0,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_and_unlock_random_entries(file_ptr, 0,
(virt_num_data_entries / 10),
0, 100);
}
/* we can't move pinned entries, so release any local pins now. */
- local_unpin_all_entries(cache_ptr, file_ptr, FALSE);
+ local_unpin_all_entries(file_ptr, FALSE);
/* Move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(cache_ptr, file_ptr, i,
- (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(cache_ptr, file_ptr, 0,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
((virt_num_data_entries / 50) - 1),
0, 100);
}
@@ -4243,11 +4204,10 @@ smoke_check_2(void)
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG);
- move_entry(cache_ptr, file_ptr, i,
- (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(cache_ptr, file_ptr, 0,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
(virt_num_data_entries / 100),
0, 100);
}
@@ -4257,7 +4217,7 @@ smoke_check_2(void)
hbool_t via_unprotect = ( (((unsigned)i) & 0x01) == 0 );
hbool_t dirty = ( (((unsigned)i) & 0x02) == 0 );
- unpin_entry(cache_ptr, file_ptr, i, TRUE, dirty, via_unprotect);
+ unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
}
if ( fid >= 0 ) {
@@ -4433,8 +4393,7 @@ smoke_check_3(void)
if ( i > 100 ) {
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
- (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -4458,10 +4417,10 @@ smoke_check_3(void)
hbool_t dirty = ( (i % 2) == 0);
if ( data[i].local_pinned ) {
- unpin_entry(cache_ptr, file_ptr, i, FALSE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
}
- pin_entry(cache_ptr, file_ptr, i, TRUE, dirty);
+ pin_entry(file_ptr, i, TRUE, dirty);
HDassert( !dirty || data[i].header.is_dirty );
HDassert( data[i].header.is_pinned );
@@ -4471,13 +4430,12 @@ smoke_check_3(void)
if ( i > 100 ) {
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
- (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
- local_pin_and_unpin_random_entries(cache_ptr, file_ptr,
- 0, virt_num_data_entries / 4,
+ local_pin_and_unpin_random_entries(file_ptr, 0,
+ virt_num_data_entries / 4,
0, (file_mpi_rank + 2));
}
@@ -4519,17 +4477,17 @@ smoke_check_3(void)
HDassert( data[i].global_pinned );
HDassert( ! data[i].local_pinned );
- unpin_entry(cache_ptr, file_ptr, i, TRUE, dirty,
+ unpin_entry(file_ptr, i, TRUE, dirty,
via_unprotect);
}
if ( i % 2 == 0 ) {
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- local_pin_and_unpin_random_entries(cache_ptr, file_ptr, 0,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ local_pin_and_unpin_random_entries(file_ptr, 0,
virt_num_data_entries / 2,
0, 2);
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
}
}
@@ -4547,9 +4505,9 @@ smoke_check_3(void)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG);
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
}
@@ -4557,7 +4515,7 @@ smoke_check_3(void)
if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
/* we can't move pinned entries, so release any local pins now. */
- local_unpin_all_entries(cache_ptr, file_ptr, FALSE);
+ local_unpin_all_entries(file_ptr, FALSE);
min_count = 10 / (file_mpi_rank + 1);
max_count = min_count + 100;
@@ -4565,11 +4523,10 @@ smoke_check_3(void)
/* move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(cache_ptr, file_ptr, i,
- (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(cache_ptr, file_ptr, 0,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
(virt_num_data_entries / 20),
min_count, max_count);
}
@@ -4580,11 +4537,10 @@ smoke_check_3(void)
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG);
- move_entry(cache_ptr, file_ptr, i,
- (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(cache_ptr, file_ptr, 0,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
(virt_num_data_entries / 40),
min_count, max_count);
}
@@ -4600,17 +4556,16 @@ smoke_check_3(void)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- local_pin_and_unpin_random_entries(cache_ptr, file_ptr, 0,
+ local_pin_and_unpin_random_entries(file_ptr, 0,
(virt_num_data_entries / 2),
0, 5);
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
if ( i > 100 ) {
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
- (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -4619,7 +4574,7 @@ smoke_check_3(void)
if ( verbose ) {HDfprintf(stderr, "%d: cp = %d\n", world_mpi_rank, cp++);}
/* release any local pins before we take down the cache. */
- local_unpin_all_entries(cache_ptr, file_ptr, FALSE);
+ local_unpin_all_entries(file_ptr, FALSE);
if ( fid >= 0 ) {
@@ -4787,8 +4742,7 @@ smoke_check_4(void)
if ( i > 100 ) {
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
- (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -4812,7 +4766,7 @@ smoke_check_4(void)
* entries are in fact pinned (which unpin_entry() should do).
*/
insert_entry(cache_ptr, file_ptr, i, H5C__PIN_ENTRY_FLAG);
- unpin_entry(cache_ptr, file_ptr, i, TRUE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, TRUE, FALSE, FALSE);
}
if ( i % 59 == 0 ) {
@@ -4820,10 +4774,10 @@ smoke_check_4(void)
hbool_t dirty = ( (i % 2) == 0);
if ( data[i].local_pinned ) {
- unpin_entry(cache_ptr, file_ptr, i, FALSE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
}
- pin_entry(cache_ptr, file_ptr, i, TRUE, dirty);
+ pin_entry(file_ptr, i, TRUE, dirty);
HDassert( !dirty || data[i].header.is_dirty );
HDassert( data[i].header.is_pinned );
@@ -4833,12 +4787,11 @@ smoke_check_4(void)
if ( i > 100 ) {
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
- (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
- local_pin_and_unpin_random_entries(cache_ptr, file_ptr, 0,
+ local_pin_and_unpin_random_entries(file_ptr, 0,
(virt_num_data_entries / 4),
0, (file_mpi_rank + 2));
}
@@ -4870,14 +4823,14 @@ smoke_check_4(void)
HDassert( data[i].global_pinned );
HDassert( ! data[i].local_pinned );
- unpin_entry(cache_ptr, file_ptr, i, TRUE, dirty, via_unprotect);
+ unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
}
if ( i % 2 == 0 ) {
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
}
}
@@ -4888,14 +4841,14 @@ smoke_check_4(void)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG);
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_and_unlock_random_entries(file_ptr,
min_idx, max_idx, 0, 100);
}
/* we can't move pinned entries, so release any local pins now. */
- local_unpin_all_entries(cache_ptr, file_ptr, FALSE);
+ local_unpin_all_entries(file_ptr, FALSE);
min_count = 10 * (file_mpi_rank % 4);
max_count = min_count + 100;
@@ -4903,11 +4856,10 @@ smoke_check_4(void)
/* move the first half of the entries... */
for ( i = 0; i < (virt_num_data_entries / 2); i++ )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- move_entry(cache_ptr, file_ptr, i,
- (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(cache_ptr, file_ptr, 0,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
(virt_num_data_entries / 20),
min_count, max_count);
}
@@ -4915,11 +4867,10 @@ smoke_check_4(void)
/* ...and then move them back. */
for ( i = (virt_num_data_entries / 2) - 1; i >= 0; i-- )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG);
- move_entry(cache_ptr, file_ptr, i,
- (i + (virt_num_data_entries / 2)));
- lock_and_unlock_random_entries(cache_ptr, file_ptr, 0,
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
+ move_entry(file_ptr, i, (i + (virt_num_data_entries / 2)));
+ lock_and_unlock_random_entries(file_ptr, 0,
(virt_num_data_entries / 40),
min_count, max_count);
}
@@ -4932,13 +4883,12 @@ smoke_check_4(void)
for ( i = 0; i < (virt_num_data_entries / 2); i+=2 )
{
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
if ( i > 100 ) {
- lock_and_unlock_random_entries(cache_ptr, file_ptr,
- (i - 100), i,
+ lock_and_unlock_random_entries(file_ptr, (i - 100), i,
min_count, max_count);
}
}
@@ -5132,24 +5082,24 @@ smoke_check_5(void)
for ( i = 0; i < (virt_num_data_entries / 4); i++ )
{
- lock_entry(cache_ptr, file_ptr, i);
+ lock_entry(file_ptr, i);
if ( i % 2 == 0 )
{
- mark_entry_dirty(cache_ptr, file_ptr, i);
+ mark_entry_dirty(i);
}
- unlock_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
+ unlock_entry(file_ptr, i, H5AC__NO_FLAGS_SET);
if ( i % 2 == 1 )
{
if ( i % 4 == 1 ) {
- lock_entry(cache_ptr, file_ptr, i);
- unlock_entry(cache_ptr, file_ptr, i, H5AC__DIRTIED_FLAG);
+ lock_entry(file_ptr, i);
+ unlock_entry(file_ptr, i, H5AC__DIRTIED_FLAG);
}
- expunge_entry(cache_ptr, file_ptr, i);
+ expunge_entry(file_ptr, i);
}
}
@@ -5162,7 +5112,7 @@ smoke_check_5(void)
i >= (virt_num_data_entries / 4);
i-- )
{
- pin_entry(cache_ptr, file_ptr, i, TRUE, FALSE);
+ pin_entry(file_ptr, i, TRUE, FALSE);
if ( i % 2 == 0 )
{
@@ -5171,7 +5121,7 @@ smoke_check_5(void)
resize_entry(i, data[i].len / 2);
}
- mark_entry_dirty(cache_ptr, file_ptr, i);
+ mark_entry_dirty(i);
if ( i % 8 <= 4 ) {
@@ -5179,7 +5129,7 @@ smoke_check_5(void)
}
}
- unpin_entry(cache_ptr, file_ptr, i, TRUE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, TRUE, FALSE, FALSE);
}
/* 6 */
@@ -5424,7 +5374,7 @@ trace_file_check(void)
strcpy(config.trace_file_name, "t_cache_trace.txt");
if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
+ != SUCCEED ) {
nerrors++;
HDfprintf(stdout,
@@ -5439,27 +5389,27 @@ trace_file_check(void)
insert_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET);
insert_entry(cache_ptr, file_ptr, 3, H5AC__NO_FLAGS_SET);
- lock_entry(cache_ptr, file_ptr, 0);
- mark_entry_dirty(cache_ptr, file_ptr, 0);
- unlock_entry(cache_ptr, file_ptr, 0, H5AC__NO_FLAGS_SET);
+ lock_entry(file_ptr, 0);
+ mark_entry_dirty(0);
+ unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET);
- lock_entry(cache_ptr, file_ptr, 1);
+ lock_entry(file_ptr, 1);
pin_protected_entry(1, TRUE);
- unlock_entry(cache_ptr, file_ptr, 1, H5AC__NO_FLAGS_SET);
- unpin_entry(cache_ptr, file_ptr, 1, TRUE, FALSE, FALSE);
+ unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET);
+ unpin_entry(file_ptr, 1, TRUE, FALSE, FALSE);
- expunge_entry(cache_ptr,file_ptr, 1);
+ expunge_entry(file_ptr, 1);
- lock_entry(cache_ptr, file_ptr, 2);
+ lock_entry(file_ptr, 2);
pin_protected_entry(2, TRUE);
- unlock_entry(cache_ptr, file_ptr, 2, H5AC__NO_FLAGS_SET);
- mark_entry_dirty(cache_ptr, file_ptr, 2);
+ unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET);
+ mark_entry_dirty(2);
resize_entry(2, data[2].len / 2);
resize_entry(2, data[2].len);
- unpin_entry(cache_ptr, file_ptr, 2, TRUE, FALSE, FALSE);
+ unpin_entry(file_ptr, 2, TRUE, FALSE, FALSE);
- move_entry(cache_ptr, file_ptr, 0, 20);
- move_entry(cache_ptr, file_ptr, 0, 20);
+ move_entry(file_ptr, 0, 20);
+ move_entry(file_ptr, 0, 20);
if ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) {
nerrors++;
@@ -5488,7 +5438,7 @@ trace_file_check(void)
config.trace_file_name[0] = '\0';
if ( H5AC_set_cache_auto_resize_config(cache_ptr, &config)
- != SUCCEED ) {
+ != SUCCEED ) {
nerrors++;
HDfprintf(stdout,