Skip to content

Commit

Permalink
Merge branch 'topic/default/Fluidfft-plugins' into 'branch/default'
Browse files Browse the repository at this point in the history
Fluidfft plugins

See merge request fluiddyn/fluidfft!50
  • Loading branch information
paugier committed Feb 5, 2024
2 parents 27f92ae + ee1a61a commit e329956
Show file tree
Hide file tree
Showing 166 changed files with 18,427 additions and 1,719 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
ignore = E501,E225,E226,E303,E201,E202,E203,W503
13 changes: 0 additions & 13 deletions .github/environment-windows.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/fluidfft-site-mpi.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions .github/fluidfft-site-seq.cfg

This file was deleted.

18 changes: 14 additions & 4 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,25 @@ jobs:
# cython is for coverage
python -m pip install coverage cython
- name: Run tests
- name: Run sequential tests with nox
run: |
cp .github/fluidfft-site-seq.cfg $HOME/.fluidfft-site.cfg
nox --session "tests(with_cov=True, with_mpi=False)"
make cleanall
cp .github/fluidfft-site-mpi.cfg $HOME/.fluidfft-site.cfg
mv .coverage/coverage.xml coverage_without_mpi.xml
- name: Run parallel tests with nox
run: |
nox --session "tests(with_cov=True, with_mpi=True)"
mv .coverage/coverage.xml coverage_with_mpi.xml
- name: Produce coverage xml
run: |
coverage xml
- name: Upload coverage to codecov
if: ${{ success() }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
files: coverage_without_mpi.xml,coverage_with_mpi.xml
32 changes: 0 additions & 32 deletions .github/workflows/ci-macos.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/ci-pixi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI Pixi

on:
- push
- pull_request

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["windows-2022", "macos-latest"]
python-version: ["3.9", "3.10", "3.11"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.11.1
cache: false
- name: Install
run: |
pixi run install-editable
# C++ code is not yet compatible with Windows
# pixi run pip install plugins/fluidfft-fftw -v --no-build-isolation --no-deps
- name: Tests
run: |
pixi run pytest -v tests
# pixi run pytest -v plugins/fluidfft-fftw
37 changes: 0 additions & 37 deletions .github/workflows/ci-windows.yml

This file was deleted.

24 changes: 11 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ workflow:
- if: $CI_COMMIT_BRANCH


# pixi-test:
# stage: pixi
# image: $DOCKER_IMAGE_PATH:pixi
# script:
# - pixi info
# # - rm -rf ../transonic
# # - hg clone https://foss.heptapod.net/fluiddyn/transonic ../transonic
# - pixi run install-editable
# - pixi run pytest -v
pixi-test:
stage: pixi
image: registry.heptapod.net:443/fluiddyn/fluidsim/ci/default:pixi
script:
- pixi info
- pixi run install-editable
- pixi run pip install plugins/fluidfft-fftw -v --no-build-isolation --no-deps
- pixi run pytest -v tests
- pixi run pytest -v plugins/fluidfft-fftw
# - pixi run pip install plugins/fluidfft-mpi_with_fftw -v --no-build-isolation --no-deps
# - pixi run mpirun -np 2 pytest -v plugins/fluidfft-mpi_with_fftw


# Build an image for the other tasks; this should be a scheduled job, as
Expand Down Expand Up @@ -85,7 +87,6 @@ tests_seq:
- job: "image:build"
optional: true
script:
- cp site.cfg.files/site.cfg.docker_seq site.cfg
- nox -s "tests(with_cov=True, with_mpi=False)"


Expand All @@ -95,7 +96,6 @@ tests_mpi:
- job: "image:build"
optional: true
script:
- cp site.cfg.files/site.cfg.docker_mpi site.cfg
- nox -s "tests(with_cov=True, with_mpi=True)"


Expand All @@ -104,8 +104,6 @@ pages:
needs:
- job: "image:build"
optional: true
variables:
FLUIDFFT_TRANSONIC_BACKEND: "python"
script:
- nox -s doc
- mkdir -p public/$CI_COMMIT_REF_NAME
Expand Down
4 changes: 3 additions & 1 deletion .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ src_cy/fft*_pxd.pxd
src/**/*.pyx
src/**/*.pxd
src/**/*.cpp
src/**/*.cu

__pycache__

Expand Down Expand Up @@ -53,6 +52,7 @@ site.cfg
.tox
.nox
.venv
.pixi
.cache
.mypy_cache
**/__pythran__/*
Expand All @@ -79,3 +79,5 @@ doc/tmp/*
.vscode

.pdm-python

src/fluidfft/build_conf.txt
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ build:
post_install:
- pdm use -f $READTHEDOCS_VIRTUALENV_PATH
- pdm sync -G doc --no-self
- pdm run pip install plugins/fluidfft-pyfftw
- FLUIDFFT_TRANSONIC_BACKEND="python" pip install . -v --no-deps
- pdm run python -c "from fluidfft_builder import create_fake_modules as c; c()"
- pdm run pip install . --no-deps -C setup-args=-Dtransonic-backend=python

sphinx:
configuration: doc/conf.py
10 changes: 0 additions & 10 deletions MANIFEST.in

This file was deleted.

39 changes: 13 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
.PHONY: clean cleanall cleanmako cleancython develop build_ext_inplace list-sessions tests
.PHONY: clean cleanall develop list-sessions tests doc

develop: sync
pdm run python -c "from fluidfft_builder import create_fake_modules as c; c()"
pdm run pip install -e . --no-deps --no-build-isolation -v
pdm run pip install -e plugins/fluidfft-fftw --no-build-isolation -v

develop_mpi_with_fftw:
pdm run pip install -e plugins/fluidfft-mpi_with_fftw --no-build-isolation -v

develop_fftwmpi:
pdm run pip install -e plugins/fluidfft-fftwmpi --no-build-isolation -v

sync:
pdm sync --clean --no-self
pdm run pip install -e plugins/fluidfft-pyfftw

clean:
rm -rf build
Expand All @@ -16,13 +23,7 @@ cleanso:
cleanpythran:
find src -name __pythran__ -type d -exec rm -rf "{}" +

cleancython:
find src -name "*_cy.cpp" -delete

cleanmako:
python -c "from src_cy.make_files_with_mako import clean_files as c; c()"

cleanall: clean cleanso cleanmako cleancython cleanpythran
cleanall: clean cleanso cleanpythran

black:
pdm run black
Expand All @@ -36,23 +37,6 @@ tests_mpi:
tests_mpi4:
mpirun -np 4 pytest -s tests

_tests_coverage:
mkdir -p .coverage
coverage run -p -m pytest -s tests
TRANSONIC_NO_REPLACE=1 coverage run -p -m pytest -s tests
# Using TRANSONIC_NO_REPLACE with mpirun in docker can block the tests
mpirun -np 2 --oversubscribe coverage run -p -m unittest discover tests

_report_coverage:
coverage combine
coverage report
coverage html
coverage xml
@echo "Code coverage analysis complete. View detailed report:"
@echo "file://${PWD}/.coverage/index.html"

coverage: _tests_coverage _report_coverage

clang-format:
find src_cpp/ -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i

Expand All @@ -63,6 +47,9 @@ list-sessions:
lock:
pdm lock -G :all

doc:
nox -s doc

# Catch-all target: route all unknown targets to nox sessions
%:
@nox --version 2>/dev/null || pip install nox
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Click on the links to know more:
P3DFFT, PFFT (for 3D solvers) either using a package manager or
[from
source](https://fluidfft.readthedocs.io/en/latest/install/fft_libs.html)
3. Python packages `fluiddyn mako cython pyfftw pythran mpi4py`
3. Python packages `fluiddyn cython pyfftw pythran mpi4py`
4. [A C++11 compiler and BLAS
libraries](https://github.com/serge-sans-paille/pythran#installation)
and
Expand Down
4 changes: 0 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import os
from pathlib import Path
import subprocess
from runpy import run_path
import getpass
from subprocess import call

Expand Down Expand Up @@ -94,9 +93,6 @@ def save_fig_scaling(dir_name, dim, n0, n1, n2=None):
except OSError:
print("Can not find doxygen to generate the documentation of the cpp code.")

run_path("../src_cy/create_fake_mod_for_doc.py")


# -- General configuration ----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down
3 changes: 1 addition & 2 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ perform Fast Fourier Transform (FFT) with different libraries, in particular
- [pfft](https://github.com/mpip/pfft)
- [p3dfft](https://github.com/sdsc/p3dfft)
- [mpi4py-fft](https://bitbucket.org/mpi4py/mpi4py-fft)
- [cufft](https://developer.nvidia.com/cufft) (fft library by CUDA
running on GPU)

[pfft](https://github.com/mpip/pfft), [p3dfft](https://github.com/sdsc/p3dfft) and [mpi4py-fft](https://bitbucket.org/mpi4py/mpi4py-fft) are specialized in computing FFT
efficiently on several cores of big clusters. The data can be split in pencils
Expand Down Expand Up @@ -110,6 +108,7 @@ journal = {Journal of Open Research Software}
overview
install
plugins
tutorials
examples
bench
Expand Down
8 changes: 8 additions & 0 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

# Installation and advice

```{danger}
We are working on a very deep reorganization of Fluidfft. Fluidfft 0.4.0, which
should be released in the beginning of 2024, will work with plugins. This
documentation is valid for Fluidfft <= 0.3.5. The new documentation should come soon.
```

## Installation with pip

To install fluidfft, you need a recent Python (>= 3.6) and a C++11 compiler
Expand Down
1 change: 1 addition & 0 deletions doc/plugins.md
Loading

0 comments on commit e329956

Please sign in to comment.