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

Defines Coarray Fortran gather-scatter communication.

Data Types

type  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...
 

Functions/Subroutines

logical function, public 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_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_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_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_mode_name (mode)
 Name of the signaling mode mode, right-adjusted for the log.
 
subroutine, public 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_init (this, send_pe, recv_pe)
 Initialise Coarray Fortran based communication method.
 
subroutine 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_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_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_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_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_nbrecv_vec_caf (this, tag, nc)
 No-op: senders push into the receiver's buffer.
 
subroutine 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_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_signal_sync = 1
 
integer, parameter, public gs_caf_signal_atomic = 2
 
integer, parameter, public gs_caf_signal_event = 3
 

Function/Subroutine Documentation

◆ gs_caf_free()

subroutine gs_caf::gs_caf_free ( class(gs_caf_t), intent(inout this)
private

Definition at line 514 of file gs_caf.F90.

◆ gs_caf_init()

subroutine gs_caf::gs_caf_init ( class(gs_caf_t), intent(inout this,
type(stack_i4_t), intent(inout send_pe,
type(stack_i4_t), intent(inout recv_pe 
)
private

Definition at line 356 of file gs_caf.F90.

Here is the call graph for this function:

◆ gs_caf_mode_get()

integer function, public gs_caf::gs_caf_mode_get
Returns
the bound mode, a GS_CAF_SIGNAL_* constant, or 0

Definition at line 269 of file gs_caf.F90.

Here is the caller graph for this function:

◆ gs_caf_mode_name()

character(len=12) function, public gs_caf::gs_caf_mode_name ( integer, intent(in mode)
Parameters
modethe mode to name, one of the GS_CAF_SIGNAL_* constants

Definition at line 282 of file gs_caf.F90.

Here is the caller graph for this function:

◆ gs_caf_set_mode()

subroutine, public gs_caf::gs_caf_set_mode ( integer, intent(in mode)
Parameters
modethe mode to bind, one of the GS_CAF_SIGNAL_* constants
Note
Collective: the atomic counters and the event coarrays are coarrays, so every image must call this in the same order.

Definition at line 308 of file gs_caf.F90.

Here is the caller graph for this function:

◆ gs_caf_signal_auto()

logical function, public gs_caf::gs_caf_signal_auto
Returns
whether the mode should be selected by benchmarking

Definition at line 234 of file gs_caf.F90.

Here is the caller graph for this function:

◆ gs_caf_signal_modes()

integer function, dimension(:), allocatable, public gs_caf::gs_caf_signal_modes
Returns
the runnable modes, as GS_CAF_SIGNAL_* constants

Definition at line 249 of file gs_caf.F90.

Here is the caller graph for this function:

◆ gs_caf_usable()

logical function, public gs_caf::gs_caf_usable
Returns
whether a gs_caf_t can be used by this run

Definition at line 218 of file gs_caf.F90.

Here is the caller graph for this function:

◆ gs_nbrecv_caf()

subroutine gs_caf::gs_nbrecv_caf ( class(gs_caf_t), intent(inout this,
integer, intent(in tag 
)
private

Definition at line 752 of file gs_caf.F90.

◆ gs_nbrecv_vec_caf()

subroutine gs_caf::gs_nbrecv_vec_caf ( class(gs_caf_t), intent(inout this,
integer, intent(in tag,
integer, intent(in nc 
)
private

Definition at line 1043 of file gs_caf.F90.

◆ gs_nbsend_caf()

subroutine gs_caf::gs_nbsend_caf ( 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 
)
private

Definition at line 579 of file gs_caf.F90.

◆ gs_nbsend_vec_caf()

subroutine gs_caf::gs_nbsend_vec_caf ( 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 
)
private
Parameters
ucompact shared buffer, component-outer: u((c-1)*n + idx).

Definition at line 905 of file gs_caf.F90.

◆ gs_nbwait_caf()

subroutine gs_caf::gs_nbwait_caf ( 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 
)
private

Definition at line 761 of file gs_caf.F90.

◆ gs_nbwait_vec_caf()

subroutine gs_caf::gs_nbwait_vec_caf ( 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 
)
private

Definition at line 1049 of file gs_caf.F90.

Variable Documentation

◆ gs_caf_avail

logical, parameter, public gs_caf::gs_caf_avail = .false.

Definition at line 57 of file gs_caf.F90.

◆ gs_caf_signal_atomic

integer, parameter, public gs_caf::gs_caf_signal_atomic = 2

Definition at line 64 of file gs_caf.F90.

◆ gs_caf_signal_event

integer, parameter, public gs_caf::gs_caf_signal_event = 3

Definition at line 65 of file gs_caf.F90.

◆ gs_caf_signal_sync

integer, parameter, public gs_caf::gs_caf_signal_sync = 1

Definition at line 63 of file gs_caf.F90.