summaryrefslogtreecommitdiffstats
path: root/src/H5FDmpio.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2000-10-10 02:21:38 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2000-10-10 02:21:38 (GMT)
commitd68bdee92f4b26f9818cc84fc620971bd92cacab (patch)
tree742f077d9a15ec24442d2644b1f6fb7209e3c2e5 /src/H5FDmpio.c
parentf8e8918d19c78033e25dc7c454573197b5562821 (diff)
downloadhdf5-d68bdee92f4b26f9818cc84fc620971bd92cacab.zip
hdf5-d68bdee92f4b26f9818cc84fc620971bd92cacab.tar.gz
hdf5-d68bdee92f4b26f9818cc84fc620971bd92cacab.tar.bz2
[svn-r2645]
Purpose: [is this a bug fix? feature? ...] Description: [describe the bug, or describe the new feature, etc] Solution: [details about the changes, algorithm, etc...] [Please as detail as you can since your own explanation is better than others guessing it from the code.] Platforms tested: [machines you have tested the changed version. This is absolute important. Test it out on at least two or three different platforms such as Big-endian-32bit (SUN/IRIX), little-endian-32(LINUX) and 64-bit (IRIX64/UNICOS/DEC-ALPHA) would be good.]
Diffstat (limited to 'src/H5FDmpio.c')
-rw-r--r--src/H5FDmpio.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index cdbedc1..f2b8435 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -731,6 +731,8 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id,
}
/* Check for debug commands in the info parameter */
+#if 0
+ /* Temporary KLUGE rky 2000-06-29, because fa->info is invalid (-1)*/
{
char debug_str[128];
int infoerr, flag, i;
@@ -747,6 +749,8 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id,
}
}
}
+ /* END Temporary KLUGE rky 2000-06-29, because fa->info is invalid (-1) */
+#endif
#endif
/*OKAY: CAST DISCARDS CONST*/
@@ -1264,6 +1268,10 @@ H5FD_mpio_read(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size,
* a racing condition (that other processes try to
* read the file before p0 finishes writing) and also
* allows all processes to report the same ret_value.
+ *
+ * Kim Yates, Pat Weidhaas, 2000-09-26
+ * Move block of coding where only p0 writes after the
+ * MPI_File_set_view call.
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1304,23 +1312,6 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id/*unused*/,
(long)mpi_off, size_i);
#endif
- /* Only p0 will do the actual write if all procs in comm write same data */
- allsame = H5FD_mpio_tas_allsame(_file, FALSE);
- if (allsame && H5_mpi_1_metawrite_g) {
- if (MPI_SUCCESS != MPI_Comm_rank(file->comm, &mpi_rank))
- HRETURN_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Comm_rank failed");
- if (mpi_rank != 0) {
-#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_Debug[(int)'w']) {
- fprintf(stdout,
- " proc %d: in H5FD_mpio_write (write omitted)\n",
- mpi_rank );
- }
-#endif
- HGOTO_DONE(SUCCEED) /* skip the actual write */
- }
- }
-
/* Obtain the data transfer properties */
if (H5P_DEFAULT==dxpl_id || H5FD_MPIO!=H5Pget_driver(dxpl_id)) {
_dx.xfer_mode = H5FD_MPIO_INDEPENDENT; /*the default*/
@@ -1373,6 +1364,23 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id/*unused*/,
file->old_use_types = use_types_this_time;
file->use_types = 0;
+ /* Only p0 will do the actual write if all procs in comm write same data */
+ allsame = H5FD_mpio_tas_allsame(_file, FALSE);
+ if (allsame && H5_mpi_1_metawrite_g) {
+ if (MPI_SUCCESS != MPI_Comm_rank(file->comm, &mpi_rank))
+ HRETURN_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_Comm_rank failed");
+ if (mpi_rank != 0) {
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_Debug[(int)'w']) {
+ fprintf(stdout,
+ " proc %d: in H5FD_mpio_write (write omitted)\n",
+ mpi_rank );
+ }
+#endif
+ HGOTO_DONE(SUCCEED) /* skip the actual write */
+ }
+ }
+
/* Write the data. */
assert(H5FD_MPIO_INDEPENDENT==dx->xfer_mode || H5FD_MPIO_COLLECTIVE==dx->xfer_mode);
if (H5FD_MPIO_INDEPENDENT==dx->xfer_mode) {