Neko 1.99.7
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
gs_caf.F90 File Reference

Go to the source code of this file.

Data Types

type  gs_caf::gs_caf_t
 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...
 

Modules

module  gs_caf
 Defines Coarray Fortran gather-scatter communication.
 

Functions/Subroutines

logical function, public gs_caf::gs_caf_usable ()
 Whether the coarray backend can actually run in this job. GS_CAF_AVAIL only says that the compiler accepted coarrays when Neko was configured; a compiler may well do so and still provide a single image per process (gfortran's -fcoarray=single, a coarray runtime that was not linked in), in which case every image sees num_images() == 1 and no halo can be exchanged. The images must map one-to-one onto the ranks of NEKO_COMM, as the backend addresses its peers by image number (rank + 1) – which also rules out a run split into several communicators (NEKO_COMM_ID).
 
logical function, public gs_caf::gs_caf_signal_auto ()
 Whether the signaling mode should be selected by benchmarking, i.e. NEKO_GS_CAF_SIGNALING=auto. The mode is a program-wide binding shared by every gs_caf_t instance, so the caller (the gs comm. autotuner) must bind it once and keep it: see gs_caf_set_mode.
 
integer function, dimension(:), allocatable, public gs_caf::gs_caf_signal_modes ()
 The signaling modes this build can run, in the order they should be benchmarked. Events are only available with a compiler that implements them.
 
integer function, public gs_caf::gs_caf_mode_get ()
 The signaling mode currently in force, or 0 if none has been bound yet (no gs_caf_t has been initialised and the autotuner has not run).
 
character(len=12) function, public gs_caf::gs_caf_mode_name (mode)
 Name of the signaling mode mode, right-adjusted for the log.
 
subroutine, public gs_caf::gs_caf_set_mode (mode)
 Bind the signaling mode shared by every gs_caf_t instance, allocating whatever module-level state the mode needs. Idempotent per mode, so it may be called again to switch modes while no gs op is in flight and no gs_caf_t instance is live – which is what the autotuner does to benchmark the modes against each other.
 
subroutine gs_caf::gs_caf_init (this, send_pe, recv_pe)
 Initialise Coarray Fortran based communication method.
 
subroutine gs_caf::gs_caf_free (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.
 
subroutine gs_caf::gs_nbsend_caf (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.
 
subroutine gs_caf::gs_nbrecv_caf (this, tag)
 No-op for coarrays: senders push into the receiver's buffer, so the receive side does not need to post anything.
 
subroutine gs_caf::gs_nbwait_caf (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.
 
subroutine gs_caf::gs_nbsend_vec_caf (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.
 
subroutine gs_caf::gs_nbrecv_vec_caf (this, tag, nc)
 No-op: senders push into the receiver's buffer.
 
subroutine gs_caf::gs_nbwait_vec_caf (this, u, n, nc, op, strm)
 Fused nc-component wait/reduce for the coarray backend.
 

Variables

logical, parameter, public gs_caf::gs_caf_avail = .false.
 Whether coarray support was built into this Neko. Lets callers (e.g. the gs comm. autotuner) skip the backend rather than aborting in init on builds without it.
 
integer, parameter, public gs_caf::gs_caf_signal_sync = 1
 
integer, parameter, public gs_caf::gs_caf_signal_atomic = 2
 
integer, parameter, public gs_caf::gs_caf_signal_event = 3