Skip to content

Commit

Permalink
Merge branch 'master' into allatoncereducedfunctional
Browse files Browse the repository at this point in the history
  • Loading branch information
JHopeCollins committed Dec 17, 2024
2 parents 886f831 + 85521cd commit b490712
Show file tree
Hide file tree
Showing 95 changed files with 7,868 additions and 389 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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"
timeout-minutes: 30
- name: Post-run cleanup
if: ${{ always() }}
run: |
cd ..
rm -rf firedrake_venv
127 changes: 127 additions & 0 deletions .github/workflows/pip-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
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
- name: Install libsupermesh
run: |
source pip_venv/bin/activate
python -m pip install 'rtree>=1.2'
cd pip_venv/src
git clone https://github.com/firedrakeproject/libsupermesh.git
mkdir -p libsupermesh/build
cd libsupermesh/build
cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV" \
-DMPI_C_COMPILER=/opt/homebrew/bin/mpicc \
-DMPI_CXX_COMPILER=/opt/homebrew/bin/mpicxx \
-DMPI_Fortran_COMPILER=/opt/homebrew/bin/mpif90 \
-DCMAKE_Fortran_COMPILER=/opt/homebrew/bin/mpif90 \
-DMPIEXEC_EXECUTABLE=/opt/homebrew/bin/mpiexec
make
make install
- 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"
timeout-minutes: 30

- name: Cleanup (post)
if: ${{ always() }}
run: |
rm -rf pip_venv
"$(brew --prefix)/bin/python3" -m pip cache purge
39 changes: 23 additions & 16 deletions .github/workflows/pyop2.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: PyOP2
name: Test PyOP2 and TSFC

# Trigger the workflow on push or pull request,
# but only for the master branch
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
Expand All @@ -31,7 +27,7 @@ jobs:
shell: bash
run: |
sudo apt update
sudo apt install build-essential mpich libmpich-dev \
sudo apt install build-essential libopenmpi-dev \
libblas-dev liblapack-dev gfortran libhwloc-dev libfabric-dev
- name: Set correct Python version
Expand Down Expand Up @@ -88,32 +84,43 @@ jobs:
make
make install
- name: Checkout PyOP2
- name: Checkout Firedrake
uses: actions/checkout@v4
with:
path: PyOP2
path: firedrake

- name: Install PyOP2 dependencies
shell: bash
working-directory: PyOP2
working-directory: firedrake
run: |
source ../venv/bin/activate
python -m pip install -U pip
python -m pip install -U pytest-timeout
- name: Install PyOP2
shell: bash
working-directory: PyOP2
working-directory: firedrake
run: |
source ../venv/bin/activate
python -m pip install -v ".[test]"
export CC=mpicc
export HDF5_DIR="$PETSC_DIR/$PETSC_ARCH"
export HDF5_MPI=ON
python -m pip install --no-binary h5py -v ".[test]"
- name: Run TSFC tests
shell: bash
working-directory: firedrake
run: |
source ../venv/bin/activate
pytest --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/tsfc
timeout-minutes: 10

- name: Run tests
- name: Run PyOP2 tests
shell: bash
working-directory: PyOP2
working-directory: firedrake
run: |
source ../venv/bin/activate
# Running parallel test cases separately works around a bug in pytest-mpi
pytest -k "not parallel" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2
mpiexec -n 3 pytest -k "parallel[3]" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2
pytest -m "not parallel" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2
mpiexec -n 2 --oversubscribe pytest -m "parallel[2]" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2
mpiexec -n 3 --oversubscribe pytest -m "parallel[3]" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2
timeout-minutes: 10
4 changes: 4 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Christopher Hawkes

Miklós Homolya

Joshua Hope-Collins...........<https://www.imperial.ac.uk/people/joshua.hope-collins13>

Christian T. Jacobs

Darko Janeković
Expand Down Expand Up @@ -170,5 +172,7 @@ Florian Wechsung..............<https://florianwechsung.github.io>

Yian Zeng

Umberto Zerbinati.............<https://www.uzerbinati.eu>

Fangyi Zhou

2 changes: 1 addition & 1 deletion CITATION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you publish results using Firedrake, we would be grateful if you would cite t

