diff options
author | jhendersonHDF <jhenderson@hdfgroup.org> | 2023-11-03 02:42:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-03 02:42:28 (GMT) |
commit | 7404b57da68e92bd28c5da2053830e7cbfe032d1 (patch) | |
tree | d9d939f5b64657c2f47181e7e09f221d1007bbeb /src/H5FDmpi.c | |
parent | 61982b60fd5e3a29044a1cdd1931b0ab9f96dec1 (diff) | |
download | hdf5-7404b57da68e92bd28c5da2053830e7cbfe032d1.zip hdf5-7404b57da68e92bd28c5da2053830e7cbfe032d1.tar.gz hdf5-7404b57da68e92bd28c5da2053830e7cbfe032d1.tar.bz2 |
Rework MPI Info FAPL preserve PR to use VFD 'ctl' operations (#3782)
Diffstat (limited to 'src/H5FDmpi.c')
-rw-r--r-- | src/H5FDmpi.c | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 127740e..f247c34 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -104,13 +104,12 @@ done: } /* end H5FD_mpi_get_size() */ /*------------------------------------------------------------------------- - * Function: H5FD_mpi_get_comm + * Function: H5FD_mpi_get_comm * - * Purpose: Retrieves the file's communicator + * Purpose: Retrieves the file's MPI_Comm communicator object * - * Return: Success: The communicator (non-negative) - * - * Failure: Negative + * Return: Success: The communicator object + * Failure: MPI_COMM_NULL * *------------------------------------------------------------------------- */ @@ -144,6 +143,45 @@ done: } /* end H5FD_mpi_get_comm() */ /*------------------------------------------------------------------------- + * Function: H5FD_mpi_get_info + * + * Purpose: Retrieves the file's MPI_Info info object + * + * Return: Success: The info object + * Failure: MPI_INFO_NULL + * + *------------------------------------------------------------------------- + */ +MPI_Info +H5FD_mpi_get_info(H5FD_t *file) +{ + const H5FD_class_t *cls; + uint64_t flags = H5FD_CTL_FAIL_IF_UNKNOWN_FLAG | H5FD_CTL_ROUTE_TO_TERMINAL_VFD_FLAG; + MPI_Info info = MPI_INFO_NULL; + void *info_ptr = (void *)(&info); + MPI_Info ret_value; + + FUNC_ENTER_NOAPI(MPI_INFO_NULL) + + assert(file); + cls = (const H5FD_class_t *)(file->cls); + assert(cls); + assert(cls->ctl); /* All MPI drivers must implement this */ + + /* Dispatch to driver */ + if ((cls->ctl)(file, H5FD_CTL_GET_MPI_INFO_OPCODE, flags, NULL, &info_ptr) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_INFO_NULL, "driver get_info request failed"); + + if (info == MPI_INFO_NULL) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_INFO_NULL, "driver get_info request failed -- bad info object"); + + ret_value = info; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD_mpi_get_info() */ + +/*------------------------------------------------------------------------- * Function: H5FD_mpi_MPIOff_to_haddr * * Purpose: Convert an MPI_Offset value to haddr_t. |