summaryrefslogtreecommitdiffstats
path: root/src/H5O.c
diff options
context:
space:
mode:
authorRobert Kim Yates <rkyates@llnl.gov>1998-08-28 23:37:58 (GMT)
committerRobert Kim Yates <rkyates@llnl.gov>1998-08-28 23:37:58 (GMT)
commit1373661a78b7a6d3c7526cd8f80b9ba3460a1d74 (patch)
tree83bd2e2ef70d44c57fa8fd53453aea99067ab10a /src/H5O.c
parent96c2b5fec405a2dd4a63b7482a431dfc984523df (diff)
downloadhdf5-1373661a78b7a6d3c7526cd8f80b9ba3460a1d74.zip
hdf5-1373661a78b7a6d3c7526cd8f80b9ba3460a1d74.tar.gz
hdf5-1373661a78b7a6d3c7526cd8f80b9ba3460a1d74.tar.bz2
[svn-r630] Added code to eliminate redundant writes of metadata,
so only proc 0 writes it to disk. The elimination is activated only when the environment variable HDF5_MPI_1_METAWRITE is nonzero; otherwise all processes that opened the file will write the metadata to disk.
Diffstat (limited to 'src/H5O.c')
-rw-r--r--src/H5O.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/H5O.c b/src/H5O.c
index addd14b..322862c 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -506,6 +506,8 @@ H5O_load(H5F_t *f, const haddr_t *addr, const void __unused__ *_udata1,
* Robb Matzke, 7 Jan 1998
* Handles constant vs non-constant messages.
*
+ * rky 980828 Only p0 writes metadata to disk.
+ *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -546,6 +548,9 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
HDmemset (p, 0, H5O_SIZEOF_HDR(f)-12);
/* write the object header header */
+#ifdef HAVE_PARALLEL
+ H5F_mpio_tas_allsame( f->shared->lf, TRUE ); /* only p0 will write */
+#endif /* HAVE_PARALLEL */
if (H5F_block_write(f, addr, (hsize_t)H5O_SIZEOF_HDR(f),
H5D_XFER_DFLT, buf) < 0) {
HRETURN_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL,
@@ -618,6 +623,9 @@ H5O_flush(H5F_t *f, hbool_t destroy, const haddr_t *addr, H5O_t *oh)
for (i = 0; i < oh->nchunks; i++) {
if (oh->chunk[i].dirty) {
assert(H5F_addr_defined(&(oh->chunk[i].addr)));
+#ifdef HAVE_PARALLEL
+ H5F_mpio_tas_allsame( f->shared->lf, TRUE ); /* only p0 write */
+#endif /* HAVE_PARALLEL */
if (H5F_block_write(f, &(oh->chunk[i].addr),
(hsize_t)(oh->chunk[i].size), H5D_XFER_DFLT,
oh->chunk[i].image) < 0) {