core 1.8.1
Shared MPI block decomposition, asynchronous ghost-layer exchange, SDF geometry, load balancing (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, Neighborhood nb=Neighborhood::Full, int depth=-1)
 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
GridHaloTopology & operator= (const GridHaloTopology &)=delete

Detailed Description

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

Definition at line 55 of file grid_halo_topology.hpp.

Constructor & Destructor Documentation

◆ GridHaloTopology() [1/2]

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

Referenced by GridHaloTopology(), and operator=().

◆ ~GridHaloTopology()

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

Definition at line 380 of file grid_halo_topology.hpp.

◆ GridHaloTopology() [2/2]

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

References GridHaloTopology().

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,
Neighborhood nb = Neighborhood::Full,
int depth = -1 )
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. nb = Faces keeps only the face ghosts (see Neighborhood). depth in [0, ghostWidth) fills only the ghost cells within depth cells of the inner block on every axis (the block keeps its ghostWidth layout; the outer ghosts are left untouched); the default -1 fills the full ghost width.

Definition at line 64 of file grid_halo_topology.hpp.

References peclet::core::halo::NbxEngine::exchange(), peclet::core::halo::Faces, peclet::core::halo::Full, peclet::core::decomp::BlockDecomposer< Dim >::globalSize(), peclet::core::decomp::BlockDecomposer< Dim >::linearGlobal(), MPI_Allreduce(), MPI_COMM_WORLD, MPI_LONG, MPI_SUM, peclet::core::decomp::BlockDecomposer< Dim >::multiGlobal(), peclet::core::decomp::BlockDecomposer< Dim >::origins(), peclet::core::decomp::BlockDecomposer< Dim >::ownerOf(), peclet::core::decomp::BlockDecomposer< Dim >::sizes(), and 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 184 of file grid_halo_topology.hpp.

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

Referenced by 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 213 of file grid_halo_topology.hpp.

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

Referenced by 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 232 of file grid_halo_topology.hpp.

References start(), and 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 243 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 371 of file grid_halo_topology.hpp.

◆ numNeighbors()

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

Definition at line 372 of file grid_halo_topology.hpp.

◆ numGhostRecv()

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

Definition at line 373 of file grid_halo_topology.hpp.

◆ operator=()

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

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