FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | dimension (:) | :: | group | ||
real, | intent(out), | dimension (:,:) | :: | all | ||
integer, | intent(in) | :: | njobs |
subroutine group_to_all_real_array (group, all, njobs)
implicit none
real, dimension (:), intent (in) :: group
real, dimension (:,:), intent (out) :: all
integer, intent (in) :: njobs
# ifdef MPI
integer :: ik, tag, idx
tag = 1003
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_array