pf_mpi_post Subroutine

public subroutine pf_mpi_post(pf, level, tag, ierror, direction)

Subroutine to post receive requests.

Arguments

Type IntentOptional AttributesName
type(pf_pfasst_t), intent(in) :: pf
class(pf_level_t), intent(inout) :: level

level to send from

integer, intent(in) :: tag

message tag

integer, intent(inout) :: ierror

error flag

integer, intent(in), optional :: direction

Calls

proc~~pf_mpi_post~~CallsGraph proc~pf_mpi_post pf_mpi_post mpi_irecv mpi_irecv proc~pf_mpi_post->mpi_irecv

Contents

Source Code


Source Code

  subroutine pf_mpi_post(pf, level, tag, ierror, direction)

    type(pf_pfasst_t), intent(in   ) :: pf
    class(pf_level_t), intent(inout) :: level   !!  level to send from
    integer,           intent(in   ) :: tag     !!  message tag
    integer,           intent(inout) :: ierror  !!  error flag
    integer, optional, intent(in)    :: direction
    integer                          :: dir, source

    dir = 1 ! default 1: send forward; set to 2 for send backwards
    if(present(direction)) dir = direction

    if(dir==1) source = modulo(pf%rank-1, pf%comm%nproc)
    if(dir==2) source = modulo(pf%rank+1, pf%comm%nproc)

    call mpi_irecv(level%recv, level%mpibuflen, myMPI_Datatype, &
                   source, tag, pf%comm%comm, pf%comm%recvreq(level%index), ierror)

  end subroutine pf_mpi_post