summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2016-06-24 22:19:09 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2016-06-24 22:19:09 (GMT)
commit29cb102f121f79c2a678f036ff211a8bad91517f (patch)
treec72e468f88cc1139c395b2ddf0d87e01cabdc7ac
parent75aa26981b4becc6926f4100707d9614e84a041c (diff)
parentf410d5d842edfb8a3b4aea4cd72ff67cb0e5b1aa (diff)
downloadhdf5-29cb102f121f79c2a678f036ff211a8bad91517f.zip
hdf5-29cb102f121f79c2a678f036ff211a8bad91517f.tar.gz
hdf5-29cb102f121f79c2a678f036ff211a8bad91517f.tar.bz2
[svn-r30104] Fixes evict-on-close feature by propagating global
flush flag up the function call stack and not setting it during H5Dclose().
-rw-r--r--src/H5AC.c4
-rw-r--r--src/H5ACprivate.h2
-rw-r--r--src/H5Cprivate.h2
-rw-r--r--src/H5Ctag.c6
-rw-r--r--src/H5D.c10
-rw-r--r--src/H5Fio.c2
-rw-r--r--src/H5G.c2
-rw-r--r--src/H5O.c2
-rw-r--r--src/H5Pfapl.c2
-rw-r--r--src/H5T.c10
10 files changed, 24 insertions, 18 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 2dfb7de..1604d35 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -2487,7 +2487,7 @@ done:
*------------------------------------------------------------------------------
*/
herr_t
-H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id)
+H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global, hid_t dxpl_id)
{
/* Variable Declarations */
herr_t ret_value = SUCCEED;
@@ -2500,7 +2500,7 @@ H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id)
HDassert(f->shared);
/* Call cache level function to evict metadata entries with specified tag */
- if(H5C_evict_tagged_entries(f, dxpl_id, metadata_tag) < 0)
+ if(H5C_evict_tagged_entries(f, dxpl_id, metadata_tag, match_global) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Cannot evict metadata")
done:
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index be20bef..513ce61 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -363,7 +363,7 @@ H5_DLL herr_t H5AC_validate_config(H5AC_cache_config_t *config_ptr);
/* Tag & Ring routines */
H5_DLL herr_t H5AC_tag(hid_t dxpl_id, haddr_t metadata_tag, haddr_t *prev_tag);
H5_DLL herr_t H5AC_flush_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id);
-H5_DLL herr_t H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hid_t dxpl_id);
+H5_DLL herr_t H5AC_evict_tagged_metadata(H5F_t * f, haddr_t metadata_tag, hbool_t match_global, hid_t dxpl_id);
H5_DLL herr_t H5AC_retag_copied_metadata(const H5F_t *f, haddr_t metadata_tag);
H5_DLL herr_t H5AC_ignore_tags(const H5F_t *f);
H5_DLL herr_t H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked);
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index 066977f..8f88ebd 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -1979,7 +1979,7 @@ H5_DLL herr_t H5C_expunge_entry(H5F_t *f, hid_t dxpl_id,
const H5C_class_t *type, haddr_t addr, unsigned flags);
H5_DLL herr_t H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags);
H5_DLL herr_t H5C_flush_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag);
-H5_DLL herr_t H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag);
+H5_DLL herr_t H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag, hbool_t match_global);
H5_DLL herr_t H5C_expunge_tag_type_metadata(H5F_t *f, hid_t dxpl_id, haddr_t tag, int type_id, unsigned flags);
#if H5C_DO_TAGGING_SANITY_CHECKS
herr_t H5C_verify_tag(int id, haddr_t tag, H5C_tag_globality_t globality);
diff --git a/src/H5Ctag.c b/src/H5Ctag.c
index d560e25..fc01ecb 100644
--- a/src/H5Ctag.c
+++ b/src/H5Ctag.c
@@ -352,7 +352,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag)
+H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag, hbool_t match_global)
{
H5C_t *cache; /* Pointer to cache structure */
H5C_tag_iter_evict_ctx_t ctx; /* Context for iterator callback */
@@ -379,8 +379,8 @@ H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag)
ctx.evicted_entries_last_pass = FALSE;
/* Iterate through entries in the cache */
- if(H5C__iter_tagged_entries(cache, tag, TRUE, H5C__evict_tagged_entries_cb, &ctx) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_BADITER, FAIL, "Iteration of tagged entries failed")
+ if(H5C__iter_tagged_entries(cache, tag, match_global, H5C__evict_tagged_entries_cb, &ctx) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_BADITER, match_global, "Iteration of tagged entries failed")
/* Keep doing this until we have stopped evicted entries */
} while(TRUE == ctx.evicted_entries_last_pass);
diff --git a/src/H5D.c b/src/H5D.c
index 1ba3829..e389930 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -356,10 +356,16 @@ H5Dclose(hid_t dset_id)
/* Clean up metadata in the metadata cache if evicting on close */
if(evict && H5F_SHARED(file)) {
- if(H5F_flush_tagged_metadata(file, tag, H5AC_ind_read_dxpl_id) < 0)
+// printf("DUMPING CACHE - BEFORE FLUSH\n");
+// H5AC_dump_cache(file);
+ if(H5AC_flush_tagged_metadata(file, tag, H5AC_ind_read_dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata")
- if(H5F_evict_tagged_metadata(file, tag, H5AC_ind_read_dxpl_id) < 0)
+// printf("DUMPING CACHE - BETWEEN FLUSH AND EVICT\n");
+// H5AC_dump_cache(file);
+ if(H5AC_evict_tagged_metadata(file, tag, FALSE, H5AC_ind_read_dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict tagged metadata")
+// printf("DUMPING CACHE - AFTER EVICT\n");
+// H5AC_dump_cache(file);
} /* end if */
done:
diff --git a/src/H5Fio.c b/src/H5Fio.c
index b9bd354..2ccd3f3 100644
--- a/src/H5Fio.c
+++ b/src/H5Fio.c
@@ -271,7 +271,7 @@ H5F_evict_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id)
f->shared->sblock = NULL;
/* Evict the object's metadata */
- if(H5AC_evict_tagged_metadata(f, tag, dxpl_id)<0)
+ if(H5AC_evict_tagged_metadata(f, tag, TRUE, dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "unable to evict tagged metadata")
/* Re-read the superblock. */
diff --git a/src/H5G.c b/src/H5G.c
index 4dc282d..9bbd43f 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -722,7 +722,7 @@ H5Gclose(hid_t group_id)
/* Check args */
if(NULL == H5I_object_verify(group_id,H5I_GROUP))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a group")
/*
* Decrement the counter on the group atom. It will be freed if the count
diff --git a/src/H5O.c b/src/H5O.c
index 3daf09e..d1806a1 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -1051,7 +1051,7 @@ done:
* the same effect as calling H5Gclose, H5Dclose, or H5Tclose.
*
* Return: Success: Non-negative
- * Failure: Negative
+ * Failure: Negative
*
* Programmer: James Laird
* July 14 2006
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index c3108c5..62d674c 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -183,7 +183,7 @@
#define H5F_ACS_OBJECT_FLUSH_CB_DEF {NULL, NULL}
/* Definition for evict on close property */
#define H5F_ACS_EVICT_ON_CLOSE_FLAG_SIZE sizeof(hbool_t)
-#define H5F_ACS_EVICT_ON_CLOSE_FLAG_DEF TRUE
+#define H5F_ACS_EVICT_ON_CLOSE_FLAG_DEF FALSE
#define H5F_ACS_EVICT_ON_CLOSE_FLAG_ENC H5P__encode_hbool_t
#define H5F_ACS_EVICT_ON_CLOSE_FLAG_DEC H5P__decode_hbool_t
#ifdef H5_HAVE_PARALLEL
diff --git a/src/H5T.c b/src/H5T.c
index 86c7860..775cfdb 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -1712,21 +1712,21 @@ done:
herr_t
H5Tclose(hid_t type_id)
{
- H5T_t *dt; /* Pointer to datatype to close */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5T_t *dt; /* Pointer to datatype to close */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("e", "i", type_id);
/* Check args */
if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if(H5T_STATE_IMMUTABLE == dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "immutable datatype")
/* When the reference count reaches zero the resources are freed */
if(H5I_dec_app_ref(type_id) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id")
+ HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "problem freeing id")
done:
FUNC_LEAVE_API(ret_value)