diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2020-11-12 12:27:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-12 12:27:05 (GMT) |
commit | aab84e704d10c15e8e759d75f809158c1923b6d5 (patch) | |
tree | ae2a45ea492075ce66be8d24f196817c57ab0790 /src/H5Fmpi.c | |
parent | 1ce4c8dd7ddaa344ad041514b1d3aa4979497275 (diff) | |
parent | 05a7b2523b47d34f921602d6968f2ad3053df873 (diff) | |
download | hdf5-aab84e704d10c15e8e759d75f809158c1923b6d5.zip hdf5-aab84e704d10c15e8e759d75f809158c1923b6d5.tar.gz hdf5-aab84e704d10c15e8e759d75f809158c1923b6d5.tar.bz2 |
Merge pull request #38 from byrnHDF/hdf5_1_8
Reduce code differences between HDF5 1.8 and 1.10
Diffstat (limited to 'src/H5Fmpi.c')
-rw-r--r-- | src/H5Fmpi.c | 72 |
1 files changed, 30 insertions, 42 deletions
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 9c7c33e..8cc2971 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. * @@ -68,58 +68,54 @@ #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * 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") + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, (-1), "driver get_rank request failed") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_mpi_get_rank() */ /*------------------------------------------------------------------------- - * 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) @@ -145,38 +141,31 @@ 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") + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, (-1), "driver get_size request failed") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_mpi_get_size() */ /*------------------------------------------------------------------------- - * 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 * *------------------------------------------------------------------------- */ @@ -197,25 +186,24 @@ 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 */ + /* 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 * *------------------------------------------------------------------------- */ @@ -236,7 +224,7 @@ 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 */ + /* 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") |