|
core 0.5.0
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
|
#include <leaf_halo.hpp>
Public Types | |
| using | DO = DistributedOctree< Dim, Bits > |
| using | M = typename DO::M |
| using | Coord = typename DO::Coord |
| using | CoordArr = std::array< Coord, Dim > |
Public Member Functions | |
| void | init (DO &d) |
| Index | numLocal () const |
| Index | numGhosts () const |
| Index | extendedSize () const |
| MPI_Comm | comm () const |
| bool | wrap (std::array< long, Dim > &g) const |
| Wrap an unbounded global fine probe into the domain (in place); false = the probe exits a non-periodic axis (no neighbour there). | |
| Index | resolve (const CoordArr &gc) |
| Resolve a wrapped global fine coordinate to an extended slot: [0, nLocal) = the covering LOCAL leaf; [nLocal, nLocal+nGhost) = ghost slot; kPending = unknown remote (queued as a miss — run the collective resolveMisses() and repeat the build pass). | |
| Index | resolveGlobal (std::array< long, Dim > g) |
| Wrap + resolve from unbounded long coords; kNone on a non-periodic exit. | |
| Index | lookup (const CoordArr &gc) const |
| Const lookup against the FINALIZED registry (no miss registration): wrapped probe → local leaf or cached ghost slot; throws on an unknown remote coord — the caller's probe set must be a subset of what the registry was built with (e.g. | |
| Index | lookupGlobal (std::array< long, Dim > g) const |
| long | resolveMisses () |
| COLLECTIVE (all ranks together, misses or not): one owner coverLevels round resolving every queued miss to a canonical ghost slot (or a newly-discovered one). | |
| int | level (Index slot) const |
| Covering-leaf level of an extended slot (local octree level convention: 0 = finest cell). | |
| const CoordArr & | ghostCoord (Index g) const |
Global fine anchor (lo corner) of ghost g in [0, nGhosts) — for SDF sampling / multi-hop probe construction by the builders. | |
| void | finalize () |
| Freeze the ghost set and establish the owner↔ghost value topology (one NBX round; the owner-side locateGlobal happens here, once — never per exchange). | |
| const DO::GatherHaloTopology & | topology () const |
| void | exchangeHost (std::vector< double > &x, int tag=45) const |
| Host exchange: refresh x[nLocal, nLocal+nGhost) from the owners (x sized extendedSize()). | |
Static Public Attributes | |
| static constexpr Index | kPending = -2 |
| resolve(): queued as a miss (call resolveMisses) | |
| static constexpr Index | kNone = -1 |
| resolveGlobal(): exits a non-periodic axis | |
Definition at line 62 of file leaf_halo.hpp.
| using peclet::core::amr::LeafHalo< Dim, Bits >::DO = DistributedOctree<Dim, Bits> |
Definition at line 64 of file leaf_halo.hpp.
| using peclet::core::amr::LeafHalo< Dim, Bits >::M = typename DO::M |
Definition at line 65 of file leaf_halo.hpp.
| using peclet::core::amr::LeafHalo< Dim, Bits >::Coord = typename DO::Coord |
Definition at line 66 of file leaf_halo.hpp.
| using peclet::core::amr::LeafHalo< Dim, Bits >::CoordArr = std::array<Coord, Dim> |
Definition at line 67 of file leaf_halo.hpp.
|
inline |
Definition at line 72 of file leaf_halo.hpp.
References peclet::core::amr::DistributedOctree< Dim, Bits >::blockBrick(), peclet::core::amr::DistributedOctree< Dim, Bits >::blockFineOrigin(), peclet::core::amr::DistributedOctree< Dim, Bits >::globalFineSize(), peclet::core::amr::DistributedOctree< Dim, Bits >::local(), peclet::core::amr::BlockOctree< Dim, Bits >::numLeaves(), peclet::core::amr::DistributedOctree< Dim, Bits >::periodic(), peclet::core::amr::DistributedOctree< Dim, Bits >::rootSpan(), and peclet::core::amr::transferFieldGradients().
|
inline |
Definition at line 89 of file leaf_halo.hpp.
|
inline |
Definition at line 90 of file leaf_halo.hpp.
Referenced by peclet::core::amr::LeafHalo< Dim, Bits >::extendedSize().
|
inline |
Definition at line 91 of file leaf_halo.hpp.
References peclet::core::amr::LeafHalo< Dim, Bits >::numGhosts().
Referenced by peclet::core::amr::LeafHalo< Dim, Bits >::finalize().
|
inline |
Definition at line 92 of file leaf_halo.hpp.
References peclet::core::amr::DistributedOctree< Dim, Bits >::comm().
|
inline |
Wrap an unbounded global fine probe into the domain (in place); false = the probe exits a non-periodic axis (no neighbour there).
Definition at line 96 of file leaf_halo.hpp.
References peclet::core::amr::transferFieldGradients().
Referenced by peclet::core::amr::LeafHalo< Dim, Bits >::lookupGlobal(), and peclet::core::amr::LeafHalo< Dim, Bits >::resolveGlobal().
|
inline |
Resolve a wrapped global fine coordinate to an extended slot: [0, nLocal) = the covering LOCAL leaf; [nLocal, nLocal+nGhost) = ghost slot; kPending = unknown remote (queued as a miss — run the collective resolveMisses() and repeat the build pass).
Definition at line 111 of file leaf_halo.hpp.
References peclet::core::amr::BlockOctree< Dim, Bits >::find(), peclet::core::amr::LeafHalo< Dim, Bits >::kPending, peclet::core::amr::DistributedOctree< Dim, Bits >::local(), and peclet::core::amr::transferFieldGradients().
Referenced by peclet::core::amr::LeafHalo< Dim, Bits >::resolveGlobal().
|
inline |
Wrap + resolve from unbounded long coords; kNone on a non-periodic exit.
Definition at line 136 of file leaf_halo.hpp.
References peclet::core::amr::LeafHalo< Dim, Bits >::kNone, peclet::core::amr::LeafHalo< Dim, Bits >::resolve(), peclet::core::amr::transferFieldGradients(), and peclet::core::amr::LeafHalo< Dim, Bits >::wrap().
|
inline |
Const lookup against the FINALIZED registry (no miss registration): wrapped probe → local leaf or cached ghost slot; throws on an unknown remote coord — the caller's probe set must be a subset of what the registry was built with (e.g.
the pressure MG's level-0 ±1 face probes against the flow's ±2 registry).
Definition at line 149 of file leaf_halo.hpp.
References peclet::core::amr::BlockOctree< Dim, Bits >::find(), peclet::core::amr::DistributedOctree< Dim, Bits >::local(), and peclet::core::amr::transferFieldGradients().
Referenced by peclet::core::amr::LeafHalo< Dim, Bits >::lookupGlobal().
|
inline |
Definition at line 169 of file leaf_halo.hpp.
References peclet::core::amr::LeafHalo< Dim, Bits >::kNone, peclet::core::amr::LeafHalo< Dim, Bits >::lookup(), peclet::core::amr::transferFieldGradients(), and peclet::core::amr::LeafHalo< Dim, Bits >::wrap().
|
inline |
COLLECTIVE (all ranks together, misses or not): one owner coverLevels round resolving every queued miss to a canonical ghost slot (or a newly-discovered one).
Returns the GLOBAL number of coords that were pending — drive the builders' fixpoint: for (;;) { attempt build; if (halo.resolveMisses() == 0) break; }
Definition at line 182 of file leaf_halo.hpp.
References peclet::core::amr::DistributedOctree< Dim, Bits >::comm(), peclet::core::amr::DistributedOctree< Dim, Bits >::coverLevels(), MPI_Allreduce(), MPI_LONG, MPI_SUM, and peclet::core::amr::transferFieldGradients().
|
inline |
Covering-leaf level of an extended slot (local octree level convention: 0 = finest cell).
Definition at line 221 of file leaf_halo.hpp.
References peclet::core::amr::BlockOctree< Dim, Bits >::level(), and peclet::core::amr::DistributedOctree< Dim, Bits >::local().
|
inline |
Global fine anchor (lo corner) of ghost g in [0, nGhosts) — for SDF sampling / multi-hop probe construction by the builders.
Definition at line 228 of file leaf_halo.hpp.
|
inline |
Freeze the ghost set and establish the owner↔ghost value topology (one NBX round; the owner-side locateGlobal happens here, once — never per exchange).
Definition at line 234 of file leaf_halo.hpp.
References peclet::core::amr::DistributedOctree< Dim, Bits >::buildGatherHaloTopology(), peclet::core::amr::LeafHalo< Dim, Bits >::extendedSize(), and peclet::core::amr::transferFieldGradients().
|
inline |
Definition at line 253 of file leaf_halo.hpp.
|
inline |
Host exchange: refresh x[nLocal, nLocal+nGhost) from the owners (x sized extendedSize()).
Values are unmodified copies of the owner's doubles (bit-exact by construction).
Definition at line 257 of file leaf_halo.hpp.
References peclet::core::amr::DistributedOctree< Dim, Bits >::comm(), MPI_BYTE, MPI_Irecv(), MPI_Isend(), MPI_STATUSES_IGNORE, MPI_Waitall(), and peclet::core::amr::transferFieldGradients().
|
staticconstexpr |
resolve(): queued as a miss (call resolveMisses)
Definition at line 69 of file leaf_halo.hpp.
Referenced by peclet::core::amr::LeafHalo< Dim, Bits >::resolve().
|
staticconstexpr |
resolveGlobal(): exits a non-periodic axis
Definition at line 70 of file leaf_halo.hpp.
Referenced by peclet::core::amr::LeafHalo< Dim, Bits >::lookupGlobal(), and peclet::core::amr::LeafHalo< Dim, Bits >::resolveGlobal().