From 7e8fab336aba2d1292d69ae5f5a2d94dce0e9728 Mon Sep 17 00:00:00 2001 From: paugier Date: Sat, 10 Feb 2024 14:55:32 +0100 Subject: [PATCH 1/2] Fix get_simple_method functions --- .../fluidfft_mpi4pyfft/mpi_with_mpi4pyfft.py | 2 -- .../mpi_with_mpi4pyfft_slab.py | 2 -- src/fluidfft/fft2d/operators.py | 20 ++++++++++--------- src/fluidfft/fft3d/operators.py | 20 ++++++++++--------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/plugins/fluidfft-mpi4pyfft/src/fluidfft_mpi4pyfft/mpi_with_mpi4pyfft.py b/plugins/fluidfft-mpi4pyfft/src/fluidfft_mpi4pyfft/mpi_with_mpi4pyfft.py index e8924ad..2b25069 100644 --- a/plugins/fluidfft-mpi4pyfft/src/fluidfft_mpi4pyfft/mpi_with_mpi4pyfft.py +++ b/plugins/fluidfft-mpi4pyfft/src/fluidfft_mpi4pyfft/mpi_with_mpi4pyfft.py @@ -137,8 +137,6 @@ def get_seq_indices_first_X(self): if __name__ == "__main__": - # mpirun -np 2 python -m fluidfft.fft3d.mpi_with_mpi4pyfft - offt = FFTclass(6, 14, 4) offt.print_summary_for_debug() offt.run_tests() diff --git a/plugins/fluidfft-mpi4pyfft/src/fluidfft_mpi4pyfft/mpi_with_mpi4pyfft_slab.py b/plugins/fluidfft-mpi4pyfft/src/fluidfft_mpi4pyfft/mpi_with_mpi4pyfft_slab.py index 883c2ef..f4d5d74 100644 --- a/plugins/fluidfft-mpi4pyfft/src/fluidfft_mpi4pyfft/mpi_with_mpi4pyfft_slab.py +++ b/plugins/fluidfft-mpi4pyfft/src/fluidfft_mpi4pyfft/mpi_with_mpi4pyfft_slab.py @@ -30,8 +30,6 @@ class FFT3DMPIWithMPI4PYFFTSlab(FFT3DMPIWithMPI4PYFFT): FFTclass = FFT3DMPIWithMPI4PYFFTSlab if __name__ == "__main__": - # mpirun -np 2 python -m fluidfft.fft3d.mpi_with_mpi4pyfft_slab - offt = FFTclass(6, 14, 4) offt.print_summary_for_debug() offt.run_tests() diff --git a/src/fluidfft/fft2d/operators.py b/src/fluidfft/fft2d/operators.py index 0d1f8b3..ca295da 100644 --- a/src/fluidfft/fft2d/operators.py +++ b/src/fluidfft/fft2d/operators.py @@ -17,7 +17,7 @@ from fluiddyn.util import mpi from fluiddyn.util.compat import cached_property -from fluidfft import create_fft_object +from fluidfft import create_fft_object, import_fft_class from fluidfft.base import OperatorsBase @@ -44,23 +44,25 @@ def _make_str_length(length): def get_simple_2d_seq_method(): + """Get a simple 2d sequential method""" try: import pyfftw - fft = "fft2d.with_pyfftw" except ImportError: - fft = "fft2d.with_fftw2d" - return fft + return "fft2d.with_fftw2d" + else: + del pyfftw + return "fft2d.with_pyfftw" def get_simple_2d_mpi_method(): + """Get a simple 2d parallel method""" + method = "fft2d.mpi_with_fftwmpi2d" try: - import fluidfft.fft2d.mpi_with_fftwmpi2d - - fft = "fft2d.mpi_with_fftwmpi2d" + import_fft_class(method) except ImportError: - fft = "fft2d.mpi_with_fftw1d" - return fft + method = "fft2d.mpi_with_fftw1d" + return method @boost diff --git a/src/fluidfft/fft3d/operators.py b/src/fluidfft/fft3d/operators.py index 3a731bd..b0d0dc2 100644 --- a/src/fluidfft/fft3d/operators.py +++ b/src/fluidfft/fft3d/operators.py @@ -14,7 +14,7 @@ from transonic import boost, Array, Type from fluiddyn.util import mpi -from fluidfft import create_fft_object +from fluidfft import create_fft_object, import_fft_class from fluidfft.base import OperatorsBase from fluidfft.fft2d.operators import _make_str_length @@ -105,23 +105,25 @@ def loop_spectra_kzkh( def get_simple_3d_seq_method(): + """Get a simple 3d sequential method""" try: import pyfftw - fft = "fft3d.with_pyfftw" except ImportError: - fft = "fft3d.with_fftw3d" - return fft + return "fft3d.with_fftw3d" + else: + del pyfftw + return "fft3d.with_pyfftw" def get_simple_3d_mpi_method(): + """Get a simple 3d parallel method""" + method = "fft3d.mpi_with_fftwmpi3d" try: - import fluidfft.fft3d.mpi_with_fftwmpi3d - - fft = "fft3d.mpi_with_fftwmpi3d" + import_fft_class(method) except ImportError: - fft = "fft3d.mpi_with_fftw1d" - return fft + method = "fft3d.mpi_with_fftw1d" + return method @boost From 68f3f067526855a93a7d8acc88fbdeaca0929209 Mon Sep 17 00:00:00 2001 From: paugier Date: Sat, 10 Feb 2024 14:56:03 +0100 Subject: [PATCH 2/2] 0.4.0rc1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2327e3d..58c3aea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = 'mesonpy' [project] name = "fluidfft" -version = "0.4.0rc0" +version = "0.4.0rc1" description = "Efficient and easy Fast Fourier Transform (FFT) for Python." authors = [ {name = "Pierre Augier", email = "pierre.augier@legi.cnrs.fr"},