xcompact3d / x3d2

https://xcompact3d.github.io/x3d2
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

Use 3D FFT transforms directly and drop the current 1D decomposition capable strategy #83

Closed semi-h closed 4 months ago

semi-h commented 5 months ago

We're moving away from doing our own FFTs using our specialist data structure to carry out 3D FFT transforms. The strategy CUDA backend implements prior to this PR was capable of being extended to 1D decomposition (already done earlier for the Thomas based approach), and as it was limited to 1D it was possible to take advantage of this for some optimisations. However, the distributed tridiagonal solver we have necessitates each slab/pencil to have certain amount of thickness, which limits a 1D decomposition strategy for going above 2k^3 ~ 4k^3 domain sizes.

This important shift in strategy was already mentioned in #32, and also #73.

The changes implemented up to so far includes switching from specialist data structure to cartesian data structure so that distributed FFT libraries can be used easily.

And currently, there is a bug in CUDA backend in poisson_fft that prevents running with different nx, ny, nz sizes. Possibly due to 3D FFT transform halving a dimension that is different than the current implementation assumes. Should be fixed soon as its not a big deal. Fixed.

Closes #73.