-
Notifications
You must be signed in to change notification settings - Fork 240
dsl: Add PETSc functionality #2570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f9d1e34
5505a12
f4ee1b9
0af998d
1146a07
cccb988
f61d4dd
6cdb7d0
9d389da
735da03
fb4b96f
33b2896
515046a
f1d7f0f
42e0e70
1e99432
bdade2c
4f3bd88
9c60990
a8f11a7
d06b275
2b6c038
ab2450b
dd73033
d3e7be6
9f32c1a
7e21e5b
f2a7df1
44b4aeb
92edf68
f6b38ed
7300c8f
1ddc053
6834611
9642278
ce9150f
f7e00bb
6e20d4b
8a79fcd
3000bd8
a0457f0
7132eb1
6897ab8
8386992
fb20781
5c1b686
b0ca11f
b6710be
01d153a
d6bd4f4
4fad6aa
6b6ad4f
525fdf6
27dd201
30ed5ba
51d4d7e
a4a5660
312c826
048f693
905def2
19fddbe
6972cbc
8037cf9
8c16f2e
dcbf929
f3d4d2d
8d10b87
53b58a9
857eb9c
7a5b10f
467c19b
343ba75
d2e3eb5
6165373
0b43ea6
62d0045
bd96379
ce5cf82
b7c4082
e485c9c
df4e638
72e8222
b72465f
16be19a
f790ab9
e3e26f0
9a182da
774af10
910c987
ff4b2d7
91c91c3
70d1719
3044691
4139a3f
7c69c4d
a19f136
cdb83ef
c51d394
bf52c5b
807396c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,11 @@ on: | |
push: | ||
branches: | ||
- main | ||
- petsc | ||
pull_request: | ||
branches: | ||
- main | ||
- petsc | ||
|
||
jobs: | ||
build: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,11 @@ on: | |
push: | ||
branches: | ||
- main | ||
- petsc | ||
pull_request: | ||
branches: | ||
- main | ||
- petsc | ||
|
||
jobs: | ||
tutorials: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,11 @@ on: | |
push: | ||
branches: | ||
- main | ||
- petsc | ||
pull_request: | ||
branches: | ||
- main | ||
- petsc | ||
|
||
jobs: | ||
flake8: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,11 @@ on: | |
push: | ||
branches: | ||
- main | ||
- petsc | ||
pull_request: | ||
branches: | ||
- main | ||
- petsc | ||
|
||
jobs: | ||
test-mpi-basic: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,11 @@ on: | |
push: | ||
branches: | ||
- main | ||
- petsc | ||
pull_request: | ||
branches: | ||
- main | ||
- petsc | ||
|
||
jobs: | ||
pytest: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: CI-petsc | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the master branch | ||
push: | ||
branches: | ||
- main | ||
- petsc | ||
pull_request: | ||
branches: | ||
- main | ||
- petsc | ||
|
||
jobs: | ||
pytest: | ||
name: ${{ matrix.name }}-${{ matrix.set }} | ||
runs-on: "${{ matrix.os }}" | ||
|
||
env: | ||
DOCKER_BUILDKIT: "1" | ||
DEVITO_ARCH: "${{ matrix.arch }}" | ||
DEVITO_LANGUAGE: ${{ matrix.language }} | ||
|
||
strategy: | ||
# Prevent all build to stop if a single one fails | ||
fail-fast: false | ||
|
||
matrix: | ||
name: [ | ||
pytest-docker-py39-gcc-noomp | ||
] | ||
include: | ||
- name: pytest-docker-py39-gcc-noomp | ||
python-version: '3.9' | ||
os: ubuntu-latest | ||
arch: "gcc" | ||
language: "C" | ||
sympy: "1.12" | ||
|
||
steps: | ||
- name: Checkout devito | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build docker image | ||
run: | | ||
docker build -f docker/Dockerfile.devito --build-arg base=zoeleibowitz/petsc_image:latest --tag zoeleibowitz/petsc_devito_image:latest . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This image should probably be on the main Devito Dockerhub now |
||
|
||
- name: Set run prefix | ||
run: | | ||
echo "RUN_CMD=docker run --rm -t -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun zoeleibowitz/petsc_devito_image:latest" >> $GITHUB_ENV | ||
id: set-run | ||
|
||
- name: Set tests | ||
run : | | ||
echo "TESTS=tests/test_petsc.py" >> $GITHUB_ENV | ||
id: set-tests | ||
|
||
- name: Check configuration | ||
run: | | ||
${{ env.RUN_CMD }} python3 -c "from devito import configuration; print(''.join(['%s: %s \n' % (k, v) for (k, v) in configuration.items()]))" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ultra nitpick: fstring |
||
|
||
- name: Test with pytest - serial | ||
run: | | ||
${{ env.RUN_CMD }} mpiexec -n 1 pytest -m "not parallel" --cov --cov-config=.coveragerc --cov-report=xml ${{ env.TESTS }} | ||
|
||
- name: Test with pytest - parallel | ||
run: | | ||
${{ env.RUN_CMD }} mpiexec -n 1 pytest -m parallel --cov --cov-config=.coveragerc --cov-report=xml ${{ env.TESTS }} | ||
|
||
- name: Test examples | ||
run: | | ||
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/seismic/01_staggered_acoustic.py | ||
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/cfd/01_navierstokes.py | ||
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/Poisson/01_poisson.py | ||
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/Poisson/02_laplace.py | ||
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/Poisson/03_poisson.py | ||
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/Poisson/04_poisson.py | ||
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/random/01_helmholtz.py | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about naming this folder 'misc' rather than 'random'? |
||
${{ env.RUN_CMD }} mpiexec -n 1 python3 examples/petsc/random/02_biharmonic.py | ||
|
||
- name: Upload coverage to Codecov | ||
if: "!contains(matrix.name, 'docker')" | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
name: ${{ matrix.name }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,11 @@ on: | |
push: | ||
branches: | ||
- main | ||
- petsc | ||
pull_request: | ||
branches: | ||
- main | ||
- petsc | ||
|
||
jobs: | ||
tutorials: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python 3.9 is EOL soon, so this version should get bumped. It would also be worth adding an Omp run