Subroutine to post receive requests.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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 |
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