Neko 1.99.7
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
gs_caf::gs_caf_t Type Referenceabstract

Gather-scatter communication using Coarray Fortran (F2008). Each image puts directly into the (module-level) receive coarray on the destination image. The signaling mode (NEKO_GS_CAF_SIGNALING) selects how segment ordering is established: sync uses sync images over the union of send and recv peers, atomic uses per-peer atomic_define/atomic_ref on data_ready/buf_ready counters, and event uses coarray events. More...

Inheritance diagram for gs_caf::gs_caf_t:
Collaboration diagram for gs_caf::gs_caf_t:

Public Member Functions

procedure, pass(thisinit (this, send_pe, recv_pe)
 Initialise Coarray Fortran based communication method.
 
procedure, pass(thisfree (this)
 Deallocate Coarray Fortran based communication method. The shared module-level recv coarray is intentionally retained so it can be reused by subsequent gs_caf_t instances.
 
procedure, pass(thisnbsend (this, u, n, tag, deps, strm)
 Pack u into per-peer slabs and put each slab into the remote image's recv_buf. Double buffering means each round writes to a different half of the recv coarray, so no back-pressure synchronisation is needed in sync mode – the visibility synchronisation in nbwait suffices. Atomic and event modes still use their per-pair signalling.
 
procedure, pass(thisnbrecv (this, tag)
 No-op for coarrays: senders push into the receiver's buffer, so the receive side does not need to post anything.
 
procedure, pass(thisnbwait (this, u, n, op, strm)
 Wait for all incoming puts and reduce them into u. In sync mode a sync_images bracket pairs with the senders' nbsend; in atomic mode each sender is awaited via its data_ready counter and credited via buf_ready after unpack.
 
procedure, pass(thisnbsend_vec (this, u, n, nc, tag, deps, strm)
 Fused nc-component put. Each peer slab is nc consecutive component blocks; the remote placement offset and slab length scale by nc, the per-peer signalling (sync/atomic/event) is unchanged.
 
procedure, pass(thisnbrecv_vec (this, tag, nc)
 No-op: senders push into the receiver's buffer.
 
procedure, pass(thisnbwait_vec (this, u, n, nc, op, strm)
 Fused nc-component wait/reduce for the coarray backend.
 
procedure(gs_comm_init), deferred, pass init gs_comm_init
 
procedure(gs_comm_free), deferred, pass free gs_comm_free
 
procedure(gs_nbsend), deferred, pass nbsend gs_nbsend
 
procedure(gs_nbrecv), deferred, pass nbrecv gs_nbrecv
 
procedure(gs_nbwait), deferred, pass nbwait gs_nbwait
 
procedure, pass(thisinit_dofs (this)
 
procedure, pass(thisfree_dofs (this)
 
procedure, pass(thisinit_order (this, send_pe, recv_pe)
 Obtains which ranks to send and receive data from.
 
procedure, pass(thisfree_order (this)
 
procedure, pass(thistake_schedule (this, src)
 Take over the gather-scatter schedule (dof lists and peer order) of src, avoiding a second (expensive) pass over the connectivity. The data is moved rather than copied, so src is left without a schedule and must not be used for communication afterwards (it can still be freed). No communication resources are set up here; complete the handover with init_schedule once src has been freed, so that the two backends never hold their resources at the same time.
 
procedure, pass(thisinit_schedule (this)
 Set up this communication method for the schedule taken over by take_schedule. Collective, as init is.
 
procedure, pass(thisnbsend_vec (this, u, n, nc, tag, deps, strm)
 Fused vector halo exchange. Default implementations abort; backends that set vec_supported = .true. override them.
 
procedure, pass(thisnbrecv_vec (this, tag, nc)
 Default fused vector receive. Abort unless a backend overrides it.
 
procedure, pass(thisnbwait_vec (this, u, n, nc, op, strm)
 Default fused vector wait/reduce. Abort unless a backend overrides it.
 

Public Attributes

real(kind=rp), dimension(:), allocatable send_buf
 Local gathered send buffer (concatenated slabs, one per send peer).
 
integer, dimension(:), allocatable send_len
 Number of dofs to send to / receive from each peer.
 
integer, dimension(:), allocatable recv_len
 
integer, dimension(:), allocatable send_offset
 0-based offset into send_buf / recv_buf for each peer.
 
integer, dimension(:), allocatable recv_offset
 
integer, dimension(:), allocatable dest_offset
 0-based offset in the remote peer's recv_buf where our slab is placed.
 
integer, dimension(:), allocatable send_img
 1-based image numbers for the send and recv peer arrays.
 
integer, dimension(:), allocatable recv_img
 
integer, dimension(:), allocatable peer
 Ranks of the union of send and recv peers, i.e. every peer this instance exchanges with in a round. Used to advance the per-peer double-buffer parity in nbwait.
 
integer, dimension(:), allocatable sync_img
 sync-mode only: the same set as image numbers, used for the pairwise sync images that bracket the put. Unallocated in atomic and event modes.
 
logical send_started = .false.
 event-mode only: false on the very first nbsend so the buf_ready wait is skipped (there are no credits posted yet).
 
type(stack_i4_t), dimension(:), allocatable send_dof
 A list of stacks of dof indices local to this process to send to rank_i.
 
type(stack_i4_t), dimension(:), allocatable recv_dof
 recv_dof(rank_i) is a stack of dof indices local to this process to receive from rank_i. size(recv_dof) == pe_size
 
integer, dimension(:), allocatable send_pe
 Array of ranks that this process should send to.
 
integer, dimension(:), allocatable recv_pe
 array of ranks that this process will receive messages from
 
logical vec_supported = .false.
 Whether this backend implements the fused vector (multi-component) halo exchange (nbsend_vec/nbrecv_vec/nbwait_vec). When .false., the gs_op_r3 caller falls back to nc independent scalar exchanges.
 

Detailed Description

Under OpenMP the pack and unpack loops are work-shared across the calling team, while every coarray operation is funnelled through the master thread – see gs_nbsend_caf.

Definition at line 171 of file gs_caf.F90.

Member Function/Subroutine Documentation

◆ free() [1/2]

procedure, pass(this) gs_caf::gs_caf_t::free ( class(gs_caf_t), intent(inout this)

Definition at line 195 of file gs_caf.F90.

◆ free() [2/2]

procedure(gs_comm_free), deferred, pass gs_comm::gs_comm_t::free
pure virtualinherited

Definition at line 70 of file gs_comm.f90.

◆ free_dofs()

procedure, pass(this) gs_comm::gs_comm_t::free_dofs ( class(gs_comm_t), intent(inout this)
inherited

Definition at line 75 of file gs_comm.f90.

◆ free_order()

procedure, pass(this) gs_comm::gs_comm_t::free_order ( class(gs_comm_t), intent(inout this)
inherited

Definition at line 77 of file gs_comm.f90.

◆ init() [1/2]

procedure, pass(this) gs_caf::gs_caf_t::init ( class(gs_caf_t), intent(inout this,
type(stack_i4_t), intent(inout send_pe,
type(stack_i4_t), intent(inout recv_pe 
)

Definition at line 194 of file gs_caf.F90.

◆ init() [2/2]

procedure(gs_comm_init), deferred, pass gs_comm::gs_comm_t::init
pure virtualinherited

Definition at line 69 of file gs_comm.f90.

◆ init_dofs()

procedure, pass(this) gs_comm::gs_comm_t::init_dofs ( class(gs_comm_t), intent(inout this)
inherited

Definition at line 74 of file gs_comm.f90.

◆ init_order()

procedure, pass(this) gs_comm::gs_comm_t::init_order ( class(gs_comm_t), intent(inout this,
type(stack_i4_t), intent(inout send_pe,
type(stack_i4_t), intent(inout recv_pe 
)
inherited
Parameters
send_pe,onlycontains rank ids this porcesss should send to
recv_pe,onlythe ranks this process should receive from

Definition at line 76 of file gs_comm.f90.

◆ init_schedule()

procedure, pass(this) gs_comm::gs_comm_t::init_schedule ( class(gs_comm_t), intent(inout this)
inherited

Definition at line 79 of file gs_comm.f90.

◆ nbrecv() [1/2]

procedure, pass(this) gs_caf::gs_caf_t::nbrecv ( class(gs_caf_t), intent(inout this,
integer, intent(in tag 
)

Definition at line 197 of file gs_caf.F90.

◆ nbrecv() [2/2]

procedure(gs_nbrecv), deferred, pass gs_comm::gs_comm_t::nbrecv
pure virtualinherited

Definition at line 72 of file gs_comm.f90.

◆ nbrecv_vec() [1/2]

procedure, pass(this) gs_caf::gs_caf_t::nbrecv_vec ( class(gs_caf_t), intent(inout this,
integer, intent(in tag,
integer, intent(in nc 
)

Definition at line 200 of file gs_caf.F90.

◆ nbrecv_vec() [2/2]

procedure, pass(this) gs_comm::gs_comm_t::nbrecv_vec ( class(gs_comm_t), intent(inout this,
integer, intent(in tag,
integer, intent(in nc 
)
inherited

Definition at line 83 of file gs_comm.f90.

◆ nbsend() [1/2]

procedure, pass(this) gs_caf::gs_caf_t::nbsend ( class(gs_caf_t), intent(inout this,
real(kind=rp), dimension(n), intent(inout u,
integer, intent(in n,
integer, intent(in tag,
type(c_ptr), intent(inout deps,
type(c_ptr), intent(inout strm 
)

Definition at line 196 of file gs_caf.F90.

◆ nbsend() [2/2]

procedure(gs_nbsend), deferred, pass gs_comm::gs_comm_t::nbsend
pure virtualinherited

Definition at line 71 of file gs_comm.f90.

◆ nbsend_vec() [1/2]

procedure, pass(this) gs_caf::gs_caf_t::nbsend_vec ( class(gs_caf_t), intent(inout this,
real(kind=rp), dimension(nc*n), intent(inout u,
integer, intent(in n,
integer, intent(in nc,
integer, intent(in tag,
type(c_ptr), intent(inout deps,
type(c_ptr), intent(inout strm 
)
Parameters
ucompact shared buffer, component-outer: u((c-1)*n + idx).

Definition at line 199 of file gs_caf.F90.

◆ nbsend_vec() [2/2]

procedure, pass(this) gs_comm::gs_comm_t::nbsend_vec ( class(gs_comm_t), intent(inout this,
real(kind=rp), dimension(nc*n), intent(inout u,
integer, intent(in n,
integer, intent(in nc,
integer, intent(in tag,
type(c_ptr), intent(inout deps,
type(c_ptr), intent(inout strm 
)
inherited
Parameters
ucompact shared buffer, component-outer: u((c-1)*n + idx)
nnumber of shared dofs (per component)
ncnumber of components

Definition at line 82 of file gs_comm.f90.

◆ nbwait() [1/2]

procedure, pass(this) gs_caf::gs_caf_t::nbwait ( class(gs_caf_t), intent(inout this,
real(kind=rp), dimension(n), intent(inout u,
integer, intent(in n,
integer  op,
type(c_ptr), intent(inout strm 
)

Definition at line 198 of file gs_caf.F90.

◆ nbwait() [2/2]

procedure(gs_nbwait), deferred, pass gs_comm::gs_comm_t::nbwait
pure virtualinherited

Definition at line 73 of file gs_comm.f90.

◆ nbwait_vec() [1/2]

procedure, pass(this) gs_caf::gs_caf_t::nbwait_vec ( class(gs_caf_t), intent(inout this,
real(kind=rp), dimension(nc*n), intent(inout u,
integer, intent(in n,
integer, intent(in nc,
integer  op,
type(c_ptr), intent(inout strm 
)

Definition at line 201 of file gs_caf.F90.

Here is the call graph for this function:

◆ nbwait_vec() [2/2]

procedure, pass(this) gs_comm::gs_comm_t::nbwait_vec ( class(gs_comm_t), intent(inout this,
real(kind=rp), dimension(nc*n), intent(inout u,
integer, intent(in n,
integer, intent(in nc,
integer  op,
type(c_ptr), intent(inout strm 
)
inherited

Definition at line 84 of file gs_comm.f90.

◆ take_schedule()

procedure, pass(this) gs_comm::gs_comm_t::take_schedule ( class(gs_comm_t), intent(inout this,
class(gs_comm_t), intent(inout src 
)
inherited
Parameters
srcthe backend to take the schedule from, left without one

Definition at line 78 of file gs_comm.f90.

Member Data Documentation

◆ dest_offset

integer, dimension(:), allocatable gs_caf::gs_caf_t::dest_offset

Definition at line 179 of file gs_caf.F90.

◆ peer

integer, dimension(:), allocatable gs_caf::gs_caf_t::peer

Definition at line 185 of file gs_caf.F90.

◆ recv_dof

type(stack_i4_t), dimension(:), allocatable gs_comm::gs_comm_t::recv_dof
inherited

Definition at line 57 of file gs_comm.f90.

◆ recv_img

integer, dimension(:), allocatable gs_caf::gs_caf_t::recv_img

Definition at line 181 of file gs_caf.F90.

◆ recv_len

integer, dimension(:), allocatable gs_caf::gs_caf_t::recv_len

Definition at line 175 of file gs_caf.F90.

◆ recv_offset

integer, dimension(:), allocatable gs_caf::gs_caf_t::recv_offset

Definition at line 177 of file gs_caf.F90.

◆ recv_pe

integer, dimension(:), allocatable gs_comm::gs_comm_t::recv_pe
inherited

Definition at line 63 of file gs_comm.f90.

◆ send_buf

real(kind=rp), dimension(:), allocatable gs_caf::gs_caf_t::send_buf

Definition at line 173 of file gs_caf.F90.

◆ send_dof

type(stack_i4_t), dimension(:), allocatable gs_comm::gs_comm_t::send_dof
inherited

Definition at line 54 of file gs_comm.f90.

◆ send_img

integer, dimension(:), allocatable gs_caf::gs_caf_t::send_img

Definition at line 181 of file gs_caf.F90.

◆ send_len

integer, dimension(:), allocatable gs_caf::gs_caf_t::send_len

Definition at line 175 of file gs_caf.F90.

◆ send_offset

integer, dimension(:), allocatable gs_caf::gs_caf_t::send_offset

Definition at line 177 of file gs_caf.F90.

◆ send_pe

integer, dimension(:), allocatable gs_comm::gs_comm_t::send_pe
inherited
Note
: this will usually be fewer than the total number of ranks size(send_pe) <= pe_size

Definition at line 61 of file gs_comm.f90.

◆ send_started

logical gs_caf::gs_caf_t::send_started = .false.

Definition at line 192 of file gs_caf.F90.

◆ sync_img

integer, dimension(:), allocatable gs_caf::gs_caf_t::sync_img

Definition at line 189 of file gs_caf.F90.

◆ vec_supported

logical gs_comm::gs_comm_t::vec_supported = .false.
inherited

Definition at line 67 of file gs_comm.f90.


The documentation for this type was generated from the following file: