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

Defines crystal router gather-scatter communication. More...

Data Types

type  gs_crystal_t
 Gather-scatter communication using a crystal router. More...
 

Functions/Subroutines

subroutine gs_crystal_init (this, send_pe, recv_pe)
 Initialise crystal router based communication method See gs_comm.f90 for details.
 
subroutine gs_crystal_free (this)
 Deallocate crystal router based communication method.
 
subroutine gs_crystal_nbrecv (this, tag)
 Post the receives of the first routing stage.
 
subroutine gs_crystal_nbsend (this, u, n, tag, deps, strm)
 Pack the shared vector and post the send of the first routing stage.
 
subroutine gs_crystal_nbwait (this, u, n, op, strm)
 Drive the remaining routing stages and reduce what is delivered into the shared vector.
 
subroutine gs_crystal_nbrecv_vec (this, tag, nc)
 Post the receives of the first routing stage, fused nc-component.
 
subroutine gs_crystal_nbsend_vec (this, u, n, nc, tag, deps, strm)
 Pack the shared vector and post the send of the first routing stage, fused nc-component.
 
subroutine gs_crystal_nbwait_vec (this, u, n, nc, op, strm)
 Drive the remaining routing stages and reduce what is delivered into the shared vector, fused nc-component.
 

Detailed Description

Runs the halo exchange as a crystal router rather than as a message to every peer: the routing plan worked out once by gs_crystal_plan says, for each stage, which words leave for a single partner, which stay, and how many arrive. One gs operation therefore costs at most one message per active stage instead of one per peer, at the price of forwarding the words that are not yet home – see gs_crystal_plan.f90 for when that trade pays.

Only the first stage overlaps the local gather-scatter: it is posted from nbsend and completed in nbwait, which then drives the remaining stages back to back. Stages are dependent, so there is nothing to hide the later ones behind.

All MPI is issued from the master thread, so the backend needs nothing beyond MPI_THREAD_FUNNELED; the packing, forwarding and reduction loops are shared out over the team.

Function/Subroutine Documentation

◆ gs_crystal_free()

subroutine gs_crystal::gs_crystal_free ( class(gs_crystal_t), intent(inout this)
private

Definition at line 120 of file gs_crystal.f90.

◆ gs_crystal_init()

subroutine gs_crystal::gs_crystal_init ( class(gs_crystal_t), intent(inout this,
type(stack_i4_t), intent(inout send_pe,
type(stack_i4_t), intent(inout recv_pe 
)

Definition at line 100 of file gs_crystal.f90.

◆ gs_crystal_nbrecv()

subroutine gs_crystal::gs_crystal_nbrecv ( class(gs_crystal_t), intent(inout this,
integer, intent(in tag 
)
private

Definition at line 136 of file gs_crystal.f90.

◆ gs_crystal_nbrecv_vec()

subroutine gs_crystal::gs_crystal_nbrecv_vec ( class(gs_crystal_t), intent(inout this,
integer, intent(in tag,
integer, intent(in nc 
)
private

Definition at line 347 of file gs_crystal.f90.

◆ gs_crystal_nbsend()

subroutine gs_crystal::gs_crystal_nbsend ( class(gs_crystal_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 170 of file gs_crystal.f90.

◆ gs_crystal_nbsend_vec()

subroutine gs_crystal::gs_crystal_nbsend_vec ( class(gs_crystal_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 385 of file gs_crystal.f90.

◆ gs_crystal_nbwait()

subroutine gs_crystal::gs_crystal_nbwait ( class(gs_crystal_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 213 of file gs_crystal.f90.

◆ gs_crystal_nbwait_vec()

subroutine gs_crystal::gs_crystal_nbwait_vec ( class(gs_crystal_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 430 of file gs_crystal.f90.