FIXME : Add documentation
call barrier
end do
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | dimension (:,:) | :: | all | ||
real, | intent(out), | dimension (:) | :: | group | ||
integer, | intent(in) | :: | njobs |
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
integer :: ik, tag
! TESTING -- MAB
integer :: idx
# ifndef MPI
group = 0.
call mp_abort ("all_to_group")
# else
tag = 1001
! do ik = 0, njobs-1
! if (proc0) then
! if (iproc == grp0(ik)) then
! group = all(ik+1,:)
! else
! call ssend (all(ik+1,:), grp0(ik), tag)
! end if
! else if (iproc == grp0(ik)) then
! call receive (group, 0, tag)
! end if
!! call barrier
! end do
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
! call barrier
end do
# endif
end subroutine all_to_group_real_array