Perform the communication of status bits with a nonblocking allreduce resulting in an delayed communication by one check_iter interval.
Status to communicate.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_status_type), | intent(inout) | :: | me | |||
integer, | intent(in) | :: | comm |
Communicator to use for the MPI reduction operation. |
subroutine tem_status_communicate_delayed(me, comm)
! --------------------------------------------------------------------------!
!!> Status to communicate.
type(tem_status_type), intent(inout) :: me
!> Communicator to use for the MPI reduction operation.
integer, intent(in) :: comm
! --------------------------------------------------------------------------!
integer :: iError
integer :: sync_status(MPI_STATUS_SIZE)
logical :: local_bits(tem_stat_nFlags)
! --------------------------------------------------------------------------!
local_bits = me%bits
if (me%check_request /= MPI_REQUEST_NULL) then
! Wait on previous Iallreduce, to synchronize status bits.
call MPI_Wait(me%check_request, sync_status, iError)
me%bits = me%oldbits
end if
me%oldbits = local_bits
! Synchronize status from the current iteration (may only become known on
! other processes in next iteration, after the wait above)
call MPI_Iallreduce( MPI_IN_PLACE, me%oldbits, tem_stat_nFlags, &
& MPI_LOGICAL, MPI_LOR, comm, me%check_request, iError )
end subroutine tem_status_communicate_delayed