Struct TempLat::FFTTopology
template <size_t NDim>
ClassList > TempLat > FFTTopology
The complete MPI topology an FFT backend will use: not just the grid shape, but the communicator whose rank order defines it and this rank's position within it. More...
#include <ffttopology.h>
Public Attributes
| Type | Name |
|---|---|
| MPICommReference | comm |
| std::array< int, NDim > | coords = {} |
| std::array< int, NDim > | dims = {} |
| int | nDimsToSplit = 0 |
Public Functions
| Type | Name |
|---|---|
| void | checkInvariants (int commSize) const Reject a topology that would violate the invariants the rest of TempLat relies on. |
| FFTDecomposition< NDim > | decomposition () const Shape-only view, for the call sites that genuinely only need the grid. |
| std::vector< int > | dimsVector () const |
Detailed Description
This exists because shape agreement is not enough. TempLat and the FFT backend used to build Cartesian communicators independently, both with reorder = 1, and reconcile them by comparing grid shape only. But the local starts installed into the layout are derived from the backend's coordinates, while ghost neighbours come from MPI_Cart_shift on TempLat's communicator. Nothing forced the two rank->coordinate mappings to agree; it worked only because mainstream MPI implementations ignore reorder. When they disagree, subdomain boundaries silently exchange the wrong data.
So the backend is the single source of truth. It reports the communicator it will actually plan on, and MPICartesianGroup builds its grid over that communicator with reorder = false, then verifies the coordinates it computes match coords below.
Fields:
* comm: the communicator the backend plans on. Its rank order is authoritative. For ParaFaFT this is a duplicate of its internal Cartesian communicator; for FFTW and KokkosFFT, which build no Cartesian topology of their own, it is the base communicator.
* dims: grid shape, one entry per lattice dimension, trailing 1s for undistributed axes.
* coords: this rank's coordinates in that grid. Undistributed axes are 0.
* nDimsToSplit: number of dimensions actually distributed (entries of dims greater than 1).
Public Attributes Documentation
variable comm
variable coords
variable dims
variable nDimsToSplit
Public Functions Documentation
function checkInvariants
Reject a topology that would violate the invariants the rest of TempLat relies on.
Call this at every point a topology is produced, so a backend change fails loudly at startup rather than corrupting data or output later.
Not named verify: that is a function-like macro in TempLat/util/tdd/tddmacros.h.
function decomposition
Shape-only view, for the call sites that genuinely only need the grid.
function dimsVector
The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/fft/ffttopology.h