|
core 1.5.0
Shared MPI block decomposition, asynchronous ghost-layer exchange, SDF geometry, load balancing (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, bool allImages=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 37 of file particle_halo_topology.hpp.
|
inline |
Bind to a migrator (provides the decomposition, domain map, rank and comm).
Definition at line 40 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).
allImages changes what the CROSS-RANK exchange sends. Off (the default), each owned particle goes to each other rank at most once, at the single periodic image nearest that rank's block (withinRcutOfBlock). On a periodic axis the ORB leaves undecomposed, that nearest image is always the unshifted one (its gap on the axis is 0), so a wrapped image inside rcut is never sent. On, EVERY periodic image of the particle within rcut of rank r's block is sent (imagesWithinRcutOfBlock with the identity allowed), one send entry per image: the same owned index may then appear several times in one rank's send list, each with its own shift, and a receiver identifies a ghost by (owner id, shift). Every exchange works per entry, so forwardPositions places each image, and reverse sums every image's contribution onto the owner. The shift of an allImages entry is exactly 0 or +-L per axis. Off => byte-identical to the one-image behaviour.
Definition at line 65 of file particle_halo_topology.hpp.
References peclet::core::halo::ParticleHaloTopology< Dim >::forwardPositions(), and MPI_Comm_size().
|
inline |
Definition at line 183 of file particle_halo_topology.hpp.
|
inline |
Definition at line 184 of file particle_halo_topology.hpp.
Referenced by peclet::core::halo::ParticleHalo< Dim >::init().
|
inline |
Definition at line 185 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 190 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 205 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 219 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 279 of file particle_halo_topology.hpp.
Referenced by peclet::core::halo::ParticleHalo< Dim >::init().
|
inline |
Definition at line 302 of file particle_halo_topology.hpp.
References peclet::core::halo::ParticleHaloTopology< Dim >::FlatTopo::sendRanks.
Referenced by peclet::core::halo::ParticleHalo< Dim >::init().