diff options
author | John Mainzer <mainzer@hdfgroup.org> | 2006-05-24 07:36:28 (GMT) |
---|---|---|
committer | John Mainzer <mainzer@hdfgroup.org> | 2006-05-24 07:36:28 (GMT) |
commit | a415cc6b17269c893704b3410a764b1c5d3d812e (patch) | |
tree | 36c29aba9c7b776bec0a65999d796d389bec9090 /test/cache_common.c | |
parent | 5f4234fabfe2ee0c07d74776d36352a8daf49e31 (diff) | |
download | hdf5-a415cc6b17269c893704b3410a764b1c5d3d812e.zip hdf5-a415cc6b17269c893704b3410a764b1c5d3d812e.tar.gz hdf5-a415cc6b17269c893704b3410a764b1c5d3d812e.tar.bz2 |
[svn-r12374] Purpose:
1) Check in potential fix to unreproduceable bug in t_cache observed on
Cobalt
2) Check in code supporting added pinned entry features in the metadata
cache.
Description:
1) Elena encountered a bug in t_cache when running on Cobalt. On
investigation I found a potential race condition in t_cache that
could explain her observation.
2) Quincey requested additions to the metadata cache allowing renaming
of pinned entryies, and marking of pinned or protected entries as
dirty.
Solution:
1) Modified t_cache.c to prevent the potential race condition. Elena
was unable to reproduce the bug on Cobalt, so we don't know if my
fix actually addressed the problem.
2) Added code supporting the requested functions. The changes were
relatively trivial, but required substantial new test code.
Platforms tested:
h5committest, serial test on heping, parallel test on phoenix.
Misc. update:
Diffstat (limited to 'test/cache_common.c')
-rw-r--r-- | test/cache_common.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/test/cache_common.c b/test/cache_common.c index 26bddf0..aeb9a25 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -1686,6 +1686,94 @@ mark_pinned_entry_dirty(H5C_t * cache_ptr, /*------------------------------------------------------------------------- + * Function: mark_pinned_or_protected_entry_dirty() + * + * Purpose: Mark the specified entry as dirty. + * + * Do nothing if pass is FALSE on entry. + * + * Return: void + * + * Programmer: John Mainzer + * 5/17/06 + * + * Modifications: + * + * None. + * + *------------------------------------------------------------------------- + */ + +void +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()"; + 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 || + entry_ptr->header.is_pinned ); + + entry_ptr->is_dirty = TRUE; + + result = H5C_mark_pinned_or_protected_entry_dirty(cache_ptr, + (void *)entry_ptr); + + if ( ( result < 0 ) + || + ( ( ! (entry_ptr->header.is_protected) ) + && + ( ! (entry_ptr->header.is_pinned) ) + ) + || + ( ( entry_ptr->header.is_protected ) + && + ( ! ( entry_ptr->header.dirtied ) ) + ) + || + ( ( ! ( entry_ptr->header.is_protected ) ) + && + ( ! ( entry_ptr->header.is_dirty ) ) + ) + || + ( entry_ptr->header.type != &(types[type]) ) + || + ( entry_ptr->size != entry_ptr->header.size ) + || + ( entry_ptr->addr != entry_ptr->header.addr ) ) { + + pass = FALSE; + failure_mssg = + "error in H5C_mark_pinned_or_protected_entry_dirty()."; + + } + + HDassert( ((entry_ptr->header).type)->id == type ); + + } + + return; + +} /* mark_pinned_or_protected_entry_dirty() */ + + +/*------------------------------------------------------------------------- * Function: rename_entry() * * Purpose: Rename the entry indicated by the type and index to its |