darray_acc_dp Subroutine

private subroutine darray_acc_dp(handle, ilo, ihi, jlo, jhi, buffer)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: handle
integer(kind=int32), intent(in) :: ilo
integer(kind=int32), intent(in) :: ihi
integer(kind=int32), intent(in) :: jlo
integer(kind=int32), intent(in) :: jhi
real(kind=dp), intent(in) :: buffer(*)

Calls

proc~~darray_acc_dp~~CallsGraph proc~darray_acc_dp darray_acc_dp proc~get_local_offset get_local_offset proc~darray_acc_dp->proc~get_local_offset proc~get_owner get_owner proc~darray_acc_dp->proc~get_owner proc~win_accumulate_dp win_t%win_accumulate_dp proc~darray_acc_dp->proc~win_accumulate_dp proc~get_local_offset->proc~get_owner proc~calculate_distribution calculate_distribution proc~get_local_offset->proc~calculate_distribution mpi_accumulate mpi_accumulate proc~win_accumulate_dp->mpi_accumulate

Called by

proc~~darray_acc_dp~~CalledByGraph proc~darray_acc_dp darray_acc_dp interface~darray_acc darray_acc interface~darray_acc->proc~darray_acc_dp

Variables

Type Visibility Attributes Name Initial
type(darray_t), private, pointer :: arr
integer(kind=int32), private :: buf_offset
integer(kind=int32), private :: col
integer(kind=MPI_ADDRESS_KIND), private :: disp
integer(kind=int32), private :: j
integer(kind=int32), private :: nranks
integer(kind=int32), private :: nrows_patch
integer(kind=int32), private :: owner

Source Code

   subroutine darray_acc_dp(handle, ilo, ihi, jlo, jhi, buffer)
      integer(int32), intent(in) :: handle, ilo, ihi, jlo, jhi
      real(dp), intent(in) :: buffer(*)
      type(darray_t), pointer :: arr
      integer(MPI_ADDRESS_KIND) :: disp
      integer(int32) :: j, col, owner, nrows_patch, buf_offset, nranks

      arr => registry(handle)
      nrows_patch = ihi - ilo + 1
      nranks = global_comm%size()

      do j = jlo, jhi
         col = j - 1
         owner = get_owner(arr%ncols, nranks, col)
         disp = get_local_offset(arr%nrows, arr%ncols, nranks, ilo - 1, col)
         buf_offset = (j - jlo)*nrows_patch + 1
         call arr%win%lock(owner)
         call arr%win%accumulate_dp(owner, disp, nrows_patch, buffer(buf_offset))
         call arr%win%unlock(owner)
      end do
   end subroutine darray_acc_dp