Skip to content

Commit

Permalink
Merge branch 'topic/default/pfft-p3dfft-plugins' into 'branch/default'
Browse files Browse the repository at this point in the history
pfft and f3dfft pluggins

Closes #34

See merge request fluiddyn/fluidfft!52
  • Loading branch information
paugier committed Feb 8, 2024
2 parents 9f8a752 + 34bc5d8 commit 13b08dd
Show file tree
Hide file tree
Showing 29 changed files with 1,773 additions and 38 deletions.
5 changes: 3 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ workflow:
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH

- if: $CI_COMMIT_TAG

pixi-test:
stage: pixi
Expand All @@ -40,6 +40,7 @@ pixi-test:
# it is quite unnecessary to run on every invocation.
image:build:
stage: image
needs: []
tags:
- container-registry-push
rules:
Expand Down Expand Up @@ -96,7 +97,7 @@ tests_mpi:
- job: "image:build"
optional: true
script:
- nox -s "tests(with_cov=True, with_mpi=True)"
- nox -s "tests(with_cov=True, with_mpi=True)" -- --with-pfft --with-p3dfft


pages:
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ develop_mpi_with_fftw:
develop_fftwmpi:
pdm run pip install -e plugins/fluidfft-fftwmpi --no-build-isolation -v

develop_pfft:
pdm run pip install -e plugins/fluidfft-pfft --no-build-isolation -v

develop_p3dfft:
pdm run pip install -e plugins/fluidfft-p3dfft --no-build-isolation -v

sync:
pdm sync --clean --no-self

Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,20 @@ RUN ln -s /usr/include/fftw* $HOME/.local/include
RUN ln -s /usr/lib/x86_64-linux-gnu/libfftw3* $HOME/.local/lib

ENV LD_LIBRARY_PATH=$HOME/.local/lib
ENV LIBRARY_PATH=$HOME/.local/lib
ENV PATH=$HOME/.local/bin:$PATH
ENV CPATH=$HOME/.local/include:$CPATH

RUN mkdir -p $HOME/.config/matplotlib
RUN echo 'backend : agg' > $HOME/.config/matplotlib/matplotlibrc

RUN wget https://foss.heptapod.net/fluiddyn/fluidfft/raw/branch/default/doc/install/install_p3dfft.sh -O ./install_p3dfft.sh
COPY --chown=appuser:appuser doc/install/install_p3dfft.sh install_p3dfft.sh
RUN chmod +x install_p3dfft.sh
RUN export FCFLAGS="-w -fallow-argument-mismatch -O2" && \
export FFLAGS="-w -fallow-argument-mismatch -O2" && \
./install_p3dfft.sh

RUN wget https://foss.heptapod.net/fluiddyn/fluidfft/raw/branch/default/doc/install/install_pfft.sh -O ./install_pfft.sh
COPY --chown=appuser:appuser doc/install/install_pfft.sh install_pfft.sh
RUN chmod +x install_pfft.sh
RUN ./install_pfft.sh

Expand Down
7 changes: 3 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ fs = import('fs')
if fs.is_file('site.cfg')
error('Error: site.cfg file exists and is no longer supported')
endif
# TODO : uncomment while Docker file is updated
# if fs.is_file('~/.fluidfft-site.cfg')
# error('Error: ~/.fluidfft-site.cfg file exists and is no longer supported')
# endif
if fs.is_file('~/.fluidfft-site.cfg')
error('Error: ~/.fluidfft-site.cfg file exists and is no longer supported')
endif

# https://mesonbuild.com/Python-module.html
py_mod = import('python')
Expand Down
41 changes: 27 additions & 14 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
make <session>
execute ``make list-sessions```` or ``nox -l`` for a list of sessions.
execute `make list-sessions` or `nox -l` for a list of sessions.
"""

Expand All @@ -30,7 +30,7 @@
no_venv_session = partial(nox.session, venv_backend="none")


@nox.session
@nox.session(reuse_venv=True)
def validate_code(session):
session.run_always(
"pdm", "sync", "--clean", "-G", "lint", "--no-self", external=True
Expand All @@ -40,10 +40,13 @@ def validate_code(session):

@nox.parametrize("with_mpi", [True, False])
@nox.parametrize("with_cov", [True, False])
@nox.session
@nox.session(reuse_venv=True)
def tests(session, with_mpi, with_cov):
"""Execute unit-tests using pytest"""

with_pfft = "--with-pfft" in session.posargs
with_p3dfft = "--with-p3dfft" in session.posargs

command = "pdm sync --clean --no-self -G test -G build -G pyfftw"
if with_mpi:
command += " -G mpi"
Expand All @@ -59,12 +62,20 @@ def tests(session, with_mpi, with_cov):
)

session.install("plugins/fluidfft-builder")
session.install("-e", "plugins/fluidfft-fftw", "--no-build-isolation", "-v")

plugin_name_seq = ["fftw"]
plugin_names = plugin_name_seq.copy()

if with_mpi:
session.install(
"-e", "plugins/fluidfft-mpi_with_fftw", "--no-build-isolation", "-v"
)
session.install("-e", "plugins/fluidfft-fftwmpi", "--no-build-isolation", "-v")
plugin_names_par = ["mpi_with_fftw", "fftwmpi"]
if with_pfft:
plugin_names_par.append("pfft")
if with_p3dfft:
plugin_names_par.append("p3dfft")
plugin_names.extend(plugin_names_par)

for name in plugin_names:
session.install("-e", f"plugins/fluidfft-{name}", "--no-build-isolation")

if with_cov:
path_coverage = Path.cwd() / ".coverage"
Expand All @@ -78,9 +89,11 @@ def run_command(command, **kwargs):

command = "pytest -v -s tests"

run_command(command, *session.posargs)
run_command(command, *session.posargs, env={"TRANSONIC_NO_REPLACE": "1"})
run_command("pytest -v plugins/fluidfft-fftw")
run_command(command)
run_command(command, env={"TRANSONIC_NO_REPLACE": "1"})

for name in plugin_name_seq:
run_command(f"pytest -v plugins/fluidfft-{name}")

if with_mpi:

Expand All @@ -93,8 +106,8 @@ def test_plugin(package_name):
command += f" plugins/{package_name}"
session.run(*command.split(), external=True)

test_plugin("fluidfft-mpi_with_fftw")
test_plugin("fluidfft-fftwmpi")
for name in plugin_names_par:
test_plugin(f"fluidfft-{name}")

if with_cov:
if with_mpi:
Expand All @@ -104,7 +117,7 @@ def test_plugin(package_name):
session.run("coverage", "html")


@nox.session
@nox.session(reuse_venv=True)
def doc(session):
session.run_always(
"pdm", "sync", "--clean", "-G", "doc", "--no-self", external=True
Expand Down
4 changes: 2 additions & 2 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ The following plugins are implemented in Fluidfft repository:
- [x] fluidfft-fftw
- [x] fluidfft-mpi_with_fftw (parallel methods using the sequential FFTW3 library)
- [x] fluidfft-fftwmpi (methods using the library `libfftw_mpi`)
- [x] fluidfft-p3dfft
- [x] fluidfft-pfft
- [x] fluidfft-mpi4pyfft (cannot be tested because mpi4py-fft installation fails)

We plan to soon also have:

- [ ] fluidfft-p3dfft
- [ ] fluidfft-pfft
- [ ] fluidfft-pyvkfft (https://pyvkfft.readthedocs.io)

0 comments on commit 13b08dd

Please sign in to comment.