Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into allatoncereducedfunctional
Browse files Browse the repository at this point in the history
  • Loading branch information
JHopeCollins committed Nov 29, 2024
2 parents 119de1a + 2be9fb2 commit 886f831
Show file tree
Hide file tree
Showing 508 changed files with 47,939 additions and 635 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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ 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 \
--timeout-method=thread \
-o faulthandler_timeout=1860 \
-n 12 --dist worksteal \
--junit-xml=firedrake.xml \
-sv tests
-sv tests/firedrake
timeout-minutes: 120
- name: Publish Test Report
uses: mikepenz/[email protected]
Expand Down
129 changes: 129 additions & 0 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Pip install Firedrake

on:
# Push to master or PR
push:
branches:
- master
pull_request:

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"
runs-on: ubuntu-latest
container:
image: firedrakeproject/firedrake-env:latest
options: --user root
defaults:
run:
shell: bash
working-directory: /home/firedrake
strategy:
# Don't immediately kill real if complex fails and vice versa.
fail-fast: false
matrix:
include:
- scalar-type: real
petsc_arch: default
- scalar-type: complex
petsc_arch: complex
env:
# PETSC_DIR, HDF5_DIR and MPICH_DIR are set inside the docker image
FIREDRAKE_CI_TESTS: 1
PYOP2_CI_TESTS: 1
PETSC_ARCH: ${{ matrix.petsc_arch }}
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
RDMAV_FORK_SAFE: 1
steps:
- name: Cleanup
if: ${{ always() }}
run: rm -rf pip_venv

- name: Create a venv
run: |
python3 -m venv pip_venv
ln -s /__w/firedrake/firedrake/src pip_venv/
- uses: actions/checkout@v4
with:
path: src/firedrake

- 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="$MPICH_DIR/mpicc" \
-DMPI_CXX_COMPILER="$MPICH_DIR/mpicxx" \
-DMPI_Fortran_COMPILER="$MPICH_DIR/mpif90" \
-DCMAKE_Fortran_COMPILER="$MPICH_DIR/mpif90" \
-DMPIEXEC_EXECUTABLE="$MPICH_DIR/mpiexec"
make
make install
- name: Pip install
run: |
source pip_venv/bin/activate
cd pip_venv/src
export CC="$MPICH_DIR/mpicc"
export CXX="$MPICH_DIR/mpicxx"
export MPICC="$MPICH_DIR/mpicc"
export MPI_HOME="$PETSC_DIR/packages"
pip install \
--log=firedrake-install.log \
--no-binary mpi4py,h5py \
-v -e './firedrake[test]'
- name: Add mpiexec to the venv and install timeout
run: |
source pip_venv/bin/activate
cat << EOF > "$VIRTUAL_ENV/bin/mpiexec"
#!/bin/bash
"$MPICH_DIR"/mpiexec "\$@"
EOF
chmod +x "$VIRTUAL_ENV"/bin/mpiexec
pip install -U pytest-timeout
- name: Run Firedrake smoke tests
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

- name: Publish Test Report
uses: mikepenz/[email protected]
if: ${{ always() && ( github.ref != 'refs/heads/master') }}
with:
report_paths: '/home/firedrake/pip_venv/src/firedrake/firedrake.xml'
comment: true
check_name: "Firedrake ${{ matrix.scalar-type }}"
updateComment: true
flaky_summary: true

- name: Cleanup
# Belt and braces: clean up before and after the run.
if: ${{ always() }}
run: rm -rf pip_venv
119 changes: 119 additions & 0 deletions .github/workflows/pyop2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: PyOP2

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

jobs:
test:
runs-on: ubuntu-latest
strategy:
# Don't immediately kill all if one Python version fails
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
env:
CC: mpicc
PETSC_DIR: ${{ github.workspace }}/petsc
PETSC_ARCH: default
RDMAV_FORK_SAFE: 1
PYOP2_CI_TESTS: 1
timeout-minutes: 60

