core 0.5.0
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
Loading...
Searching...
No Matches
peclet::core::halo::GridHalo< T > Class Template Reference

GPU ghost-layer exchange for a contiguous device field peclet::core::View<T> (one element per extended-block cell). More...

#include <grid_halo.hpp>

Public Member Functions

 GridHalo ()=default
 
 GridHalo (const GridHalo &)=delete
 
GridHalooperator= (const GridHalo &)=delete
 
template<int Dim>
void init (const GridHaloTopology< Dim > &halo)
 
void exchange (const View< T > &field, int tag=0)
 Exchange ghost layers of the device field field. Blocking (== exchangeBegin+exchangeEnd).
 
void exchangeBegin (const View< T > &field, int tag=0)
 Start an exchange: periodic self-copy, device pack, post Isend/Irecv, return with the messages in flight.
 
void exchangeEnd (const View< T > &field)
 Complete the exchange started by exchangeBegin: wait, then scatter the received halo cells into field's ghost region (must be the same field).
 

Detailed Description

template<class T>
class peclet::core::halo::GridHalo< T >

GPU ghost-layer exchange for a contiguous device field peclet::core::View<T> (one element per extended-block cell).

Build once from a host GridHaloTopology via init(); exchange() runs every step.

Definition at line 125 of file grid_halo.hpp.

Constructor & Destructor Documentation

◆ GridHalo() [1/2]

template<class T >
peclet::core::halo::GridHalo< T >::GridHalo ( )
default

◆ GridHalo() [2/2]

template<class T >
peclet::core::halo::GridHalo< T >::GridHalo ( const GridHalo< T > &  )
delete

Member Function Documentation

◆ operator=()

template<class T >
GridHalo & peclet::core::halo::GridHalo< T >::operator= ( const GridHalo< T > &  )
delete

◆ init()

template<class T >
template<int Dim>
void peclet::core::halo::GridHalo< T >::init ( const GridHaloTopology< Dim > &  halo)
inline

◆ exchange()

template<class T >
void peclet::core::halo::GridHalo< T >::exchange ( const View< T > &  field,
int  tag = 0 
)
inline

Exchange ghost layers of the device field field. Blocking (== exchangeBegin+exchangeEnd).

Definition at line 166 of file grid_halo.hpp.

References peclet::core::halo::GridHalo< T >::exchangeBegin(), and peclet::core::halo::GridHalo< T >::exchangeEnd().

◆ exchangeBegin()

template<class T >
void peclet::core::halo::GridHalo< T >::exchangeBegin ( const View< T > &  field,
int  tag = 0 
)
inline

Start an exchange: periodic self-copy, device pack, post Isend/Irecv, return with the messages in flight.

The caller may run kernels that touch only INNER (non-ghost, non-send) cells before exchangeEnd — that overlap is the point of the split. One exchange may be in flight per GridHalo instance.

Definition at line 175 of file grid_halo.hpp.

References peclet::core::halo::detail::gpuAwareMpi(), MPI_BYTE, MPI_Irecv(), and MPI_Isend().

Referenced by peclet::core::halo::GridHalo< T >::exchange().

◆ exchangeEnd()

template<class T >
void peclet::core::halo::GridHalo< T >::exchangeEnd ( const View< T > &  field)
inline

Complete the exchange started by exchangeBegin: wait, then scatter the received halo cells into field's ghost region (must be the same field).

Definition at line 219 of file grid_halo.hpp.

References MPI_STATUSES_IGNORE, and MPI_Waitall().

Referenced by peclet::core::halo::GridHalo< T >::exchange().


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