38 use,
intrinsic :: iso_c_binding
55 integer,
allocatable :: send_pe(:)
57 integer,
allocatable :: recv_pe(:)
61 procedure(
gs_nbsend), pass(this),
deferred :: nbsend
62 procedure(
gs_nbrecv), pass(this),
deferred :: nbrecv
63 procedure(
gs_nbwait), pass(this),
deferred :: nbwait
104 integer,
intent(in) :: n
105 real(kind=
rp),
dimension(n),
intent(inout) :: u
106 type(c_ptr),
intent(inout) :: deps
107 type(c_ptr),
intent(inout) :: strm
136 integer,
intent(in) :: n
137 real(kind=
rp),
dimension(n),
intent(inout) :: u
139 type(c_ptr),
intent(inout) :: strm
150 call this%free_dofs()
152 allocate(this%send_dof(0:
pe_size-1))
153 allocate(this%recv_dof(0:
pe_size-1))
156 call this%send_dof(i)%init()
157 call this%recv_dof(i)%init()
166 if (
allocated(this%send_dof))
then
168 call this%send_dof(i)%free()
170 deallocate(this%send_dof)
173 if (
allocated(this%recv_dof))
then
175 call this%recv_dof(i)%free()
177 deallocate(this%recv_dof)
189 integer,
pointer :: sp(:)
192 allocate(this%send_pe(send_pe%size()))
194 sp => send_pe%array()
195 do i = 1, send_pe%size()
196 this%send_pe(i) = sp(i)
199 allocate(this%recv_pe(recv_pe%size()))
201 sp => recv_pe%array()
202 do i = 1, recv_pe%size()
203 this%recv_pe(i) = sp(i)
211 if (
allocated(this%send_pe))
then
212 deallocate(this%send_pe)
215 if (
allocated(this%recv_pe))
then
216 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 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
subroutine free_dofs(this)
integer, parameter, public gs_comm_nccl
subroutine free_order(this)
integer, parameter, public rp
Global precision used in computations.
Implements a dynamic stack ADT.
Gather-scatter communication method.