summaryrefslogtreecommitdiffstats
path: root/src/H5Fmpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Fmpi.c')
-rw-r--r--src/H5Fmpi.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c
index 2ce454a..f854d3b 100644
--- a/src/H5Fmpi.c
+++ b/src/H5Fmpi.c
@@ -310,50 +310,53 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm)
FUNC_ENTER_NOAPI(FAIL)
+ /* Sanity check */
HDassert(mpi_comm);
+
+ /* Set value to return to invalid MPI comm */
*mpi_comm = MPI_COMM_NULL;
/* if the loc_id is valid, then get the comm from the file
attached to the loc_id */
if(H5I_INVALID_HID != loc_id) {
H5G_loc_t loc;
- H5F_t *f = NULL;
+ H5F_t *f;
- /* retrieve the file structure */
+ /* Retrieve the file structure */
if(H5G_loc(loc_id, &loc) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
+ HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a location")
f = loc.oloc->file;
HDassert(f);
- /* check if MPIO driver is used */
+ /* Check if MPIO driver is used */
if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) {
/* retrieve the file communicator */
if(MPI_COMM_NULL == (*mpi_comm = H5F_mpi_get_comm(f)))
- HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator")
- }
- }
- /* otherwise, this if from H5Fopen or H5Fcreate and has to be collective */
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator")
+ } /* end if */
+ } /* end if */
+ /* otherwise, this is from H5Fopen or H5Fcreate and has to be collective */
else {
H5P_genplist_t *plist; /* Property list pointer */
- HDassert(H5P_isa_class(acspl_id, H5P_FILE_ACCESS));
-
if(NULL == (plist = H5P_object_verify(acspl_id, H5P_FILE_ACCESS)))
- HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access list")
+ HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a file access list")
if(H5FD_MPIO == H5P_peek_driver(plist)) {
const H5FD_mpio_fapl_t *fa; /* MPIO fapl info */
if(NULL == (fa = (const H5FD_mpio_fapl_t *)H5P_peek_driver_info(plist)))
- HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info")
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad VFL driver info")
*mpi_comm = fa->comm;
- }
- }
+ } /* end if */
+ } /* end else */
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_mpi_retrieve_comm */
+
/*-------------------------------------------------------------------------
* Function: H5F_get_mpi_info
*