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

#include <grid_halo_topology.hpp>

Classes

struct  FlatTopology
 

Public Member Functions

 GridHaloTopology ()=default
 
void buildTopology (const decomp::BlockDecomposer< Dim > &dec, int rank, int ghostWidth, const std::array< bool, Dim > &periodic, MPI_Comm comm=MPI_COMM_WORLD)
 Build the halo topology for rank's block of dec, with the given ghost width and per-axis periodicity.
 
template<typename Field >
void start (Field &field, int tag=0)
 Post all sends/recvs; returns immediately so the caller can compute the block interior.
 
template<typename Field >
void wait (Field &field)
 Complete a started exchange: wait for receives and scatter them into the ghost cells.
 
template<typename Field >
void exchangeNbx (Field &field, int tag=0)
 Convenience: full blocking exchange via the NBX-style engine (start + wait).
 
template<typename Field >
void exchangePersistent (Field &field)
 Full exchange via MPI_Neighbor_alltoallv on a cached distributed-graph communicator.
 
template<typename Field >
void reverseAdd (Field &field, int tag=0)
 
FlatTopology flatten () const
 
const decomp::BlockIndexer< Dim > & indexer () const
 
std::size_t numNeighbors () const
 
std::size_t numGhostRecv () const
 
 ~GridHaloTopology ()
 
 GridHaloTopology (const GridHaloTopology &)=delete
 
GridHaloTopologyoperator= (const GridHaloTopology &)=delete
 

Detailed Description

template<int Dim>
class peclet::core::halo::GridHaloTopology< Dim >

Definition at line 48 of file grid_halo_topology.hpp.

Constructor & Destructor Documentation

◆ GridHaloTopology() [1/2]

template<int Dim>
peclet::core::halo::GridHaloTopology< Dim >::GridHaloTopology ( )
default

◆ ~GridHaloTopology()

template<int Dim>
peclet::core::halo::GridHaloTopology< Dim >::~GridHaloTopology ( )
inline

Definition at line 304 of file grid_halo_topology.hpp.

◆ GridHaloTopology() [2/2]

template<int Dim>
peclet::core::halo::GridHaloTopology< Dim >::GridHaloTopology ( const GridHaloTopology< Dim > &  )
delete

Member Function Documentation

◆ buildTopology()

template<int Dim>
void peclet::core::halo::GridHaloTopology< Dim >::buildTopology ( const decomp::BlockDecomposer< Dim > &  dec,
int  rank,
int  ghostWidth,
const std::array< bool, Dim > &  periodic,
MPI_Comm  comm = MPI_COMM_WORLD 
)
inline

Build the halo topology for rank's block of dec, with the given ghost width and per-axis periodicity.

Communicates once (NBX) to establish matched send lists.

Definition at line 54 of file grid_halo_topology.hpp.

References peclet::core::wrap().

◆ start()

template<int Dim>
template<typename Field >
void peclet::core::halo::GridHaloTopology< Dim >::start ( Field field,
int  tag = 0 
)
inline

Post all sends/recvs; returns immediately so the caller can compute the block interior.

Definition at line 138 of file grid_halo_topology.hpp.

References MPI_BYTE, MPI_Irecv(), MPI_Isend(), and MPI_REQUEST_NULL.

Referenced by peclet::core::halo::GridHaloTopology< Dim >::exchangeNbx().

◆ wait()

template<int Dim>
template<typename Field >
void peclet::core::halo::GridHaloTopology< Dim >::wait ( Field field)
inline

Complete a started exchange: wait for receives and scatter them into the ghost cells.

Definition at line 167 of file grid_halo_topology.hpp.

References MPI_STATUS_IGNORE, MPI_STATUSES_IGNORE, MPI_UNDEFINED, MPI_Waitall(), and MPI_Waitany().

Referenced by peclet::core::halo::GridHaloTopology< Dim >::exchangeNbx().

◆ exchangeNbx()

template<int Dim>
template<typename Field >
void peclet::core::halo::GridHaloTopology< Dim >::exchangeNbx ( Field field,
int  tag = 0 
)
inline

Convenience: full blocking exchange via the NBX-style engine (start + wait).

Definition at line 186 of file grid_halo_topology.hpp.

References peclet::core::halo::GridHaloTopology< Dim >::start(), and peclet::core::halo::GridHaloTopology< Dim >::wait().

◆ exchangePersistent()

template<int Dim>
template<typename Field >
void peclet::core::halo::GridHaloTopology< Dim >::exchangePersistent ( Field field)
inline

Full exchange via MPI_Neighbor_alltoallv on a cached distributed-graph communicator.

Fastest for the fixed neighbour pattern of a static grid. Identical result to exchangeNbx.

Definition at line 197 of file grid_halo_topology.hpp.

References MPI_BYTE, and MPI_Neighbor_alltoallv().

◆ reverseAdd()

template<int Dim>
template<typename Field >
void peclet::core::halo::GridHaloTopology< Dim >::reverseAdd ( Field field,
int  tag = 0 
)
inline

◆ flatten()

◆ indexer()

template<int Dim>
const decomp::BlockIndexer< Dim > & peclet::core::halo::GridHaloTopology< Dim >::indexer ( ) const
inline

Definition at line 295 of file grid_halo_topology.hpp.

◆ numNeighbors()

template<int Dim>
std::size_t peclet::core::halo::GridHaloTopology< Dim >::numNeighbors ( ) const
inline

Definition at line 296 of file grid_halo_topology.hpp.

◆ numGhostRecv()

template<int Dim>
std::size_t peclet::core::halo::GridHaloTopology< Dim >::numGhostRecv ( ) const
inline

Definition at line 297 of file grid_halo_topology.hpp.

◆ operator=()


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