38 use,
intrinsic :: iso_c_binding
56 integer,
allocatable :: send_pe(:)
58 integer,
allocatable :: recv_pe(:)
62 procedure(
gs_nbsend), pass(this),
deferred :: nbsend
63 procedure(
gs_nbrecv), pass(this),
deferred :: nbrecv
64 procedure(
gs_nbwait), pass(this),
deferred :: nbwait
105 integer,
intent(in) :: n
106 real(kind=
rp),
dimension(n),
intent(inout) :: u
107 integer,
intent(in) :: tag
108 type(c_ptr),
intent(inout) :: deps
109 type(c_ptr),
intent(inout) :: strm
120 integer,
intent(in) :: tag
139 integer,
intent(in) :: n
140 real(kind=
rp),
dimension(n),
intent(inout) :: u
142 type(c_ptr),
intent(inout) :: strm
153 call this%free_dofs()
155 allocate(this%send_dof(0:
pe_size-1))
156 allocate(this%recv_dof(0:
pe_size-1))
159 call this%send_dof(i)%init()
160 call this%recv_dof(i)%init()
169 if (
allocated(this%send_dof))
then
171 call this%send_dof(i)%free()
173 deallocate(this%send_dof)
176 if (
allocated(this%recv_dof))
then
178 call this%recv_dof(i)%free()
180 deallocate(this%recv_dof)
192 integer,
pointer :: sp(:)
195 allocate(this%send_pe(send_pe%size()))
197 sp => send_pe%array()
198 do i = 1, send_pe%size()
199 this%send_pe(i) = sp(i)
202 allocate(this%recv_pe(recv_pe%size()))
204 sp => recv_pe%array()
205 do i = 1, recv_pe%size()
206 this%recv_pe(i) = sp(i)
214 if (
allocated(this%send_pe))
then
215 deallocate(this%send_pe)
218 if (
allocated(this%recv_pe))
then
219 deallocate(this%recv_pe)
Abstract interface for deallocating a Gather-scatter communication method.
Abstract interface for initializing a Gather-scatter communication method.
Abstract interface for initiating non-blocking recieve operations Posts non-blocking recieve of value...
Abstract interface for initiating non-blocking send operations Sends the values in u(send_dof(send_pe...
Abstract interface for waiting on non-blocking operations Waits and checks that data is in buffers an...
integer, public pe_size
MPI size of communicator.
Defines a gather-scatter communication method.
subroutine init_dofs(this)
integer, parameter, public gs_comm_mpigpu
integer, parameter, public gs_comm_mpi
subroutine init_order(this, send_pe, recv_pe)
Obtains which ranks to send and receive data from.
integer, parameter, public gs_comm_nvshmem
integer, parameter, public gs_comm_openshmem
subroutine free_dofs(this)
integer, parameter, public gs_comm_nccl
subroutine free_order(this)
integer, parameter, public gs_comm_caf
integer, parameter, public rp
Global precision used in computations.
Implements a dynamic stack ADT.
Gather-scatter communication method.