summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/H5F.c b/src/H5F.c
index c096c21..21db0ba 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -2979,6 +2979,10 @@ H5F_close(H5F_t *f)
/* Only flush at this point if the file will be closed */
if (closing) {
+ /* Dump debugging info */
+ H5AC_debug(f);
+ H5F_istore_stats(f, FALSE);
+
#ifdef H5_HAVE_FPHDF5
/*
* We only want the captain to perform the flush of the metadata
@@ -2988,19 +2992,24 @@ H5F_close(H5F_t *f)
H5FD_fphdf5_is_captain(f->shared->lf)) {
#endif /* H5_HAVE_FPHDF5 */
- /* Dump debugging info */
- H5AC_debug(f);
- H5F_istore_stats(f, FALSE);
-
/* Flush and destroy all caches */
if (H5F_flush(f, H5AC_dxpl_id, H5F_SCOPE_LOCAL,
H5F_FLUSH_INVALIDATE | H5F_FLUSH_CLOSING) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache");
#ifdef H5_HAVE_FPHDF5
+ } else {
+ /*
+ * If this isn't the captain process, flush but only clear
+ * the flags.
+ */
+ if (H5F_flush(f, H5AC_dxpl_id, H5F_SCOPE_LOCAL,
+ H5F_FLUSH_INVALIDATE | H5F_FLUSH_CLOSING | H5F_FLUSH_CLEAR_ONLY) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache");
+
}
- /* Wait for the captain to finish up... */
+ /* Let's all meet up now... */
if (H5FD_is_fphdf5_driver(f->shared->lf))
MPI_Barrier(H5FP_SAP_BARRIER_COMM);
#endif /* H5_HAVE_FPHDF5 */