FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | dimension (:) | :: | all | ||
real, | intent(out) | :: | group | |||
integer, | intent(in) | :: | njobs |
subroutine all_to_group_real (all, group, njobs)
implicit none
real, dimension (:), intent (in) :: all
real, intent (out) :: group
integer, intent (in) :: njobs
#ifdef MPI
integer :: ik, tag, idx
tag = 1000
do ik = 0, njobs-1
if (proc0) then
idx = mod(ik,size(all))
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