diff options
Diffstat (limited to 'src/H5Fmpi.c')
-rw-r--r-- | src/H5Fmpi.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 60593a8..f854d3b 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- @@ -312,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 * |