Skip to content

Commit d791eed

Browse files
committed
amrex::FFT
Add parallel FFT capability to AMReX. It relies on FFTW3, cuFFT, rocFFT and oneMKL, for CPU, CUDA, HIP and SYCL builds, respectively.
1 parent 62c2a81 commit d791eed

32 files changed

+1018
-10
lines changed

.github/workflows/apps.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ jobs:
9595
-DWarpX_OPENPMD=OFF \
9696
-DCMAKE_VERBOSE_MAKEFILE=ON \
9797
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
98+
-DAMReX_FFT=ON \
9899
-DAMReX_LINEAR_SOLVER_INCFLO=OFF
99100
cmake --build WarpX/build -j 4
100101

.github/workflows/clang.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
-DCMAKE_BUILD_TYPE=Debug \
4545
-DCMAKE_VERBOSE_MAKEFILE=ON \
4646
-DCMAKE_INSTALL_PREFIX=/tmp/my-amrex \
47+
-DAMReX_FFT=ON \
4748
-DAMReX_EB=ON \
4849
-DAMReX_FORTRAN=ON \
4950
-DAMReX_MPI=OFF \
@@ -104,6 +105,7 @@ jobs:
104105
cmake .. \
105106
-DCMAKE_BUILD_TYPE=Debug \
106107
-DCMAKE_VERBOSE_MAKEFILE=ON \
108+
-DAMReX_FFT=ON \
107109
-DAMReX_EB=ON \
108110
-DAMReX_ENABLE_TESTS=ON \
109111
-DAMReX_FORTRAN=ON \
@@ -158,6 +160,7 @@ jobs:
158160
cmake .. \
159161
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
160162
-DCMAKE_VERBOSE_MAKEFILE=ON \
163+
-DAMReX_FFT=ON \
161164
-DAMReX_EB=ON \
162165
-DAMReX_ENABLE_TESTS=ON \
163166
-DAMReX_FORTRAN=OFF \
@@ -200,7 +203,7 @@ jobs:
200203
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
201204
ccache -z
202205
203-
./configure --dim 2 --with-fortran no --comp llvm --with-mpi no
206+
./configure --dim 2 --with-fortran no --comp llvm --with-mpi no --enable-fft yes
204207
make -j4 WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS="-fno-operator-names" \
205208
CCACHE=ccache
206209
make install

.github/workflows/cuda.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
3939
cmake -S . -B build \
4040
-DCMAKE_VERBOSE_MAKEFILE=ON \
41+
-DAMReX_FFT=ON \
4142
-DAMReX_EB=ON \
4243
-DAMReX_ENABLE_TESTS=ON \
4344
-DAMReX_FORTRAN=OFF \
@@ -97,6 +98,7 @@ jobs:
9798
cmake -S . -B build \
9899
-DCMAKE_VERBOSE_MAKEFILE=ON \
99100
-DAMReX_MPI=OFF \
101+
-DAMReX_FFT=ON \
100102
-DAMReX_EB=ON \
101103
-DAMReX_ENABLE_TESTS=ON \
102104
-DAMReX_FORTRAN=OFF \
@@ -153,6 +155,7 @@ jobs:
153155
-DCMAKE_VERBOSE_MAKEFILE=ON \
154156
-DAMReX_ENABLE_TESTS=ON \
155157
-DAMReX_TEST_TYPE=Small \
158+
-DAMReX_FFT=ON \
156159
-DAMReX_FORTRAN=ON \
157160
-DAMReX_FORTRAN_INTERFACES=ON \
158161
-DAMReX_GPU_BACKEND=CUDA \
@@ -196,7 +199,7 @@ jobs:
196199
ccache -z
197200
198201
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
199-
./configure --dim 3 --with-cuda yes --enable-eb yes --enable-xsdk-defaults yes --with-fortran no
202+
./configure --dim 3 --with-cuda yes --enable-eb yes --enable-xsdk-defaults yes --with-fortran no --enable-fft yes
200203
#
201204
# /home/runner/work/amrex/amrex/Src/Base/AMReX_GpuLaunchGlobal.H:16:41: error: unused parameter ‘f0’ [-Werror=unused-parameter]
202205
# 16 | AMREX_GPU_GLOBAL void launch_global (L f0) { f0(); }

.github/workflows/dependencies/dependencies.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ sudo apt-get update
1616

1717
sudo apt-get install -y --no-install-recommends\
1818
build-essential \
19+
libfftw3-dev \
1920
g++ gfortran \
2021
libopenmpi-dev \
2122
openmpi-bin

.github/workflows/dependencies/dependencies_clang.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ sudo apt-get update
1616

1717
sudo apt-get install -y --no-install-recommends \
1818
build-essential \
19+
libfftw3-dev \
1920
gfortran \
2021
clang-$1

.github/workflows/dependencies/dependencies_gcc.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ sudo apt-get update
1717

1818
sudo apt-get install -y --no-install-recommends \
1919
build-essential \
20+
libfftw3-dev \
2021
g++-$1 gfortran-$1 \
2122
libopenmpi-dev \
2223
openmpi-bin

.github/workflows/dependencies/dependencies_hip.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ sudo apt-get install -y --no-install-recommends \
5656
roctracer-dev \
5757
rocprofiler-dev \
5858
rocrand-dev \
59+
rocfft-dev \
5960
rocprim-dev
6061

6162
# hiprand-dev is a new package that does not exist in old versions

.github/workflows/dependencies/dependencies_nvcc.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ sudo apt-get install -y \
3535
cuda-minimal-build-$VERSION_DASHED \
3636
cuda-nvml-dev-$VERSION_DASHED \
3737
cuda-nvtx-$VERSION_DASHED \
38+
libcufft-dev-$VERSION_DASHED \
3839
libcurand-dev-$VERSION_DASHED
3940
sudo ln -s cuda-$VERSION_DOTTED /usr/local/cuda

