-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move PyOP2 into Firedrake repository
* Moves PyOP2 code into Firedrake repository. * Adds a pyproject.toml for Firedrake * Enables (with some caveats) one to `pip install firedrake`! * Adds a new pip workflow to make sure things work * Moves Firedrake tests into a `tests/firedrake` subdirectory.
- Loading branch information
1 parent
6bb9a9f
commit 1bceac4
Showing
474 changed files
with
1,089 additions
and
1,111 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -59,7 +59,7 @@ jobs: | |
cd .. | ||
# Linting should ignore unquoted shell variable $COMPLEX | ||
# shellcheck disable=SC2086 | ||
./firedrake/scripts/firedrake-install \ | ||
./firedrake/firedrake/scripts/firedrake-install \ | ||
$COMPLEX \ | ||
--honour-petsc-dir \ | ||
--mpicc="$MPICH_DIR"/mpicc \ | ||
|
@@ -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] | ||
|
This file was deleted.
Oops, something went wrong.
This file contains 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,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 |
Oops, something went wrong.