Skip to content

Commit 69562d9

Browse files
committed
CI: update GHA, setup Codecov, setup dependabot, remove Azure
1 parent 0bacc30 commit 69562d9

8 files changed

+115
-155
lines changed

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly

.github/workflows/main.yml

+67-19
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,77 @@
1-
name: github-CI
1+
name: main
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
411

512
jobs:
6-
build:
7-
13+
test:
814
runs-on: ${{ matrix.os }}
915
strategy:
16+
fail-fast: false
1017
matrix:
11-
os: [ubuntu-latest, macos-latest]
12-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
13-
name: Python ${{ matrix.python-version }} example
18+
os:
19+
- ubuntu-latest
20+
- macos-latest
21+
mpi:
22+
- mpich
23+
- openmpi
24+
py:
25+
# - "3.7"
26+
# - "3.8"
27+
# - "3.9"
28+
- "3.10"
29+
- "3.11"
30+
- "3.12"
1431

1532
steps:
16-
- uses: actions/checkout@v3
17-
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
18-
- name: setup-conda
19-
uses: s-weigand/setup-conda@v1
33+
34+
- uses: actions/checkout@v4
35+
36+
- uses: actions/setup-python@v5
2037
with:
21-
update-conda: true
22-
python-version: ${{ matrix.python-version }}
23-
conda-channels: anaconda, conda-forge
24-
- run: conda --version
25-
- run: which python
38+
python-version: ${{ matrix.py }}
39+
2640
- run: |
27-
conda config --set always_yes yes
28-
conda install -n root conda-build numpy fftw
29-
conda build ./conf
41+
# Install fftw
42+
case $(uname) in
43+
Linux)
44+
sudo apt update
45+
sudo apt install -y -q libfftw3-dev
46+
;;
47+
Darwin)
48+
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
49+
brew install fftw
50+
;;
51+
esac
52+
53+
- run: python -m pip install -U pip build
54+
55+
- run: python -m build
56+
57+
- uses: mpi4py/setup-mpi@v1
58+
with:
59+
mpi: ${{ matrix.mpi }}
60+
61+
- run: pip install -vvv dist/mpi4py_fft-*.whl
62+
env:
63+
CFLAGS: "-O0"
64+
65+
- run: pip install -r conf/requirements-test.txt
66+
67+
- if: matrix.mpi == 'mpich' && startsWith(matrix.os, 'ubuntu')
68+
run: ./runtests.sh
69+
working-directory: tests
70+
71+
- if: matrix.mpi == 'mpich' && startsWith(matrix.os, 'ubuntu')
72+
uses: codecov/codecov-action@v4
73+
with:
74+
files: test/coverage.xml
75+
name: ${{ matrix.os }}-${{ matrix.mpi }}-${{ matrix.py }}
76+
env:
77+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ _templates/
1111
*.dat
1212
*.html
1313
*.xml
14-
*.txt
1514
*.h5
1615
*.nc
1716
*.xdmf

azure-pipelines.yml

-83
This file was deleted.

conf/requirements-test.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage
2+
pyfftw; sys_platform == 'linux' and python_version < '3.12'
3+
scipy

tests/runtests.sh

+36-44
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,39 @@
11
#!/bin/sh
22
set -e
33

