summaryrefslogtreecommitdiffstats
path: root/test/cache_common.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-03-24 17:52:17 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-03-24 17:52:17 (GMT)
commit667b34c713318b7a70af5c9b63fccb9ac653a201 (patch)
treeb887d45b649be5e87326786056e046f967bc01bf /test/cache_common.c
parentadf47d11b821bbdd40ec7ebc0a4e6a69781e6ca7 (diff)
downloadhdf5-667b34c713318b7a70af5c9b63fccb9ac653a201.zip
hdf5-667b34c713318b7a70af5c9b63fccb9ac653a201.tar.gz
hdf5-667b34c713318b7a70af5c9b63fccb9ac653a201.tar.bz2
[svn-r16600] Description:
Ensure that metadata cache entries with flush dependencies are written to the file in the correct order (for serial I/O, at least). 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/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.6 (amazon) in debug mode Mac OS X/32 10.5.6 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'test/cache_common.c')
-rw-r--r--test/cache_common.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index 0c16b36..7f8a458 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -1171,7 +1171,8 @@ add_flush_op(int target_type,
int type,
int idx,
hbool_t flag,
- size_t new_size)
+ size_t new_size,
+ unsigned * order_ptr)
{
int i;
test_entry_t * target_base_addr;
@@ -1204,6 +1205,7 @@ add_flush_op(int target_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;
+ (target_entry_ptr->flush_ops)[i].order_ptr = order_ptr;
}
@@ -1470,6 +1472,12 @@ execute_flush_op(H5C_t * cache_ptr,
op_ptr->flag);
break;
+ case FLUSH_OP__ORDER:
+ HDassert( op_ptr->order_ptr );
+ entry_ptr->flush_order = *op_ptr->order_ptr;
+ (*op_ptr->order_ptr)++;
+ break;
+
default:
pass = FALSE;
failure_mssg = "Undefined flush op code.";
@@ -1656,6 +1664,8 @@ reset_entries(void)
base_addr[j].child_flush_dep_height_rc[k] = 0;
base_addr[j].flush_dep_height = 0;
+ base_addr[j].flush_order = 0;
+
addr += (haddr_t)entry_size;
alt_addr += (haddr_t)entry_size;
} /* end for */
@@ -2252,8 +2262,25 @@ verify_entry_status(H5C_t * cache_ptr,
} /* end if */
} /* end if */
+ /* Flush dependency flush order */
+ if ( pass ) {
+ if ( expected[i].flush_order >= 0 && entry_ptr->flush_order != (unsigned)expected[i].flush_order ) {
+ pass = FALSE;
+ sprintf(msg,
+ "%d entry (%d, %d) flush_order actual/expected = %u/%d.\n",
+ tag,
+ expected[i].entry_type,
+ expected[i].entry_index,
+ entry_ptr->flush_order,
+ expected[i].flush_order);
+ failure_mssg = msg;
+ } /* end if */
+ } /* end if */
+
i++;
} /* while */
+if(!pass)
+ HDfprintf(stderr, "failure_mssg = '%s'\n", failure_mssg);
return;
@@ -5023,7 +5050,6 @@ destroy_flush_dependency(H5C_t * cache_ptr,
/* Sanity check parent entry */
HDassert( par_entry_ptr->index == par_idx );
HDassert( par_entry_ptr->type == par_type );
- HDassert( par_entry_ptr->is_protected );
HDassert( par_entry_ptr->is_pinned );
HDassert( par_entry_ptr->flush_dep_height > 0 );
HDassert( par_entry_ptr == par_entry_ptr->self );