summaryrefslogtreecommitdiffstats
path: root/src/H5C.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2016-11-25 22:07:23 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2016-11-25 22:07:23 (GMT)
commit1071d8bf73bc9f069b9d939d882aa27e2334f94a (patch)
treeab2ad7c29fc31a6385a622226ac98b973be1ad7a /src/H5C.c
parentfff898558e3c828070abe81b4147bd959ed37ccb (diff)
downloadhdf5-1071d8bf73bc9f069b9d939d882aa27e2334f94a.zip
hdf5-1071d8bf73bc9f069b9d939d882aa27e2334f94a.tar.gz
hdf5-1071d8bf73bc9f069b9d939d882aa27e2334f94a.tar.bz2
Add a flag for H5C__flush_single_entry() to allow the parallel code to request
that images for entries be generated, even when not writing the entry from an MPI rank.
Diffstat (limited to 'src/H5C.c')
-rw-r--r--src/H5C.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/src/H5C.c b/src/H5C.c
index 147489b..31f887d 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -5739,6 +5739,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
hbool_t during_flush; /* external flag */
hbool_t write_entry; /* internal flag */
hbool_t destroy_entry; /* internal flag */
+ hbool_t generate_image; /* internal flag */
hbool_t was_dirty;
haddr_t entry_addr = HADDR_UNDEF;
herr_t ret_value = SUCCEED; /* Return value */
@@ -5759,6 +5760,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
take_ownership = ((flags & H5C__TAKE_OWNERSHIP_FLAG) != 0);
del_from_slist_on_destroy = ((flags & H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) != 0);
during_flush = ((flags & H5C__DURING_FLUSH_FLAG) != 0);
+ generate_image = ((flags & H5C__GENERATE_IMAGE_FLAG) != 0);
/* Set the flag for destroying the entry, based on the 'take ownership'
* and 'destroy' flags
@@ -5818,29 +5820,13 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
entry_ptr->flush_in_progress = TRUE;
entry_ptr->flush_marker = FALSE;
- /* serialize the entry if necessary, and then write it to disk. */
- if(write_entry) {
-
- /* The entry is dirty, and we are doing either a flush,
- * or a flush destroy. In either case, serialize the
- * entry and write it to disk.
- *
- * Note that this may cause the entry to be re-sized and/or
- * moved in the cache.
- *
- * As we will not update the metadata cache's data structures
- * until we we finish the write, we must touch up these
- * data structures for size and location changes even if we
- * are about to delete the entry from the cache (i.e. on a
- * flush destroy).
- */
+ /* The entry is dirty, and we are doing a flush, a flush destroy or have
+ * been requested to generate an image. In those cases, serialize the
+ * entry.
+ */
+ if(write_entry || generate_image) {
HDassert(entry_ptr->is_dirty);
-#if H5C_DO_SANITY_CHECKS
- if(cache_ptr->check_write_permitted && !(cache_ptr->write_permitted))
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Write when writes are always forbidden!?!?!")
-#endif /* H5C_DO_SANITY_CHECKS */
-
if(NULL == entry_ptr->image_ptr) {
if(NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer")
@@ -5854,13 +5840,22 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't generate entry's image")
} /* end if ( ! (entry_ptr->image_up_to_date) ) */
+ } /* end if */
+
+ /* Finally, write the image to disk.
+ *
+ * Note that if the H5AC__CLASS_SKIP_WRITES flag is set in the
+ * in the entry's type, we silently skip the write. This
+ * flag should only be used in test code.
+ */
+ if(write_entry) {
+ HDassert(entry_ptr->is_dirty);
+
+#if H5C_DO_SANITY_CHECKS
+ if(cache_ptr->check_write_permitted && !(cache_ptr->write_permitted))
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Write when writes are always forbidden!?!?!")
+#endif /* H5C_DO_SANITY_CHECKS */
- /* Finally, write the image to disk.
- *
- * Note that if the H5AC__CLASS_SKIP_WRITES flag is set in the
- * in the entry's type, we silently skip the write. This
- * flag should only be used in test code.
- */
if(((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0) {
#ifdef H5_HAVE_PARALLEL
if(collective_write_list) {
@@ -7600,6 +7595,15 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry,
*
* Purpose: Serialize an entry and generate its image.
*
+ * Note: This may cause the entry to be re-sized and/or moved in
+ * the cache.
+ *
+ * As we will not update the metadata cache's data structures
+ * until we we finish the write, we must touch up these
+ * data structures for size and location changes even if we
+ * are about to delete the entry from the cache (i.e. on a
+ * flush destroy).
+ *
* Return: Non-negative on success/Negative on failure
*
* Programmer: Mohamad Chaarawi