tem_status_communicate_delayed Subroutine

public subroutine tem_status_communicate_delayed(me, comm)

Perform the communication of status bits with a nonblocking allreduce resulting in an delayed communication by one check_iter interval.

Status to communicate.

Arguments

Type IntentOptional Attributes Name
type(tem_status_type), intent(inout) :: me
integer, intent(in) :: comm

Communicator to use for the MPI reduction operation.


Calls

proc~~tem_status_communicate_delayed~~CallsGraph proc~tem_status_communicate_delayed tem_status_communicate_delayed mpi_iallreduce mpi_iallreduce proc~tem_status_communicate_delayed->mpi_iallreduce mpi_wait mpi_wait proc~tem_status_communicate_delayed->mpi_wait

Called by

proc~~tem_status_communicate_delayed~~CalledByGraph proc~tem_status_communicate_delayed tem_status_communicate_delayed proc~tem_simcontrol_syncupdate tem_simControl_syncUpdate proc~tem_simcontrol_syncupdate->proc~tem_status_communicate_delayed

Source Code

  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