.github/workflows/gcc.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
mkdir build
4343
cd build
4444
cmake .. \
45+
-DAMReX_FFT=ON \
4546
-DAMReX_FORTRAN=ON \
4647
-DAMReX_PLOTFILE_TOOLS=ON \
4748
-DCMAKE_VERBOSE_MAKEFILE=ON \
@@ -99,6 +100,7 @@ jobs:
99100
cmake -S . -B build \
100101
-DCMAKE_BUILD_TYPE=Debug \
101102
-DCMAKE_VERBOSE_MAKEFILE=ON \
103+
-DAMReX_FFT=ON \
102104
-DAMReX_EB=ON \
103105
-DAMReX_ENABLE_TESTS=ON \
104106
-DAMReX_FORTRAN=ON \
@@ -147,6 +149,7 @@ jobs:
147149
cmake -S . -B build \
148150
-DCMAKE_BUILD_TYPE=Debug \
149151
-DCMAKE_VERBOSE_MAKEFILE=ON \
152+
-DAMReX_FFT=ON \
150153
-DAMReX_EB=ON \
151154
-DAMReX_ENABLE_TESTS=ON \
152155
-DAMReX_FORTRAN=ON \
@@ -196,6 +199,7 @@ jobs:
196199
cmake -S . -B build \
197200
-DCMAKE_BUILD_TYPE=Debug \
198201
-DCMAKE_VERBOSE_MAKEFILE=ON \
202+
-DAMReX_FFT=ON \
199203
-DAMReX_EB=OFF \
200204
-DAMReX_ENABLE_TESTS=ON \
201205
-DAMReX_FORTRAN=ON \
@@ -248,6 +252,7 @@ jobs:
248252
-DCMAKE_VERBOSE_MAKEFILE=ON \
249253
-DAMReX_ASSERTIONS=ON \
250254
-DAMReX_TESTING=ON \
255+
-DAMReX_FFT=ON \
251256
-DAMReX_EB=OFF \
252257
-DAMReX_ENABLE_TESTS=ON \
253258
-DAMReX_BOUND_CHECK=ON \
@@ -310,6 +315,7 @@ jobs:
310315
-DAMReX_TESTING=ON \
311316
-DAMReX_BOUND_CHECK=ON \
312317
-DAMReX_FPE=ON \
318+
-DAMReX_FFT=ON \
313319
-DAMReX_EB=ON \
314320
-DAMReX_ENABLE_TESTS=ON \
315321
-DAMReX_FORTRAN=ON \
@@ -371,6 +377,7 @@ jobs:
371377
-DAMReX_TESTING=ON \
372378
-DAMReX_BOUND_CHECK=ON \
373379
-DAMReX_FPE=ON \
380+
-DAMReX_FFT=ON \
374381
-DAMReX_EB=ON \
375382
-DAMReX_ENABLE_TESTS=ON \
376383
-DAMReX_FORTRAN=OFF \
@@ -457,7 +464,7 @@ jobs:
457464
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
458465
ccache -z
459466
460-
./configure --dim 3 --enable-eb yes --enable-xsdk-defaults yes
467+
./configure --dim 3 --enable-eb yes --enable-xsdk-defaults yes --enable-fft yes
461468
make -j4 WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS=-fno-operator-names \
462469
CCACHE=ccache
463470
make install
@@ -497,7 +504,8 @@ jobs:
497504
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
498505
ccache -z
499506
500-
./configure --dim 3 --enable-eb no --enable-xsdk-defaults no --single-precision yes --single-precision-particles yes --enable-tiny-profile yes
507+
./configure --dim 3 --enable-eb no --enable-xsdk-defaults no --single-precision yes \
508+
--single-precision-particles yes --enable-tiny-profile yes --enable-fft yes
501509
make -j4 WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS=-fno-operator-names \
502510
CCACHE=ccache
503511
make install
@@ -623,6 +631,7 @@ jobs:
623631
-DAMReX_OMP=ON \
624632
-DCMAKE_VERBOSE_MAKEFILE=ON \
625633
-DAMReX_ENABLE_TESTS=ON \
634+
-DAMReX_FFT=ON \
626635
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
627636
make -j 4
628637

.github/workflows/hip.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
4949
cmake -S . -B build \
5050
-DCMAKE_VERBOSE_MAKEFILE=ON \
51+
-DAMReX_FFT=ON \
5152
-DAMReX_EB=ON \
5253
-DAMReX_ENABLE_TESTS=ON \
5354
-DAMReX_FORTRAN=ON \
@@ -103,6 +104,7 @@ jobs:
103104
104105
cmake -S . -B build_full_legacywrapper \
105106
-DCMAKE_VERBOSE_MAKEFILE=ON \
107+
-DAMReX_FFT=ON \
106108
-DAMReX_EB=OFF \
107109
-DAMReX_ENABLE_TESTS=ON \
108110
-DAMReX_FORTRAN=ON \
@@ -145,7 +147,9 @@ jobs:
145147
export CCACHE_MAXSIZE=100M
146148
ccache -z
147149
148-
./configure --dim 2 --with-hip yes --enable-eb yes --enable-xsdk-defaults yes --with-mpi no --with-omp no --single-precision yes --single-precision-particles yes
150+
./configure --dim 2 --with-hip yes --enable-eb yes --enable-xsdk-defaults yes \
151+
--with-mpi no --with-omp no --single-precision yes \
152+
--single-precision-particles yes --enable-fft yes
149153
make -j4 WARN_ALL=TRUE AMD_ARCH=gfx90a CCACHE=ccache
150154
make install
151155

0 commit comments

Comments
 (0)