39 use,
intrinsic :: iso_c_binding
61 integer,
allocatable :: send_pe(:)
63 integer,
allocatable :: recv_pe(:)
67 logical :: vec_supported = .false.
71 procedure(
gs_nbsend), pass(this),
deferred :: nbsend
72 procedure(
gs_nbrecv), pass(this),
deferred :: nbrecv
73 procedure(
gs_nbwait), pass(this),
deferred :: nbwait
119 integer,
intent(in) :: n
120 real(kind=
rp),
dimension(n),
intent(inout) :: u
121 integer,
intent(in) :: tag
122 type(c_ptr),
intent(inout) :: deps
123 type(c_ptr),
intent(inout) :: strm
134 integer,
intent(in) :: tag
153 integer,
intent(in) :: n
154 real(kind=
rp),
dimension(n),
intent(inout) :: u
156 type(c_ptr),
intent(inout) :: strm
167 call this%free_dofs()
169 allocate(this%send_dof(0:
pe_size-1))
170 allocate(this%recv_dof(0:
pe_size-1))
173 call this%send_dof(i)%init()
174 call this%recv_dof(i)%init()
183 if (
allocated(this%send_dof))
then
185 call this%send_dof(i)%free()
187 deallocate(this%send_dof)
190 if (
allocated(this%recv_dof))
then
192 call this%recv_dof(i)%free()
194 deallocate(this%recv_dof)
206 integer,
pointer :: sp(:)
209 allocate(this%send_pe(send_pe%size()))
211 sp => send_pe%array()
212 do i = 1, send_pe%size()
213 this%send_pe(i) = sp(i)
216 allocate(this%recv_pe(recv_pe%size()))
218 sp => recv_pe%array()
219 do i = 1, recv_pe%size()
220 this%recv_pe(i) = sp(i)
228 if (
allocated(this%send_pe))
then
229 deallocate(this%send_pe)
232 if (
allocated(this%recv_pe))
then
233 deallocate(this%recv_pe)
244 integer,
intent(in) :: n, nc
245 real(kind=
rp),
dimension(nc*n),
intent(inout) :: u
246 integer,
intent(in) :: tag
247 type(c_ptr),
intent(inout) :: deps
248 type(c_ptr),
intent(inout) :: strm
249 call neko_error(
'Vector gather-scatter not supported by this comm backend')
255 integer,
intent(in) :: tag, nc
256 call neko_error(
'Vector gather-scatter not supported by this comm backend')
262 integer,
intent(in) :: n, nc
263 real(kind=
rp),
dimension(nc*n),
intent(inout) :: u
265 type(c_ptr),
intent(inout) :: strm
266 call neko_error(
'Vector gather-scatter not supported by this comm backend')
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 gs_nbsend_vec(this, u, n, nc, tag, deps, strm)
Default fused vector send. Abort unless a backend overrides it.
subroutine init_dofs(this)
subroutine gs_nbrecv_vec(this, tag, nc)
Default fused vector receive. Abort unless a backend overrides it.
integer, parameter, public gs_vec_nc
Maximum number of components handled by the fused vector (multi-component) halo exchange used by gs_o...
integer, parameter, public gs_comm_mpigpu
integer, parameter, public gs_comm_neighbour
integer, parameter, public gs_comm_mpi
subroutine init_order(this, send_pe, recv_pe)
Obtains which ranks to send and receive data from.
subroutine gs_nbwait_vec(this, u, n, nc, op, strm)
Default fused vector wait/reduce. Abort unless a backend overrides it.
integer, parameter, public gs_comm_nvshmem
integer, parameter, public gs_comm_openshmem
integer, parameter, public gs_comm_utofu
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.