steps:
- name: Install system dependencies
shell: bash
run: |
sudo apt update
sudo apt install build-essential mpich libmpich-dev \
libblas-dev liblapack-dev gfortran libhwloc-dev libfabric-dev
- name: Set correct Python version
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ matrix.python-version }}
# By default setup-python pollutes the environment in such a way that virtual
# environments cannot be used. This prevents us from building libsupermesh because
# it relies on having rtree installed into a venv.
# https://github.com/actions/setup-python/issues/851
# https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-update-environment-flag
update-environment: false

- name: Create virtual environment
shell: bash
run: |
${{ steps.setup-python.outputs.python-path }} -m venv venv
- name: Clone PETSc
uses: actions/checkout@v4
with:
repository: firedrakeproject/petsc
path: ${{ env.PETSC_DIR }}

- name: Build and install PETSc
shell: bash
working-directory: ${{ env.PETSC_DIR }}
run: |
./configure \
--download-hdf5 \
--with-debugging=1 \
--with-shared-libraries=1 \
--with-c2html=0 \
--with-fortran-bindings=0
make
- name: Install libsupermesh
shell: bash
run: |
source venv/bin/activate
python -m pip install 'rtree>=1.2'
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=mpicc \
-DMPI_CXX_COMPILER=mpicxx \
-DMPI_Fortran_COMPILER=mpif90 \
-DCMAKE_Fortran_COMPILER=mpif90 \
-DMPIEXEC_EXECUTABLE=mpiexec
make
make install
- name: Checkout PyOP2
uses: actions/checkout@v4
with:
path: PyOP2

- name: Install PyOP2 dependencies
shell: bash
working-directory: PyOP2
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
run: |
source ../venv/bin/activate
python -m pip install -v ".[test]"
- name: Run tests
shell: bash
working-directory: PyOP2
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
timeout-minutes: 10
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,34 @@ __pycache__/
/firedrake_configuration/configuration.json
/firedrake.egg-info
/docs/source/element_list.csv


# Build
build
dist
MANIFEST
PyOP2.egg-info
*.py[cdo]

# Extension modules
sparsity.so
sparsity.c
sparsity.cpython*.so
# Docs
pyop2.coffee.rst
pyop2.rst
pyop2.pdf
pyop2.aux
pyop2.log

# Testing
.pytest-incremental
.tox
.vagrant

# Meshes
*.edge
*.ele
*.msh
*.node
*.geo
19 changes: 19 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,22 @@ Joe Wallwork <[email protected]>
Jingmin Xia <[email protected]>
Jingmin Xia <[email protected]> <[email protected]>

Gheorghe-Teodor Bercea <[email protected]> <foraker.doc.ic.ac.uk>
George Boutsioukis <[email protected]>
David A Ham <[email protected]>
David A Ham <[email protected]> <[email protected]>
Miklós Homolya <[email protected]>
Nicolas Loriant <[email protected]> <[email protected]>
Nicolas Loriant <[email protected]> <[email protected]>
Nicolas Loriant <[email protected]> <[email protected]>
Nicolas Loriant <[email protected]> <[email protected]>
Nicolas Loriant <[email protected]> <[email protected]>
Fabio Luporini <[email protected]> <[email protected]>
Graham Markall <[email protected]> <[email protected]>
Graham Markall <[email protected]> <[email protected]>
Andrew McRae <[email protected]> <[email protected]>
Andrew McRae <[email protected]> <[email protected]>
Lawrence Mitchell <[email protected]> <[email protected]>
Lawrence Mitchell <[email protected]> <[email protected]>
Kaho Sato <[email protected]>
Reuben W. Nixon-Hill <[email protected]> <[email protected]>
31 changes: 31 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Firedrake:
Firedrake is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
Expand All @@ -11,3 +12,33 @@ License for more details.
You should have received a copy of the GNU Lesser General Public
License along with Firedrake. If not, see <http://www.gnu.org/licenses/>.

PyOP2:
Copyright (c) 2012, Imperial College London and others. Please see the
AUTHORS file in the main source directory for a full list of copyright
holders. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* The name of Imperial College London or that of other
contributors may not be used to endorse or promote products
derived from this software without specific prior written
permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTERS
''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
include versioneer.py
include firedrake/_version.py
recursive-include pyop2 *.c
include pyop2/_version.py

Loading

0 comments on commit 886f831

Please sign in to comment.