@manual{FiredrakeUserManual,
title = {Firedrake User Manual},
author = {David A. Ham and Paul H. J. Kelly and Lawrence Mitchell and Colin J. Cotter and Robert C. Kirby and Koki Sagiyama and Nacime Bouziani and Thomas J. Gregory and Jack Betteridge and Daniel R. Shapero and Reuben W. Nixon-Hill and Connor J. Ward and Patrick E. Farrell and Pablo D. Brubeck and India Marsden and Daiane I. Dolci and Sophia Vorderwuelbecke and Thomas H. Gibson and Miklós Homolya and Tianjiao Sun and Andrew T. T. McRae and Fabio Luporini and Alastair Gregory and Michael Lange and Simon W. Funke and Florian Rathgeber and Gheorghe-Teodor Bercea and Graham R. Markall},
author = {David A. Ham and Paul H. J. Kelly and Lawrence Mitchell and Colin J. Cotter and Robert C. Kirby and Koki Sagiyama and Nacime Bouziani and Thomas J. Gregory and Jack Betteridge and Daniel R. Shapero and Reuben W. Nixon-Hill and Connor J. Ward and Patrick E. Farrell and Pablo D. Brubeck and India Marsden and Daiane I. Dolci and Joshua Hope-Collins and Sophia Vorderwuelbecke and Thomas H. Gibson and Miklós Homolya and Tianjiao Sun and Andrew T. T. McRae and Fabio Luporini and Alastair Gregory and Michael Lange and Simon W. Funke and Florian Rathgeber and Gheorghe-Teodor Bercea and Graham R. Markall},
organization = {Imperial College London and University of Oxford and Baylor University and University of Washington},
edition = {First edition},
year = {2023},
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ lint:
@python -m flake8 $(FLAKE8_FORMAT) pyop2
@echo " Linting PyOP2 scripts"
@python -m flake8 $(FLAKE8_FORMAT) pyop2/scripts --filename=*
@echo " Linting TSFC"
@python -m flake8 $(FLAKE8_FORMAT) tsfc

actionlint:
@echo " Pull latest actionlint image"
Expand Down
15 changes: 7 additions & 8 deletions docker/Dockerfile.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apt-get update \
cmake gfortran git libopenblas-serial-dev \
libtool python3-dev python3-pip python3-tk python3-venv \
python3-requests zlib1g-dev libboost-dev sudo gmsh \
bison flex ninja-build \
bison flex ninja-build pkg-config \
libocct-ocaf-dev libocct-data-exchange-dev \
swig graphviz \
libcurl4-openssl-dev libxml2-dev \
Expand Down Expand Up @@ -67,9 +67,14 @@ RUN bash -c 'cd petsc; \
--download-suitesparse \
--download-superlu_dist \
PETSC_ARCH=packages; \
mv packages/include/petscconf.h packages/include/old_petscconf.nope;'
mv packages/include/petscconf.h packages/include/old_petscconf.nope; \
rm -rf /home/firedrake/petsc/**/externalpackages; \
rm -rf /home/firedrake/petsc/src/docs; \
rm -f /home/firedrake/petsc/src/**/tutorials/output/*; \
rm -f /home/firedrake/petsc/src/**/tests/output/*'
# Don't run make here, we only want MPICH and HWLOC
# It is also necessary to move `petscconf.h` so packages isn't treated like a working PETSc
# Cleaned up unnecessary files

# Build default Firedrake PETSc
RUN bash -c 'export PACKAGES=/home/firedrake/petsc/packages; \
Expand Down Expand Up @@ -149,12 +154,6 @@ RUN bash -c 'export PETSC_DIR=/home/firedrake/petsc; \
./configure; \
make SLEPC_DIR=/home/firedrake/slepc PETSC_DIR=/home/firedrake/petsc PETSC_ARCH=complex;'

# Clean up unnecessary files
RUN rm -rf /home/firedrake/petsc/**/externalpackages \
&& rm -rf /home/firedrake/petsc/src/docs \
&& rm -f /home/firedrake/petsc/src/**/tutorials/output/* \
&& rm -f /home/firedrake/petsc/src/**/tests/output/*

# Set some useful environment variables
ENV PETSC_DIR /home/firedrake/petsc
ENV SLEPC_DIR /home/firedrake/slepc
Expand Down
5 changes: 3 additions & 2 deletions docs/source/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ they have the system dependencies:
* zlib
* flex, bison
* Ninja
* pkg-config

Firedrake has been successfully installed on Windows 10 using the
Windows Subsystem for Linux. There are more detailed instructions for
Expand Down Expand Up @@ -229,10 +230,10 @@ type::

You should now be able to run ``firedrake-update``.

Installing Firedrake with pip (experimental, Linux only)
Installing Firedrake with pip (experimental)
--------------------------------------------------------

Firedrake has experimental support for installing using ``pip``, avoiding the need for the ``firedrake-install`` script. At present only Linux is tested using this install method.
Firedrake has experimental support for installing using ``pip``, avoiding the need for the ``firedrake-install`` script.

Requirements
~~~~~~~~~~~~
Expand Down
10 changes: 9 additions & 1 deletion docs/source/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@
Firedrake events
----------------

Firedrake USA'25
~~~~~~~~~~~~~~~~

The ninth Firedrake user and developer workshop will be held 28 February
and 1 March 2025 at Baylor University in Texas, USA. For more information
see :doc:`the workshop page <firedrake_usa_25>`.


Firedrake '24
~~~~~~~~~~~~~

The eighth Firedrake user and developer workshop will be held
The eighth Firedrake user and developer workshop was held
between 16-18 September 2024 at the University of Oxford. For more
information see :doc:`the workshop page <firedrake_24>`.

Expand Down
4 changes: 1 addition & 3 deletions docs/source/firedrake_usa_20.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ Organising Committee
University of Washington.
* `David Ham <https://www.imperial.ac.uk/people/david.ham>`_, Imperial
College London.
* `Lawrence Mitchell
<https://www.dur.ac.uk/computer.science/staff/profile/?id=17243>`_,
Durham University.
* Lawrence Mitchell, Durham University.


Further details
Expand Down
Loading

0 comments on commit b490712

Please sign in to comment.