Subroutine to send the solution to the next processor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(pf_pfasst_t), | intent(inout) | :: | pf | |||
class(pf_level_t), | intent(inout) | :: | level | |||
integer, | intent(in) | :: | tag | |||
logical, | intent(in) | :: | blocking | |||
integer, | intent(in), | optional | :: | direction |
subroutine pf_send(pf, level, tag, blocking, direction)
type(pf_pfasst_t), intent(inout) :: pf
class(pf_level_t), intent(inout) :: level
integer, intent(in) :: tag
logical, intent(in) :: blocking
integer, optional, intent(in) :: direction
integer :: dir, ierror
dir = 1 ! default: send forward
if(present(direction)) dir = direction
ierror = 0
call start_timer(pf, TSEND + level%index - 1)
if (pf%debug) print*, 'DEBUG --',pf%rank, 'begin send, tag=',tag,blocking,' pf%state%status =',pf%state%status
if (pf%rank /= pf%comm%nproc-1 .and. dir == 1 ) then
call pf%comm%send(pf, level, tag, blocking, ierror, dir)
elseif (pf%rank /= 0 .and. dir == 2 ) then
!print *, pf%rank, 'sending backward',tag,blocking,pf%rank
call pf%comm%send(pf, level, tag, blocking, ierror, dir)
end if
if (ierror /= 0) then
print *, pf%rank, 'warning: error during send', ierror
stop "pf_parallel:pf_send"
endif
if (pf%debug) print*, 'DEBUG --',pf%rank, 'end send, tag=',tag,blocking
call end_timer(pf, TSEND + level%index - 1)
end subroutine pf_send