Return the processor id that has the point i in the g_lo layout
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(g_layout_type), | intent(in) | :: | lo | |||
integer, | intent(in) | :: | i |
elemental function proc_id_g (lo, i)
#ifdef SHMEM
use mp, only : nproc
#endif
implicit none
integer :: proc_id_g
type (g_layout_type), intent (in) :: lo
integer, intent (in) :: i
#ifdef SHMEM
integer k
proc_id_g = nproc - 1
do k =1, nproc-1
if ( i < lo%proc_map(k)) then
proc_id_g = k - 1
exit
endif
enddo
#else
proc_id_g = i/lo%blocksize
#endif
end function proc_id_g