-
Notifications
You must be signed in to change notification settings - Fork 254
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
Open
ZoeLeibowitz
wants to merge
107
commits into
main
Choose a base branch
from
petsc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
107 commits
Select commit
Hold shift + click to select a range
f9d1e34
compiler: Add PETSc module
ZoeLeibowitz 5505a12
Clean up
ZoeLeibowitz f4ee1b9
compiler: Initialize and Finalize PETSc once and command line args
ZoeLeibowitz 0af998d
Coupled (#41)
ZoeLeibowitz 1146a07
misc: Rebase fixes
ZoeLeibowitz cccb988
Fix sympy_dtype for expressions containing FieldFromPointer objects (…
ZoeLeibowitz f61d4dd
compiler: Add PETSc language and printer (#67)
ZoeLeibowitz 6cdb7d0
compiler: Temp fix for memory leaks. (#70)
ZoeLeibowitz 9d389da
workflows: Push PETSc/Devito docker image to Docker Hub (#71)
ZoeLeibowitz 735da03
Merge branch 'devitocodes:main' into master
ZoeLeibowitz fb4b96f
Compiler: Add basic initguess callback (#72)
ZoeLeibowitz 33b2896
Staggered grids (#73)
ZoeLeibowitz 515046a
Drop unnecessary IndexedData check (#74)
ZoeLeibowitz f1d7f0f
Separate PETSc install into single image (#75)
ZoeLeibowitz 42e0e70
Add some examples (#76)
ZoeLeibowitz 1e99432
Merge branch 'devitocodes:main' into master
ZoeLeibowitz bdade2c
Merge branch 'devitocodes:main' into master
ZoeLeibowitz 4f3bd88
Use VecCreateMPIWithArray (#77)
ZoeLeibowitz 9c60990
workflows: Edit petsc docker image
ZoeLeibowitz a8f11a7
workflows: Update petsc install to latest release
ZoeLeibowitz d06b275
logging: Corner case for PETSc
JDBetteridge 2b6c038
examples: Add 1D example
ZoeLeibowitz ab2450b
examples: Add 04_poisson example
ZoeLeibowitz dd73033
workflows: Update workflow to run new tests
ZoeLeibowitz d3e7be6
misc: Flake 8
ZoeLeibowitz 9f32c1a
misc: Fix conflict with main
ZoeLeibowitz 7e21e5b
misc: Flake8
ZoeLeibowitz f2a7df1
misc: Fix merge conflicts with main
ZoeLeibowitz 44b4aeb
misc: Fix merge leftover
ZoeLeibowitz 92edf68
dsl/compiler: Edits to mixed solver functionality
ZoeLeibowitz f6b38ed
compiler: Working petscbundle
ZoeLeibowitz 7300c8f
compiler: Add PetscMixin to simplify priority destroys
ZoeLeibowitz 1ddc053
compiler: Working reuse_efunc for petscbundles
ZoeLeibowitz 6834611
dsl/compiler: Zero columns for essential bcs
ZoeLeibowitz 9642278
dsl: Compatible scaling of jacobian
ZoeLeibowitz ce9150f
dsl: Scale boundary rows of jacobian
ZoeLeibowitz f7e00bb
types: Edit PetscMixin and use it in other petsc classes
ZoeLeibowitz 6e20d4b
dsl: Add extraction file
ZoeLeibowitz 8a79fcd
dsl: Move symbolic extraction functions outside of the PETSc module
ZoeLeibowitz 3000bd8
types: Move EssentialBC to another file
ZoeLeibowitz a0457f0
dsl/compiler: Add equation.py to petsc module
ZoeLeibowitz 7132eb1
dsl: Add jacobian class for single fields
ZoeLeibowitz 6897ab8
dsl: Fix compatible scaling for single fields
ZoeLeibowitz 8386992
dsl: Improve Jacobian abstraction
ZoeLeibowitz fb20781
examples: Add pressure norm check in stokes example
ZoeLeibowitz 5c1b686
tests: Add more petsc tests for linear coupled
ZoeLeibowitz b0ca11f
misc: Merge petsc branch in but broken petscbundle
ZoeLeibowitz b6710be
types: Fix PetscBundle symbolic shape
ZoeLeibowitz 01d153a
tests: Fix petsc tests
ZoeLeibowitz d6bd4f4
misc: Address comments
ZoeLeibowitz 4fad6aa
misc: Merge leftover
ZoeLeibowitz 6b6ad4f
Merge pull request #2588 from devitocodes/JDBetteridge/petsc_fix_pyte…
ZoeLeibowitz 525fdf6
Merge branch 'petsc' into biharmonic
ZoeLeibowitz 27dd201
compiler: Edit switch_log_level
ZoeLeibowitz 30ed5ba
tests: Add mpi petsc test
ZoeLeibowitz 51d4d7e
misc: Address more comments and add docstrings
ZoeLeibowitz a4a5660
misc: Clean up more docstrings
ZoeLeibowitz 312c826
misc: Add BaseJacobian
ZoeLeibowitz 048f693
misc: Docstrings, stop list output for PETScSolve, tests
ZoeLeibowitz 905def2
misc: Flake8
ZoeLeibowitz 19fddbe
misc: Fix exprs in 01_navierstokes.py due to change in PETScSolve out…
ZoeLeibowitz 6972cbc
Merge branch 'biharmonic' into petsc_mpi
ZoeLeibowitz 8037cf9
misc: Clean up
ZoeLeibowitz 8c16f2e
misc: Utilise zero_vector function
ZoeLeibowitz dcbf929
Merge branch 'biharmonic' into petsc_mpi
ZoeLeibowitz f3d4d2d
misc: Move vecset to function inside iet/utils.py
ZoeLeibowitz 8d10b87
misc: Flake8
ZoeLeibowitz 53b58a9
misc: Clean up
ZoeLeibowitz 857eb9c
misc: Add more tests
ZoeLeibowitz 7a5b10f
mpi: Start parallel tests
ZoeLeibowitz 467c19b
add to petsc laplacian test
ZoeLeibowitz 343ba75
merge conflict
ZoeLeibowitz d2e3eb5
mpi tests
ZoeLeibowitz 6165373
edit test
ZoeLeibowitz 0b43ea6
tests: Add petsc parallel test
ZoeLeibowitz 62d0045
clean up
ZoeLeibowitz bd96379
misc: Simplify comm extraction in lower_petsc
ZoeLeibowitz ce5cf82
clean up
ZoeLeibowitz b7c4082
trigger petsc CI
ZoeLeibowitz e485c9c
misc: Add todo:
ZoeLeibowitz df4e638
address some of ed's comments
ZoeLeibowitz 72e8222
misc: Address comments
ZoeLeibowitz b72465f
Merge pull request #2635 from devitocodes/petsc_mpi
ZoeLeibowitz 16be19a
dsl/compiler: Add PETSc logging instrastructure and tests
ZoeLeibowitz f790ab9
Merge pull request #2655 from devitocodes/petsc_performance_summary
ZoeLeibowitz e3e26f0
compiler: Fix language summary
ZoeLeibowitz 9a182da
misc: Fix advisor profiling with new language arg
ZoeLeibowitz 774af10
misc: Clean up and docstrings
ZoeLeibowitz 910c987
misc: Clean up
ZoeLeibowitz ff4b2d7
misc: flake8
ZoeLeibowitz 91c91c3
Merge pull request #2626 from devitocodes/biharmonic
ZoeLeibowitz 70d1719
misc: Merge with main
ZoeLeibowitz 3044691
tests: Update petsc tests since merging with latest main
ZoeLeibowitz 4139a3f
misc: Flake8
ZoeLeibowitz 7c69c4d
dsl/compiler: Extend solver_parameters handling in PETScSolve and upd…
ZoeLeibowitz a19f136
workflows: Fix segfault in parallel tests
ZoeLeibowitz cdb83ef
PETSc clean up (#2740)
ZoeLeibowitz c51d394
Merge branch 'main' into petsc
ZoeLeibowitz bf52c5b
misc: Fixes since merge with main
ZoeLeibowitz 807396c
tests: Edit test_special_array_definition
ZoeLeibowitz 29e188d
misc: Merge with main
ZoeLeibowitz fd4b0e8
types: Add is_CompositeObject to handle dereferencing petscstruct types
ZoeLeibowitz 9451510
Merge branch 'main' into petsc
ZoeLeibowitz cde2198
merge petsc with main
ZoeLeibowitz 501e1f9
tests: Fix petsc test
ZoeLeibowitz a91bdaf
ci: Edit Dockerfile.petsc, add docker-petsc.yml and clean up pytest-p…
ZoeLeibowitz f5b60f2
Utilise `PetscSection` to constrain essential boundary conditions (#2…
ZoeLeibowitz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: Publish devito-petsc docker image | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - petsc | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
| name: Build and push devito-petsc image | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| # Use buildkit | ||
| DOCKER_BUILDKIT: "1" | ||
|
|
||
| PETSC_REPO: https://gitlab.com/ZoeLeibowitz/petsc.git | ||
| PETSC_BRANCH: zoe/feature-da-section-sf | ||
|
|
||
| steps: | ||
| - name: Checkout devito | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to DockerHub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
|
||
| - name: Build & push petsc image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: docker/Dockerfile.petsc | ||
| push: true | ||
| platforms: linux/amd64 | ||
| tags: | | ||
| devitocodes/devito-petsc:latest | ||
| build-args: | | ||
| base=devitocodes/devito:gcc-dev-amd64 | ||
| PETSC_REPO=${{ env.PETSC_REPO }} | ||
| PETSC_BRANCH=${{ env.PETSC_BRANCH }} | ||
|
|
||
| - name: Remove dangling layers | ||
| run: docker system prune -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,9 +19,11 @@ on: | |
| push: | ||
| branches: | ||
| - main | ||
| - petsc | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - petsc | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,9 +13,11 @@ on: | |
| push: | ||
| branches: | ||
| - main | ||
| - petsc | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - petsc | ||
|
|
||
| jobs: | ||
| tutorials: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,9 +13,11 @@ on: | |
| push: | ||
| branches: | ||
| - main | ||
| - petsc | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - petsc | ||
|
|
||
| jobs: | ||
| flake8: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,9 +13,11 @@ on: | |
| push: | ||
| branches: | ||
| - main | ||
| - petsc | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - petsc | ||
|
|
||
| jobs: | ||
| test-mpi-basic: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,9 +13,11 @@ on: | |
| push: | ||
| branches: | ||
| - main | ||
| - petsc | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - petsc | ||
|
|
||
| jobs: | ||
| pytest: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| name: CI-petsc | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - petsc | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - petsc | ||
|
|
||
| jobs: | ||
| pytest: | ||
| name: ${{ matrix.name }} | ||
| 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 | ||
|
|
||
| # To be extended | ||
| matrix: | ||
| include: | ||
| - name: pytest-petsc | ||
| os: ubuntu-latest | ||
| arch: "gcc" | ||
| language: "C" | ||
|
|
||
| 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.petsc \ | ||
| --build-arg PETSC_REPO=https://gitlab.com/ZoeLeibowitz/petsc.git \ | ||
| --build-arg PETSC_BRANCH=zoe/feature-da-section-sf \ | ||
| --tag devito_petsc_image:test . | ||
|
|
||
| - name: Set run prefix | ||
| run: | | ||
| echo "RUN_CMD=docker run --rm -t -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_petsc_image:test" >> $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()]))" | ||
|
|
||
| - 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 | ||
|
Contributor
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 }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,9 +13,11 @@ on: | |
| push: | ||
| branches: | ||
| - main | ||
| - petsc | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - petsc | ||
|
|
||
| jobs: | ||
| tutorials: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ultra nitpick: fstring