mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-23 16:20:57 +08:00
[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
This commit is contained in:
parent
adf47d11b8
commit
667b34c713
@ -185,7 +185,7 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
|
||||
|
||||
/* Maximum height of flush dependency relationships between entries. This is
|
||||
* currently tuned to the extensible array (H5EA) data structure, which only
|
||||
* requires 4 levels of dependency (i.e. heights 0-3).
|
||||
* requires 4 levels of dependency (i.e. heights 0-4).
|
||||
*/
|
||||
|
||||
#define H5C__NUM_FLUSH_DEP_HEIGHTS 4
|
||||
|
3976
test/cache.c
3976
test/cache.c
File diff suppressed because it is too large
Load Diff
@ -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 );
|
||||
|
@ -127,7 +127,8 @@
|
||||
#define FLUSH_OP__DIRTY 1
|
||||
#define FLUSH_OP__RESIZE 2
|
||||
#define FLUSH_OP__RENAME 3
|
||||
#define FLUSH_OP__MAX_OP 3
|
||||
#define FLUSH_OP__ORDER 4
|
||||
#define FLUSH_OP__MAX_OP 4
|
||||
|
||||
#define MAX_FLUSH_OPS 10 /* Maximum number of flush operations
|
||||
* that can be associated with a
|
||||
@ -144,6 +145,7 @@ typedef struct flush_op
|
||||
* FLUSH_OP__DIRTY
|
||||
* FLUSH_OP__RESIZE
|
||||
* FLUSH_OP__RENAME
|
||||
* FLUSH_OP__ORDER
|
||||
*/
|
||||
int type; /* type code of the cache entry that
|
||||
* is the target of the operation.
|
||||
@ -183,6 +185,10 @@ typedef struct flush_op
|
||||
* FLUSH_OP__RENAME operation.
|
||||
* Unused elsewhere.
|
||||
*/
|
||||
unsigned * order_ptr; /* Pointer to outside counter for
|
||||
* recording the order of entries
|
||||
* flushed.
|
||||
*/
|
||||
} flush_op;
|
||||
|
||||
typedef struct test_entry_t
|
||||
@ -300,6 +306,7 @@ typedef struct test_entry_t
|
||||
* dependency children
|
||||
*/
|
||||
unsigned flush_dep_height; /* flush dependency height of entry */
|
||||
unsigned flush_order; /* Order that entry was flushed in */
|
||||
} test_entry_t;
|
||||
|
||||
/* The following is a cut down copy of the hash table manipulation
|
||||
@ -471,6 +478,7 @@ struct expected_entry_status
|
||||
* dependency children
|
||||
*/
|
||||
unsigned flush_dep_height; /* flush dependency height of entry */
|
||||
int flush_order; /* flush order of entry */
|
||||
};
|
||||
|
||||
|
||||
@ -602,7 +610,8 @@ void add_flush_op(int target_type,
|
||||
int type,
|
||||
int idx,
|
||||
hbool_t flag,
|
||||
size_t size);
|
||||
size_t size,
|
||||
unsigned * order);
|
||||
|
||||
|
||||
void addr_to_type_and_index(haddr_t addr,
|
||||
|
Loading…
Reference in New Issue
Block a user