| Type | Intent | Optional | 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 | |||
| integer(kind=int32), | intent(in) | :: | buffer(*) |
| 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 | ||||
| integer(kind=int32), | private | :: | req_count | ||||
| type(request_t), | private, | allocatable | :: | requests(:) |
subroutine darray_put_i32(handle, ilo, ihi, jlo, jhi, buffer) integer(int32), intent(in) :: handle, ilo, ihi, jlo, jhi integer(int32), intent(in) :: buffer(*) type(darray_t), pointer :: arr type(request_t), allocatable :: requests(:) integer(MPI_ADDRESS_KIND) :: disp integer(int32) :: j, col, owner, nrows_patch, buf_offset, req_count, nranks arr => registry(handle) nrows_patch = ihi - ilo + 1 nranks = global_comm%size() allocate (requests(jhi - jlo + 1)) call arr%win%lock_all() req_count = 0 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 req_count = req_count + 1 call arr%win%rput_i32(owner, disp, nrows_patch, buffer(buf_offset), requests(req_count)) end do call arr%win%flush_all() call waitall(requests(1:req_count)) call arr%win%unlock_all() deallocate (requests) end subroutine darray_put_i32