diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-08-17 01:04:48 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-08-17 01:04:48 (GMT) |
commit | 88ecc17474e86e67f0ce64ed0b36c0d10e93eb66 (patch) | |
tree | a34dfcef1f8b737a893efafcfca1897f40676357 /src/H5Fmpi.c | |
parent | 4312f5ea1a611cef01e9ecfb57d7c287c9549249 (diff) | |
download | hdf5-88ecc17474e86e67f0ce64ed0b36c0d10e93eb66.zip hdf5-88ecc17474e86e67f0ce64ed0b36c0d10e93eb66.tar.gz hdf5-88ecc17474e86e67f0ce64ed0b36c0d10e93eb66.tar.bz2 |
Removes email and Modifications sections
Diffstat (limited to 'src/H5Fmpi.c')
-rw-r--r-- | src/H5Fmpi.c | 116 |
1 files changed, 52 insertions, 64 deletions
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 7759430..b6cf3a3 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -15,7 +15,7 @@ * * Created: H5Fmpi.c * Jan 10 2008 - * Quincey Koziol <koziol@hdfgroup.org> + * Quincey Koziol * * Purpose: MPI-related routines. * @@ -90,14 +90,14 @@ herr_t H5F_get_mpi_handle(const H5F_t *f, MPI_File **f_handle) { herr_t ret_value = SUCCEED; - hid_t fapl = -1; + hid_t fapl_id = H5I_INVALID_HID; FUNC_ENTER_NOAPI(FAIL) - assert(f && f->shared); + HDassert(f && f->shared); /* Dispatch to driver */ - if ((ret_value = H5FD_get_vfd_handle(f->shared->lf, fapl, (void **)f_handle)) < 0) + if ((ret_value = H5FD_get_vfd_handle(f->shared->lf, fapl_id, (void **)f_handle)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file handle") done: @@ -106,33 +106,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_mpi_get_rank + * Function: H5F_mpi_get_rank * - * Purpose: Retrieves the rank of an MPI process. + * Purpose: Retrieves the rank of an MPI process. * - * Return: Success: The rank (non-negative) + * Return: Success: The rank (non-negative) * - * Failure: Negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ int H5F_mpi_get_rank(const H5F_t *f) { - int ret_value; + int ret_value = -1; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI((-1)) HDassert(f && f->shared); /* Dispatch to driver */ - if ((ret_value=H5FD_mpi_get_rank(f->shared->lf)) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_rank request failed") + if ((ret_value = H5FD_mpi_get_rank(f->shared->lf)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "driver get_rank request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -140,33 +138,31 @@ done: /*------------------------------------------------------------------------- - * Function: H5F_mpi_get_comm + * Function: H5F_mpi_get_comm * - * Purpose: Retrieves the file's communicator + * Purpose: Retrieves the file's communicator * - * Return: Success: The communicator (non-negative) + * Return: Success: The communicator (non-negative) * - * Failure: Negative + * Failure: Negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 30, 2004 * - * Modifications: - * *------------------------------------------------------------------------- */ MPI_Comm H5F_mpi_get_comm(const H5F_t *f) { - MPI_Comm ret_value; + MPI_Comm ret_value = MPI_COMM_NULL; FUNC_ENTER_NOAPI(MPI_COMM_NULL) HDassert(f && f->shared); /* Dispatch to driver */ - if ((ret_value=H5FD_mpi_get_comm(f->shared->lf))==MPI_COMM_NULL) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed") + if ((ret_value = H5FD_mpi_get_comm(f->shared->lf)) == MPI_COMM_NULL) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -185,22 +181,20 @@ done: * Programmer: John Mainzer * Friday, May 6, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ int H5F_mpi_get_size(const H5F_t *f) { - int ret_value; + int ret_value = -1; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI((-1)) HDassert(f && f->shared); /* Dispatch to driver */ - if ((ret_value=H5FD_mpi_get_size(f->shared->lf)) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_size request failed") + if ((ret_value = H5FD_mpi_get_size(f->shared->lf)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "driver get_size request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -208,16 +202,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fset_mpi_atomicity - * - * Purpose: Sets the atomicity mode + * Function: H5Fset_mpi_atomicity * - * Return: Success: Non-negative + * Purpose: Private call to set the atomicity mode * - * Failure: Negative - * - * Programmer: Mohamad Chaarawi - * Feb 14, 2012 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -238,26 +227,25 @@ H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag) if(!H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI)) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, does not support MPI atomicity mode") - /* set atomicity value */ - if (H5FD_set_mpio_atomicity (file->shared->lf, flag) < 0) + /* Set atomicity value */ + if (H5FD_set_mpio_atomicity(file->shared->lf, flag) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set atomicity flag") done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Fset_mpi_atomicity() */ /*------------------------------------------------------------------------- - * Function: H5Fget_mpi_atomicity - * - * Purpose: Returns the atomicity mode + * Function: H5Fget_mpi_atomicity * - * Return: Success: Non-negative + * Purpose: Returns the atomicity mode * - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Mohamad Chaarawi - * Feb 14, 2012 + * Programmer: Mohamad Chaarawi + * Feb 14, 2012 * *------------------------------------------------------------------------- */ @@ -278,28 +266,28 @@ H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag) if(!H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI)) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, does not support MPI atomicity mode") - /* get atomicity value */ - if (H5FD_get_mpio_atomicity (file->shared->lf, flag) < 0) + /* Get atomicity value */ + if (H5FD_get_mpio_atomicity(file->shared->lf, flag) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get atomicity flag") done: FUNC_LEAVE_API(ret_value) -} +} /* end H5Fget_mpi_atomicity() */ /*------------------------------------------------------------------------- - * Function: H5F_mpi_retrieve_comm + * Function: H5F_mpi_retrieve_comm * - * Purpose: Retrieves an MPI communicator from the file the location ID + * Purpose: Retrieves an MPI communicator from the file the location ID * is in. If the loc_id is invalid, the fapl_id is used to * retrieve the communicator. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * - * Programmer: Mohamad Chaarawi - * Feb 14, 2012 + * Programmer: Mohamad Chaarawi + * Feb 14, 2012 * *------------------------------------------------------------------------- */ @@ -320,11 +308,11 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) attached to the loc_id */ if(H5I_INVALID_HID != loc_id) { H5G_loc_t loc; - H5F_t *f; + H5F_t *f = NULL; /* Retrieve the file structure */ if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") f = loc.oloc->file; HDassert(f); @@ -333,8 +321,8 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) /* retrieve the file communicator */ if(MPI_COMM_NULL == (*mpi_comm = H5F_mpi_get_comm(f))) 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 */ @@ -349,8 +337,8 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) 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) |