all_to_group_real_array Subroutine

private subroutine all_to_group_real_array(all, group, njobs)

FIXME : Add documentation

Arguments

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

Contents


Source Code

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