proc_id_accelx Function

private elemental function proc_id_accelx(lo, i)

Arguments

Type IntentOptional Attributes Name
type(accelx_layout_type), intent(in) :: lo
integer, intent(in) :: i

Return Value integer


Contents

Source Code


Source Code

  elemental integer function proc_id_accelx (lo, i)
#ifdef SHMEM
    use mp, only : nproc
#endif
    implicit none
    type (accelx_layout_type), intent (in) :: lo
    integer, intent (in) :: i
#ifdef SHMEM
    integer :: k

    proc_id_accelx = nproc - 1
    do k =1, nproc-1
       if ( i < lo%proc_map(k)) then 
          proc_id_accelx = k - 1
          exit
       endif
    enddo
#else
    proc_id_accelx = i/lo%blocksize
#endif
  end function proc_id_accelx