summaryrefslogtreecommitdiffstats
path: root/src/H5FDmpio.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2003-04-25 14:21:16 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2003-04-25 14:21:16 (GMT)
commitd2bdbd04809ef8530e433f19d287c8c9a8f94ab4 (patch)
tree51dcdca9dc57991e19ab80283332997c5690ca08 /src/H5FDmpio.c
parent0462c0bc2c4ebd0fc2b6343dee0c019d39777efc (diff)
downloadhdf5-d2bdbd04809ef8530e433f19d287c8c9a8f94ab4.zip
hdf5-d2bdbd04809ef8530e433f19d287c8c9a8f94ab4.tar.gz
hdf5-d2bdbd04809ef8530e433f19d287c8c9a8f94ab4.tar.bz2
[svn-r6753] Purpose:
Code cleanup Description: Replaced the comm/info freeing with H5FD_mpio_comm_info_free to make it cleaner and consistent. Replaced couple FUNC_LEAVE_NOAPI(SUCCEED) with FUNC_LEAVE_NOAPI(ret_value). These were bugs since it was possible errors may occur at FUNC_ENTER...() time and this hardcoding would not report those errors. Documented some modification history. Platforms tested: Did not h5committested because these are all MPI code and well protected by HAVE_PARALLEL. Tested in eirene and modi4, both parallel mode. Misc. update:
Diffstat (limited to 'src/H5FDmpio.c')
-rw-r--r--src/H5FDmpio.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index d54b4fd..4fb7a68 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -293,6 +293,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info)
fa.comm = comm;
fa.info = info;
+ /* duplication is done during driver setting. */
ret_value= H5P_set_driver(plist, H5FD_MPIO, &fa);
done:
@@ -932,9 +933,7 @@ fprintf(stderr, "in H5FD_mpio_fapl_free\n");
/* Free the internal communicator and INFO object */
assert(MPI_COMM_NULL!=fa->comm);
- MPI_Comm_free(&fa->comm);
- if (MPI_INFO_NULL != fa->info)
- MPI_Info_free(&fa->info);
+ H5FD_mpio_comm_info_free(&fa->comm, &fa->info);
H5MM_xfree(fa);
done:
@@ -942,7 +941,7 @@ done:
if (H5FD_mpio_Debug[(int)'t'])
fprintf(stderr, "leaving H5FD_mpio_fapl_free\n");
#endif
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(ret_value);
} /* end H5FD_mpio_fapl_free() */
@@ -985,6 +984,10 @@ fprintf(stderr, "leaving H5FD_mpio_fapl_free\n");
* rky & ppw, 1999-11-07
* Modified "H5FD_mpio_open" so that file-truncation is
* avoided for brand-new files (with zero filesize).
+ *
+ * Albert Cheng, 2003-04-17
+ * Duplicate the communicator and Info object so that file is
+ * insulated from the old one.
*-------------------------------------------------------------------------
*/
static H5FD_t *
@@ -1163,6 +1166,9 @@ done:
*
* Robb Matzke, 1999-08-06
* Modified to work with the virtual file layer.
+ *
+ * Albert Cheng, 2003-04-17
+ * Free the communicator stored.
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2287,6 +2293,6 @@ done:
if (H5FD_mpio_Debug[(int)'t'])
fprintf(stderr, "Leaving H5FD_mpio_comm_info_free\n");
#endif
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(ret_value);
}
#endif /* H5_HAVE_PARALLEL */