group_to_all_real Subroutine

private subroutine group_to_all_real(group, all, njobs)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: group
real, intent(out), dimension (:) :: all
integer, intent(in) :: njobs

Contents

Source Code


Source Code

  subroutine group_to_all_real (group, all, njobs)
    implicit none
    real, intent (in) :: group
    real, dimension (:), intent (out) :: all
    integer, intent (in) :: njobs
#ifdef MPI
    integer :: ik, tag, idx
    tag = 1002
    do ik = 0, njobs-1
       if (iproc == grp0(ik)) then
          if (.not. proc0) then
             call ssend (group, 0, tag)
          else
             idx = mod(ik,size(all))
             all(idx+1) = group
          end if
       else if (proc0) then
          idx = mod(ik,size(all))
          call receive (all(idx+1), grp0(ik), tag)
       end if
    end do
# else
    UNUSED_DUMMY(group); UNUSED_DUMMY(njobs)
    all = 0
    call mp_abort("group_to_all")
# endif
  end subroutine group_to_all_real