4-
PY=$(python -c 'import sys; print(sys.version_info.major)')
5-
export OMPI_MCA_plm=isolated
6-
export OMPI_MCA_btl_vader_single_copy_mechanism=none
7-
export OMPI_MCA_rmaps_base_oversubscribe=yes
8-
9-
if [ $PY -eq 3 ]; then
10-
# coverage only for python version 3
11-
12-
python -m coverage erase
13-
14-
python -m coverage run -m test_fftw
15-
python -m coverage run -m test_libfft
16-
python -m coverage run -m test_io
17-
python -m coverage run -m test_darray
18-
mpiexec -n 2 python -m coverage run -m test_pencil
19-
20-
#mpiexec -n 4 python -m coverage test_pencil.py
21-
#mpiexec -n 8 python -m coverage test_pencil.py
22-
mpiexec -n 2 python -m coverage run -m test_mpifft
23-
#mpiexec -n 4 python -m coverage test_mpifft.py
24-
# mpiexec -n 8 python -m coverage test_mpifft.py
25-
# mpiexec -n 12 python -m coverage test_mpifft.py
26-
mpiexec -n 2 python -m coverage run spectral_dns_solver.py
27-
mpiexec -n 2 python -m coverage run -m test_io
28-
#mpiexec -n 4 python -m coverage run -m test_io
29-
mpiexec -n 2 python -m coverage run -m test_darray
30-
#mpiexec -n 4 python -m coverage run -m test_darray
31-
32-
python -m coverage combine
33-
34-
else
35-
python test_fftw.py
36-
python test_libfft.py
37-
mpiexec -n 2 python test_pencil.py
38-
#mpiexec -n 4 python test_pencil.py
39-
#mpiexec -n 8 python test_pencil.py
40-
mpiexec -n 2 python test_mpifft.py
41-
#mpiexec -n 4 python test_mpifft.py
42-
# mpiexec -n 8 python test_mpifft.py
43-
# mpiexec -n 12 python test_mpifft.py
44-
mpiexec -n 2 python test_io.py
45-
mpiexec -n 2 python test_darray.py
46-
mpiexec -n 2 python spectral_dns_solver.py
47-
fi
4+
export OMPI_MCA_plm_ssh_agent=false
5+
export OMPI_MCA_pml=ob1
6+
export OMPI_MCA_btl=tcp,self
7+
export OMPI_MCA_mpi_yield_when_idle=true
8+
export OMPI_MCA_btl_base_warn_component_unused=false
9+
export OMPI_MCA_rmaps_base_oversubscribe=true
10+
export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
11+
12+
set -x
13+
14+
python -m coverage erase
15+
16+
python -m coverage run -m test_fftw
17+
python -m coverage run -m test_libfft
18+
python -m coverage run -m test_io
19+
python -m coverage run -m test_darray
20+
21+
mpiexec -n 2 python -m coverage run -m test_pencil
22+
mpiexec -n 4 python -m coverage run -m test_pencil
23+
#mpiexec -n 8 python -m coverage test_pencil.py
24+
25+
mpiexec -n 2 python -m coverage run -m test_mpifft
26+
mpiexec -n 4 python -m coverage run -m test_mpifft
27+
#mpiexec -n 8 python -m coverage test_mpifft.py
28+
#mpiexec -n 12 python -m coverage test_mpifft.py
29+
30+
mpiexec -n 2 python -m coverage run -m test_io
31+
mpiexec -n 4 python -m coverage run -m test_io
32+
33+
mpiexec -n 2 python -m coverage run -m test_darray
34+
mpiexec -n 4 python -m coverage run -m test_darray
35+
36+
mpiexec -n 2 python -m coverage run spectral_dns_solver.py
37+
38+
python -m coverage combine
39+
python -m coverage xml

tests/test_mpifft.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def test_mpifft():
152152
fft.backward.input_array.shape)
153153
assert (fft.backward.output_pencil.subshape ==
154154
fft.backward.output_array.shape)
155-
assert np.alltrue(np.array(fft.global_shape(True)) == np.array(fft.forward.output_pencil.shape))
156-
assert np.alltrue(np.array(fft.global_shape(False)) == np.array(fft.forward.input_pencil.shape))
155+
assert np.all(np.array(fft.global_shape(True)) == np.array(fft.forward.output_pencil.shape))
156+
assert np.all(np.array(fft.global_shape(False)) == np.array(fft.forward.input_pencil.shape))
157157
ax = -1 if axes is None else axes[-1] if isinstance(axes[-1], int) else axes[-1][-1]
158158
assert fft.forward.input_pencil.substart[ax] == 0
159159
assert fft.backward.output_pencil.substart[ax] == 0

tests/test_speed.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
from time import time
22
import numpy as np
3+
import pyfftw
34
import scipy.fftpack as sp
45
from mpi4py_fft import fftw
56
import pickle
67

7-
try:
8-
import pyfftw
9-
except ImportError:
10-
print('pyFFTW not available')
11-
raise SystemExit(0)
12-
138
try:
149
#fftw.import_wisdom('wisdom.dat')
1510
pyfftw.import_wisdom(pickle.load(open('pyfftw.wisdom', 'rb')))

0 commit comments

Comments
 (0)