Skip to content

Class TempLat::GhostUpdater

template <size_t NDim>

ClassList > TempLat > GhostUpdater

A class which updates the ghost cells in our total memory block. By having the LayoutStruct , this class knows what is the ghostDepth.More...

  • #include <ghostupdater.h>

Public Functions

Type Name
GhostUpdater (MPICartesianExchange exchange, LayoutStruct< NDim > layout)
void pUpdate_NOMPI (MemoryBlock< T, NDim > & block, device::Idx dimension=0)
void pUpdate_NOMPI_singleDim (MemoryBlock< T, NDim > & block, size_t dim)
Local periodic ghost copy for a single dimension (no MPI).
void update (MemoryBlock< T, NDim > & block)
void updateBatch (std::span< MemoryBlock< T, NDim > *const > blocks)
Coalesced ghost update of several equally-shaped blocks (the components of a multi-component field). All faces of a given dimension/direction are packed into one buffer and exchanged in a single message, cutting the per-component message and synchronization count. The dimension sweep stays sequential so corner/edge ghosts remain correct. A batch of one is byte-identical to update().
void update_forDimension_device (MemoryBlock< T, NDim > & block, size_t dimension)
void update_forDimension_device_batch (std::span< MemoryBlock< T, NDim > *const > blocks, size_t dimension)
Coalesced GPU exchange of one split dimension for several blocks. Each component's face is packed into the shared slab buffers at its own contiguous offset (c * total_size), so the whole batch travels as one exchange (one P2P pull / one MPI message of C*total_size elements) with a single pack fence and a single unpack fence, instead of C separate exchanges + 2C fences. The send buffers grow to C * maxSlab and re-publish their IPC handles once per new maximum C.
~GhostUpdater ()

Detailed Description

Has one public method, update<T>(T* ptr), which, based on LayoutStruct, uses the associated subarrays and performs the exchange up and down in all dimensions, through calls to MPICartesianExchange with the appriate datatypes for the subarrays.

Unit test: ctest -R test-ghostupdater

Public Functions Documentation

function GhostUpdater

inline TempLat::GhostUpdater::GhostUpdater (
    MPICartesianExchange exchange,
    LayoutStruct < NDim > layout
) 

function pUpdate_NOMPI

template<typename T>
inline void TempLat::GhostUpdater::pUpdate_NOMPI (
    MemoryBlock < T, NDim > & block,
    device::Idx dimension=0
) 

function pUpdate_NOMPI_singleDim

Local periodic ghost copy for a single dimension (no MPI).

template<typename T>
inline void TempLat::GhostUpdater::pUpdate_NOMPI_singleDim (
    MemoryBlock < T, NDim > & block,
    size_t dim
) 


function update

template<typename T>
inline void TempLat::GhostUpdater::update (
    MemoryBlock < T, NDim > & block
) 

function updateBatch

Coalesced ghost update of several equally-shaped blocks (the components of a multi-component field). All faces of a given dimension/direction are packed into one buffer and exchanged in a single message, cutting the per-component message and synchronization count. The dimension sweep stays sequential so corner/edge ghosts remain correct. A batch of one is byte-identical to update().

template<typename T>
inline void TempLat::GhostUpdater::updateBatch (
    std::span< MemoryBlock < T, NDim > *const > blocks
) 


function update_forDimension_device

template<typename T>
inline void TempLat::GhostUpdater::update_forDimension_device (
    MemoryBlock < T, NDim > & block,
    size_t dimension
) 

function update_forDimension_device_batch

Coalesced GPU exchange of one split dimension for several blocks. Each component's face is packed into the shared slab buffers at its own contiguous offset (c * total_size), so the whole batch travels as one exchange (one P2P pull / one MPI message of C*total_size elements) with a single pack fence and a single unpack fence, instead of C separate exchanges + 2C fences. The send buffers grow to C * maxSlab and re-publish their IPC handles once per new maximum C.

template<typename T>
inline void TempLat::GhostUpdater::update_forDimension_device_batch (
    std::span< MemoryBlock < T, NDim > *const > blocks,
    size_t dimension
) 


function ~GhostUpdater

inline TempLat::GhostUpdater::~GhostUpdater () 


The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/lattice/ghostcells/ghostupdater.h