From 3b90c189cad3762670f2228b87d1c533767bcbe1 Mon Sep 17 00:00:00 2001 From: John Mainzer Date: Thu, 20 Jan 2005 17:40:37 -0500 Subject: [svn-r9850] Purpose: 1) Provide facilities in cache to allow us to avoid a potential cache consistency bug in the parallel case. 2) Clean up a off by one sanity checking bug. 3) Turn off execution of long running tests in debug mode. Description: 1) In the parallel case, all writes to metadata must be collective, but reads may not be. In pricipal, this allows us to different contents in different caches. This isn't a problem as long as the correct data is always on disk, but unless we can force certain writes immediately, that need not be the case. 2) & 3) should need no further explanation. Solution: 1) Add code allowing us to mark cache entries, and then force these entries to be flushed at a later time. Note that to actually avoid the bug, we will have to modify existing code to use these new features. 2) & 3) should need no further explanation. Platforms tested: heping (serial debug and production) committest (copper, sol, and heping). test failed on heping in the c++ portion of the build, but at Quincey's siggestion, I am proceeding with the checkin. Misc. update: --- src/H5AC.c | 35 +- src/H5ACprivate.h | 24 +- src/H5B.c | 68 +- src/H5C.c | 212 ++- src/H5Cprivate.h | 39 +- src/H5F.c | 17 +- src/H5Gnode.c | 36 +- src/H5HG.c | 17 +- src/H5HL.c | 24 +- src/H5O.c | 47 +- test/cache.c | 3893 +++++++++++++++++++++++++++++++++++++++++++++++------ 11 files changed, 3871 insertions(+), 541 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index 125aaf0..0d75536 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -623,10 +623,18 @@ done: * in H5C.c, and then re-wrote the function as a wrapper for * H5C_insert_entry(). * + * JRM - 1/6/05 + * Added the flags parameter. At present, this parameter is + * only used to set the new flush_marker field on the new + * entry. Since this doesn't apply to the SAP code, no change + * is needed there. Thus the only change to the body of the + * code is to pass the flags parameter through to + * H5C_insert_entry(). + * *------------------------------------------------------------------------- */ herr_t -H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing) +H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags) { herr_t result; H5AC_info_t *info; @@ -727,7 +735,8 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * cache, type, addr, - thing); + thing, + flags); if ( result < 0 ) { @@ -1085,14 +1094,21 @@ done: * Abstracted the guts of the function to H5C_unprotect() * in H5C.c, and then re-wrote the function as a wrapper for * H5C_unprotect(). + * + * JRM - 1/6/05 + * Replaced the deleted parameter with the new flags parameter. + * Since the deleted parameter is not used by the FPHDF5 code, + * the only change in the body is to replace the deleted + * parameter with the flags parameter in the call to + * H5C_unprotect(). * *------------------------------------------------------------------------- */ herr_t -H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, hbool_t deleted) +H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags) { herr_t result; - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5AC_unprotect, FAIL) @@ -1133,6 +1149,15 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, * (deleted == TRUE), we need to send a request to the SAP * telling it to remove that bit of metadata from its cache. */ + /* the deleted parameter has been replaced with the flags + * parameter. The actual value of deleted is still passed + * in as a bit in flags. If it is needed, it can be extracted + * as follows: + * + * deleted = ( (flags & H5C__DELETED_FLAG) != 0 ); + * + * JRM -- 1/6/05 + */ if ( H5FP_request_release_lock(H5FD_fphdf5_file_id(lf), addr, TRUE, &req_id, &status) < 0 ) HGOTO_ERROR(H5E_FPHDF5, H5E_CANTUNLOCK, FAIL, \ @@ -1173,7 +1198,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, type, addr, thing, - deleted); + flags); if ( result < 0 ) { diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 8c34d92..b26bd1e 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -162,15 +162,31 @@ extern hid_t H5AC_ind_dxpl_id; /* * Library prototypes. */ + +/* #defines of flags used in the flags parameters in some of the + * following function calls. Note that they are just copies of + * the equivalent flags from H5Cprivate.h. + */ + +#define H5AC__NO_FLAGS_SET H5C__NO_FLAGS_SET +#define H5AC__SET_FLUSH_MARKER_FLAG H5C__SET_FLUSH_MARKER_FLAG +#define H5AC__DELETED_FLAG H5C__DELETED_FLAG +#define H5AC__FLUSH_INVALIDATE_FLAG H5C__FLUSH_INVALIDATE_FLAG +#define H5AC__FLUSH_CLEAR_ONLY_FLAG H5C__FLUSH_CLEAR_ONLY_FLAG +#define H5AC__FLUSH_MARKED_ENTRIES_FLAG H5C__FLUSH_MARKED_ENTRIES_FLAG + + + H5_DLL herr_t H5AC_init(void); H5_DLL herr_t H5AC_create(const H5F_t *f, int size_hint); -H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, - void *thing); +H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, + haddr_t addr, void *thing, unsigned int flags); H5_DLL void *H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, const void *udata1, void *udata2, H5AC_protect_t rw); -H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, - void *thing, hbool_t deleted); +H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, + const H5AC_class_t *type, haddr_t addr, + void *thing, unsigned int flags); H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags); H5_DLL herr_t H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr); diff --git a/src/H5B.c b/src/H5B.c index 4626d0c..13d3946 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -241,7 +241,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, /* * Cache the new B-tree node. */ - if (H5AC_set(f, dxpl_id, H5AC_BT, *addr_p, bt) < 0) + if (H5AC_set(f, dxpl_id, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree root node to cache") #ifdef H5B_DEBUG H5B_assert(f, dxpl_id, *addr_p, shared->type, udata); @@ -738,7 +738,8 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u } done: - if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) < 0) + if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) + < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) @@ -892,7 +893,8 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, haddr_t old_addr, tmp_bt->cache_info.is_dirty = TRUE; tmp_bt->left = *new_addr_p; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, tmp_bt, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, tmp_bt, + H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") tmp_bt=NULL; /* Make certain future references will be caught */ } @@ -900,7 +902,8 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, haddr_t old_addr, old_bt->right = *new_addr_p; done: - if (new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, new_bt, FALSE) < 0) + if (new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, + new_bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -981,7 +984,8 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, if (!lt_key_changed) HDmemcpy(lt_key, H5B_NKEY(bt,shared,0), type->sizeof_nkey); - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) + != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt = NULL; @@ -993,7 +997,8 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, if (!rt_key_changed) HDmemcpy(rt_key, H5B_NKEY(bt,shared,bt->nchildren), type->sizeof_nkey); - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, child, bt, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, child, bt, H5AC__NO_FLAGS_SET) + != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt = NULL; @@ -1014,7 +1019,8 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, bt->cache_info.is_dirty = TRUE; bt->left = old_root; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, child, bt, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, child, bt, H5AC__NO_FLAGS_SET) + != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt=NULL; /* Make certain future references will be caught */ @@ -1035,13 +1041,15 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, if (NULL == (new_bt = H5B_copy(bt))) { HCOMMON_ERROR(H5E_BTREE, H5E_CANTLOAD, "unable to copy old root"); - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) + != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") HGOTO_DONE(FAIL) } - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) + != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt=NULL; /* Make certain future references will be caught */ @@ -1068,7 +1076,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, HDmemcpy(H5B_NKEY(new_bt,shared,2), rt_key, shared->type->sizeof_nkey); /* Insert the modified copy of the old root into the file again */ - if (H5AC_set(f, dxpl_id, H5AC_BT, addr, new_bt) < 0) + if (H5AC_set(f, dxpl_id, H5AC_BT, addr, new_bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to flush old B-tree root node") #ifdef H5B_DEBUG @@ -1448,8 +1456,10 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type done: { - herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) < 0); - herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, twin, FALSE)<0); + herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, + H5AC__NO_FLAGS_SET) < 0); + herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, + twin, H5AC__NO_FLAGS_SET)<0); if (e1 || e2) /*use vars to prevent short-circuit of side effects */ HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node(s)") } @@ -1515,7 +1525,7 @@ H5B_iterate (H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op level = bt->level; left_child = bt->child[0]; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) < 0) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") bt = NULL; /* Make certain future references will be caught */ @@ -1548,7 +1558,8 @@ H5B_iterate (H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op next_addr = bt->right; nchildren = bt->nchildren; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, cur_addr, bt, FALSE) < 0) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, cur_addr, bt, + H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") bt = NULL; @@ -1718,7 +1729,8 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type HDmemcpy(H5B_NKEY(sibling,shared,0), H5B_NKEY(bt,shared,idx+1), type->sizeof_nkey); sibling->cache_info.is_dirty = TRUE; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, + H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1747,7 +1759,8 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling->right = bt->right; sibling->cache_info.is_dirty = TRUE; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, + H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1762,7 +1775,8 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling->left = bt->left; sibling->cache_info.is_dirty = TRUE; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, + H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1771,7 +1785,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type bt->right = HADDR_UNDEF; H5_CHECK_OVERFLOW(shared->sizeof_rnode,size_t,hsize_t); if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)shared->sizeof_rnode)<0 - || H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, TRUE)<0) { + || H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5C__DELETED_FLAG)<0) { bt = NULL; HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to free B-tree node") } @@ -1823,7 +1837,8 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type HDmemcpy(H5B_NKEY(sibling,shared,0), H5B_NKEY(bt,shared,bt->nchildren), type->sizeof_nkey); sibling->cache_info.is_dirty = TRUE; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, + H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1856,7 +1871,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type } done: - if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE)<0) + if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET)<0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) @@ -1919,7 +1934,8 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void bt->cache_info.is_dirty = TRUE; } - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) + != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release node") bt=NULL; /* Make certain future references will be caught */ @@ -1996,7 +2012,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree node") done: - if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, TRUE)<0) + if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5C__DELETED_FLAG)<0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node in cache") FUNC_LEAVE_NOAPI(ret_value) @@ -2230,7 +2246,8 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f } done: - if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) < 0) + if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) + < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) @@ -2290,7 +2307,7 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void cur->level = bt->level; head = tail = cur; - status = H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE); + status = H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET); assert(status >= 0); bt=NULL; /* Make certain future references will be caught */ @@ -2343,7 +2360,8 @@ H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type, void } } /* Release node */ - status = H5AC_unprotect(f, dxpl_id, H5AC_BT, cur->addr, bt, FALSE); + status = H5AC_unprotect(f, dxpl_id, H5AC_BT, cur->addr, bt, + H5AC__NO_FLAGS_SET); assert(status >= 0); bt=NULL; /* Make certain future references will be caught */ diff --git a/src/H5C.c b/src/H5C.c index 575a6dd..38863e8 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -29,7 +29,7 @@ * in an attempt to support re-use. * * For a detailed overview of the cache, please see the - * header comment for H5C_t in this file. + * header comment for H5C_t in H5Cpkg.h. * * Modifications: * @@ -37,6 +37,18 @@ * Switched over to using skip list routines instead of TBBT * routines. * + * JRM - 12/15/04 + * Added code supporting manual and automatic cache resizing. + * See the header for H5C_auto_size_ctl_t in H5Cprivate.h for + * an overview. + * + * Some elements of the automatic cache resize code depend on + * the LRU list. Thus if we ever choose to support a new + * replacement policy, we will either have to disable those + * elements of the auto resize code when running the new + * policy, or modify them to make use of similar information + * maintained by the new policy code. + * *------------------------------------------------------------------------- */ @@ -145,7 +157,7 @@ * JRM - 12/9/04 * * - * In the H5C__DLL_PRE_INSERT_SC macro, replaced the lines: + * - In the H5C__DLL_PRE_INSERT_SC macro, replaced the lines: * * ( ( (len) == 1 ) && * ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || @@ -167,6 +179,29 @@ * take on negative values, and thus the revised clause "( (Size) < 0 )" * caused compiler warnings. * JRM - 12/22/04 + * + * - In the H5C__DLL_SC macro, replaced the lines: + * + * ( ( (len) == 1 ) && + * ( ( (head_ptr) != (tail_ptr) ) || ( (cache_ptr)->size <= 0 ) || + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) + * ) || + * + * with + * + * ( ( (len) == 1 ) && + * ( ( (head_ptr) != (tail_ptr) ) || + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) + * ) || + * + * Epoch markers have size 0, so we can now have a non-empty list with + * zero size. Hence the "( (Size) <= 0 )" clause cause false failures + * in the sanity check. Since "Size" is typically a size_t, it can't + * take on negative values, and thus the revised clause "( (Size) < 0 )" + * caused compiler warnings. + * JRM - 1/10/05 * ****************************************************************************/ @@ -200,7 +235,7 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ ( (len) < 0 ) || \ ( (Size) < 0 ) || \ ( ( (len) == 1 ) && \ - ( ( (head_ptr) != (tail_ptr) ) || ( (cache_ptr)->size <= 0 ) || \ + ( ( (head_ptr) != (tail_ptr) ) || \ ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) \ ) \ ) || \ @@ -1695,7 +1730,7 @@ static herr_t H5C_make_space_in_cache(H5F_t * f, ****************************************************************************/ /* Note that H5C__MAX_EPOCH_MARKERS is defined in H5Cpkg.h, not here because - * it is needed to dimension an array in H5C_t. + * it is needed to dimension arrays in H5C_t. */ #define H5C__EPOCH_MARKER_TYPE H5C__MAX_NUM_TYPE_IDS @@ -2229,7 +2264,7 @@ H5C_dest(H5F_t * f, HDassert( cache_ptr->skip_file_checks || f ); if ( H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, - cache_ptr, H5F_FLUSH_INVALIDATE) < 0 ) { + cache_ptr, H5C__FLUSH_INVALIDATE_FLAG) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") } @@ -2341,6 +2376,23 @@ done: * list, never in the index or in the tree. However, it * never hurts to tidy up. * + * JRM -- 1/6/05 + * Reworked code to support the new + * H5C__FLUSH_MARKED_ENTRIES_FLAG, and for the replacement of + * H5F_FLUSH_INVALIDATE flag with H5C__FLUSH_INVALIDATE_FLAG. + * + * Note that the H5C__FLUSH_INVALIDATE_FLAG takes precidence + * over the H5C__FLUSH_MARKED_ENTRIES_FLAG. Thus if both are + * set, the functions behaves as if just the + * H5C__FLUSH_INVALIDATE_FLAG was set. + * + * The H5C__FLUSH_CLEAR_ONLY_FLAG flag can co-exist with + * either the H5C__FLUSH_MARKED_ENTRIES_FLAG, or the + * H5C__FLUSH_INVALIDATE_FLAG. In all cases, it is simply + * passed along to H5C_flush_single_entry(). In the case of + * H5C__FLUSH_MARKED_ENTRIES_FLAG, it will only apply to + * the marked entries. + * *------------------------------------------------------------------------- */ herr_t @@ -2352,7 +2404,8 @@ H5C_flush_cache(H5F_t * f, { herr_t status; herr_t ret_value = SUCCEED; - hbool_t destroy = ( (flags & H5F_FLUSH_INVALIDATE) != 0 ); + hbool_t destroy; + hbool_t flush_marked_entries; hbool_t first_flush = TRUE; int32_t protected_entries = 0; int32_t i; @@ -2370,6 +2423,14 @@ H5C_flush_cache(H5F_t * f, HDassert( cache_ptr->skip_file_checks || f ); HDassert( cache_ptr->slist_ptr ); + destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ); + + /* note that flush_marked_entries is set to FALSE if destroy is TRUE */ + flush_marked_entries = ( ( (flags & H5C__FLUSH_MARKED_ENTRIES_FLAG) != 0 ) + && + ( ! destroy ) + ); + if ( ( destroy ) && ( cache_ptr->epoch_markers_active > 0 ) ) { status = H5C__autoadjust__ageout__remove_all_markers(cache_ptr); @@ -2404,31 +2465,34 @@ H5C_flush_cache(H5F_t * f, actual_slist_size += entry_ptr->size; #endif /* H5C_DO_SANITY_CHECKS */ - if ( entry_ptr->is_protected ) { + if ( ( ! flush_marked_entries ) || ( entry_ptr->flush_marker ) ) { - /* we have major problems -- but lets flush everything - * we can before we flag an error. - */ - protected_entries++; + if ( entry_ptr->is_protected ) { - } else { + /* we have major problems -- but lets flush everything + * we can before we flag an error. + */ + protected_entries++; - status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, - cache_ptr, - NULL, - entry_ptr->addr, - flags, - &first_flush, - FALSE); - if ( status < 0 ) { + } else { - /* This shouldn't happen -- if it does, we are toast so - * just scream and die. - */ - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ - "Can't flush entry.") + status = H5C_flush_single_entry(f, + primary_dxpl_id, + secondary_dxpl_id, + cache_ptr, + NULL, + entry_ptr->addr, + flags, + &first_flush, + FALSE); + if ( status < 0 ) { + + /* This shouldn't happen -- if it does, we are toast so + * just scream and die. + */ + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "Can't flush entry.") + } } } @@ -2750,10 +2814,15 @@ done: * Added code to set the cache_full flag to TRUE when ever * we need to make space in the cache. * - * JRM --11/22/04 + * JRM -- 11/22/04 * Updated function for the addition of the first_flush_ptr * parameter to H5C_make_space_in_cache(). * + * JRM -- 1/6/05 + * Added the flags parameter, and code supporting + * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is + * ignored unless the new entry is dirty. + * *------------------------------------------------------------------------- */ @@ -2764,11 +2833,13 @@ H5C_insert_entry(H5F_t * f, H5C_t * cache_ptr, const H5C_class_t * type, haddr_t addr, - void * thing) + void * thing, + unsigned int flags) { herr_t result; herr_t ret_value = SUCCEED; /* Return value */ hbool_t first_flush = TRUE; + hbool_t set_flush_marker; hbool_t write_permitted = TRUE; H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * test_entry_ptr; @@ -2784,6 +2855,8 @@ H5C_insert_entry(H5F_t * f, HDassert( H5F_addr_defined(addr) ); HDassert( thing ); + set_flush_marker = ( (flags & H5C__SET_FLUSH_MARKER_FLAG) != 0 ); + entry_ptr = (H5C_cache_entry_t *)thing; entry_ptr->addr = addr; @@ -2905,7 +2978,12 @@ H5C_insert_entry(H5F_t * f, if ( entry_ptr->is_dirty ) { + entry_ptr->flush_marker = set_flush_marker; H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr) + + } else { + + entry_ptr->flush_marker = FALSE; } H5C__UPDATE_RP_FOR_INSERTION(cache_ptr, entry_ptr, FAIL) @@ -4109,6 +4187,13 @@ H5C_stats__reset(H5C_t * cache_ptr) * In particular, we now add dirty entries to the tree if * they aren't in the tree already. * + * JRM -- 1/6/05 + * Added the flags parameter, and code supporting + * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is + * ignored unless the new entry is dirty. Also note that + * once the flush_marker field of an entry is set, the + * only way it can be reset is by being flushed. + * *------------------------------------------------------------------------- */ herr_t @@ -4119,8 +4204,10 @@ H5C_unprotect(H5F_t * f, const H5C_class_t * type, haddr_t addr, void * thing, - hbool_t deleted) + unsigned int flags) { + hbool_t deleted; + hbool_t set_flush_marker; herr_t ret_value = SUCCEED; /* Return value */ H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * test_entry_ptr; @@ -4136,6 +4223,9 @@ H5C_unprotect(H5F_t * f, HDassert( H5F_addr_defined(addr) ); HDassert( thing ); + deleted = ( (flags & H5C__DELETED_FLAG) != 0 ); + set_flush_marker = ( (flags & H5C__SET_FLUSH_MARKER_FLAG) != 0 ); + entry_ptr = (H5C_cache_entry_t *)thing; HDassert( entry_ptr->addr == addr ); @@ -4151,13 +4241,18 @@ H5C_unprotect(H5F_t * f, entry_ptr->is_protected = FALSE; - /* add the entry to the tree if it is dirty, and it isn't already in - * the tree. + /* if the entry is dirty, or its flush_marker with the set flush flag, + * and then add it to the skip list if it isn't there already. */ - if ( ( entry_ptr->is_dirty ) && ( ! (entry_ptr->in_slist) ) ) { + if ( entry_ptr->is_dirty ) { - H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr) + entry_ptr->flush_marker |= set_flush_marker; + + if ( ! (entry_ptr->in_slist) ) { + + H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr) + } } /* this implementation of the "deleted" option is a bit inefficient, as @@ -4172,9 +4267,9 @@ H5C_unprotect(H5F_t * f, if ( deleted ) { /* the following first flush flag will never be used as we are - * calling H5C_flush_single_entry with both the H5F_FLUSH_CLEAR_ONLY - * and H5F_FLUSH_INVALIDATE flags. However, it is needed for the - * function call. + * calling H5C_flush_single_entry with both the + * H5C__FLUSH_CLEAR_ONLY_FLAG and H5C__FLUSH_INVALIDATE_FLAG flags. + * However, it is needed for the function call. */ hbool_t dummy_first_flush = TRUE; @@ -4199,7 +4294,8 @@ H5C_unprotect(H5F_t * f, cache_ptr, type, addr, - (H5F_FLUSH_CLEAR_ONLY|H5F_FLUSH_INVALIDATE), + (H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_INVALIDATE_FLAG), &dummy_first_flush, TRUE) < 0 ) { @@ -4906,7 +5002,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, cache_ptr, entry_ptr->type, entry_ptr->addr, - (unsigned)0, + H5C__NO_FLAGS_SET, first_flush_ptr, FALSE); } else { @@ -4919,7 +5015,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, cache_ptr, entry_ptr->type, entry_ptr->addr, - H5F_FLUSH_INVALIDATE, + H5C__FLUSH_INVALIDATE_FLAG, first_flush_ptr, TRUE); } @@ -4985,7 +5081,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, cache_ptr, entry_ptr->type, entry_ptr->addr, - H5F_FLUSH_INVALIDATE, + H5C__FLUSH_INVALIDATE_FLAG, first_flush_ptr, TRUE); @@ -5304,7 +5400,7 @@ done: * secondary_dxpl_id is used in any subsequent flush where * *first_flush_ptr is FALSE on entry. * - * If the H5F_FLUSH_CLEAR_ONLY flag is set, the entry will + * If the H5C__FLUSH_INVALIDATE_FLAG flag is set, the entry will * be cleared and not flushed -- in the case *first_flush_ptr, * primary_dxpl_id, and secondary_dxpl_id are all irrelevent, * and the call can't be part of a sequence of flushes. @@ -5332,6 +5428,13 @@ done: * QAK -- 11/26/04 * Updated function for the switch from TBBTs to skip lists. * + * JRM -- 1/6/05 + * Updated function to reset the flush_marker field. + * Also replace references to H5F_FLUSH_INVALIDATE and + * H5F_FLUSH_CLEAR_ONLY with references to + * H5C__FLUSH_INVALIDATE_FLAG and H5C__FLUSH_CLEAR_ONLY_FLAG + * respectively. + * *------------------------------------------------------------------------- */ static herr_t @@ -5345,8 +5448,8 @@ H5C_flush_single_entry(H5F_t * f, hbool_t * first_flush_ptr, hbool_t del_entry_from_slist_on_destroy) { - hbool_t destroy = ( (flags & H5F_FLUSH_INVALIDATE) != 0 ); - hbool_t clear_only = ( (flags & H5F_FLUSH_CLEAR_ONLY) != 0); + hbool_t destroy; + hbool_t clear_only; herr_t ret_value = SUCCEED; /* Return value */ herr_t status; H5C_cache_entry_t * entry_ptr = NULL; @@ -5359,6 +5462,9 @@ H5C_flush_single_entry(H5F_t * f, HDassert( H5F_addr_defined(addr) ); HDassert( first_flush_ptr ); + destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ); + clear_only = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); + /* attempt to find the target entry in the hash table */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) @@ -5367,14 +5473,17 @@ H5C_flush_single_entry(H5F_t * f, if ( entry_ptr->in_slist ) { - if ( entry_ptr->addr != addr ) { + if ( ( ( entry_ptr->flush_marker ) && ( ! entry_ptr->is_dirty ) ) || + ( entry_ptr->addr != addr ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "entry in slist failed sanity checks.") } } else { - if ( ( entry_ptr->is_dirty ) || ( entry_ptr->addr != addr ) ) { + if ( ( entry_ptr->is_dirty ) || + ( entry_ptr->flush_marker ) || + ( entry_ptr->addr != addr ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "entry failed sanity checks.") @@ -5449,6 +5558,8 @@ H5C_flush_single_entry(H5F_t * f, #endif /* NDEBUG */ #endif /* H5_HAVE_PARALLEL */ + entry_ptr->flush_marker = FALSE; + if ( clear_only ) { H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) } else { @@ -5527,6 +5638,7 @@ H5C_flush_single_entry(H5F_t * f, if ( ! destroy ) { HDassert( !(entry_ptr->is_dirty) ); + HDassert( !(entry_ptr->flush_marker) ); } } @@ -5727,7 +5839,7 @@ H5C_make_space_in_cache(H5F_t * f, cache_ptr, entry_ptr->type, entry_ptr->addr, - (unsigned)0, + H5C__NO_FLAGS_SET, first_flush_ptr, FALSE); } else { @@ -5738,7 +5850,7 @@ H5C_make_space_in_cache(H5F_t * f, cache_ptr, entry_ptr->type, entry_ptr->addr, - H5F_FLUSH_INVALIDATE, + H5C__FLUSH_INVALIDATE_FLAG, first_flush_ptr, TRUE); } @@ -5781,7 +5893,7 @@ H5C_make_space_in_cache(H5F_t * f, cache_ptr, entry_ptr->type, entry_ptr->addr, - (unsigned)0, + H5C__NO_FLAGS_SET, first_flush_ptr, FALSE); @@ -5824,7 +5936,7 @@ H5C_make_space_in_cache(H5F_t * f, cache_ptr, entry_ptr->type, entry_ptr->addr, - H5F_FLUSH_INVALIDATE, + H5C__FLUSH_INVALIDATE_FLAG, first_flush_ptr, TRUE); diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 71cdc90..7830b26 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -153,7 +153,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * out of a hat -- you should be able to change them as necessary. * * However, if you need a very big cache, you should also increase the - * size of the hash table (H5C__HASH_TABLE_LEN in H5C.c). The current + * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current * upper bound on cache size is rather large for the current hash table * size. */ @@ -234,6 +234,11 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * are marked dirty. However they may remain in the list after * being flushed. * + * flush_marker: Boolean flag indicating that the entry is to be flushed + * the next time H5C_flush_cache() is called with the + * H5AC__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when + * the entry is flushed for whatever reason. + * * * Fields supporting the hash table: * @@ -275,7 +280,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * clean and dirty LRU lists to the usual LRU list. When reading in * parallel mode, we evict from the clean LRU list only. This implies * that we must try to ensure that the clean LRU list is reasonably well - * stocked. See the comments on H5C_t in H5C.c for more details. + * stocked. See the comments on H5C_t in H5Cpkg.h for more details. * * Note that even if we start with a completely clean cache, a sequence * of protects without unprotects can empty the clean LRU list. In this @@ -338,6 +343,7 @@ typedef struct H5C_cache_entry_t hbool_t is_dirty; hbool_t is_protected; hbool_t in_slist; + hbool_t flush_marker; /* fields supporting the hash table: */ @@ -475,7 +481,7 @@ typedef struct H5C_cache_entry_t * automatically. * * When this increment mode is selected, the remaining fields - * in the cache size decrease section ar ignored. + * in the cache size decrease section are ignored. * * H5C_decr__threshold: Attempt to decrease the size of the cache * whenever the average hit rate over the last epoch rises @@ -502,7 +508,7 @@ typedef struct H5C_cache_entry_t * ignored. * * H5C_decr__threshold: If the hit rate exceeds this threshold in any - * epoch, attempt todecrement the cache size by size_decrement. + * epoch, attempt to decrement the cache size by size_decrement. * * Note that cache size may not be decremented below min_size. * @@ -655,6 +661,26 @@ typedef struct H5C_auto_size_ctl_t /* * Library prototypes. */ + +/* #defines of flags used in the flags parameters in some of the + * following function calls. Note that not all flags are applicable + * to all function calls. Flags that don't apply to a particular + * function are ignored in that function. + */ + +/* Generic "no flags set" value for all function calls */ +#define H5C__NO_FLAGS_SET 0x0000 + +/* These flags apply to H5C_insert_entry() & H5C_unprotect() */ +#define H5C__SET_FLUSH_MARKER_FLAG 0x0001 +#define H5C__DELETED_FLAG 0x0002 + +/* These flags apply to H5C_flush() & H5C_flush_single_entry() */ +#define H5C__FLUSH_INVALIDATE_FLAG 0x0004 +#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0008 +#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0010 + + H5_DLL H5C_t * H5C_create(size_t max_cache_size, size_t min_clean_size, int max_type_id, @@ -701,7 +727,8 @@ H5_DLL herr_t H5C_insert_entry(H5F_t * f, H5C_t * cache_ptr, const H5C_class_t * type, haddr_t addr, - void * thing); + void * thing, + unsigned int flags); H5_DLL herr_t H5C_rename_entry(H5C_t * cache_ptr, const H5C_class_t * type, @@ -739,7 +766,7 @@ H5_DLL herr_t H5C_unprotect(H5F_t * f, const H5C_class_t * type, haddr_t addr, void * thing, - hbool_t deleted); + unsigned int flags); #endif /* !_H5Cprivate_H */ diff --git a/src/H5F.c b/src/H5F.c index 9a83ca2..ce7621b 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -2909,6 +2909,11 @@ done: * Modified the flags being passed in to be one flag instead * of several. * + * John Mainzer, 2005-01-07 + * H5AC (and H5C) now have their own system of flags. Hence + * we must now translate between the H5F_FLUSH flags and the + * H5AC flags. Added code to handle this detail. + * *------------------------------------------------------------------------- */ static herr_t @@ -2916,6 +2921,7 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags) { unsigned nerrors = 0; /* Errors from nested flushes */ unsigned i; /* Index variable */ + unsigned int H5AC_flags; /* translated flags for H5AC_flush() */ herr_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5F_flush) @@ -3012,7 +3018,16 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags) * allocates object headers (calls the H5O_init function...via a * lot of other functions first).... */ - if (H5AC_flush(f, dxpl_id, flags & (H5F_FLUSH_INVALIDATE | H5F_FLUSH_CLEAR_ONLY)) < 0) + + H5AC_flags = 0; + + if ( (flags & H5F_FLUSH_INVALIDATE) != 0 ) + H5AC_flags |= H5AC__FLUSH_INVALIDATE_FLAG; + + if ( (flags & H5F_FLUSH_CLEAR_ONLY) != 0 ) + H5AC_flags |= H5AC__FLUSH_CLEAR_ONLY_FLAG; + + if (H5AC_flush(f, dxpl_id, H5AC_flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush meta data cache") /* Write the superblock to disk */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index e6c1776..5d30559 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -750,7 +750,7 @@ H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t UNUSED op, void *_lt_key, sym->entry = H5FL_SEQ_CALLOC(H5G_entry_t,(2*H5F_SYM_LEAF_K(f))); if (NULL==sym->entry) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - if (H5AC_set(f, dxpl_id, H5AC_SNODE, *addr_p, sym) < 0) + if (H5AC_set(f, dxpl_id, H5AC_SNODE, *addr_p, sym, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to cache symbol table leaf node"); /* * The left and right symbols in an empty tree are both the @@ -996,7 +996,8 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_lt_key HGOTO_ERROR(H5E_SYM, H5E_UNSUPPORTED, FAIL, "internal erorr (unknown symbol find operation)"); done: - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) < 0) + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node"); FUNC_LEAVE_NOAPI(ret_value); @@ -1185,9 +1186,11 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *_lt_key, insert_into->nsyms += 1; done: - if (snrt && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, *new_node_p, snrt, FALSE) < 0) + if (snrt && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, *new_node_p, snrt, + H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node"); - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) < 0) + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node"); FUNC_LEAVE_NOAPI(ret_value); @@ -1356,7 +1359,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, sn->nsyms = 0; sn->cache_info.is_dirty = TRUE; if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)H5G_node_size(f))<0 - || H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, TRUE)<0) { + || H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5C__DELETED_FLAG)<0) { sn = NULL; HGOTO_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to free symbol table node"); } @@ -1422,7 +1425,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, sn->nsyms = 0; sn->cache_info.is_dirty = TRUE; if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)H5G_node_size(f))<0 - || H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, TRUE)<0) { + || H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5C__DELETED_FLAG)<0) { sn = NULL; HGOTO_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to free symbol table node"); } @@ -1431,7 +1434,8 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, } /* end else */ done: - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE)<0) + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + H5AC__NO_FLAGS_SET)<0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node"); FUNC_LEAVE_NOAPI(ret_value); @@ -1491,7 +1495,8 @@ H5G_node_iterate (H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t a for (i=0; ientry[i].name_off; - if (H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) != SUCCEED) { + if (H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) + != SUCCEED) { sn = NULL; HGOTO_ERROR(H5E_SYM, H5E_PROTECT, H5B_ITER_ERROR, "unable to release object header"); } @@ -1540,7 +1545,8 @@ done: if (heap && H5HL_unprotect(f, dxpl_id, heap, bt_udata->ent->cache.stab.heap_addr) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_ITER_ERROR, "unable to unprotect symbol name"); - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) != SUCCEED) + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_ITER_ERROR, "unable to release object header"); if(name_off) @@ -1589,7 +1595,8 @@ H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr *num_objs += sn->nsyms; done: - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) != SUCCEED) + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_ITER_ERROR, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1659,7 +1666,8 @@ H5G_node_name(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, } done: - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) != SUCCEED) + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_ITER_ERROR, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1710,7 +1718,8 @@ H5G_node_type(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, } done: - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) != SUCCEED) + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_ITER_ERROR, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1925,7 +1934,8 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, } done: - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) < 0) + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node"); FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5HG.c b/src/H5HG.c index 5939369..ca56824 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -278,7 +278,7 @@ HDmemset(heap->chunk,0,size); } /* Add the heap to the cache */ - if (H5AC_set (f, dxpl_id, H5AC_GHEAP, addr, heap)<0) + if (H5AC_set (f, dxpl_id, H5AC_GHEAP, addr, heap, H5AC__NO_FLAGS_SET)<0) HGOTO_ERROR (H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, \ "unable to cache global heap collection"); @@ -1021,7 +1021,8 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* hobj->idx = idx; done: - if ( heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, heap->addr, heap, FALSE) < 0 ) + if ( heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, heap->addr, heap, + H5AC__NO_FLAGS_SET) < 0 ) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to unprotect heap."); FUNC_LEAVE_NOAPI(ret_value); @@ -1094,7 +1095,8 @@ H5HG_read (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/) ret_value=object; done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, FALSE)<0) + if (heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, + H5AC__NO_FLAGS_SET)<0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, NULL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1154,7 +1156,8 @@ H5HG_link (H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) ret_value=heap->obj[hobj->idx].nrefs; done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, FALSE)<0) + if (heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, + H5AC__NO_FLAGS_SET)<0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1183,7 +1186,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) size_t need; int i; unsigned u; - hbool_t deleted=FALSE; /* Whether the heap gets deleted */ + unsigned flags=H5AC__NO_FLAGS_SET;/* Whether the heap gets deleted */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5HG_remove, FAIL); @@ -1236,7 +1239,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) heap->cache_info.is_dirty = FALSE; H5_CHECK_OVERFLOW(heap->size,size_t,hsize_t); H5MF_xfree(f, H5FD_MEM_GHEAP, dxpl_id, heap->addr, (hsize_t)heap->size); - deleted=TRUE; /* Indicate that the object was deleted, for the unprotect call */ + flags=H5C__DELETED_FLAG; /* Indicate that the object was deleted, for the unprotect call */ } else { /* * If the heap is in the CWFS list then advance it one position. The @@ -1259,7 +1262,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) } done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, deleted) != SUCCEED) + if (heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, flags) != SUCCEED) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5HL.c b/src/H5HL.c index b88effb..d437558 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -172,7 +172,7 @@ H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr_p/*out*/) /* add to cache */ heap->cache_info.is_dirty = TRUE; - if (H5AC_set(f, dxpl_id, H5AC_LHEAP, *addr_p, heap) < 0) + if (H5AC_set(f, dxpl_id, H5AC_LHEAP, *addr_p, heap, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, FAIL, "unable to cache heap"); done: @@ -764,7 +764,8 @@ H5HL_read(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t offset, size_t size, voi ret_value=buf; done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, FALSE) != SUCCEED) + if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, + H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, NULL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -884,7 +885,8 @@ H5HL_unprotect(H5F_t *f, hid_t dxpl_id, const H5HL_t *heap, haddr_t addr) assert(heap); assert(H5F_addr_defined(addr)); - if (H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, (void *)heap, FALSE) != SUCCEED) + if (H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, (void *)heap, + H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); done: @@ -1099,7 +1101,8 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t buf_size, const void * ret_value=offset; done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, FALSE) != SUCCEED) + if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, + H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, (size_t)(-1), "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1156,7 +1159,10 @@ H5HL_write(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t offset, size_t size, co HDmemcpy(heap->chunk + H5HL_SIZEOF_HDR(f) + offset, buf, size); done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, FALSE) != SUCCEED && ret_value != FAIL) + if (heap && + H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, H5AC__NO_FLAGS_SET) + != SUCCEED && + ret_value != FAIL) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1293,7 +1299,8 @@ H5HL_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t offset, size_t size) heap->freelist = fl; done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, FALSE) != SUCCEED) + if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, + H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1360,14 +1367,15 @@ H5HL_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) } /* end else */ /* Release the local heap metadata from the cache */ - if (H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, TRUE)<0) { + if (H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, H5C__DELETED_FLAG)<0) { heap = NULL; HGOTO_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release local heap"); } heap = NULL; done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, FALSE)<0) + if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, + H5AC__NO_FLAGS_SET)<0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release local heap"); FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5O.c b/src/H5O.c index 2dbd2fe..5f4cb00 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -318,7 +318,7 @@ H5O_init(H5F_t *f, hid_t dxpl_id, size_t size_hint, H5G_entry_t *ent/*out*/, had oh->mesg[0].chunkno = 0; /* cache it */ - if (H5AC_set(f, dxpl_id, H5AC_OHDR, ent->header, oh) < 0) + if (H5AC_set(f, dxpl_id, H5AC_OHDR, ent->header, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to cache object header"); /* open it */ @@ -1220,7 +1220,10 @@ int H5O_link(const H5G_entry_t *ent, int adjust, hid_t dxpl_id) { H5O_t *oh = NULL; - hbool_t deleted=FALSE; /* Whether the object was deleted as a result of this action */ + unsigned int flags=H5AC__NO_FLAGS_SET; /* used to indicate whether the + * object was deleted as a result + * of this action. + */ int ret_value = FAIL; FUNC_ENTER_NOAPI(H5O_link, FAIL); @@ -1258,7 +1261,7 @@ H5O_link(const H5G_entry_t *ent, int adjust, hid_t dxpl_id) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file"); /* Mark the object header as deleted */ - deleted=TRUE; + flags = H5C__DELETED_FLAG; } /* end else */ } /* end if */ } else if (adjust>0) { @@ -1280,7 +1283,7 @@ H5O_link(const H5G_entry_t *ent, int adjust, hid_t dxpl_id) ret_value = oh->nlink; done: - if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, deleted) < 0) + if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1379,7 +1382,8 @@ H5O_count_real (H5G_entry_t *ent, const H5O_class_t *type, hid_t dxpl_id) ret_value=acc; done: - if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) != SUCCEED) + if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, + H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1484,7 +1488,8 @@ H5O_exists_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t d ret_value=(sequence<0); done: - if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) != SUCCEED) + if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, + H5AC__NO_FLAGS_SET) != SUCCEED) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1634,7 +1639,8 @@ H5O_read_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, void *mes } done: - if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) < 0) + if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, + H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, NULL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1904,7 +1910,8 @@ H5O_modify_real(H5G_entry_t *ent, const H5O_class_t *type, int overwrite, ret_value = sequence; done: - if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) < 0) + if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, + H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -1986,7 +1993,8 @@ H5O_unprotect(H5G_entry_t *ent, H5O_t *oh, hid_t dxpl_id) assert(H5F_addr_defined(ent->header)); assert(oh); - if (H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) < 0) + if (H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, + H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); done: @@ -2328,7 +2336,8 @@ H5O_touch(H5G_entry_t *ent, hbool_t force, hid_t dxpl_id) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to update object modificaton time"); done: - if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE)<0) + if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, + H5AC__NO_FLAGS_SET)<0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -2432,7 +2441,8 @@ H5O_bogus(H5G_entry_t *ent, hid_t dxpl_id) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to update object 'bogus' message"); done: - if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE)<0) + if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, + H5AC__NO_FLAGS_SET)<0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE(ret_value); @@ -2580,7 +2590,8 @@ H5O_remove_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t d HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to remove constant message(s)"); done: - if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) < 0) + if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, + H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -3238,7 +3249,8 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file"); done: - if (oh && H5AC_unprotect(f, dxpl_id, H5AC_OHDR, addr, oh, TRUE)<0) + if (oh && + H5AC_unprotect(f, dxpl_id, H5AC_OHDR, addr, oh, H5C__DELETED_FLAG)<0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -3421,7 +3433,8 @@ H5O_get_info(H5G_entry_t *ent, H5O_stat_t *ostat, hid_t dxpl_id) ostat->nchunks=oh->nchunks; done: - if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE)<0) + if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, + H5AC__NO_FLAGS_SET)<0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -3597,7 +3610,8 @@ H5O_iterate(const H5G_entry_t *ent, unsigned type_id, H5O_operator_t op, } /* end for */ done: - if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) < 0) + if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, + H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); @@ -3825,7 +3839,8 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f HDfprintf(stream, "*** TOTAL SIZE DOES NOT MATCH ALLOCATED SIZE!\n"); done: - if (oh && H5AC_unprotect(f, dxpl_id, H5AC_OHDR, addr, oh, FALSE) < 0) + if (oh && H5AC_unprotect(f, dxpl_id, H5AC_OHDR, addr, oh, + H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); FUNC_LEAVE_NOAPI(ret_value); diff --git a/test/cache.c b/test/cache.c index a23b3ad..6a603e5 100644 --- a/test/cache.c +++ b/test/cache.c @@ -144,6 +144,18 @@ typedef struct test_entry_t hbool_t is_protected; /* entry should currently be on * the cache's protected list. */ + hbool_t loaded; /* entry has been loaded since the + * last time it was reset. + */ + hbool_t cleared; /* entry has been cleared since the + * last time it was reset. + */ + hbool_t flushed; /* entry has been flushed since the + * last time it was reset. + */ + hbool_t destroyed; /* entry has been destroyed since the + * last time it was reset. + */ } test_entry_t; /* The following is a cut down copy of the hash table manipulation @@ -217,10 +229,28 @@ if ( ( (cache_ptr) == NULL ) || \ } +/* misc type definitions */ + +struct flush_cache_test_spec +{ + int entry_num; + int entry_type; + int entry_index; + hbool_t insert_flag; + hbool_t dirty_flag; + unsigned int flags; + hbool_t expected_loaded; + hbool_t expected_cleared; + hbool_t expected_flushed; + hbool_t expected_destroyed; +}; + + /* global variable declarations: */ static hbool_t write_permitted = TRUE; static hbool_t pass = TRUE; /* set to false on error */ +static hbool_t skip_long_tests = TRUE; const char *failure_mssg = NULL; test_entry_t pico_entries[NUM_PICO_ENTRIES]; @@ -496,7 +526,8 @@ static haddr_t type_and_index_to_addr(int32_t type, static void insert_entry(H5C_t * cache_ptr, int32_t type, int32_t idx, - hbool_t dirty); + hbool_t dirty, + unsigned int flags); static void rename_entry(H5C_t * cache_ptr, int32_t type, @@ -606,6 +637,27 @@ static void smoke_check_6(void); static void smoke_check_7(void); static void smoke_check_8(void); static void write_permitted_check(void); +static void check_flush_cache(void); +static void check_flush_cache__empty_cache(H5C_t * cache_ptr); +static void check_flush_cache__multi_entry(H5C_t * cache_ptr); +static void check_flush_cache__multi_entry_test(H5C_t * cache_ptr, + int test_num, + unsigned int flush_flags, + int spec_size, + struct flush_cache_test_spec spec[]); +static void check_flush_cache__single_entry(H5C_t * cache_ptr); +static void check_flush_cache__single_entry_test(H5C_t * cache_ptr, + int test_num, + int entry_type, + int entry_idx, + hbool_t insert_flag, + hbool_t dirty_flag, + unsigned int flags, + unsigned int flush_flags, + hbool_t expected_loaded, + hbool_t expected_cleared, + hbool_t expected_flushed, + hbool_t expected_destroyed); static void check_flush_protected_err(void); static void check_destroy_protected_err(void); static void check_duplicate_insert_err(void); @@ -631,7 +683,7 @@ static void unprotect_entry(H5C_t * cache_ptr, int32_t type, int32_t idx, int dirty, - hbool_t deleted); + unsigned int flags); static void verify_clean(void); @@ -845,6 +897,8 @@ clear(H5F_t * f, entry_ptr->header.is_dirty = FALSE; entry_ptr->is_dirty = FALSE; + entry_ptr->cleared = TRUE; + if ( dest ) { destroy(f, thing); @@ -959,6 +1013,8 @@ destroy(H5F_t UNUSED * f, HDassert( !(entry_ptr->is_dirty) ); HDassert( !(entry_ptr->header.is_dirty) ); + entry_ptr->destroyed = TRUE; + return(SUCCEED); } /* dest() */ @@ -1068,6 +1124,8 @@ flush(H5F_t *f, HDassert( entry_ptr->header.size == entry_ptr->size ); HDassert( entry_ptr->size == entry_sizes[entry_ptr->type] ); + entry_ptr->flushed = TRUE; + if ( ( ! write_permitted ) && ( entry_ptr->is_dirty ) ) { pass = FALSE; @@ -1199,6 +1257,8 @@ load(H5F_t UNUSED *f, HDassert( entry_ptr->addr == addr ); HDassert( entry_ptr->size == entry_sizes[type] ); + entry_ptr->loaded = TRUE; + entry_ptr->is_dirty = FALSE; (entry_ptr->reads)++; @@ -1506,6 +1566,11 @@ reset_entries(void) base_addr[j].is_dirty = FALSE; base_addr[j].is_protected = FALSE; + base_addr[j].loaded = FALSE; + base_addr[j].cleared = FALSE; + base_addr[j].flushed = FALSE; + base_addr[j].destroyed = FALSE; + addr += (haddr_t)entry_size; alt_addr += (haddr_t)entry_size; } @@ -1751,11 +1816,12 @@ flush_cache(H5C_t * cache_ptr, if ( destroy_entries ) { result = H5C_flush_cache(NULL, -1, -1, cache_ptr, - H5F_FLUSH_INVALIDATE); + H5C__FLUSH_INVALIDATE_FLAG); } else { - result = H5C_flush_cache(NULL, -1, -1, cache_ptr, 0); + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + H5C__NO_FLAGS_SET); } } @@ -1794,6 +1860,10 @@ flush_cache(H5C_t * cache_ptr, * * Modifications: * + * JRM -- 1/13/05 + * Updated function for the flags parameter in + * H5C_insert_entry(), and to allow access to this parameter. + * *------------------------------------------------------------------------- */ @@ -1801,7 +1871,8 @@ static void insert_entry(H5C_t * cache_ptr, int32_t type, int32_t idx, - hbool_t dirty) + hbool_t dirty, + unsigned int flags) { herr_t result; test_entry_t * base_addr; @@ -1828,7 +1899,7 @@ insert_entry(H5C_t * cache_ptr, } result = H5C_insert_entry(NULL, -1, -1, cache_ptr, &(types[type]), - entry_ptr->addr, (void *)entry_ptr); + entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( entry_ptr->header.is_protected ) || @@ -1952,7 +2023,7 @@ rename_entry(H5C_t * cache_ptr, return; -} /* insert_entry() */ +} /* rename_entry() */ /*------------------------------------------------------------------------- @@ -2058,6 +2129,10 @@ protect_entry(H5C_t * cache_ptr, * * Modifications: * + * JRM -- 1/7/05 + * Updated for the replacement of the deleted parameter in + * H5C_unprotect() with the new flags parameter. + * *------------------------------------------------------------------------- */ @@ -2068,7 +2143,7 @@ unprotect_entry(H5C_t * cache_ptr, int32_t type, int32_t idx, int dirty, - hbool_t deleted) + unsigned int flags) { /* const char * fcn_name = "unprotect_entry()"; */ herr_t result; @@ -2097,7 +2172,7 @@ unprotect_entry(H5C_t * cache_ptr, } result = H5C_unprotect(NULL, -1, -1, cache_ptr, &(types[type]), - entry_ptr->addr, (void *)entry_ptr, deleted); + entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || ( entry_ptr->header.is_protected ) || @@ -2184,7 +2259,8 @@ row_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry(cache_ptr, type, (idx + lag), dirty_inserts); + insert_entry(cache_ptr, type, (idx + lag), dirty_inserts, + H5C__NO_FLAGS_SET); } @@ -2205,7 +2281,8 @@ row_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); - unprotect_entry(cache_ptr, type, idx+lag-2, NO_CHANGE, FALSE); + unprotect_entry(cache_ptr, type, idx+lag-2, NO_CHANGE, + H5C__NO_FLAGS_SET); } @@ -2235,7 +2312,8 @@ row_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 5)); - unprotect_entry(cache_ptr, type, idx+lag-5, NO_CHANGE, FALSE); + unprotect_entry(cache_ptr, type, idx+lag-5, NO_CHANGE, + H5C__NO_FLAGS_SET); } if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { @@ -2254,7 +2332,8 @@ row_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); - unprotect_entry(cache_ptr, type, idx-lag+2, NO_CHANGE, FALSE); + unprotect_entry(cache_ptr, type, idx-lag+2, NO_CHANGE, + H5C__NO_FLAGS_SET); } if ( ( pass ) && ( (idx - lag + 1) >= 0 ) && @@ -2277,35 +2356,37 @@ row_major_scan_forward(H5C_t * cache_ptr, case 0: /* we just did an insert */ unprotect_entry(cache_ptr, type, idx - lag, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); break; case 1: if ( (entries[type])[idx-lag].is_dirty ) { unprotect_entry(cache_ptr, type, idx - lag, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } else { unprotect_entry(cache_ptr, type, idx - lag, - dirty_unprotects, FALSE); + dirty_unprotects, + H5C__NO_FLAGS_SET); } break; case 2: /* we just did an insrt */ unprotect_entry(cache_ptr, type, idx - lag, - NO_CHANGE, TRUE); + NO_CHANGE, H5C__DELETED_FLAG); break; case 3: if ( (entries[type])[idx-lag].is_dirty ) { unprotect_entry(cache_ptr, type, idx - lag, - NO_CHANGE, TRUE); + NO_CHANGE, H5C__DELETED_FLAG); } else { unprotect_entry(cache_ptr, type, idx - lag, - dirty_destroys, TRUE); + dirty_destroys, + H5C__DELETED_FLAG); } break; @@ -2324,7 +2405,7 @@ row_major_scan_forward(H5C_t * cache_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); unprotect_entry(cache_ptr, type, idx - lag, - dirty_unprotects, FALSE); + dirty_unprotects, H5C__NO_FLAGS_SET); } } @@ -2404,7 +2485,8 @@ hl_row_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry(cache_ptr, type, (idx + lag), dirty_inserts); + insert_entry(cache_ptr, type, (idx + lag), dirty_inserts, + H5C__NO_FLAGS_SET); } i = idx; @@ -2421,7 +2503,8 @@ hl_row_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry(cache_ptr, type, i, NO_CHANGE, FALSE); + unprotect_entry(cache_ptr, type, i, NO_CHANGE, + H5C__NO_FLAGS_SET); } i--; } @@ -2506,7 +2589,8 @@ row_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx - lag)); - insert_entry(cache_ptr, type, (idx - lag), dirty_inserts); + insert_entry(cache_ptr, type, (idx - lag), dirty_inserts, + H5C__NO_FLAGS_SET); } @@ -2527,7 +2611,8 @@ row_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); - unprotect_entry(cache_ptr, type, idx-lag+2, NO_CHANGE, FALSE); + unprotect_entry(cache_ptr, type, idx-lag+2, NO_CHANGE, + H5C__NO_FLAGS_SET); } @@ -2557,7 +2642,8 @@ row_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 5)); - unprotect_entry(cache_ptr, type, idx-lag+5, NO_CHANGE, FALSE); + unprotect_entry(cache_ptr, type, idx-lag+5, NO_CHANGE, + H5C__NO_FLAGS_SET); } if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { @@ -2576,7 +2662,8 @@ row_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); - unprotect_entry(cache_ptr, type, idx+lag-2, NO_CHANGE, FALSE); + unprotect_entry(cache_ptr, type, idx+lag-2, NO_CHANGE, + H5C__NO_FLAGS_SET); } if ( ( pass ) && ( (idx + lag - 1) >= 0 ) && @@ -2601,34 +2688,36 @@ row_major_scan_backward(H5C_t * cache_ptr, if ( (entries[type])[idx+lag].is_dirty ) { unprotect_entry(cache_ptr, type, idx + lag, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } else { unprotect_entry(cache_ptr, type, idx + lag, - dirty_unprotects, FALSE); + dirty_unprotects, + H5C__NO_FLAGS_SET); } break; case 1: /* we just did an insert */ unprotect_entry(cache_ptr, type, idx + lag, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); break; case 2: if ( (entries[type])[idx + lag].is_dirty ) { unprotect_entry(cache_ptr, type, idx + lag, - NO_CHANGE, TRUE); + NO_CHANGE, H5C__DELETED_FLAG); } else { unprotect_entry(cache_ptr, type, idx + lag, - dirty_destroys, TRUE); + dirty_destroys, + H5C__DELETED_FLAG); } break; case 3: /* we just did an insrt */ unprotect_entry(cache_ptr, type, idx + lag, - NO_CHANGE, TRUE); + NO_CHANGE, H5C__DELETED_FLAG); break; default: @@ -2645,7 +2734,7 @@ row_major_scan_backward(H5C_t * cache_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); unprotect_entry(cache_ptr, type, idx + lag, - dirty_unprotects, FALSE); + dirty_unprotects, H5C__NO_FLAGS_SET); } } @@ -2725,7 +2814,8 @@ hl_row_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry(cache_ptr, type, (idx + lag), dirty_inserts); + insert_entry(cache_ptr, type, (idx + lag), dirty_inserts, + H5C__NO_FLAGS_SET); } i = idx; @@ -2742,7 +2832,8 @@ hl_row_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry(cache_ptr, type, i, NO_CHANGE, FALSE); + unprotect_entry(cache_ptr, type, i, NO_CHANGE, + H5C__NO_FLAGS_SET); } i--; } @@ -2825,7 +2916,8 @@ col_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx + lag)); - insert_entry(cache_ptr, type, (idx + lag), dirty_inserts); + insert_entry(cache_ptr, type, (idx + lag), dirty_inserts, + H5C__NO_FLAGS_SET); } if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { @@ -2843,7 +2935,7 @@ col_major_scan_forward(H5C_t * cache_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); unprotect_entry(cache_ptr, type, idx - lag, - dirty_unprotects, FALSE); + dirty_unprotects, H5C__NO_FLAGS_SET); } if ( verbose ) @@ -2931,7 +3023,8 @@ hl_col_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, i); - insert_entry(cache_ptr, type, i, dirty_inserts); + insert_entry(cache_ptr, type, i, dirty_inserts, + H5C__NO_FLAGS_SET); } if ( ( pass ) && ( i >= 0 ) && ( i <= max_indices[type] ) ) { @@ -2949,7 +3042,7 @@ hl_col_major_scan_forward(H5C_t * cache_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, i); unprotect_entry(cache_ptr, type, i, - dirty_unprotects, FALSE); + dirty_unprotects, H5C__NO_FLAGS_SET); } if ( verbose ) @@ -3037,7 +3130,8 @@ col_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, (idx - lag)); - insert_entry(cache_ptr, type, (idx - lag), dirty_inserts); + insert_entry(cache_ptr, type, (idx - lag), dirty_inserts, + H5C__NO_FLAGS_SET); } if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { @@ -3055,7 +3149,7 @@ col_major_scan_backward(H5C_t * cache_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); unprotect_entry(cache_ptr, type, idx + lag, - dirty_unprotects, FALSE); + dirty_unprotects, H5C__NO_FLAGS_SET); } if ( verbose ) @@ -3146,7 +3240,8 @@ hl_col_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(i, %d, %d) ", type, i); - insert_entry(cache_ptr, type, i, dirty_inserts); + insert_entry(cache_ptr, type, i, dirty_inserts, + H5C__NO_FLAGS_SET); } if ( ( pass ) && ( i >= 0 ) && ( i <= max_indices[type] ) ) { @@ -3164,7 +3259,7 @@ hl_col_major_scan_backward(H5C_t * cache_ptr, HDfprintf(stdout, "(u, %d, %d) ", type, i); unprotect_entry(cache_ptr, type, i, - dirty_unprotects, FALSE); + dirty_unprotects, H5C__NO_FLAGS_SET); } if ( verbose ) @@ -3209,6 +3304,10 @@ hl_col_major_scan_backward(H5C_t * cache_ptr, * * Modifications: * + * JRM -- 1/18/05 + * Added code to skip this test if the skip_long_tests global + * is true. + * *------------------------------------------------------------------------- */ @@ -3227,6 +3326,15 @@ smoke_check_1(void) TESTING("smoke check #1 -- all clean, ins, dest, ren, 4/2 MB cache"); + if ( skip_long_tests ) { + + SKIPPED(); + + HDfprintf(stdout, " Long tests disabled.\n"); + + return; + } + pass = TRUE; if ( show_progress ) /* 1 */ @@ -3383,6 +3491,10 @@ smoke_check_1(void) * * Modifications: * + * JRM -- 1/18/05 + * Added code to skip this test if the skip_long_tests global + * is true. + * *------------------------------------------------------------------------- */ @@ -3401,6 +3513,15 @@ smoke_check_2(void) TESTING("smoke check #2 -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache"); + if ( skip_long_tests ) { + + SKIPPED(); + + HDfprintf(stdout, " Long tests disabled.\n"); + + return; + } + pass = TRUE; if ( show_progress ) /* 1 */ @@ -3556,6 +3677,10 @@ smoke_check_2(void) * * Modifications: * + * JRM -- 1/18/05 + * Added code to skip this test if the skip_long_tests global + * is true. + * *------------------------------------------------------------------------- */ @@ -3574,6 +3699,15 @@ smoke_check_3(void) TESTING("smoke check #3 -- all clean, ins, dest, ren, 2/1 KB cache"); + if ( skip_long_tests ) { + + SKIPPED(); + + HDfprintf(stdout, " Long tests disabled.\n"); + + return; + } + pass = TRUE; if ( show_progress ) /* 1 */ @@ -3730,6 +3864,10 @@ smoke_check_3(void) * * Modifications: * + * JRM -- 1/18/05 + * Added code to skip this test if the skip_long_tests global + * is true. + * *------------------------------------------------------------------------- */ @@ -3748,6 +3886,15 @@ smoke_check_4(void) TESTING("smoke check #4 -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache"); + if ( skip_long_tests ) { + + SKIPPED(); + + HDfprintf(stdout, " Long tests disabled.\n"); + + return; + } + pass = TRUE; if ( show_progress ) /* 1 */ @@ -3904,6 +4051,10 @@ smoke_check_4(void) * * Modifications: * + * JRM -- 1/18/05 + * Added code to skip this test if the skip_long_tests global + * is true. + * *------------------------------------------------------------------------- */ @@ -3964,6 +4115,15 @@ smoke_check_5(void) TESTING("smoke check #5 -- all clean, ins, prot, unprot, AR cache 1"); + if ( skip_long_tests ) { + + SKIPPED(); + + HDfprintf(stdout, " Long tests disabled.\n"); + + return; + } + pass = TRUE; if ( show_progress ) /* 1 */ @@ -4111,6 +4271,10 @@ smoke_check_5(void) * * Modifications: * + * JRM -- 1/18/05 + * Added code to skip this test if the skip_long_tests global + * is true. + * *------------------------------------------------------------------------- */ @@ -4173,6 +4337,15 @@ smoke_check_6(void) pass = TRUE; + if ( skip_long_tests ) { + + SKIPPED(); + + HDfprintf(stdout, " Long tests disabled.\n"); + + return; + } + if ( show_progress ) /* 1 */ HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); @@ -4318,6 +4491,10 @@ smoke_check_6(void) * * Modifications: * + * JRM -- 1/18/05 + * Added code to skip this test if the skip_long_tests global + * is true. + * *------------------------------------------------------------------------- */ @@ -4379,6 +4556,15 @@ smoke_check_7(void) TESTING("smoke check #7 -- all clean, ins, prot, unprot, AR cache 2"); + if ( skip_long_tests ) { + + SKIPPED(); + + HDfprintf(stdout, " Long tests disabled.\n"); + + return; + } + pass = TRUE; if ( show_progress ) /* 1 */ @@ -4526,6 +4712,10 @@ smoke_check_7(void) * * Modifications: * + * JRM -- 1/18/05 + * Added code to skip this test if the skip_long_tests global + * is true. + * *------------------------------------------------------------------------- */ @@ -4587,6 +4777,15 @@ smoke_check_8(void) TESTING("smoke check #8 -- ~1/2 dirty, ins, prot, unprot, AR cache 2"); + if ( skip_long_tests ) { + + SKIPPED(); + + HDfprintf(stdout, " Long tests disabled.\n"); + + return; + } + pass = TRUE; if ( show_progress ) /* 1 */ @@ -4637,101 +4836,2978 @@ smoke_check_8(void) /* do_inserts */ FALSE, /* dirty_inserts */ dirty_inserts); - if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + if ( show_progress ) /* 5 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + hl_row_major_scan_forward(/* cache_ptr */ cache_ptr, + /* verbose */ FALSE, + /* reset_stats */ TRUE, + /* display_stats */ display_stats, + /* display_detailed_stats */ FALSE, + /* do_inserts */ TRUE, + /* dirty_inserts */ dirty_inserts); + + if ( show_progress ) /* 6 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + /* flush and destroy all entries in the cache: */ + + flush_cache(/* cache_ptr */ cache_ptr, + /* destroy_entries */ TRUE, + /* dump_stats */ FALSE, + /* dump_detailed_stats */ FALSE); + + if ( show_progress ) /* 7 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + hl_col_major_scan_forward(/* cache_ptr */ cache_ptr, + /* verbose */ FALSE, + /* reset_stats */ TRUE, + /* display_stats */ display_stats, + /* display_detailed_stats */ FALSE, + /* do_inserts */ TRUE, + /* dirty_inserts */ dirty_inserts, + /* dirty_unprotects */ dirty_unprotects); + + if ( show_progress ) /* 8 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + /* flush all entries in the cache: */ + + flush_cache(/* cache_ptr */ cache_ptr, + /* destroy_entries */ FALSE, + /* dump_stats */ FALSE, + /* dump_detailed_stats */ FALSE); + + if ( show_progress ) /* 9 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + hl_col_major_scan_backward(/* cache_ptr */ cache_ptr, + /* verbose */ FALSE, + /* reset_stats */ TRUE, + /* display_stats */ display_stats, + /* display_detailed_stats */ FALSE, + /* do_inserts */ TRUE, + /* dirty_inserts */ dirty_inserts, + /* dirty_unprotects */ dirty_unprotects); + + if ( show_progress ) /* 10 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + takedown_cache(cache_ptr, display_stats, TRUE); + + if ( show_progress ) /* 11 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + verify_clean(); + verify_unprotected(); + + if ( pass ) { PASSED(); } else { H5_FAILED(); } + + if ( ! pass ) + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + fcn_name, failure_mssg); + +} /* smoke_check_8() */ + + +/*------------------------------------------------------------------------- + * Function: write_permitted_check() + * + * Purpose: A basic test of the write permitted function. In essence, + * we load the cache up with dirty entryies, set + * write_permitted to FALSE, and then protect a bunch of + * entries. If there are any writes while write_permitted is + * FALSE, the test will fail. + * + * Return: void + * + * Programmer: John Mainzer + * 6/24/04 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + +static void +write_permitted_check(void) +{ + +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + + const char * fcn_name = "write_permitted_check"; + hbool_t show_progress = FALSE; + hbool_t display_stats = FALSE; + int32_t lag = 10; + int mile_stone = 1; + H5C_t * cache_ptr = NULL; + +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + + TESTING("write permitted check -- 1/0 MB cache"); + +#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS + + pass = TRUE; + + if ( show_progress ) /* 1 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + reset_entries(); + + if ( show_progress ) /* 2 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + cache_ptr = setup_cache((size_t)(1 * 1024 * 1024), + (size_t)(0)); + + if ( show_progress ) /* 3 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + row_major_scan_forward(/* cache_ptr */ cache_ptr, + /* lag */ lag, + /* verbose */ FALSE, + /* reset_stats */ TRUE, + /* display_stats */ display_stats, + /* display_detailed_stats */ TRUE, + /* do_inserts */ TRUE, + /* dirty_inserts */ TRUE, + /* do_renames */ TRUE, + /* rename_to_main_addr */ FALSE, + /* do_destroys */ TRUE, + /* dirty_destroys */ TRUE, + /* dirty_unprotects */ TRUE); + + if ( show_progress ) /* 4 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + write_permitted = FALSE; + + row_major_scan_backward(/* cache_ptr */ cache_ptr, + /* lag */ lag, + /* verbose */ FALSE, + /* reset_stats */ TRUE, + /* display_stats */ display_stats, + /* display_detailed_stats */ TRUE, + /* do_inserts */ FALSE, + /* dirty_inserts */ FALSE, + /* do_renames */ TRUE, + /* rename_to_main_addr */ TRUE, + /* do_destroys */ FALSE, + /* dirty_destroys */ FALSE, + /* dirty_unprotects */ NO_CHANGE); + + if ( show_progress ) /* 5 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + write_permitted = TRUE; + + row_major_scan_forward(/* cache_ptr */ cache_ptr, + /* lag */ lag, + /* verbose */ FALSE, + /* reset_stats */ TRUE, + /* display_stats */ display_stats, + /* display_detailed_stats */ TRUE, + /* do_inserts */ TRUE, + /* dirty_inserts */ TRUE, + /* do_renames */ TRUE, + /* rename_to_main_addr */ FALSE, + /* do_destroys */ FALSE, + /* dirty_destroys */ TRUE, + /* dirty_unprotects */ TRUE); + + if ( show_progress ) /* 6 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + /* flush and destroy all entries in the cache: */ + + flush_cache(/* cache_ptr */ cache_ptr, + /* destroy_entries */ TRUE, + /* dump_stats */ FALSE, + /* dump_detailed_stats */ FALSE); + + if ( show_progress ) /* 7 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + col_major_scan_forward(/* cache_ptr */ cache_ptr, + /* lag */ lag, + /* verbose */ FALSE, + /* reset_stats */ TRUE, + /* display_stats */ display_stats, + /* display_detailed_stats */ TRUE, + /* do_inserts */ TRUE, + /* dirty_inserts */ TRUE, + /* dirty_unprotects */ TRUE); + + if ( show_progress ) /* 8 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + write_permitted = FALSE; + + col_major_scan_backward(/* cache_ptr */ cache_ptr, + /* lag */ lag, + /* verbose */ FALSE, + /* reset_stats */ TRUE, + /* display_stats */ display_stats, + /* display_detailed_stats */ TRUE, + /* do_inserts */ FALSE, + /* dirty_inserts */ FALSE, + /* dirty_unprotects */ NO_CHANGE); + + write_permitted = TRUE; + + if ( show_progress ) /* 9 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + takedown_cache(cache_ptr, display_stats, TRUE); + + if ( show_progress ) /* 10 */ + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + fcn_name, mile_stone++, (int)pass); + + verify_clean(); + verify_unprotected(); + + if ( pass ) { PASSED(); } else { H5_FAILED(); } + + if ( ! pass ) + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + fcn_name, failure_mssg); + +#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + + SKIPPED(); + + HDfprintf(stdout, " Clean and dirty LRU lists disabled.\n"); + +#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + +} /* write_permitted_check() */ + + +/*------------------------------------------------------------------------- + * Function: check_flush_cache() + * + * Purpose: Verify that flush_cache behaves as expected. In particular, + * test the behaviour with different flags. + * + * Return: void + * + * Programmer: John Mainzer + * 1/10/05 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + +static void +check_flush_cache(void) +{ + const char * fcn_name = "check_flush_cache"; + H5C_t * cache_ptr = NULL; + + TESTING("H5C_flush_cache() functionality"); + + pass = TRUE; + + /* allocate a cache, and flush it under various circumstances. + * To the extent possible, verify that the desired actions took + * place. + */ + + if ( pass ) { + + reset_entries(); + + cache_ptr = setup_cache((size_t)(2 * 1024 * 1024), + (size_t)(1 * 1024 * 1024)); + } + + /* first test behaviour on an empty cache. Can't do much sanity + * checking in this case, so simply check the return values. + */ + + if ( pass ) { + + check_flush_cache__empty_cache(cache_ptr); + } + + /* now do a series of similar tests with a cache with a single entry. + * Start with a clean entry, with no flags set. + */ + + if ( pass ) { + + check_flush_cache__single_entry(cache_ptr); + } + + if ( pass ) { + + check_flush_cache__multi_entry(cache_ptr); + } + + if ( pass ) { + + takedown_cache(cache_ptr, FALSE, FALSE); + } + + if ( pass ) { PASSED(); } else { H5_FAILED(); } + + if ( ! pass ) + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + fcn_name, failure_mssg); + +} /* check_flush_cache() */ + + +/*------------------------------------------------------------------------- + * Function: check_flush_cache__empty_cache() + * + * Purpose: Verify that flush_cache behaves as expected with an empty + * cache. + * + * Return: void + * + * Programmer: John Mainzer + * 1/12/05 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + +static void +check_flush_cache__empty_cache(H5C_t * cache_ptr) +{ + /* const char * fcn_name = "check_flush_cache__empty_cache"; */ + herr_t result; + + if ( cache_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "cache_ptr NULL on entry to empty cache case."; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "cache not empty at beginning of empty cache case."; + } + + + /* Test behaviour on an empty cache. Can't do much sanity + * checking in this case, so simply check the return values. + */ + + if ( pass ) { + + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "flush with flags = 0x00 failed on empty cache.\n"; + } + } + + if ( pass ) { + + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + H5C__FLUSH_INVALIDATE_FLAG); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "flush with flags = 0x04 failed on empty cache.\n"; + } + } + + if ( pass ) { + + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + H5C__FLUSH_CLEAR_ONLY_FLAG); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "flush with flags = 0x08 failed on empty cache.\n"; + } + } + + + if ( pass ) { + + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + H5C__FLUSH_MARKED_ENTRIES_FLAG); + + if ( result < 0 ) { + + pass = FALSE; + failure_mssg = "flush with flags = 0x10 failed on empty cache.\n"; + } + } + +} /* check_flush_cache__empty_cache() */ + + +/*------------------------------------------------------------------------- + * Function: check_flush_cache__multi_entry() + * + * Purpose: Verify that flush_cache behaves as expected when the cache + * contains multiple elements. + * + * Return: void + * + * Programmer: John Mainzer + * 1/14/05 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + +static void +check_flush_cache__multi_entry(H5C_t * cache_ptr) +{ + /* const char * fcn_name = "check_flush_cache__multi_entry"; */ + + if ( cache_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "cache_ptr NULL on entry to multi entry case."; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "cache not empty at beginning of multi entry case."; + } + + { + int test_num = 1; + unsigned int flush_flags = H5C__NO_FLAGS_SET; + int spec_size = 8; + struct flush_cache_test_spec spec[8] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ FALSE + } + }; + + check_flush_cache__multi_entry_test(cache_ptr, test_num, + flush_flags, spec_size, spec); + } + + + { + int test_num = 2; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG; + int spec_size = 8; + struct flush_cache_test_spec spec[8] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + } + }; + + check_flush_cache__multi_entry_test(cache_ptr, test_num, + flush_flags, spec_size, spec); + } + + + { + int test_num = 3; + unsigned int flush_flags = H5C__FLUSH_CLEAR_ONLY_FLAG; + int spec_size = 8; + struct flush_cache_test_spec spec[8] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; + + check_flush_cache__multi_entry_test(cache_ptr, test_num, + flush_flags, spec_size, spec); + } + + + { + int test_num = 4; + unsigned int flush_flags = H5C__FLUSH_MARKED_ENTRIES_FLAG; + int spec_size = 8; + struct flush_cache_test_spec spec[8] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ FALSE + } + }; + + check_flush_cache__multi_entry_test(cache_ptr, test_num, + flush_flags, spec_size, spec); + } + + + { + int test_num = 5; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG; + int spec_size = 8; + struct flush_cache_test_spec spec[8] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + } + }; + + check_flush_cache__multi_entry_test(cache_ptr, test_num, + flush_flags, spec_size, spec); + } + + + { + int test_num = 6; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG; + int spec_size = 8; + struct flush_cache_test_spec spec[8] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ TRUE + } + }; + + check_flush_cache__multi_entry_test(cache_ptr, test_num, + flush_flags, spec_size, spec); + } + + + { + int test_num = 7; + unsigned int flush_flags = H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG; + int spec_size = 8; + struct flush_cache_test_spec spec[8] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + } + }; + + check_flush_cache__multi_entry_test(cache_ptr, test_num, + flush_flags, spec_size, spec); + } + + + { + int test_num = 8; + unsigned int flush_flags = H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG; + int spec_size = 8; + struct flush_cache_test_spec spec[8] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ TRUE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ TRUE + } + }; + + check_flush_cache__multi_entry_test(cache_ptr, test_num, + flush_flags, spec_size, spec); + } + + + /* verify that all other flags are ignored */ + { + int test_num = 9; + unsigned int flush_flags = (unsigned) + ~(H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG); + int spec_size = 8; + struct flush_cache_test_spec spec[8] = + { + { + /* entry_num = */ 0, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 100, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 1, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 75, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 2, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 25, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 3, + /* entry_type = */ PICO_ENTRY_TYPE, + /* entry_index = */ 50, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__NO_FLAGS_SET, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 4, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 10, + /* insert_flag = */ FALSE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 5, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 20, + /* insert_flag = */ FALSE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ TRUE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 6, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 30, + /* insert_flag = */ TRUE, + /* dirty_flag = */ FALSE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ FALSE, + /* expected_destroyed = */ FALSE + }, + { + /* entry_num = */ 7, + /* entry_type = */ MONSTER_ENTRY_TYPE, + /* entry_index = */ 40, + /* insert_flag = */ TRUE, + /* dirty_flag = */ TRUE, + /* flags = */ H5C__SET_FLUSH_MARKER_FLAG, + /* expected_loaded = */ FALSE, + /* expected_cleared = */ FALSE, + /* expected_flushed = */ TRUE, + /* expected_destroyed = */ FALSE + } + }; + + check_flush_cache__multi_entry_test(cache_ptr, test_num, + flush_flags, spec_size, spec); + } + +} /* check_flush_cache__multi_entry() */ + + +/*------------------------------------------------------------------------- + * Function: check_flush_cache__multi_entry_test() + * + * Purpose: Run a multi entry flush cache test. + * + * Return: void + * + * Programmer: John Mainzer + * 1/13/05 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + +static void +check_flush_cache__multi_entry_test(H5C_t * cache_ptr, + int test_num, + unsigned int flush_flags, + int spec_size, + struct flush_cache_test_spec spec[]) +{ + /* const char * fcn_name = "check_flush_cache__multi_entry_test"; */ + static char msg[128]; + herr_t result; + int i; + size_t total_entry_size = 0; + test_entry_t * base_addr; + test_entry_t * entry_ptr; + + if ( cache_ptr == NULL ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "cache_ptr NULL on entry to single entry test #%d.", + test_num); + failure_mssg = msg; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "cache not empty at beginning of multi entry test #%d.", + test_num); + failure_mssg = msg; + } + else if ( ( spec_size < 1 ) || ( spec == NULL ) ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "missing/bad test spec on entry to multi entry test #%d.", + test_num); + failure_mssg = msg; + } + + i = 0; + while ( ( pass ) && ( i < spec_size ) ) + { + if ( ( spec[i].entry_num != i ) || + ( spec[i].entry_type < 0 ) || + ( spec[i].entry_type >= NUMBER_OF_ENTRY_TYPES ) || + ( spec[i].entry_index < 0 ) || + ( spec[i].entry_index > max_indices[spec[i].entry_type] ) ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "bad data in spec[%d] on entry to multi entry test #%d.", + i, test_num); + failure_mssg = msg; + } + i++; + } + + i = 0; + while ( ( pass ) && ( i < spec_size ) ) + { + if ( spec[i].insert_flag ) { + + insert_entry(cache_ptr, spec[i].entry_type, spec[i].entry_index, + spec[i].dirty_flag, spec[i].flags); + + } else { + + protect_entry(cache_ptr, spec[i].entry_type, spec[i].entry_index); + + unprotect_entry(cache_ptr, spec[i].entry_type, spec[i].entry_index, + (int)(spec[i].dirty_flag), spec[i].flags); + } + + total_entry_size += entry_sizes[spec[i].entry_type]; + + i++; + } + + if ( pass ) { + + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, flush_flags); + + if ( result < 0 ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "flush with flags 0x%x failed in multi entry test #%d.", + flush_flags, test_num); + failure_mssg = msg; + } + } + + i = 0; + while ( ( pass ) && ( i < spec_size ) ) + { + base_addr = entries[spec[i].entry_type]; + entry_ptr = &(base_addr[spec[i].entry_index]); + + if ( ( entry_ptr->loaded != spec[i].expected_loaded ) || + ( entry_ptr->cleared != spec[i].expected_cleared ) || + ( entry_ptr->flushed != spec[i].expected_flushed ) || + ( entry_ptr->destroyed != spec[i].expected_destroyed ) ) { + +#if 0 /* This is useful debugging code. Lets keep it around. */ + + HDfprintf(stdout, + "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->loaded), + (int)(spec[i].expected_loaded), + (int)(entry_ptr->cleared), + (int)(spec[i].expected_cleared), + (int)(entry_ptr->flushed), + (int)(spec[i].expected_flushed), + (int)(entry_ptr->destroyed), + (int)(spec[i].expected_destroyed)); + +#endif + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Bad status on entry %d after flush in multi entry test #%d.", + i, test_num); + failure_mssg = msg; + } + i++; + } + + if ( pass ) { + + if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 ) + && + ( ( cache_ptr->index_len != spec_size ) + || + ( cache_ptr->index_size != total_entry_size ) + ) + ) + || + ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ) + && + ( ( cache_ptr->index_len != 0 ) + || + ( cache_ptr->index_size != 0 ) + ) + ) + ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Unexpected cache len/size after flush in multi entry test #%d.", + test_num); + failure_mssg = msg; + } + } + + /* clean up the cache to prep for the next test */ + if ( pass ) { + + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + H5C__FLUSH_INVALIDATE_FLAG); + + if ( result < 0 ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Flush failed on cleanup in multi entry test #%d.", + test_num); + failure_mssg = msg; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Unexpected cache len/size after cleanup in multi entry test #%d.", + test_num); + failure_mssg = msg; + + } + } + + i = 0; + while ( ( pass ) && ( i < spec_size ) ) + { + base_addr = entries[spec[i].entry_type]; + entry_ptr = &(base_addr[spec[i].entry_index]); + + entry_ptr->loaded = FALSE; + entry_ptr->cleared = FALSE; + entry_ptr->flushed = FALSE; + entry_ptr->destroyed = FALSE; + + i++; + } + +} /* check_flush_cache__multi_entry_test() */ + + +/*------------------------------------------------------------------------- + * Function: check_flush_cache__single_entry() + * + * Purpose: Verify that flush_cache behaves as expected when the cache + * contains only one element. + * + * Return: void + * + * Programmer: John Mainzer + * 1/12/05 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ + +static void +check_flush_cache__single_entry(H5C_t * cache_ptr) +{ + /* const char * fcn_name = "check_flush_cache__single_entry"; */ + + if ( cache_ptr == NULL ) { + + pass = FALSE; + failure_mssg = "cache_ptr NULL on entry to single entry case."; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { + + pass = FALSE; + failure_mssg = "cache not empty at beginning of single entry case."; + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 1, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 2, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 3, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 4, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 5, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 6, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 7, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 8, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 9, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 10, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 11, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 12, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 13, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 14, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 15, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 16, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 17, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 18, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 19, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 20, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 21, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 22, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 23, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 24, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 25, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 26, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 27, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 28, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 29, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 30, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 31, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 32, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ FALSE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ TRUE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 33, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 34, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 35, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 36, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 37, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 38, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 39, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 40, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 41, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 42, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 43, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 44, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 45, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 46, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 47, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 48, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__NO_FLAGS_SET, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 49, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 50, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__NO_FLAGS_SET, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 51, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 52, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 53, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 54, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } + + if ( pass ) { + + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 55, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } - hl_row_major_scan_forward(/* cache_ptr */ cache_ptr, - /* verbose */ FALSE, - /* reset_stats */ TRUE, - /* display_stats */ display_stats, - /* display_detailed_stats */ FALSE, - /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts); + if ( pass ) { - if ( show_progress ) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 56, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ FALSE + ); + } - /* flush and destroy all entries in the cache: */ + if ( pass ) { - flush_cache(/* cache_ptr */ cache_ptr, - /* destroy_entries */ TRUE, - /* dump_stats */ FALSE, - /* dump_detailed_stats */ FALSE); + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 57, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } - if ( show_progress ) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + if ( pass ) { - hl_col_major_scan_forward(/* cache_ptr */ cache_ptr, - /* verbose */ FALSE, - /* reset_stats */ TRUE, - /* display_stats */ display_stats, - /* display_detailed_stats */ FALSE, - /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* dirty_unprotects */ dirty_unprotects); + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 58, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } - if ( show_progress ) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + if ( pass ) { - /* flush all entries in the cache: */ + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 59, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } - flush_cache(/* cache_ptr */ cache_ptr, - /* destroy_entries */ FALSE, - /* dump_stats */ FALSE, - /* dump_detailed_stats */ FALSE); + if ( pass ) { - if ( show_progress ) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 60, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ FALSE + ); + } - hl_col_major_scan_backward(/* cache_ptr */ cache_ptr, - /* verbose */ FALSE, - /* reset_stats */ TRUE, - /* display_stats */ display_stats, - /* display_detailed_stats */ FALSE, - /* do_inserts */ TRUE, - /* dirty_inserts */ dirty_inserts, - /* dirty_unprotects */ dirty_unprotects); + if ( pass ) { - if ( show_progress ) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 61, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } - takedown_cache(cache_ptr, display_stats, TRUE); + if ( pass ) { - if ( show_progress ) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 62, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_MARKED_ENTRIES_FLAG | + H5C__FLUSH_INVALIDATE_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ FALSE, + /* expected_flushed */ TRUE, + /* expected_destroyed */ TRUE + ); + } - verify_clean(); - verify_unprotected(); + if ( pass ) { - if ( pass ) { PASSED(); } else { H5_FAILED(); } + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 63, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ FALSE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } - if ( ! pass ) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + if ( pass ) { -} /* smoke_check_8() */ + check_flush_cache__single_entry_test + ( + /* cache_ptr */ cache_ptr, + /* test_num */ 64, + /* entry_type */ PICO_ENTRY_TYPE, + /* entry_idx */ 0, + /* insert_flag */ TRUE, + /* dirty_flag */ TRUE, + /* flags */ H5C__SET_FLUSH_MARKER_FLAG, + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + H5C__FLUSH_CLEAR_ONLY_FLAG | + H5C__FLUSH_MARKED_ENTRIES_FLAG, + /* expected_loaded */ FALSE, + /* expected_cleared */ TRUE, + /* expected_flushed */ FALSE, + /* expected_destroyed */ TRUE + ); + } + +} /* check_flush_cache__single_entry() */ /*------------------------------------------------------------------------- - * Function: write_permitted_check() + * Function: check_flush_cache__single_entry_test() * - * Purpose: A basic test of the write permitted function. In essence, - * we load the cache up with dirty entryies, set - * write_permitted to FALSE, and then protect a bunch of - * entries. If there are any writes while write_permitted is - * FALSE, the test will fail. + * Purpose: Run a single entry flush cache test. * * Return: void * * Programmer: John Mainzer - * 6/24/04 + * 1/12/05 * * Modifications: * @@ -4739,168 +7815,162 @@ smoke_check_8(void) */ static void -write_permitted_check(void) +check_flush_cache__single_entry_test(H5C_t * cache_ptr, + int test_num, + int entry_type, + int entry_idx, + hbool_t insert_flag, + hbool_t dirty_flag, + unsigned int flags, + unsigned int flush_flags, + hbool_t expected_loaded, + hbool_t expected_cleared, + hbool_t expected_flushed, + hbool_t expected_destroyed) { + /* const char * fcn_name = "check_flush_cache__single_entry_test"; */ + static char msg[128]; + herr_t result; + test_entry_t * base_addr; + test_entry_t * entry_ptr; -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - - const char * fcn_name = "write_permitted_check"; - hbool_t show_progress = FALSE; - hbool_t display_stats = FALSE; - int32_t lag = 10; - int mile_stone = 1; - H5C_t * cache_ptr = NULL; - -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - - TESTING("write permitted check -- 1/0 MB cache"); - -#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - - pass = TRUE; - - if ( show_progress ) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); - - reset_entries(); - - if ( show_progress ) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); - - cache_ptr = setup_cache((size_t)(1 * 1024 * 1024), - (size_t)(0)); - - if ( show_progress ) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); - - row_major_scan_forward(/* cache_ptr */ cache_ptr, - /* lag */ lag, - /* verbose */ FALSE, - /* reset_stats */ TRUE, - /* display_stats */ display_stats, - /* display_detailed_stats */ TRUE, - /* do_inserts */ TRUE, - /* dirty_inserts */ TRUE, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, - /* do_destroys */ TRUE, - /* dirty_destroys */ TRUE, - /* dirty_unprotects */ TRUE); - - if ( show_progress ) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); - - write_permitted = FALSE; - - row_major_scan_backward(/* cache_ptr */ cache_ptr, - /* lag */ lag, - /* verbose */ FALSE, - /* reset_stats */ TRUE, - /* display_stats */ display_stats, - /* display_detailed_stats */ TRUE, - /* do_inserts */ FALSE, - /* dirty_inserts */ FALSE, - /* do_renames */ TRUE, - /* rename_to_main_addr */ TRUE, - /* do_destroys */ FALSE, - /* dirty_destroys */ FALSE, - /* dirty_unprotects */ NO_CHANGE); - - if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); - - write_permitted = TRUE; + if ( cache_ptr == NULL ) { - row_major_scan_forward(/* cache_ptr */ cache_ptr, - /* lag */ lag, - /* verbose */ FALSE, - /* reset_stats */ TRUE, - /* display_stats */ display_stats, - /* display_detailed_stats */ TRUE, - /* do_inserts */ TRUE, - /* dirty_inserts */ TRUE, - /* do_renames */ TRUE, - /* rename_to_main_addr */ FALSE, - /* do_destroys */ FALSE, - /* dirty_destroys */ TRUE, - /* dirty_unprotects */ TRUE); + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "cache_ptr NULL on entry to single entry test #%d.", + test_num); + failure_mssg = msg; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { - if ( show_progress ) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "cache not empty at beginning of single entry test #%d.", + test_num); + failure_mssg = msg; + } + else if ( ( entry_type < 0 ) || ( entry_type >= NUMBER_OF_ENTRY_TYPES ) || + ( entry_idx < 0 ) || ( entry_idx > max_indices[entry_type] ) ) { - /* flush and destroy all entries in the cache: */ + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Bad parameters on entry to single entry test #%d.", + test_num); + failure_mssg = msg; + } - flush_cache(/* cache_ptr */ cache_ptr, - /* destroy_entries */ TRUE, - /* dump_stats */ FALSE, - /* dump_detailed_stats */ FALSE); + if ( pass ) { - if ( show_progress ) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + base_addr = entries[entry_type]; + entry_ptr = &(base_addr[entry_idx]); - col_major_scan_forward(/* cache_ptr */ cache_ptr, - /* lag */ lag, - /* verbose */ FALSE, - /* reset_stats */ TRUE, - /* display_stats */ display_stats, - /* display_detailed_stats */ TRUE, - /* do_inserts */ TRUE, - /* dirty_inserts */ TRUE, - /* dirty_unprotects */ TRUE); + if ( insert_flag ) { - if ( show_progress ) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + insert_entry(cache_ptr, entry_type, entry_idx, dirty_flag, flags); - write_permitted = FALSE; + } else { - col_major_scan_backward(/* cache_ptr */ cache_ptr, - /* lag */ lag, - /* verbose */ FALSE, - /* reset_stats */ TRUE, - /* display_stats */ display_stats, - /* display_detailed_stats */ TRUE, - /* do_inserts */ FALSE, - /* dirty_inserts */ FALSE, - /* dirty_unprotects */ NO_CHANGE); + protect_entry(cache_ptr, entry_type, entry_idx); - write_permitted = TRUE; + unprotect_entry(cache_ptr, entry_type, entry_idx, + (int)dirty_flag, flags); + } + } - if ( show_progress ) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + if ( pass ) { - takedown_cache(cache_ptr, display_stats, TRUE); + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, flush_flags); - if ( show_progress ) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", - fcn_name, mile_stone++, (int)pass); + if ( result < 0 ) { - verify_clean(); - verify_unprotected(); + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "flush with flags 0x%x failed in single entry test #%d.", + flush_flags, test_num); + failure_mssg = msg; + } + else if ( ( entry_ptr->loaded != expected_loaded ) || + ( entry_ptr->cleared != expected_cleared ) || + ( entry_ptr->flushed != expected_flushed ) || + ( entry_ptr->destroyed != expected_destroyed ) ) { - if ( pass ) { PASSED(); } else { H5_FAILED(); } + HDfprintf(stdout, + "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", + (int)(entry_ptr->loaded), + (int)expected_loaded, + (int)(entry_ptr->cleared), + (int)expected_cleared, + (int)(entry_ptr->flushed), + (int)expected_flushed, + (int)(entry_ptr->destroyed), + (int)expected_destroyed); + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Unexpected entry status after flush in single entry test #%d.", + test_num); + failure_mssg = msg; + } + else if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 ) + && + ( ( cache_ptr->index_len != 1 ) + || + ( cache_ptr->index_size != entry_sizes[entry_type] ) + ) + ) + || + ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ) + && + ( ( cache_ptr->index_len != 0 ) + || + ( cache_ptr->index_size != 0 ) + ) + ) + ) { + + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Unexpected cache len/size after flush in single entry test #%d.", + test_num); + failure_mssg = msg; + } + } + + + /* clean up the cache to prep for the next test */ + if ( pass ) { - if ( ! pass ) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", - fcn_name, failure_mssg); + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + H5C__FLUSH_INVALIDATE_FLAG); -#else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + if ( result < 0 ) { - SKIPPED(); + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Flush failed on cleanup in single entry test #%d.", + test_num); + failure_mssg = msg; + } + else if ( ( cache_ptr->index_len != 0 ) || + ( cache_ptr->index_size != 0 ) ) { - HDfprintf(stdout, " Clean and dirty LRU lists disabled.\n"); + pass = FALSE; + HDsnprintf(msg, (size_t)128, + "Unexpected cache len/size after cleanup in single entry test #%d.", + test_num); + failure_mssg = msg; -#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ + } else { -} /* write_permitted_check() */ + entry_ptr->loaded = FALSE; + entry_ptr->cleared = FALSE; + entry_ptr->flushed = FALSE; + entry_ptr->destroyed = FALSE; + } + } +} /* check_flush_cache__single_entry_test() */ /*------------------------------------------------------------------------- @@ -4943,16 +8013,18 @@ check_flush_protected_err(void) protect_entry(cache_ptr, 0, 0); - if ( H5C_flush_cache(NULL, -1, -1, cache_ptr, 0) >= 0 ) { + if ( H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET) + >= 0 ) { pass = FALSE; failure_mssg = "flush succeeded on cache with protected entry.\n"; } else { - unprotect_entry(cache_ptr, 0, 0, TRUE, FALSE); + unprotect_entry(cache_ptr, 0, 0, TRUE, H5C__NO_FLAGS_SET); - if ( H5C_flush_cache(NULL, -1, -1, cache_ptr, 0) < 0 ) { + if ( H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET) + < 0 ) { pass = FALSE; failure_mssg = "flush failed after unprotect.\n"; @@ -5020,7 +8092,7 @@ check_destroy_protected_err(void) } else { - unprotect_entry(cache_ptr, 0, 0, TRUE, FALSE); + unprotect_entry(cache_ptr, 0, 0, TRUE, H5C__NO_FLAGS_SET); if ( H5C_dest(NULL, -1, -1, cache_ptr) < 0 ) { @@ -5090,7 +8162,7 @@ check_duplicate_insert_err(void) result = H5C_insert_entry(NULL, -1, -1, cache_ptr, &(types[0]), entry_ptr->addr, - (void *)entry_ptr); + (void *)entry_ptr, H5C__NO_FLAGS_SET); if ( result >= 0 ) { @@ -5099,7 +8171,7 @@ check_duplicate_insert_err(void) } else { - unprotect_entry(cache_ptr, 0, 0, TRUE, FALSE); + unprotect_entry(cache_ptr, 0, 0, TRUE, H5C__NO_FLAGS_SET); takedown_cache(cache_ptr, FALSE, FALSE); } @@ -5157,9 +8229,9 @@ check_rename_err(void) cache_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); - insert_entry(cache_ptr, 0, 0, TRUE); - insert_entry(cache_ptr, 0, 1, TRUE); - insert_entry(cache_ptr, 1, 0, TRUE); + insert_entry(cache_ptr, 0, 0, TRUE, H5C__NO_FLAGS_SET); + insert_entry(cache_ptr, 0, 1, TRUE, H5C__NO_FLAGS_SET); + insert_entry(cache_ptr, 1, 0, TRUE, H5C__NO_FLAGS_SET); entry_0_0_ptr = &((entries[0])[0]); entry_0_1_ptr = &((entries[0])[1]); @@ -5263,7 +8335,7 @@ check_double_protect_err(void) if ( pass ) { - unprotect_entry(cache_ptr, 0, 0, FALSE, FALSE); + unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); } if ( pass ) { @@ -5322,7 +8394,7 @@ check_double_unprotect_err(void) protect_entry(cache_ptr, 0, 0); - unprotect_entry(cache_ptr, 0, 0, FALSE, FALSE); + unprotect_entry(cache_ptr, 0, 0, FALSE, H5C__NO_FLAGS_SET); entry_ptr = &((entries[0])[0]); } @@ -5330,7 +8402,8 @@ check_double_unprotect_err(void) if ( pass ) { result = H5C_unprotect(NULL, -1, -1, cache_ptr, &(types[0]), - entry_ptr->addr, (void *)entry_ptr, FALSE); + entry_ptr->addr, (void *)entry_ptr, + H5C__NO_FLAGS_SET); if ( result > 0 ) { @@ -5502,7 +8575,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5532,7 +8605,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5562,7 +8635,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5592,7 +8665,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5622,7 +8695,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5652,7 +8725,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5683,7 +8756,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5713,7 +8786,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5743,7 +8816,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5774,7 +8847,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5870,7 +8943,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5901,7 +8974,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5932,7 +9005,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5963,7 +9036,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -5993,7 +9066,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6023,7 +9096,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6053,7 +9126,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6064,7 +9137,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i + 1000, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6094,7 +9167,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6124,7 +9197,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6220,7 +9293,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6250,7 +9323,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6280,7 +9353,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6310,7 +9383,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6413,7 +9486,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6440,7 +9513,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6467,7 +9540,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6498,7 +9571,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6528,7 +9601,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6557,7 +9630,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6586,7 +9659,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6616,7 +9689,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6647,7 +9720,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6674,7 +9747,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6701,7 +9774,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6731,7 +9804,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6836,7 +9909,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6863,7 +9936,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6890,7 +9963,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6921,7 +9994,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6951,7 +10024,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -6980,7 +10053,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7009,7 +10082,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7038,7 +10111,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7067,7 +10140,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7096,7 +10169,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7125,7 +10198,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7155,7 +10228,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7186,7 +10259,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7213,7 +10286,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7242,7 +10315,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7272,7 +10345,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7376,7 +10449,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7403,7 +10476,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7430,7 +10503,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7461,7 +10534,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7491,7 +10564,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7520,7 +10593,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7549,7 +10622,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7579,7 +10652,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7610,7 +10683,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7637,7 +10710,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7664,7 +10737,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7694,7 +10767,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7797,7 +10870,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7824,7 +10897,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7851,7 +10924,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7879,7 +10952,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7907,7 +10980,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7935,7 +11008,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -7964,7 +11037,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8062,7 +11135,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8089,7 +11162,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8124,7 +11197,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8155,7 +11228,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8186,7 +11259,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8218,7 +11291,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8248,7 +11321,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8279,7 +11352,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8311,7 +11384,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8343,7 +11416,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8375,7 +11448,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8405,7 +11478,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8435,7 +11508,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8465,7 +11538,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8495,7 +11568,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8525,7 +11598,7 @@ check_auto_cache_resize(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8749,7 +11822,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8780,7 +11853,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8810,7 +11883,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8906,7 +11979,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8937,7 +12010,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -8967,7 +12040,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9063,7 +12136,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9094,7 +12167,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9124,7 +12197,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9221,7 +12294,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9250,7 +12323,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9280,7 +12353,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9375,7 +12448,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9405,7 +12478,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9435,7 +12508,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9530,7 +12603,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9560,7 +12633,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9590,7 +12663,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9692,7 +12765,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9722,7 +12795,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9754,7 +12827,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9784,7 +12857,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9816,7 +12889,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9916,7 +12989,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9946,7 +13019,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -9978,7 +13051,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10008,7 +13081,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10040,7 +13113,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10147,7 +13220,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10177,7 +13250,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10211,7 +13284,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10243,7 +13316,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10277,7 +13350,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 999, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10377,7 +13450,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10409,7 +13482,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10502,7 +13575,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10534,7 +13607,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10627,7 +13700,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10659,7 +13732,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10752,7 +13825,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10784,7 +13857,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10878,7 +13951,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -10910,7 +13983,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -11004,7 +14077,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -11036,7 +14109,7 @@ check_auto_cache_resize_disable(void) if ( pass ) { unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -11263,7 +14336,7 @@ check_auto_cache_resize_epoch_markers(void) if ( pass ) { unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -11296,7 +14369,7 @@ check_auto_cache_resize_epoch_markers(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -11328,7 +14401,7 @@ check_auto_cache_resize_epoch_markers(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -11438,7 +14511,7 @@ check_auto_cache_resize_epoch_markers(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -11622,7 +14695,7 @@ check_auto_cache_resize_epoch_markers(void) if ( pass ) { unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -13879,7 +16952,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -13925,7 +16998,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, 0, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -14008,7 +17081,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i + 500, - NO_CHANGE, FALSE); + NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } @@ -14112,7 +17185,8 @@ check_auto_cache_resize_aux_fcns(void) } if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, FALSE); + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, + H5C__NO_FLAGS_SET); } if ( pass ) { @@ -14314,7 +17388,13 @@ int main(void) { H5open(); -#if 0 + +#ifdef NDEBUG + skip_long_tests = FALSE; +#else /* NDEBUG */ + skip_long_tests = TRUE; +#endif /* NDEBUG */ + smoke_check_1(); smoke_check_2(); smoke_check_3(); @@ -14323,8 +17403,9 @@ main(void) smoke_check_6(); smoke_check_7(); smoke_check_8(); -#endif + write_permitted_check(); + check_flush_cache(); check_flush_protected_err(); check_destroy_protected_err(); check_duplicate_insert_err(); -- cgit v0.12