summaryrefslogtreecommitdiffstats
path: root/src/H5FDmpiposix.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-11-20 14:36:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-11-20 14:36:59 (GMT)
commit1619a308cbd6cb45ace7724a8aaadf003a3f80a2 (patch)
treecaa4deb7836762854d88dddf8c970abb72cd68f4 /src/H5FDmpiposix.c
parent0f45aeb53a0d2cfe379ed50e9370faef09d18a25 (diff)
downloadhdf5-1619a308cbd6cb45ace7724a8aaadf003a3f80a2.zip
hdf5-1619a308cbd6cb45ace7724a8aaadf003a3f80a2.tar.gz
hdf5-1619a308cbd6cb45ace7724a8aaadf003a3f80a2.tar.bz2
[svn-r7860] Purpose:
Bug fix Description: Our previous "optimization" of metadata writing which only wrote metadata from one process was abusing MPI-I/O and after some consultation with Rob Ross and Rajeev Thakur, Albert & I have come up with a solution... Solution: Instead of only writing from one process, issue a collective write operation with all processes, for metadata writes. Platforms tested: FreeBSD 4.9 (sleipnir) h5committest
Diffstat (limited to 'src/H5FDmpiposix.c')
-rw-r--r--src/H5FDmpiposix.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c
index 2625208..647fb35 100644
--- a/src/H5FDmpiposix.c
+++ b/src/H5FDmpiposix.c
@@ -229,6 +229,7 @@ static const H5FD_class_t H5FD_mpiposix_g = {
H5FD_FLMAP_SINGLE /*fl_map */
};
+#ifdef OLD_METADATA_WRITE
/* Global var to allow elimination of redundant metadata writes
* to be controlled by the value of an environment variable. */
/* Use the elimination by default unless this is the Intel Red machine */
@@ -237,6 +238,7 @@ hbool_t H5_mpiposix_1_metawrite_g = TRUE;
#else
hbool_t H5_mpiposix_1_metawrite_g = FALSE;
#endif
+#endif /* OLD_METADATA_WRITE */
/* Interface initialization */
#define INTERFACE_INIT H5FD_mpiposix_init
@@ -1309,7 +1311,9 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code)
/* Only p<round> will do the actual write if all procs in comm write same metadata */
+#ifdef OLD_METADATA_WRITE
if (H5_mpiposix_1_metawrite_g)
+#endif /* OLD_METADATA_WRITE */
if (file->mpi_rank != H5_PAR_META_WRITE)
HGOTO_DONE(SUCCEED) /* skip the actual write */
} /* end if */
@@ -1384,10 +1388,17 @@ done:
/* Guard against getting into metadata broadcast in failure cases */
else {
/* if only p<round> writes, need to broadcast the ret_value to other processes */
+#ifdef OLD_METADATA_WRITE
if ((type!=H5FD_MEM_DRAW) && H5_mpiposix_1_metawrite_g) {
if (MPI_SUCCESS != (mpi_code= MPI_Bcast(&ret_value, sizeof(ret_value), MPI_BYTE, H5_PAR_META_WRITE, file->comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code)
} /* end if */
+#else /* OLD_METADATA_WRITE */
+ if (type!=H5FD_MEM_DRAW) {
+ if (MPI_SUCCESS != (mpi_code= MPI_Bcast(&ret_value, sizeof(ret_value), MPI_BYTE, H5_PAR_META_WRITE, file->comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code)
+ } /* end if */
+#endif /* OLD_METADATA_WRITE */
} /* end else */
FUNC_LEAVE_NOAPI(ret_value)