Skip to content

Commit

Permalink
Merge branch 'master' into indiamai/new_def_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
indiamai committed Jan 30, 2025
2 parents 82965b9 + c2500aa commit f4bd073
Show file tree
Hide file tree
Showing 86 changed files with 2,648 additions and 914 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,16 @@ jobs:
--venv-name firedrake_venv \
--disable-ssh \
|| (cat firedrake-install.log && /bin/false)
- name: Install test dependencies
run: |
. ../firedrake_venv/bin/activate
python -m pip install pytest-timeout
- name: Run smoke tests
run: |
. ../firedrake_venv/bin/activate
python -m pytest -v tests/firedrake/regression/ -k "poisson_strong or stokes_mini or dg_advection"
# also test for 'problem libraries' (spatialindex and libsupermesh)
python -m pytest -v tests/firedrake/regression/test_locate_cell.py
python -m pytest -v tests/firedrake/supermesh/test_assemble_mixed_mass_matrix.py
timeout-minutes: 30
make check CHECK_PYTEST_ARGS="--timeout 60"
timeout-minutes: 10
- name: Post-run cleanup
if: ${{ always() }}
run: |
Expand Down
102 changes: 79 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ env:
RELEASE_TAG: latest

jobs:
build:
name: "Build Firedrake"
# Run on our self-hosted machines
test:
name: "Run Firedrake tests (Linux)"
runs-on: [self-hosted, Linux]
container:
image: firedrakeproject/firedrake-env:latest
strategy:
# Don't immediately kill real if complex fails and vice versa.
# We want to know all of the tests which fail, so don't kill real if
# complex fails and vice-versa
fail-fast: false
matrix:
include:
Expand All @@ -47,13 +47,16 @@ jobs:
OPENBLAS_NUM_THREADS: 1
COMPLEX: ${{ matrix.complex }}
RDMAV_FORK_SAFE: 1
EXTRA_PYTEST_ARGS: --splitting-algorithm least_duration --timeout=1800 --timeout-method=thread -o faulthandler_timeout=1860 tests/firedrake
steps:
- uses: actions/checkout@v4

