-
Notifications
You must be signed in to change notification settings - Fork 161
126 lines (113 loc) · 3.99 KB
/
pyop2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Test PyOP2 and TSFC
on:
push:
branches:
- master
pull_request:
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 Firedrake
uses: actions/checkout@v4
with:
path: firedrake
- name: Install PyOP2 dependencies
shell: bash
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: firedrake
run: |
source ../venv/bin/activate
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 PyOP2 tests
shell: bash
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
timeout-minutes: 10