Skip to content

Remove C-wrapper for MPI_Waitall #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 10, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/mpi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,8 @@ subroutine MPI_Waitall_proc(count, array_of_requests, array_of_statuses, ierror)
integer, dimension(count), intent(inout) :: array_of_requests
integer, dimension(*), intent(out) :: array_of_statuses
integer, optional, intent(out) :: ierror
integer :: arr_request_item
integer :: arr_request_item_kind_4
integer(kind=MPI_HANDLE_KIND) :: arr_request_item_kind_mpi_handle_kind

integer(c_int) :: local_ierr, status_ierr
integer :: i
Expand All @@ -699,17 +700,17 @@ subroutine MPI_Waitall_proc(count, array_of_requests, array_of_statuses, ierror)

! Convert Fortran requests to C requests.
do i = 1, count
arr_request_item = array_of_requests(i)
c_requests(i) = c_mpi_request_f2c(arr_request_item)
arr_request_item_kind_4 = array_of_requests(i)
c_requests(i) = c_mpi_request_f2c(arr_request_item_kind_4)
end do

! Call the native MPI_Waitall.
local_ierr = c_mpi_waitall(count, c_requests, MPI_STATUSES_IGNORE_from_c)

! Convert the C requests back to Fortran handles.
do i = 1, count
arr_request_item = c_requests(i)
array_of_requests(i) = c_mpi_request_c2f(arr_request_item)
arr_request_item_kind_mpi_handle_kind = c_requests(i)
array_of_requests(i) = c_mpi_request_c2f(arr_request_item_kind_mpi_handle_kind)
end do

if (present(ierror)) then
Expand Down