diff options
Diffstat (limited to 'testpar/t_cache.c')
-rw-r--r-- | testpar/t_cache.c | 360 |
1 files changed, 155 insertions, 205 deletions
diff --git a/testpar/t_cache.c b/testpar/t_cache.c index b80730b..2590295 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -342,40 +342,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 */ @@ -1657,6 +1650,7 @@ serve_write_request(struct mssg_t * mssg_ptr) /**************************** Call back functions ****************************/ /*****************************************************************************/ + /*------------------------------------------------------------------------- * Function: clear_datum * @@ -2184,8 +2178,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()"; @@ -2193,7 +2186,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 ); @@ -2295,8 +2287,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]) ) || @@ -2375,8 +2367,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, @@ -2391,7 +2382,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 ); @@ -2407,7 +2397,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; @@ -2421,8 +2411,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++; } } @@ -2452,8 +2441,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) { @@ -2462,7 +2450,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 ); @@ -2477,7 +2464,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; @@ -2502,8 +2489,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()"; */ @@ -2512,14 +2498,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); } } @@ -2549,8 +2534,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) { @@ -2560,7 +2544,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 ); @@ -2580,7 +2563,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 { @@ -2612,8 +2595,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, @@ -2625,7 +2607,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 ); @@ -2637,7 +2618,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); } } @@ -2664,8 +2645,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) { @@ -2674,7 +2654,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 ); @@ -2686,8 +2665,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; @@ -2716,8 +2695,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()"; @@ -2726,7 +2704,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 ); @@ -2777,9 +2754,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; @@ -2787,8 +2762,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 ); @@ -2839,8 +2812,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) @@ -2851,7 +2823,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 ); @@ -2862,14 +2833,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 ) ); @@ -2992,10 +2963,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; @@ -3008,7 +2978,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 ); @@ -3258,7 +3227,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", @@ -3559,8 +3528,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) { @@ -3571,7 +3539,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 ); @@ -3648,8 +3615,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, @@ -3662,7 +3628,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 ); @@ -3677,20 +3642,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); } @@ -4022,26 +3987,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 ) { @@ -4190,8 +4153,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); } } @@ -4199,44 +4161,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); } @@ -4244,11 +4205,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); } @@ -4258,7 +4218,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 ) { @@ -4434,8 +4394,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); } } @@ -4459,10 +4418,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 ); @@ -4472,13 +4431,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)); } @@ -4520,17 +4478,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); } } @@ -4548,9 +4506,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); } @@ -4558,7 +4516,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; @@ -4566,11 +4524,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); } @@ -4581,11 +4538,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); } @@ -4601,17 +4557,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); } } @@ -4620,7 +4575,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 ) { @@ -4788,8 +4743,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); } } @@ -4813,7 +4767,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 ) { @@ -4821,10 +4775,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 ); @@ -4834,12 +4788,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)); } @@ -4871,14 +4824,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); } } @@ -4889,14 +4842,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; @@ -4904,11 +4857,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); } @@ -4916,11 +4868,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); } @@ -4933,13 +4884,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); } } @@ -5133,24 +5083,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); } } @@ -5163,7 +5113,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 ) { @@ -5172,7 +5122,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 ) { @@ -5180,7 +5130,7 @@ smoke_check_5(void) } } - unpin_entry(cache_ptr, file_ptr, i, TRUE, FALSE, FALSE); + unpin_entry(file_ptr, i, TRUE, FALSE, FALSE); } /* 6 */ @@ -5425,7 +5375,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, @@ -5440,27 +5390,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++; @@ -5489,7 +5439,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, |