|
core 1.5.0
Shared MPI block decomposition, asynchronous ghost-layer exchange, SDF geometry, load balancing (header-only C++20)
|
Namespaces | |
| namespace | detail |
Classes | |
| struct | DomainMap |
| Physical-space layout that maps a position to a global cell of the decomposition. More... | |
| struct | GridFieldView |
A contiguous local array of T (one per cell of the extended block) viewed as a packable field. More... | |
| class | GridHalo |
GPU ghost-layer exchange for a contiguous device field peclet::core::View<T> (one element per extended-block cell). More... | |
| class | GridHaloTopology |
| class | NbxEngine |
| class | ParticleHalo |
| class | ParticleHaloTopology |
| class | ParticleMigrator |
| class | ParticleMigratorView |
| Device counterpart of ParticleMigrator. 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). | |
| 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::decomp::BlockDecomposer< Dim >::globalSize(), peclet::core::decomp::BlockDecomposer< Dim >::init(), peclet::core::decomp::BlockDecomposer< Dim >::linearGlobal(), MPI_Allreduce(), MPI_Comm_size(), MPI_DOUBLE, and MPI_SUM.