summaryrefslogtreecommitdiffstats
path: root/test/cache.c
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2005-09-27 05:20:11 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2005-09-27 05:20:11 (GMT)
commitc100b0bf2639c03579ce1b2c4013b36c6f40350b (patch)
tree5c3b2834af1206110243886f357857900a8b108e /test/cache.c
parentf9fc749ca218a878dbea4022ba1c2fb527f7822c (diff)
downloadhdf5-c100b0bf2639c03579ce1b2c4013b36c6f40350b.zip
hdf5-c100b0bf2639c03579ce1b2c4013b36c6f40350b.tar.gz
hdf5-c100b0bf2639c03579ce1b2c4013b36c6f40350b.tar.bz2
[svn-r11470] Purpose:
Repair synchronization bug in the metadata cache in PHDF5 Also repair numerous other bugs that surfaced in testing the bug fix. Description: While operations modifying metadata must be collective, we allow independant reads. This allows metadata caches on different processes to adjust to different sizes, and to place the entries on their dirty lists in different orders. Since only process 0 actually writes metadata to disk (all other processes thought they did, but the writes were discarded on the theory that they had to be collective), this made it possible for another process to modify metadata, flush it, and then read it back in in its original form (pre-modification) form. The possibilities for file corruption should be obvious. Solution: Make the policy that only process 0 can write to file explicit, and visible to the metadata caches. Thus only process 0 may flush dirty entries -- all other caches must retain dirty entries until they are informed by process 0 that the entries are clean. Synchronization is handled by counting the bytes of dirty cache entries created, and then synching up between the caches whenever the sum exceeds an (eventually user specified) limit. Dirty metadata creation is consistent across all processes because all operations modifying metadata must be collective. This change uncovered may bugs which are repaired in this checkin. It also required modification of H5HL and H5O to allocate file space on insertion rather than on flush from cache. Platforms tested: H5committest, heping(parallel & serial) Misc. update:
Diffstat (limited to 'test/cache.c')
-rw-r--r--test/cache.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/test/cache.c b/test/cache.c
index 1ee2c22..84943ee 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -1767,7 +1767,10 @@ setup_cache(size_t max_cache_size,
min_clean_size,
(NUMBER_OF_ENTRY_TYPES - 1),
(const char **)entry_type_names,
- check_write_permitted);
+ check_write_permitted,
+ TRUE,
+ NULL,
+ NULL);
if ( cache_ptr == NULL ) {
@@ -2186,6 +2189,10 @@ protect_entry(H5C_t * cache_ptr,
* Modified function to use the new dirtied parameter of
* H5C_unprotect().
*
+ * JRM -- 9/8/05
+ * Update for new entry size parameter in H5C_unprotect().
+ * We don't use them here for now.
+ *
*-------------------------------------------------------------------------
*/
@@ -2226,7 +2233,7 @@ unprotect_entry(H5C_t * cache_ptr,
result = H5C_unprotect(NULL, -1, -1, cache_ptr, &(types[type]),
entry_ptr->addr, (void *)entry_ptr,
- flags);
+ flags, 0);
if ( ( result < 0 ) ||
( entry_ptr->header.is_protected ) ||
@@ -8530,6 +8537,10 @@ check_double_protect_err(void)
* Modified function to use the new dirtied parameter in
* H5C_unprotect().
*
+ * JRM -- 9/8/05
+ * Updated function for the new size change parameter in
+ * H5C_unprotect(). We don't use them for now.
+ *
*-------------------------------------------------------------------------
*/
@@ -8567,8 +8578,8 @@ check_double_unprotect_err(void)
if ( pass ) {
result = H5C_unprotect(NULL, -1, -1, cache_ptr, &(types[0]),
- entry_ptr->addr, (void *)entry_ptr,
- H5C__NO_FLAGS_SET);
+ entry_ptr->addr, (void *)entry_ptr,
+ H5C__NO_FLAGS_SET, 0);
if ( result > 0 ) {