pf_mpi_recv_status Subroutine

public subroutine pf_mpi_recv_status(pf, tag, istatus, ierror, direction)

Uses

  • proc~~pf_mpi_recv_status~~UsesGraph proc~pf_mpi_recv_status pf_mpi_recv_status module~pf_mod_mpi pf_mod_mpi proc~pf_mpi_recv_status->module~pf_mod_mpi

Subroutine to receive convergence status information

Arguments

Type IntentOptional AttributesName
type(pf_pfasst_t), intent(inout) :: pf

main pfasst structure

integer, intent(in) :: tag

message tag

integer, intent(inout) :: istatus

status flag to receive

integer, intent(inout) :: ierror

error flag

integer, intent(in), optional :: direction

Calls

proc~~pf_mpi_recv_status~~CallsGraph proc~pf_mpi_recv_status pf_mpi_recv_status mpi_recv mpi_recv proc~pf_mpi_recv_status->mpi_recv

Contents

Source Code


Source Code

  subroutine pf_mpi_recv_status(pf, tag,istatus,ierror, direction)
    use pf_mod_mpi, only: MPI_INTEGER, MPI_STATUS_SIZE

    type(pf_pfasst_t), intent(inout) :: pf        !!  main pfasst structure
    integer,           intent(in)    :: tag       !!  message tag
    integer,           intent(inout) :: istatus   !!  status flag to receive
    integer,           intent(inout) :: ierror    !!  error flag
    integer, optional, intent(in)    :: direction
    integer                          :: source
    integer    ::  stat(MPI_STATUS_SIZE), dir

    integer :: message

    dir = 1 ! default 1: send forward; set to 2 for send backwards
    if(present(direction)) dir = direction
    
    if(dir == 2) then
       source = modulo(pf%rank+1, pf%comm%nproc) 
    else
       source = modulo(pf%rank-1, pf%comm%nproc) 
    end if

    ! Get the message
    call mpi_recv(message, 1, MPI_INTEGER,source, tag, pf%comm%comm, stat, ierror)
    istatus=message

  end subroutine pf_mpi_recv_status