A routine to test for all count communications, given by the message handles in requests, to complete. We return the message statuses and completion flag
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | count | |||
integer, | intent(inout), | dimension(:) | :: | requests | ||
integer, | intent(out), | dimension(MPI_STATUS_SIZE,count) | :: | status | ||
logical, | intent(out) | :: | flag |
subroutine testall_stat (count, requests, status, flag)
implicit none
integer, intent(in) :: count
integer, dimension(:), intent (inout) :: requests
# ifdef MPI
integer, dimension(MPI_STATUS_SIZE,count), intent(out) :: status
# else
integer,intent(out) :: status
# endif
logical, intent(out) :: flag
# ifdef MPI
!Note mpi_test will set the request handle to MPI_NULL (or similar)
!when message complete so have to set requests as inout
integer :: ierror
!$OMP MASTER
call time_message(.false., time_mp_sync, ' MPI Sync')
!$OMP END MASTER
call mpi_testall(count,requests,flag,status,ierror)
!$OMP MASTER
call time_message(.false., time_mp_sync, ' MPI Sync')
!$OMP END MASTER
# else
status = 0
flag = .false.
# endif
end subroutine testall_stat