summaryrefslogtreecommitdiffstats
path: root/src/H5Smpio.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-06-17 16:38:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-06-17 16:38:43 (GMT)
commit15a916df4ba024d944c2e549fdff8165de3e36a3 (patch)
tree1167886df032fb301047fb4cc59766fb87788abc /src/H5Smpio.c
parent2ae3f6b8669ce5dc19fe7e3d03eeb4728d8c9d1c (diff)
downloadhdf5-15a916df4ba024d944c2e549fdff8165de3e36a3.zip
hdf5-15a916df4ba024d944c2e549fdff8165de3e36a3.tar.gz
hdf5-15a916df4ba024d944c2e549fdff8165de3e36a3.tar.bz2
[svn-r5652] Purpose:
Code cleanup Description: Use dataset transfer property list to hold information about the MPI types for the current transfer, instead of setting pseudo-global variables in the file's struct. Platforms tested: Linux 2.2.x (eirene) w/parallel & IRIX64 6.5 (modi4) w/parallel & FORTRAN
Diffstat (limited to 'src/H5Smpio.c')
-rw-r--r--src/H5Smpio.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 5c4377b..3d5e136 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -567,6 +567,7 @@ H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout,
MPI_Datatype mpi_buf_type, mpi_file_type;
hbool_t mbt_is_derived=0,
mft_is_derived=0;
+ hbool_t plist_is_setup=0; /* Whether the dxpl has been customized */
#if 0
H5P_genplist_t *plist; /* Property list pointer */
#endif /* 0 */
@@ -646,7 +647,9 @@ H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout,
* Pass buf type, file type to the file driver. Request an MPI type
* transfer (instead of an elementary byteblock transfer).
*/
- H5FD_mpio_setup(f->shared->lf, mpi_buf_type, mpi_file_type, 1);
+ if(H5FD_mpio_setup(dxpl_id, mpi_buf_type, mpi_file_type)<0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties");
+ plist_is_setup=1;
/* transfer the data */
H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t);
@@ -654,16 +657,22 @@ H5S_mpio_spaces_xfer(H5F_t *f, const H5O_layout_t *layout,
if (do_write) {
err = H5FD_write(f->shared->lf, H5FD_MEM_DRAW, dxpl_id, addr, mpi_count, buf);
if (err) {
- HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,"MPI write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,"MPI write failed");
}
} else {
err = H5FD_read (f->shared->lf, H5FD_MEM_DRAW, dxpl_id, addr, mpi_count, buf);
if (err) {
- HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,"MPI read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL,"MPI read failed");
}
}
done:
+ /* Reset the dxpl settings */
+ if(plist_is_setup) {
+ if(H5FD_mpio_teardown(dxpl_id)<0)
+ HRETURN_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "unable to reset dxpl values");
+ } /* end if */
+
/* free the MPI buf and file types */
if (mbt_is_derived) {
err = MPI_Type_free( &mpi_buf_type );