Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,19 @@ jobs:
user_firedrake_tests:
runs-on: ubuntu-latest
container:
image: firedrakeproject/firedrake-vanilla:latest
image: firedrakeproject/firedrake-vanilla-default:latest
options: --user root
volumes:
- ${{ github.workspace }}:/repositories
defaults:
run:
shell: bash -l {0}
steps:
- name: Fix HOME
# For unknown reasons GitHub actions overwrite HOME to /github/home
# which will break everything unless fixed
# (https://github.com/actions/runner/issues/863)
run: echo "HOME=/home/firedrake" >> "$GITHUB_ENV"
- name: Checkout pySDC
uses: actions/checkout@v4
with:
Expand All @@ -190,25 +195,32 @@ jobs:
with:
repository: firedrakeproject/gusto
path: ./gusto_repo
- name: Create virtual environment
# pass '--system-site-packages' so Firedrake can be found
run: python3 -m venv --system-site-packages venv-pySDC

- name: Install pySDC
run: |
. /home/firedrake/firedrake/bin/activate
python -m pip install --no-deps -e /repositories/pySDC
python -m pip install qmat
. venv-pySDC/bin/activate
pip install -e /repositories/pySDC
pip install qmat
# test installation
python -c "import pySDC; print(f'pySDC module: {pySDC}')"
- name: Install gusto
run: |
. /home/firedrake/firedrake/bin/activate
python -m pip install -e /repositories/gusto_repo
. venv-pySDC/bin/activate
pip install -e /repositories/gusto_repo
# test installation
python -c "import gusto; print(f'gusto module: {gusto}')"
- name: run pytest
run: |
. /home/firedrake/firedrake/bin/activate
. venv-pySDC/bin/activate
firedrake-clean
cd ./pySDC
coverage run -m pytest --continue-on-collection-errors -v --durations=0 /repositories/pySDC/pySDC/tests -m firedrake
python -m coverage run -m pytest --continue-on-collection-errors -v --durations=0 /repositories/pySDC/pySDC/tests -m firedrake
timeout-minutes: 45
- name: Make coverage report
run: |
. /home/firedrake/firedrake/bin/activate

cd ./pySDC
mv data ../data_firedrake
Expand Down
10 changes: 5 additions & 5 deletions pySDC/tests/test_helpers/test_gusto_coupling.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def test_generic_gusto_problem(setup):
error = abs(un_forward - un_ref) / abs(un_ref)

assert (
error < np.finfo(float).eps * 1e2
error < np.finfo(float).eps * 1e4
), f'Forward Euler does not match reference implementation! Got relative difference of {error}'

# test backward Euler step
Expand Down Expand Up @@ -326,7 +326,7 @@ def run(stepper, n_steps):
print(error)

assert (
error < solver_parameters['snes_rtol'] * 1e3
error < solver_parameters['snes_rtol'] * 1e4
), f'pySDC and Gusto differ in method {method}! Got relative difference of {error}'


Expand Down Expand Up @@ -449,7 +449,7 @@ def run(stepper, n_steps):
print(error)

assert (
error < solver_parameters['snes_rtol'] * 1e3
error < solver_parameters['snes_rtol'] * 1e4
), f'pySDC and Gusto differ in SDC! Got relative difference of {error}'


Expand Down Expand Up @@ -633,7 +633,7 @@ def test_pySDC_integrator_MSSDC(n_steps, useMPIController, setup, submit=True, n
my_env = os.environ.copy()
my_env['COVERAGE_PROCESS_START'] = 'pyproject.toml'
cwd = '.'
cmd = f'mpiexec -np {n_tasks} python {__file__} --test=MSSDC --n_steps={n_steps}'.split()
cmd = f'mpiexec -np {n_tasks} --oversubscribe python {__file__} --test=MSSDC --n_steps={n_steps}'.split()

p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env, cwd=cwd)
p.wait()
Expand Down Expand Up @@ -762,7 +762,7 @@ def test_pySDC_integrator_MSSDC(n_steps, useMPIController, setup, submit=True, n
print(error)

assert (
error < solver_parameters['snes_rtol'] * 1e3
error < solver_parameters['snes_rtol'] * 1e4
), f'pySDC and Gusto differ in method {method}! Got relative difference of {error}'


Expand Down
2 changes: 1 addition & 1 deletion pySDC/tests/test_tutorials/test_step_7.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def test_E_MPI():
my_env['COVERAGE_PROCESS_START'] = 'pyproject.toml'
cwd = '.'
num_procs = 3
cmd = f'mpiexec -np {num_procs} python pySDC/tutorial/step_7/E_pySDC_with_Firedrake.py --useMPIsweeper'.split()
cmd = f'mpiexec -np {num_procs} --oversubscribe python pySDC/tutorial/step_7/E_pySDC_with_Firedrake.py --useMPIsweeper'.split()

p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=my_env, cwd=cwd)
p.wait()
Expand Down
2 changes: 1 addition & 1 deletion pySDC/tutorial/step_7/E_pySDC_with_Firedrake.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def runHeatFiredrake(useMPIsweeper=False, ML=False):

# do tests that we got the same as last time
n_nodes = 1 if useMPIsweeper else description['sweeper_params']['num_nodes']
assert error[0][1] < 2e-8
assert error[0][1] < 2e-7
assert tot_iter == 10 if ML else 29
assert tot_solver_setup == n_nodes
assert tot_solves == n_nodes * tot_iter
Expand Down
2 changes: 1 addition & 1 deletion pySDC/tutorial/step_7/F_pySDC_with_Gusto.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def williamson_5(
lamda, phi, _ = lonlatr_from_xyz(x, y, z)

# Equation: coriolis
parameters = ShallowWaterParameters(H=mean_depth, g=g)
parameters = ShallowWaterParameters(mesh, H=mean_depth, g=g)
Omega = parameters.Omega
fexpr = 2 * Omega * z / radius

Expand Down