diff --git a/.github/workflows/ci_pipeline.yml b/.github/workflows/ci_pipeline.yml index 7650b8638b1af264a78f65c255a9a613fa42702f..586ef8f9c004449883350416ccb3b27be86cd777 100644 --- a/.github/workflows/ci_pipeline.yml +++ b/.github/workflows/ci_pipeline.yml @@ -173,7 +173,7 @@ 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 @@ -181,6 +181,11 @@ jobs: 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: @@ -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 diff --git a/pySDC/tests/test_helpers/test_gusto_coupling.py b/pySDC/tests/test_helpers/test_gusto_coupling.py index 1eeeb9fa0f806aae315e42a80e8ad516eb004ea9..119442a223bd4ff088d424e116b8b136785df966 100644 --- a/pySDC/tests/test_helpers/test_gusto_coupling.py +++ b/pySDC/tests/test_helpers/test_gusto_coupling.py @@ -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 @@ -326,7 +326,7 @@ def test_pySDC_integrator_RK(use_transport_scheme, method, setup): 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}' @@ -449,7 +449,7 @@ def test_pySDC_integrator(use_transport_scheme, imex, setup): 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}' @@ -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() @@ -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}' diff --git a/pySDC/tests/test_tutorials/test_step_7.py b/pySDC/tests/test_tutorials/test_step_7.py index 3445aea4b07b40047c0e6d10a885db9c12a4fe07..72f40a889cfe6cd96cbed88158bb7ac0db04914a 100644 --- a/pySDC/tests/test_tutorials/test_step_7.py +++ b/pySDC/tests/test_tutorials/test_step_7.py @@ -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() diff --git a/pySDC/tutorial/step_7/E_pySDC_with_Firedrake.py b/pySDC/tutorial/step_7/E_pySDC_with_Firedrake.py index 0307d53592745aef3db3a0fa6c2f2395e8b30ea2..a1539a693e6dc5d6f164e738f51a4467333f69c5 100644 --- a/pySDC/tutorial/step_7/E_pySDC_with_Firedrake.py +++ b/pySDC/tutorial/step_7/E_pySDC_with_Firedrake.py @@ -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 diff --git a/pySDC/tutorial/step_7/F_pySDC_with_Gusto.py b/pySDC/tutorial/step_7/F_pySDC_with_Gusto.py index fdd9b0eac857c9df776fa28734fd3605823c6b5f..13e91946090e410cf1dc418f671c47453e06b841 100644 --- a/pySDC/tutorial/step_7/F_pySDC_with_Gusto.py +++ b/pySDC/tutorial/step_7/F_pySDC_with_Gusto.py @@ -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