diff options
author | jhendersonHDF <jhenderson@hdfgroup.org> | 2022-07-18 17:32:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-18 17:32:09 (GMT) |
commit | ba5385ffc2f75a774e62581f6de13c5987cf3053 (patch) | |
tree | 041e5ef065e45d8f35b19335c0ab59d0930714d8 /src/H5Fmpi.c | |
parent | 69ddcd02f1b0ebba294df59da1b8a93f204433d9 (diff) | |
download | hdf5-ba5385ffc2f75a774e62581f6de13c5987cf3053.zip hdf5-ba5385ffc2f75a774e62581f6de13c5987cf3053.tar.gz hdf5-ba5385ffc2f75a774e62581f6de13c5987cf3053.tar.bz2 |
Fix some hard-coded MPI I/O VFD checks (#1898)
Diffstat (limited to 'src/H5Fmpi.c')
-rw-r--r-- | src/H5Fmpi.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 8768104..e83d69c 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -390,12 +390,24 @@ H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm) } /* otherwise, this is from H5Fopen or H5Fcreate and has to be collective */ else { - H5P_genplist_t *plist; /* Property list pointer */ + H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */ + H5P_genplist_t * plist; /* Property list pointer */ + unsigned long driver_feat_flags; + H5FD_class_t * driver_class = NULL; if (NULL == (plist = H5P_object_verify(acspl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_FILE, H5E_BADTYPE, FAIL, "not a file access list") - if (H5FD_MPIO == H5P_peek_driver(plist)) + if (H5P_peek(plist, H5F_ACS_FILE_DRV_NAME, &driver_prop) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get driver ID & info") + + if (NULL == (driver_class = H5FD_get_class(driver_prop.driver_id))) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get driver class structure") + + if (H5FD_driver_query(driver_class, &driver_feat_flags) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get driver feature flags") + + if (driver_feat_flags & H5FD_FEAT_HAS_MPI) if (H5P_peek(plist, H5F_ACS_MPI_PARAMS_COMM_NAME, mpi_comm) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get MPI communicator") } |