Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into JDBetteridge/faster…
Browse files Browse the repository at this point in the history
…_tests
  • Loading branch information
connorjward committed Jan 9, 2025
2 parents 130b7b8 + 39742a6 commit ea03f73
Show file tree
Hide file tree
Showing 635 changed files with 57,060 additions and 2,115 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto

# Whitespace
* whitespace=tab-in-indent,space-before-tab,trailing-space,tabwidth=2
*.{py,pyx,pxd,pxi} whitespace=tab-in-indent,space-before-tab,trailing-space,tabwidth=4
Makefile whitespace=space-before-tab,trailing-space,tabwidth=2
pyop2/_version.py export-subst
firedrake/_version.py export-subst
61 changes: 61 additions & 0 deletions .github/workflows/build-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Install and test Firedrake (macOS)

on:
push:
branches:
- master
pull_request:
# By default this workflow is run on the "opened", "synchronize" and
# "reopened" events. We add "labelled" so it will run if the PR is given a label.
types: [opened, synchronize, reopened, labeled]

concurrency:
# Cancels jobs running if new commits are pushed
group: >
${{ github.workflow }}-
${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build Firedrake (macOS)
runs-on: [self-hosted, macOS]
# 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 # needed to symlink the checked out branch into the venv
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
steps:
- name: Add homebrew to PATH
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path
run: echo "/opt/homebrew/bin" >> "$GITHUB_PATH"
- uses: actions/checkout@v4
- name: Pre-run cleanup
if: ${{ always() }}
run: |
cd ..
rm -rf firedrake_venv
- name: Install Python
run: brew install python python-setuptools
- name: Build Firedrake
run: |
cd ..
"$(brew --prefix)/bin/python3" \
firedrake/scripts/firedrake-install \
--venv-name firedrake_venv \
--disable-ssh \
|| (cat firedrake-install.log && /bin/false)
- 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
- name: Post-run cleanup
if: ${{ always() }}
run: |
cd ..
rm -rf firedrake_venv
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
--mpicxx="$MPICH_DIR"/mpicxx \
--mpif90="$MPICH_DIR"/mpif90 \
--mpiexec="$MPICH_DIR"/mpiexec \
--mpihome="$MPICH_DIR"/.. \
--venv-name firedrake_venv \
--no-package-manager \
--disable-ssh \
Expand Down Expand Up @@ -97,7 +98,7 @@ jobs:
. ../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/test_0init.py
python -m pytest -v tests/firedrake/test_0init.py
python -m pytest \
--durations=200 \
--timeout=1800 \
Expand All @@ -106,7 +107,7 @@ jobs:
-m "not parallel" \
-n 12 --dist worksteal \
--junit-xml=firedrake1.xml \
-sv tests
-sv tests/firedrake
timeout-minutes: 60
- name: Test Firedrake 2 ranks
run: |
Expand All @@ -122,7 +123,7 @@ jobs:
-o faulthandler_timeout=1860 \
--junit-xml=firedrake2_\$MPISPAWN_TASK_ID1.xml \
-m "parallel[\$MPISPAWN_WORLD_SIZE] and not broken" \
-v tests
-v tests/firedrake
timeout-minutes: 30
- name: Test Firedrake 3 ranks
run: |
Expand All @@ -138,7 +139,7 @@ jobs:
-o faulthandler_timeout=1860 \
--junit-xml=firedrake3_\$MPISPAWN_TASK_ID1.xml \
-m "parallel[\$MPISPAWN_WORLD_SIZE] and not broken" \
-v tests
-v tests/firedrake
timeout-minutes: 60
- name: Test Firedrake 4 ranks
run: |
Expand All @@ -154,7 +155,7 @@ jobs:
-o faulthandler_timeout=1860 \
--junit-xml=firedrake4_\$MPISPAWN_TASK_ID1.xml \
-m "parallel[\$MPISPAWN_WORLD_SIZE] and not broken" \
-v tests
-v tests/firedrake
timeout-minutes: 30
- name: Test Firedrake 6 ranks
run: |
Expand All @@ -167,7 +168,7 @@ jobs:
-o faulthandler_timeout=1860 \
--junit-xml=firedrake6.xml \
-m "parallel[6] and not broken" \
-sv tests
-sv tests/firedrake
timeout-minutes: 30
- name: Test Firedrake 7 ranks
run: |
Expand All @@ -180,7 +181,7 @@ jobs:
-o faulthandler_timeout=1860 \
--junit-xml=firedrake7.xml \
-m "parallel[7] and not broken" \
-sv tests
-sv tests/firedrake
timeout-minutes: 30
- name: Test Firedrake 8 ranks
run: |
Expand All @@ -193,7 +194,7 @@ jobs:
-o faulthandler_timeout=1860 \
--junit-xml=firedrake8.xml \
-m "parallel[8] and not broken" \
-sv tests
-sv tests/firedrake
timeout-minutes: 30
- name: Publish Test Report
uses: mikepenz/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker_reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Build and push ${{ inputs.target }}
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: true
no-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Setup flake8 annotations
Expand Down
111 changes: 111 additions & 0 deletions .github/workflows/pip-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Pip install Firedrake (macOS)

on:
push:
branches:
- master
pull_request:
# By default this workflow is run on the "opened", "synchronize" and
# "reopened" events. We add "labelled" so it will run if the PR is given a label.
types: [opened, synchronize, reopened, labeled]

concurrency:
# Cancels jobs running if new commits are pushed
group: >
${{ github.workflow }}-
${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
name: "Build Firedrake using pip (macOS)"
runs-on: [self-hosted, macOS]
# 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:
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
steps:
- name: Add homebrew to PATH
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path
run: echo "/opt/homebrew/bin" >> "$GITHUB_PATH"

- name: Install homebrew packages
run: brew install gcc autoconf pkg-config make automake cmake ninja libtool boost openblas python python-setuptools mpich

- name: Cleanup (pre)
if: ${{ always() }}
run: |
rm -rf pip_venv
"$(brew --prefix)/bin/python3" -m pip cache purge
- name: Create a virtual environment
run: |
"$(brew --prefix)/bin/python3" -m venv pip_venv
mkdir pip_venv/src
- name: Install PETSc
run: |
cd pip_venv/src
git clone https://github.com/firedrakeproject/petsc.git
cd petsc
./configure PETSC_DIR="$PWD" PETSC_ARCH=default \
--with-shared-libraries=1 \
--with-mpi-dir=/opt/homebrew \
--with-zlib \
--download-bison \
--download-hdf5 \
--download-hwloc \
--download-hypre \
--download-metis \
--download-mumps \
--download-netcdf \
--download-pastix \
--download-pnetcdf \
--download-ptscotch \
--download-scalapack \
--download-suitesparse \
--download-superlu_dist
make
- uses: actions/checkout@v4
with:
path: pip_venv/src/firedrake

- name: Pip install
run: |
export PETSC_DIR="$PWD/pip_venv/src/petsc"
export PETSC_ARCH=default
export HDF5_DIR="$PETSC_DIR/$PETSC_ARCH"
export HDF5_MPI=ON
export CC=/opt/homebrew/bin/mpicc
export CXX=/opt/homebrew/bin/mpicxx
export MPICC="$CC"
source pip_venv/bin/activate
cd pip_venv/src
python -m pip install \
--log=firedrake-install.log \
--no-binary h5py \
-v -e './firedrake[test]'
- name: Install CI-specific test dependencies
run: |
source pip_venv/bin/activate
python -m pip install -U pytest-timeout
- name: Run Firedrake smoke tests
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

- name: Cleanup (post)
if: ${{ always() }}
run: |
rm -rf pip_venv
"$(brew --prefix)/bin/python3" -m pip cache purge
Loading

0 comments on commit ea03f73

Please sign in to comment.