summaryrefslogtreecommitdiffstats
path: root/test/cache_common.c
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2006-07-13 17:59:39 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2006-07-13 17:59:39 (GMT)
commit801b5b09f26dac69e77bb4a794f2785977f9eb7e (patch)
treef96577fe353fe34c5ad7be4fcb72b62cebdcda4d /test/cache_common.c
parent8db4fe6d16d3e51e3d6122db02aaf888b911ebe0 (diff)
downloadhdf5-801b5b09f26dac69e77bb4a794f2785977f9eb7e.zip
hdf5-801b5b09f26dac69e77bb4a794f2785977f9eb7e.tar.gz
hdf5-801b5b09f26dac69e77bb4a794f2785977f9eb7e.tar.bz2
[svn-r12462] Committed a variety of metadata cache related changes:
1) Added trace file support to the metadata cache. This allows capture of all metadata cache calls in trace files for purposes of optimization and debuging. 2) Added an expunge entry function. This allows an entry to be deleteded from the cache without writing it to disk even if it is dirty. 3) Added a function call to resize pinned entries. 4) Added code to deal with entries that are dirty on load. This is needed in support of a bug fix which can alter object headers on load to repair files. 5) Added progress reporting code to the "MDC API smoke check" test in cache_api.c. To enable the progress reporting, set report_progress to TRUE in mdc_api_call_smoke_check(). Tested with h5committest, and a parallel test on phoenix (dual athelon linux box).
Diffstat (limited to 'test/cache_common.c')
-rw-r--r--test/cache_common.c65
1 files changed, 64 insertions, 1 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index ad5fe12..7e04d37 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -1449,6 +1449,69 @@ takedown_cache(H5C_t * cache_ptr,
/*-------------------------------------------------------------------------
+ * Function: expunge_entry()
+ *
+ * Purpose: Expunge the entry indicated by the type and index.
+ *
+ * Do nothing if pass is FALSE on entry.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 7/6/06
+ *
+ * Modifications:
+ *
+ * None.
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+expunge_entry(H5C_t * cache_ptr,
+ int32_t type,
+ int32_t idx)
+{
+ /* const char * fcn_name = "expunge_entry()"; */
+ herr_t result;
+ test_entry_t * base_addr;
+ test_entry_t * entry_ptr;
+
+ if ( pass ) {
+
+ HDassert( cache_ptr );
+ HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) );
+ HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) );
+
+ base_addr = entries[type];
+ entry_ptr = &(base_addr[idx]);
+
+ HDassert( entry_ptr->index == idx );
+ HDassert( entry_ptr->type == type );
+ HDassert( entry_ptr == entry_ptr->self );
+ HDassert( entry_ptr->cache_ptr == cache_ptr );
+ HDassert( ! ( entry_ptr->header.is_protected ) );
+ HDassert( ! ( entry_ptr->is_protected ) );
+ HDassert( ! ( entry_ptr->header.is_pinned ) );
+ HDassert( ! ( entry_ptr->is_pinned ) );
+
+ result = H5C_expunge_entry(NULL, -1, -1, cache_ptr, &(types[type]),
+ entry_ptr->addr);
+
+ if ( result < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "error in H5C_expunge_entry().";
+
+ }
+ }
+
+ return;
+
+} /* expunge_entry() */
+
+
+/*-------------------------------------------------------------------------
* Function: flush_cache()
*
* Purpose: Flush the specified cache, destroying all entries if
@@ -1709,7 +1772,7 @@ mark_pinned_or_protected_entry_dirty(H5C_t * cache_ptr,
int32_t type,
int32_t idx)
{
- const char * fcn_name = "mark_pinned_or_protected_entry_dirty()";
+ /* const char * fcn_name = "mark_pinned_or_protected_entry_dirty()"; */
herr_t result;
test_entry_t * base_addr;
test_entry_t * entry_ptr;