- name: Cleanup
if: ${{ always() }}
run: |
cd ..
rm -rf firedrake_venv
- name: Build Firedrake
run: |
cd ..
Expand Down Expand Up @@ -87,56 +90,108 @@ jobs:
--package-branch fiat indiamai/integrate_fuse \
--package-branch fuse main \
|| (cat firedrake-install.log && /bin/false)
- name: Install test dependencies
id: build
run: |
sudo apt update
sudo apt -y install parallel
. ../firedrake_venv/bin/activate
python "$(which firedrake-clean)"
python -m pip install \
pytest-xdist pytest-timeout ipympl
python -m pip install pytest-timeout ipympl pytest-split pytest-xdist
python -m pip list
- name: Test Firedrake
- name: Run tests (nprocs = 1)
run: |
: # Use pytest-xdist here so we can have a single collated output (not possible
: # for parallel tests)
. ../firedrake_venv/bin/activate
echo OMP_NUM_THREADS is "$OMP_NUM_THREADS"
echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS"
python -m pytest -v tests/firedrake/test_0init.py
python -m pytest \
--durations=200 \
--timeout=1800 \
--timeout-method=thread \
-o faulthandler_timeout=1860 \
-n 12 --dist worksteal \
--junit-xml=firedrake.xml \
-sv tests/firedrake
timeout-minutes: 120
firedrake-run-split-tests 1 1 "-n 12 $EXTRA_PYTEST_ARGS --junit-xml=firedrake1_{#}.xml"
- name: Run tests (nprocs = 2)
# Run even if earlier tests failed
if: ${{ success() || steps.build.conclusion == 'success' }}
run: |
. ../firedrake_venv/bin/activate
firedrake-run-split-tests 2 6 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake2_{#}.xml"
- name: Run tests (nprocs = 3)
if: ${{ success() || steps.build.conclusion == 'success' }}
run: |
. ../firedrake_venv/bin/activate
firedrake-run-split-tests 3 4 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake3_{#}.xml"
- name: Run tests (nprocs = 4)
if: ${{ success() || steps.build.conclusion == 'success' }}
run: |
. ../firedrake_venv/bin/activate
firedrake-run-split-tests 4 3 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake4_{#}.xml"
- name: Run tests (nprocs = 5)
if: ${{ success() || steps.build.conclusion == 'success' }}
run: |
. ../firedrake_venv/bin/activate
firedrake-run-split-tests 5 2 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake5_{#}.xml"
- name: Run tests (nprocs = 6)
if: ${{ success() || steps.build.conclusion == 'success' }}
run: |
. ../firedrake_venv/bin/activate
firedrake-run-split-tests 6 2 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake6_{#}.xml"
- name: Run tests (nprocs = 7)
if: ${{ success() || steps.build.conclusion == 'success' }}
run: |
. ../firedrake_venv/bin/activate
firedrake-run-split-tests 7 1 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake7_{#}.xml"
- name: Run tests (nprocs = 8)
if: ${{ success() || steps.build.conclusion == 'success' }}
run: |
. ../firedrake_venv/bin/activate
firedrake-run-split-tests 8 1 "$EXTRA_PYTEST_ARGS --junit-xml=firedrake8_{#}.xml"
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5.0.0-a02
if: ${{ always() && ( github.ref != 'refs/heads/master') }}
# To avoid permissions issues do not run with forked repos
# (see https://github.com/mikepenz/action-junit-report/issues/23)
if: ${{ always() && (github.ref != 'refs/heads/master') && (github.event.pull_request.head.repo.full_name == github.repository) }}
with:
report_paths: '/__w/firedrake/firedrake/firedrake.xml'
report_paths: 'firedrake*.xml'
comment: true
check_name: "Firedrake ${{ matrix.scalar-type }}"
updateComment: true
flaky_summary: true

- name: Upload log files
uses: actions/upload-artifact@v4
if: always()
with:
name: firedrake-logs-${{ matrix.scalar-type }}
path: pytest_*.log

- name: Test pyadjoint
if: ${{ matrix.scalar-type == 'real' }}
run: |
. ../firedrake_venv/bin/activate
cd ../firedrake_venv/src/pyadjoint
python -m pytest \
--strict-markers \
--durations=200 \
--timeout=600 \
--timeout-method=thread \
-o faulthandler_timeout=660 \
-n 12 --dist worksteal \
-sv tests/firedrake_adjoint
timeout-minutes: 30

- name: Cleanup
# Belt and braces: clean up before and after the run.
if: ${{ always() }}
run: |
cd ..
rm -rf firedrake_venv
docker_tag:
name: "Set the Docker release tag"
runs-on: [self-hosted, Linux]
Expand All @@ -153,14 +208,15 @@ jobs:
echo The release tag is "$RELEASE_TAG"
outputs:
tag: ${{ env.RELEASE_TAG }}

docker:
name: "Build Docker containers"
# Only run on master, but always generate firedrake-env image,
# even if build fails (see docker.yml)
if: ${{ (github.ref == 'refs/heads/master') && always() }}
needs: [build, docker_tag]
needs: [test, docker_tag]
uses: ./.github/workflows/docker.yml
with:
tag: ${{ needs.docker_tag.outputs.tag }}
status: ${{ needs.build.result }}
status: ${{ needs.test.result }}
secrets: inherit
10 changes: 4 additions & 6 deletions .github/workflows/pip-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
# Only run this action if we are pushing to master or the PR is labelled "macOS"
if: ${{ (github.ref == 'refs/heads/master') || contains(github.event.pull_request.labels.*.name, 'macOS') }}
env:
FIREDRAKE_CI_TESTS: 1
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
steps:
Expand Down Expand Up @@ -53,6 +54,7 @@ jobs:
--with-shared-libraries=1 \
--with-mpi-dir=/opt/homebrew \
--with-zlib \
--with-strict-petscerrorcode \
--download-bison \
--download-hdf5 \
--download-hwloc \
Expand Down Expand Up @@ -97,12 +99,8 @@ jobs:
run: |
source pip_venv/bin/activate
cd pip_venv/src/firedrake
python -m pytest --timeout=1800 -v tests/firedrake/regression \
-k "poisson_strong or stokes_mini or dg_advection"
# also test for 'problem libraries' (spatialindex and libsupermesh)
python -m pytest -v tests/firedrake/regression/test_locate_cell.py
python -m pytest -v tests/firedrake/supermesh/test_assemble_mixed_mass_matrix.py
timeout-minutes: 30
make check CHECK_PYTEST_ARGS="--timeout 60"
timeout-minutes: 10

- name: Cleanup (post)
if: ${{ always() }}
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,14 @@ jobs:
run: |
source pip_venv/bin/activate
cd pip_venv/src/firedrake
pytest -v tests/firedrake/test_0init.py
pytest \
--durations=200 \
--timeout=1800 \
--timeout-method=thread \
-o faulthandler_timeout=1860 \
-n 12 --dist worksteal \
--junit-xml=firedrake.xml \
-sv tests/firedrake/regression -k "poisson_strong or stokes_mini or dg_advection"
timeout-minutes: 120
make check CHECK_PYTEST_ARGS="--timeout 60"
timeout-minutes: 10

- name: Publish Test Report
uses: mikepenz/action-junit-report@v5.0.0-a02
if: ${{ always() && ( github.ref != 'refs/heads/master') }}
# To avoid permissions issues do not run with forked repos
# (see https://github.com/mikepenz/action-junit-report/issues/23)
if: ${{ always() && (github.ref != 'refs/heads/master') && (github.event.pull_request.head.repo.full_name == github.repository) }}
with:
report_paths: '/home/firedrake/pip_venv/src/firedrake/firedrake.xml'
comment: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pyop2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
--with-debugging=1 \
--with-shared-libraries=1 \
--with-c2html=0 \
--with-strict-petscerrorcode \
--with-fortran-bindings=0
make
Expand Down
Loading

0 comments on commit f4bd073

Please sign in to comment.