summaryrefslogtreecommitdiffstats
path: root/test/cache2_common.c
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2008-10-03 06:50:54 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2008-10-03 06:50:54 (GMT)
commit648d6ac066ed4f75e168f7a4946fb62d0da6d400 (patch)
treedfe57c4556e6ced61264cdb00f731ac2edcbbb77 /test/cache2_common.c
parentd3f252466cddf196075b31c442fe1aed611b6ca8 (diff)
downloadhdf5-648d6ac066ed4f75e168f7a4946fb62d0da6d400.zip
hdf5-648d6ac066ed4f75e168f7a4946fb62d0da6d400.tar.gz
hdf5-648d6ac066ed4f75e168f7a4946fb62d0da6d400.tar.bz2
[svn-r15763] Converted the fractal heap direct block cache client to use the
revised cache. Note that this conversion is not as efficient as it should be. Specifically, it does it more memcpy's between the metadata cache's on disk image of the direct block and the fractal heap's on disk image of the direct block than is absolutely essential. Eventually, we will want to fix this -- probably by allowing the metadata cache and the fractal heap direct block to share a common on disk image of the direct block. However, this will require extensions to the client / metadata cache interface, and some reworking of the fractal heap as well. This checkin also includes Mike M's fix to the Linew specific bug mentioned in my checkin of 22 Aug 2008. Tested on Phoenix (serial debug and production), Kagiso (parallel), and Linew (serial)
Diffstat (limited to 'test/cache2_common.c')
-rw-r--r--test/cache2_common.c327
1 files changed, 207 insertions, 120 deletions
diff --git a/test/cache2_common.c b/test/cache2_common.c
index dcc4b13..c27f7f4 100644
--- a/test/cache2_common.c
+++ b/test/cache2_common.c
@@ -1151,6 +1151,7 @@ serialize(haddr_t addr,
herr_t
pico_serialize(const H5F_t UNUSED *f,
+ hid_t UNUSED dxpl_id,
haddr_t addr,
size_t len,
void * image_ptr,
@@ -1167,6 +1168,7 @@ pico_serialize(const H5F_t UNUSED *f,
herr_t
nano_serialize(const H5F_t UNUSED *f,
+ hid_t UNUSED dxpl_id,
haddr_t addr,
size_t len,
void * image_ptr,
@@ -1183,7 +1185,8 @@ nano_serialize(const H5F_t UNUSED *f,
herr_t
micro_serialize(const H5F_t UNUSED *f,
- haddr_t addr,
+ hid_t UNUSED dxpl_id,
+ haddr_t addr,
size_t len,
void * image_ptr,
void * thing,
@@ -1199,6 +1202,7 @@ micro_serialize(const H5F_t UNUSED *f,
herr_t
tiny_serialize(const H5F_t UNUSED *f,
+ hid_t UNUSED dxpl_id,
haddr_t addr,
size_t len,
void * image_ptr,
@@ -1215,7 +1219,8 @@ tiny_serialize(const H5F_t UNUSED *f,
herr_t
small_serialize(const H5F_t UNUSED *f,
- haddr_t addr,
+ hid_t UNUSED dxpl_id,
+ haddr_t addr,
size_t len,
void * image_ptr,
void * thing,
@@ -1231,7 +1236,8 @@ small_serialize(const H5F_t UNUSED *f,
herr_t
medium_serialize(const H5F_t UNUSED *f,
- haddr_t addr,
+ hid_t UNUSED dxpl_id,
+ haddr_t addr,
size_t len,
void * image_ptr,
void * thing,
@@ -1247,7 +1253,8 @@ medium_serialize(const H5F_t UNUSED *f,
herr_t
large_serialize(const H5F_t UNUSED *f,
- haddr_t addr,
+ hid_t UNUSED dxpl_id,
+ haddr_t addr,
size_t len,
void * image_ptr,
void * thing,
@@ -1263,6 +1270,7 @@ large_serialize(const H5F_t UNUSED *f,
herr_t
huge_serialize(const H5F_t UNUSED *f,
+ hid_t UNUSED dxpl_id,
haddr_t addr,
size_t len,
void * image_ptr,
@@ -1279,7 +1287,8 @@ huge_serialize(const H5F_t UNUSED *f,
herr_t
monster_serialize(const H5F_t UNUSED *f,
- haddr_t addr,
+ hid_t UNUSED dxpl_id,
+ haddr_t addr,
size_t len,
void * image_ptr,
void * thing,
@@ -1295,7 +1304,8 @@ monster_serialize(const H5F_t UNUSED *f,
herr_t
variable_serialize(const H5F_t UNUSED *f,
- haddr_t addr,
+ hid_t UNUSED dxpl_id,
+ haddr_t addr,
size_t len,
void * image_ptr,
void * thing,
@@ -1689,16 +1699,18 @@ dirty_entry2(H5F_t * file_ptr,
int32_t idx,
hbool_t dirty_pin)
{
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
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_indices2[type] ) );
-
if ( pass2 ) {
+ cache_ptr = file_ptr->shared->cache2;
+
+ HDassert( cache_ptr );
+ HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
+
if ( dirty_pin ) {
if ( ! entry_in_cache2(cache_ptr, type, idx) ) {
@@ -1766,29 +1778,30 @@ execute_flush_op2(H5F_t * file_ptr,
unsigned * flags_ptr)
{
/* const char * fcn_name = "execute_flush_op2()"; */
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
-
- HDassert( cache_ptr != NULL );
- HDassert( cache_ptr->magic == H5C2__H5C2_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_indices2[entry_ptr->type] ) );
- HDassert( ( 0 <= op_ptr->type ) &&
- ( op_ptr->type < NUMBER_OF_ENTRY_TYPES ) );
- HDassert( ( 0 <= op_ptr->idx ) &&
- ( op_ptr->idx <= max_indices2[op_ptr->type] ) );
- HDassert( ( op_ptr->flag == FALSE ) || ( op_ptr->flag == TRUE ) );
- HDassert( flags_ptr != NULL );
+ H5C2_t * cache_ptr;
if ( pass2 ) {
+ cache_ptr = file_ptr->shared->cache2;
+ HDassert( cache_ptr != NULL );
+ HDassert( cache_ptr->magic == H5C2__H5C2_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_indices2[entry_ptr->type] ) );
+ HDassert( ( 0 <= op_ptr->type ) &&
+ ( op_ptr->type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= op_ptr->idx ) &&
+ ( op_ptr->idx <= max_indices2[op_ptr->type] ) );
+ HDassert( ( op_ptr->flag == FALSE ) || ( op_ptr->flag == TRUE ) );
+ HDassert( flags_ptr != NULL );
+
switch ( op_ptr->op_code )
{
case FLUSH_OP__NO_OP:
@@ -2084,18 +2097,20 @@ resize_entry2(H5F_t * file_ptr,
size_t new_size,
hbool_t resize_pin)
{
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
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_indices2[type] ) );
- HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes2[type] ) );
-
if ( pass2 ) {
+ cache_ptr = file_ptr->shared->cache2;
+
+ HDassert( cache_ptr );
+ HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( type == VARIABLE_ENTRY_TYPE );
+ HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
+ HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes2[type] ) );
+
base_addr = entries2[type];
entry_ptr = &(base_addr[idx]);
@@ -2164,19 +2179,20 @@ resize_pinned_entry2(H5F_t * file_ptr,
int32_t idx,
size_t new_size)
{
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
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_indices2[type] ) );
- HDassert( type = VARIABLE_ENTRY_TYPE ) ;
- HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes2[type] ) );
-
if ( pass2 ) {
+ cache_ptr = file_ptr->shared->cache2;
+ HDassert( cache_ptr );
+ HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
+ HDassert( type = VARIABLE_ENTRY_TYPE ) ;
+ HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes2[type] ) );
+
if ( ! entry_in_cache2(cache_ptr, type, idx) ) {
pass2 = FALSE;
@@ -2989,7 +3005,7 @@ expunge_entry2(H5F_t * file_ptr,
{
/* const char * fcn_name = "expunge_entry2()"; */
#ifndef NDEBUG
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
#endif /* NDEBUG */
herr_t result;
test_entry_t * base_addr;
@@ -2997,6 +3013,10 @@ expunge_entry2(H5F_t * file_ptr,
if ( pass2 ) {
+#ifndef NDEBUG
+ cache_ptr = file_ptr->shared->cache2;
+#endif /* NDEBUG */
+
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
@@ -3053,13 +3073,11 @@ flush_cache2(H5F_t * file_ptr,
hbool_t dump_detailed_stats)
{
const char * fcn_name = "flush_cache2()";
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
hbool_t show_progress = FALSE;
herr_t result = 0;
int mile_post = 0;
- HDassert(file_ptr);
-
if ( show_progress ) {
HDfprintf(stdout, "%s: mile_post = %d.\n",
fcn_name, mile_post++); /* 0 */
@@ -3074,6 +3092,10 @@ flush_cache2(H5F_t * file_ptr,
if ( pass2 ) {
+ HDassert(file_ptr);
+
+ cache_ptr = file_ptr->shared->cache2;
+
if ( destroy_entries ) {
result = H5C2_flush_cache(file_ptr, H5P_DATASET_XFER_DEFAULT,
@@ -3162,7 +3184,7 @@ insert_entry2(H5F_t * file_ptr,
hbool_t UNUSED dirty,
unsigned int flags)
{
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
herr_t result;
hbool_t insert_pinned;
test_entry_t * base_addr;
@@ -3170,6 +3192,8 @@ insert_entry2(H5F_t * file_ptr,
if ( pass2 ) {
+ cache_ptr = file_ptr->shared->cache2;
+
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
@@ -3268,7 +3292,7 @@ mark_pinned_entry_dirty2(H5F_t * file_ptr,
{
/* const char * fcn_name = "mark_pinned_entry_dirty2()"; */
#ifndef NDEBUG
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
#endif /* NDEBUG */
herr_t result;
test_entry_t * base_addr;
@@ -3276,6 +3300,10 @@ mark_pinned_entry_dirty2(H5F_t * file_ptr,
if ( pass2 ) {
+#ifndef NDEBUG
+ cache_ptr = file_ptr->shared->cache2;
+#endif /* NDEBUG */
+
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
@@ -3366,7 +3394,7 @@ mark_pinned_or_protected_entry_dirty2(H5F_t * file_ptr,
{
/* const char * fcn_name = "mark_pinned_or_protected_entry_dirty2()"; */
#ifndef NDEBUG
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
#endif /* NDEBUG */
herr_t result;
test_entry_t * base_addr;
@@ -3374,6 +3402,10 @@ mark_pinned_or_protected_entry_dirty2(H5F_t * file_ptr,
if ( pass2 ) {
+#ifndef NDEBUG
+ cache_ptr = file_ptr->shared->cache2;
+#endif /* NDEBUG */
+
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
@@ -3579,7 +3611,7 @@ pin_protected_entry2(H5F_t * file_ptr,
{
/* const char * fcn_name = "pin_protected_entry2()"; */
#ifndef NDEBUG
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
#endif /* NDEBUG */
herr_t result;
test_entry_t * base_addr;
@@ -3587,6 +3619,10 @@ pin_protected_entry2(H5F_t * file_ptr,
if ( pass2 ) {
+#ifndef NDEBUG
+ cache_ptr = file_ptr->shared->cache2;
+#endif /* NDEBUG */
+
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
@@ -3659,7 +3695,7 @@ protect_entry2(H5F_t * file_ptr,
int32_t idx)
{
const char * fcn_name = "protect_entry2()";
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
hbool_t verbose = FALSE;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -3672,6 +3708,8 @@ protect_entry2(H5F_t * file_ptr,
if ( pass2 ) {
+ cache_ptr = file_ptr->shared->cache2;
+
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
@@ -3783,13 +3821,15 @@ protect_entry_ro2(H5F_t * file_ptr,
int32_t idx)
{
/* const char * fcn_name = "protect_entry_ro2()"; */
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
H5C2_cache_entry_t * cache_entry_ptr;
if ( pass2 ) {
+ cache_ptr = file_ptr->shared->cache2;
+
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
@@ -3866,7 +3906,7 @@ unpin_entry2(H5F_t * file_ptr,
{
/* const char * fcn_name = "unpin_entry2()"; */
#ifndef NDEBUG
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
#endif /* NDEBUG */
herr_t result;
test_entry_t * base_addr;
@@ -3874,6 +3914,10 @@ unpin_entry2(H5F_t * file_ptr,
if ( pass2 ) {
+#ifndef NDEBUG
+ cache_ptr = file_ptr->shared->cache2;
+#endif /* NDEBUG */
+
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
@@ -3957,7 +4001,7 @@ unprotect_entry2(H5F_t * file_ptr,
{
const char * fcn_name = "unprotect_entry2()";
#ifndef NDEBUG
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
#endif /* NDEBUG */
herr_t result;
hbool_t verbose = FALSE;
@@ -3974,6 +4018,10 @@ unprotect_entry2(H5F_t * file_ptr,
if ( pass2 ) {
+#ifndef NDEBUG
+ cache_ptr = file_ptr->shared->cache2;
+#endif /* NDEBUG */
+
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
@@ -4157,7 +4205,7 @@ unprotect_entry_with_size_change2(H5F_t * file_ptr,
{
/* const char * fcn_name = "unprotect_entry_with_size_change2()"; */
#ifndef NDEBUG
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
#endif /* NDEBUG */
herr_t result;
hbool_t dirty_flag_set;
@@ -4169,6 +4217,10 @@ unprotect_entry_with_size_change2(H5F_t * file_ptr,
if ( pass2 ) {
+#ifndef NDEBUG
+ cache_ptr = file_ptr->shared->cache2;
+#endif /* NDEBUG */
+
HDassert( cache_ptr );
HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
HDassert( ( 0 <= idx ) && ( idx <= max_indices2[type] ) );
@@ -4293,21 +4345,26 @@ row_major_scan_forward2(H5F_t * file_ptr,
int dirty_unprotects)
{
const char * fcn_name = "row_major_scan_forward2";
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
- int32_t type;
+ H5C2_t * cache_ptr;
+ int32_t type = 0;
int32_t idx;
int32_t local_max_index;
if ( verbose )
HDfprintf(stdout, "%s(): entering.\n", fcn_name);
- HDassert( lag >= 10 );
+ if ( pass2 ) {
- type = 0;
+ cache_ptr = file_ptr->shared->cache2;
- if ( ( pass2 ) && ( reset_stats ) ) {
+ HDassert( cache_ptr != NULL );
- H5C2_stats__reset(cache_ptr);
+ HDassert( lag >= 10 );
+
+ if ( reset_stats ) {
+
+ H5C2_stats__reset(cache_ptr);
+ }
}
while ( ( pass2 ) && ( type < NUMBER_OF_ENTRY_TYPES ) )
@@ -4653,8 +4710,8 @@ hl_row_major_scan_forward2(H5F_t * file_ptr,
hbool_t dirty_inserts)
{
const char * fcn_name = "hl_row_major_scan_forward2";
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
- int32_t type;
+ H5C2_t * cache_ptr;
+ int32_t type = 0;
int32_t idx;
int32_t i;
int32_t lag = 100;
@@ -4663,15 +4720,19 @@ hl_row_major_scan_forward2(H5F_t * file_ptr,
if ( verbose )
HDfprintf(stdout, "%s(): entering.\n", fcn_name);
- HDassert( lag > 5 );
- HDassert( max_index >= 200 );
- HDassert( max_index <= MAX_ENTRIES );
+ if ( pass2 ) {
- type = 0;
+ cache_ptr = file_ptr->shared->cache2;
- if ( ( pass2 ) && ( reset_stats ) ) {
+ HDassert( cache_ptr != NULL );
+ HDassert( lag > 5 );
+ HDassert( max_index >= 200 );
+ HDassert( max_index <= MAX_ENTRIES );
- H5C2_stats__reset(cache_ptr);
+ if ( reset_stats ) {
+
+ H5C2_stats__reset(cache_ptr);
+ }
}
while ( ( pass2 ) && ( type < NUMBER_OF_ENTRY_TYPES ) )
@@ -4775,21 +4836,25 @@ row_major_scan_backward2(H5F_t * file_ptr,
int dirty_unprotects)
{
const char * fcn_name = "row_major_scan_backward2";
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
- int32_t type;
+ H5C2_t * cache_ptr;
+ int32_t type = NUMBER_OF_ENTRY_TYPES - 1;
int32_t idx;
int32_t local_max_index;
if ( verbose )
HDfprintf(stdout, "%s(): Entering.\n", fcn_name);
- HDassert( lag >= 10 );
+ if ( pass2 ) {
- type = NUMBER_OF_ENTRY_TYPES - 1;
+ cache_ptr = file_ptr->shared->cache2;
+
+ HDassert( cache_ptr != NULL );
+ HDassert( lag >= 10 );
- if ( ( pass2 ) && ( reset_stats ) ) {
+ if ( reset_stats ) {
- H5C2_stats__reset(cache_ptr);
+ H5C2_stats__reset(cache_ptr);
+ }
}
while ( ( pass2 ) && ( type >= 0 ) )
@@ -5102,8 +5167,8 @@ hl_row_major_scan_backward2(H5F_t * file_ptr,
hbool_t dirty_inserts)
{
const char * fcn_name = "hl_row_major_scan_backward2";
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
- int32_t type;
+ H5C2_t * cache_ptr;
+ int32_t type = NUMBER_OF_ENTRY_TYPES - 1;
int32_t idx;
int32_t i;
int32_t lag = 100;
@@ -5112,15 +5177,19 @@ hl_row_major_scan_backward2(H5F_t * file_ptr,
if ( verbose )
HDfprintf(stdout, "%s(): entering.\n", fcn_name);
- HDassert( lag > 5 );
- HDassert( max_index >= 200 );
- HDassert( max_index <= MAX_ENTRIES );
+ if ( pass2 ) {
- type = NUMBER_OF_ENTRY_TYPES - 1;
+ cache_ptr = file_ptr->shared->cache2;
- if ( ( pass2 ) && ( reset_stats ) ) {
+ HDassert( cache_ptr != NULL );
+ HDassert( lag > 5 );
+ HDassert( max_index >= 200 );
+ HDassert( max_index <= MAX_ENTRIES );
- H5C2_stats__reset(cache_ptr);
+ if ( reset_stats ) {
+
+ H5C2_stats__reset(cache_ptr);
+ }
}
while ( ( pass2 ) && ( type >= 0 ) )
@@ -5215,27 +5284,30 @@ col_major_scan_forward2(H5F_t * file_ptr,
int dirty_unprotects)
{
const char * fcn_name = "col_major_scan_forward2()";
- H5C2_t * cache_ptr = file_ptr->shared->cache2;
+ H5C2_t * cache_ptr;
int i;
- int32_t type;
+ int32_t type = 0;
int32_t idx;
int32_t local_max_index[NUMBER_OF_ENTRY_TYPES];
if ( verbose )
HDfprintf(stdout, "%s: entering.\n", fcn_name);
- for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ )
- {
- local_max_index[i] = MIN(max_index, max_indices2[i]);
- }
+ if ( pass2 ) {
- HDassert( lag > 5 );
+ cache_ptr = file_ptr->shared->cache2;
- type = 0;
+ for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ )
+ {
+ local_max_index[i] = MIN(max_index, max_indices2[i]);
+ }
- if ( ( pass2 ) && ( reset_stats ) ) {
+ HDassert( lag > 5 );
- H5C2_stats__reset(cache_ptr);
+ if ( reset_stats ) {
+
+ H5C2_stats__reset(cache_ptr);
+ }
}
idx = -lag;
@@ -5335,7 +5407,7 @@ hl_col_major_scan_forward2(H5F_t * file_ptr,
{
const char * fcn_name = "hl_col_major_scan_forward2()";
H5C2_t * cache_ptr = file_ptr->shared->cache2;
- int32_t type;
+ int32_t type = 0;
int32_t idx;
int32_t lag = 200;
int32_t i;
@@ -5344,15 +5416,19 @@ hl_col_major_scan_forward2(H5F_t * file_ptr,
if ( verbose )
HDfprintf(stdout, "%s: entering.\n", fcn_name);
- HDassert( lag > 5 );
- HDassert( max_index >= 500 );
- HDassert( max_index <= MAX_ENTRIES );
+ if ( pass2 ) {
- type = 0;
+ cache_ptr = file_ptr->shared->cache2;
- if ( ( pass2 ) && ( reset_stats ) ) {
+ HDassert( cache_ptr != NULL );
+ HDassert( lag > 5 );
+ HDassert( max_index >= 500 );
+ HDassert( max_index <= MAX_ENTRIES );
- H5C2_stats__reset(cache_ptr);
+ if ( reset_stats ) {
+
+ H5C2_stats__reset(cache_ptr);
+ }
}
idx = 0;
@@ -5467,16 +5543,23 @@ col_major_scan_backward2(H5F_t * file_ptr,
if ( verbose )
HDfprintf(stdout, "%s: entering.\n", fcn_name);
- for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ )
- {
- local_max_index[i] = MIN(max_index, max_indices2[i]);
- }
+ if ( pass2 ) {
- HDassert( lag > 5 );
+ cache_ptr = file_ptr->shared->cache2;
- if ( ( pass2 ) && ( reset_stats ) ) {
+ HDassert( cache_ptr != NULL );
- H5C2_stats__reset(cache_ptr);
+ for ( i = 0; i < NUMBER_OF_ENTRY_TYPES; i++ )
+ {
+ local_max_index[i] = MIN(max_index, max_indices2[i]);
+ }
+
+ HDassert( lag > 5 );
+
+ if ( reset_stats ) {
+
+ H5C2_stats__reset(cache_ptr);
+ }
}
/* idx = MAX_ENTRIES + lag; */
@@ -5587,7 +5670,7 @@ hl_col_major_scan_backward2(H5F_t * file_ptr,
{
const char * fcn_name = "hl_col_major_scan_backward2()";
H5C2_t * cache_ptr = file_ptr->shared->cache2;
- int32_t type;
+ int32_t type = 0;
int32_t idx;
int32_t lag = 50;
int32_t i;
@@ -5596,20 +5679,24 @@ hl_col_major_scan_backward2(H5F_t * file_ptr,
if ( verbose )
HDfprintf(stdout, "%s: entering.\n", fcn_name);
- HDassert( lag > 5 );
- HDassert( max_index >= 500 );
- HDassert( max_index <= MAX_ENTRIES );
+ if ( pass2 ) {
- type = 0;
+ cache_ptr = file_ptr->shared->cache2;
+
+ HDassert( cache_ptr != NULL );
+ HDassert( lag > 5 );
+ HDassert( max_index >= 500 );
+ HDassert( max_index <= MAX_ENTRIES );
- local_max_index = MIN(max_index, MAX_ENTRIES);
+ local_max_index = MIN(max_index, MAX_ENTRIES);
- if ( ( pass2 ) && ( reset_stats ) ) {
+ if ( ( pass2 ) && ( reset_stats ) ) {
- H5C2_stats__reset(cache_ptr);
- }
+ H5C2_stats__reset(cache_ptr);
+ }
- idx = local_max_index;
+ idx = local_max_index;
+ }
while ( ( pass2 ) && ( idx >= 0 ) )
{