|
core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
|
#include <particle_halo_topology.hpp>
Classes | |
| struct | FlatTopo |
Public Member Functions | |
| void | init (const ParticleMigrator< Dim > &mig) |
| Bind to a migrator (provides the decomposition, domain map, rank and comm). | |
| void | build (const std::vector< Vec< Dim > > &pos, double rcut, bool includePeriodicSelf=false) |
(Re)establish the owner<->ghost correspondence: every owned particle within rcut of another rank's block becomes a ghost there. | |
| std::size_t | numOwned () const |
| std::size_t | numGhost () const |
| const std::vector< Vec< Dim > > & | ghostPositions () const |
| void | forwardPositions (const Vec< Dim > *owned, Vec< Dim > *ghost) |
| owned[N] -> ghost[G], with the periodic image shift added (use for positions). | |
| template<typename T > | |
| void | forward (const T *owned, T *ghost) |
| owned[N] -> ghost[G], verbatim (translation-invariant fields: velocity, id, radius, ...). | |
| template<typename T > | |
| void | reverse (const T *ghost, T *owned) |
| ghost[G] -> owned[N], accumulated (T must have operator+=). | |
| MPI_Comm | comm () const |
| FlatTopo | flatten () const |
Definition at line 36 of file particle_halo_topology.hpp.
|
inline |
Bind to a migrator (provides the decomposition, domain map, rank and comm).
Definition at line 39 of file particle_halo_topology.hpp.
|
inline |
(Re)establish the owner<->ghost correspondence: every owned particle within rcut of another rank's block becomes a ghost there.
Call after migration / on neighbour-list rebuild.
includePeriodicSelf additionally emits LOCAL periodic self-ghosts: copies of an owned particle at its own periodic image(s) that fall within rcut of THIS rank's own block. They are needed when a rank borders itself across a periodic face — i.e. an undecomposed periodic axis (a "×1" ORB axis, e.g. the z of a 2×2×1 layout) or np=1 — where the periodic neighbour is owned by the same rank and so is never produced by the cross-rank exchange. Off by default => byte-identical to the cross-rank-only behaviour (no self-ghosts, no MPI self-messages). Self-ghosts occupy the ghost slots AFTER the received ones ([numReceived, numGhost)) and are filled locally (no MPI).
Definition at line 52 of file particle_halo_topology.hpp.
References peclet::core::halo::ParticleHaloTopology< Dim >::forwardPositions(), and MPI_Comm_size().
|
inline |
Definition at line 142 of file particle_halo_topology.hpp.
|
inline |
Definition at line 143 of file particle_halo_topology.hpp.
Referenced by peclet::core::halo::ParticleHalo< Dim >::init().
|
inline |
Definition at line 144 of file particle_halo_topology.hpp.
|
inline |
owned[N] -> ghost[G], with the periodic image shift added (use for positions).
Direct point-to-point over the topology fixed by build() (no NBX consensus) – this is the per-iteration hot path, so it must not pay the dynamic-discovery cost every call.
Definition at line 149 of file particle_halo_topology.hpp.
Referenced by peclet::core::halo::ParticleHaloTopology< Dim >::build().
|
inline |
owned[N] -> ghost[G], verbatim (translation-invariant fields: velocity, id, radius, ...).
Definition at line 164 of file particle_halo_topology.hpp.
|
inline |
ghost[G] -> owned[N], accumulated (T must have operator+=).
Use for forces/torques/fluxes: each ghost's partial contribution is summed onto its owner. Owner array is added to in place.
Definition at line 178 of file particle_halo_topology.hpp.
References MPI_BYTE, MPI_Irecv(), MPI_Isend(), MPI_REQUEST_NULL, MPI_STATUSES_IGNORE, and MPI_Waitall().
|
inline |
Definition at line 238 of file particle_halo_topology.hpp.
Referenced by peclet::core::halo::ParticleHalo< Dim >::init().
|
inline |
Definition at line 257 of file particle_halo_topology.hpp.
References peclet::core::halo::ParticleHaloTopology< Dim >::FlatTopo::sendRanks.
Referenced by peclet::core::halo::ParticleHalo< Dim >::init().