|
core 1.8.1
Shared MPI block decomposition, asynchronous ghost-layer exchange, SDF geometry, load balancing (header-only C++20)
|
Namespaces | |
| namespace | detail |
Classes | |
| class | GridHalo |
| GPU ghost-layer exchange for a contiguous device field peclet::core::View<T> (one element per extended-block cell). More... | |
| struct | GridFieldView |
| A contiguous local array of T (one per cell of the extended block) viewed as a packable field. More... | |
| class | GridHaloTopology |
| class | NbxEngine |
| class | ParticleHalo |
| class | ParticleHaloTopology |
| struct | DomainMap |
| Physical-space layout that maps a position to a global cell of the decomposition. More... | |
| class | ParticleMigrator |
| class | ParticleMigratorView |
| Device counterpart of ParticleMigrator. More... | |
Enumerations | |
| enum class | Neighborhood { Full , Faces } |
| Which ghost cells a topology fills. More... | |
Functions | |
| template<int Dim> | |
| std::size_t | rebalanceByParticleCount (decomp::BlockDecomposer< Dim > &dec, ParticleMigrator< Dim > &mig, std::vector< typename detail::NonDeduced< Vec< Dim > >::type > &pos, std::vector< char > &payload, std::size_t stride, MPI_Comm comm=MPI_COMM_WORLD, std::vector< double > *weightOut=nullptr) |
| Re-decompose dec so each block holds a near-equal particle count, then migrate the particles (positions + opaque fixed-stride payload) to their new owners via mig (which must reference dec). | |
Variables | |
| constexpr Index | kHaloSerialCopy = 2048 |
| Host memory space only: a gather (self-copy + pack) or an unpack of at most this many elements runs as a plain loop on the calling thread, not as a parallel region. | |
| constexpr int | kHaloShmSpin = 256 |
| Host memory space, on-node shared-memory transport: a wait on a partner's flag polls this many times (with a CPU pause) between yields of the time slice. | |
|
strong |
Which ghost cells a topology fills.
Full (the default): every ghost cell, edges and corners included. Faces: only ghost cells with exactly ONE coordinate outside the inner block — the cells a face-neighbour (7-point) stencil reads; edge and corner ghosts are left untouched.
| Enumerator | |
|---|---|
| Full | |
| Faces | |
Definition at line 52 of file grid_halo_topology.hpp.
| std::size_t peclet::core::halo::rebalanceByParticleCount | ( | decomp::BlockDecomposer< Dim > & | dec, |
| ParticleMigrator< Dim > & | mig, | ||
| std::vector< typename detail::NonDeduced< Vec< Dim > >::type > & | pos, | ||
| std::vector< char > & | payload, | ||
| std::size_t | stride, | ||
| MPI_Comm | comm = MPI_COMM_WORLD, | ||
| std::vector< double > * | weightOut = nullptr ) |
Re-decompose dec so each block holds a near-equal particle count, then migrate the particles (positions + opaque fixed-stride payload) to their new owners via mig (which must reference dec).
weightOut, when non-null, receives the agreed global per-cell count grid (x-fastest). Returns this rank's new local particle count. (pos is a non-deduced parameter — Dim is fixed by dec/mig — because int Dim cannot deduce from a std::array's size_t bound.)
Collective on comm: one MPI_Allreduce of the global per-cell count grid (size product(globalSize) doubles — mind it on a fine decomposition grid) and the migration's NBX round. payload holds stride bytes per particle. The new partition is the unaligned weighted ORB init(numBlocks, globalSize, weights); the coarse-first aligned form (init(…, weights, align) / chooseAlignedWeighted) is not used here.
Definition at line 47 of file particle_rebalance.hpp.
References peclet::core::halo::ParticleMigrator< Dim >::cellOf(), peclet::core::decomp::BlockDecomposer< Dim >::globalSize(), peclet::core::decomp::BlockDecomposer< Dim >::init(), peclet::core::decomp::BlockDecomposer< Dim >::linearGlobal(), peclet::core::halo::ParticleMigrator< Dim >::migrate(), MPI_Allreduce(), MPI_Comm_size(), MPI_COMM_WORLD, MPI_DOUBLE, and MPI_SUM.
|
inlineconstexpr |
Host memory space only: a gather (self-copy + pack) or an unpack of at most this many elements runs as a plain loop on the calling thread, not as a parallel region.
A few hundred halo elements cost far less to copy than one fork/join of the OpenMP pool. Bitwise-neutral (a copy is a copy); device builds always launch.
Definition at line 190 of file grid_halo.hpp.
Referenced by peclet::core::halo::GridHalo< T >::exchangeBegin(), and peclet::core::halo::GridHalo< T >::exchangeEnd().
|
inlineconstexpr |
Host memory space, on-node shared-memory transport: a wait on a partner's flag polls this many times (with a CPU pause) between yields of the time slice.
Bitwise-neutral (it only decides how a wait spends its time).
Definition at line 195 of file grid_halo.hpp.