diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2016-01-21 22:31:15 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2016-01-21 22:31:15 (GMT) |
commit | 91aeb766fafbc4c03d98699de4cac590df9c63a3 (patch) | |
tree | d0ea24a184746c342f198564adb4fe487cf215c9 /src/H5Fmpi.c | |
parent | 8ca4c2f44b60295ab3f757a9a90ac75ff09cb548 (diff) | |
download | hdf5-91aeb766fafbc4c03d98699de4cac590df9c63a3.zip hdf5-91aeb766fafbc4c03d98699de4cac590df9c63a3.tar.gz hdf5-91aeb766fafbc4c03d98699de4cac590df9c63a3.tar.bz2 |
[svn-r28950] - remove META_FLUSH_COLLECTIVELY property for delayed sanity checks from metadata dxpls
- remove H5AC_ind_dxpl_id and use only H5AC_dxpl_id everywhere instead.
- remove flush_me_collectively flag from cache entries
- add a collective sanity check (MPI_Barrier) for every HDF5 API routine that could possibly touch the file. This is trigerred when the environment variable H5_COLL_API_SANITY_CHECK is set to a non 0 digit.
tested on BB-8 with serial and parallel.
Diffstat (limited to 'src/H5Fmpi.c')
-rw-r--r-- | src/H5Fmpi.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index fe2a774..9783947 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -258,5 +258,74 @@ H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag) done: FUNC_LEAVE_API(ret_value) } + + +/*------------------------------------------------------------------------- + * Function: H5F_mpi_retrieve_comm + * + * 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 + * + * Failure: Negative + * + * Programmer: Mohamad Chaarawi + * Feb 14, 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(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; + + /* retrieve the file structure */ + if(H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + f = loc.oloc->file; + HDassert(f); + + /* 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 */ + 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") + + 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") + + *mpi_comm = fa->comm; + } + } +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_mpi_retrieve_comm */ + #endif /* H5_HAVE_PARALLEL */ |