Subroutine to send this processor's convergence status to the next processor
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(pf_pfasst_t), | intent(inout) | :: | pf | |||
integer, | intent(in) | :: | tag | |||
integer, | intent(in), | optional | :: | direction |
subroutine pf_send_status(pf, tag, direction)
type(pf_pfasst_t), intent(inout) :: pf
integer, intent(in) :: tag
integer, optional, intent(in) :: direction
integer :: dir
integer :: istatus
integer :: ierror
dir = 1 ! default 1: send forward; set to 2 for send backwards
if(present(direction)) dir = direction
if (pf%rank == 0 .and. dir == 2) return
if (pf%rank == pf%comm%nproc-1 .and. dir == 1) return
ierror = 0
istatus = pf%state%status
if (dir == 1) then
if (pf%debug) print*, 'DEBUG --',pf%rank, 'begins send_status with status', istatus, 'with tag =', tag
call pf%comm%send_status(pf, tag, istatus, ierror, dir)
if (pf%debug) print*, 'DEBUG --',pf%rank, 'ends send_status'
elseif (dir == 2) then
if (pf%debug) print*, 'DEBUG --',pf%rank, 'begins send_status with status', istatus, 'backwards with tag =', tag
call pf%comm%send_status(pf, tag, istatus, ierror, dir)
if (pf%debug) print*, 'DEBUG --',pf%rank, 'ends send_status'
else
print *, pf%rank, 'warning: bad dir during send_status', dir
stop "pf_parallel:pf_send_status"
end if
if (ierror /= 0) then
print *, pf%rank, 'warning: error during send_status', ierror
stop "pf_parallel:pf_send_status"
endif
end subroutine pf_send_status