|
core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
|
#include <block_decomposer.hpp>
Public Member Functions | |
| BlockDecomposer ()=default | |
| BlockDecomposer (std::size_t numBlocks, IVec< Dim > globalSize) | |
| BlockDecomposer (std::size_t numBlocks, IVec< Dim > globalSize, const std::vector< Real > &weights) | |
| void | init (std::size_t numBlocks, IVec< Dim > globalSize) |
Build the decomposition of a globalSize cell grid into numBlocks blocks (equal cell count). | |
| void | init (std::size_t numBlocks, IVec< Dim > globalSize, const std::vector< Real > &weights) |
| Weighted ORB: balance the total weight per block instead of the cell count. | |
| std::size_t | numBlocks () const |
| const IVec< Dim > & | globalSize () const |
| const std::vector< IVec< Dim > > & | origins () const |
| const std::vector< IVec< Dim > > & | sizes () const |
| Block< Dim > | block (std::size_t b) const |
| int | ownerOf (const IVec< Dim > &g) const |
| Owning block index of a global cell coordinate. Caller must wrap into [0, globalSize) first. | |
| void | flattenTree (std::vector< int > &splitDim, std::vector< Index > &splitVal) const |
Flatten the implicit ORB tree into two parallel arrays for a device-callable ownerOf: for node i, splitDim[i] is the split axis (−1 ⇒ leaf), splitVal[i] the split coordinate (internal) or the block index (leaf); children sit at 2i+1 / 2i+2. | |
| Index | linearGlobal (const IVec< Dim > &g) const |
| Global multi-index -> global linear index (x-fastest: I = x + y*nx + z*nx*ny). | |
| IVec< Dim > | multiGlobal (Index lin) const |
| Global linear index -> global multi-index (inverse of linearGlobal). | |
Definition at line 28 of file block_decomposer.hpp.
|
default |
|
inline |
Definition at line 31 of file block_decomposer.hpp.
References peclet::core::decomp::BlockDecomposer< Dim >::globalSize(), peclet::core::decomp::BlockDecomposer< Dim >::init(), and peclet::core::decomp::BlockDecomposer< Dim >::numBlocks().
|
inline |
Definition at line 32 of file block_decomposer.hpp.
References peclet::core::decomp::BlockDecomposer< Dim >::globalSize(), peclet::core::decomp::BlockDecomposer< Dim >::init(), and peclet::core::decomp::BlockDecomposer< Dim >::numBlocks().
|
inline |
Build the decomposition of a globalSize cell grid into numBlocks blocks (equal cell count).
Definition at line 38 of file block_decomposer.hpp.
References peclet::core::decomp::BlockDecomposer< Dim >::globalSize(), and peclet::core::decomp::BlockDecomposer< Dim >::numBlocks().
Referenced by peclet::core::decomp::BlockDecomposer< Dim >::BlockDecomposer(), and peclet::core::decomp::BlockDecomposer< Dim >::BlockDecomposer().
|
inline |
Weighted ORB: balance the total weight per block instead of the cell count.
weights is a per-cell weight array over the global grid (size == product(globalSize), x-fastest). Each split is placed on the integer cell boundary whose cumulative weight is closest to the sub-block's target fraction. Reduces bit-exactly to the unweighted init() when all weights are equal.
Definition at line 47 of file block_decomposer.hpp.
References peclet::core::decomp::BlockDecomposer< Dim >::globalSize(), and peclet::core::decomp::BlockDecomposer< Dim >::numBlocks().
|
inline |
Definition at line 58 of file block_decomposer.hpp.
Referenced by peclet::core::decomp::BlockDecomposer< Dim >::BlockDecomposer(), peclet::core::decomp::BlockDecomposer< Dim >::BlockDecomposer(), peclet::core::decomp::BlockDecomposer< Dim >::init(), and peclet::core::decomp::BlockDecomposer< Dim >::init().
|
inline |
Definition at line 59 of file block_decomposer.hpp.
Referenced by peclet::core::decomp::BlockDecomposer< Dim >::BlockDecomposer(), peclet::core::decomp::BlockDecomposer< Dim >::BlockDecomposer(), peclet::core::decomp::BlockDecomposer< Dim >::init(), and peclet::core::decomp::BlockDecomposer< Dim >::init().
|
inline |
Definition at line 60 of file block_decomposer.hpp.
|
inline |
Definition at line 61 of file block_decomposer.hpp.
|
inline |
Definition at line 63 of file block_decomposer.hpp.
|
inline |
Owning block index of a global cell coordinate. Caller must wrap into [0, globalSize) first.
Definition at line 66 of file block_decomposer.hpp.
|
inline |
Flatten the implicit ORB tree into two parallel arrays for a device-callable ownerOf: for node i, splitDim[i] is the split axis (−1 ⇒ leaf), splitVal[i] the split coordinate (internal) or the block index (leaf); children sit at 2i+1 / 2i+2.
Uploaded once by ParticleMigratorView so the per-particle owner lookup runs on the device (D1). Mirrors ownerOf exactly.
Definition at line 79 of file block_decomposer.hpp.
|
inline |
Global multi-index -> global linear index (x-fastest: I = x + y*nx + z*nx*ny).
Definition at line 89 of file block_decomposer.hpp.
|
inline |
Global linear index -> global multi-index (inverse of linearGlobal).
Definition at line 99 of file block_decomposer.hpp.