diff --git a/example_cases/ismipc_30x30/ismipc_30x30.sh b/example_cases/ismipc_30x30/ismipc_30x30.sh index 6bc6ea3..2e9465a 100755 --- a/example_cases/ismipc_30x30/ismipc_30x30.sh +++ b/example_cases/ismipc_30x30/ismipc_30x30.sh @@ -13,8 +13,8 @@ cp output_momsolve/ismipc_U_obs.h5 input/ #Run each phase of the model in turn RUN_DIR=$FENICS_ICE_BASE_DIR/runs/ -#python $RUN_DIR/run_inv.py ismipc_30x30.toml -#python $RUN_DIR/run_forward.py ismipc_30x30.toml -#python $RUN_DIR/run_eigendec.py ismipc_30x30.toml -#python $RUN_DIR/run_errorprop.py ismipc_30x30.toml +python $RUN_DIR/run_inv.py ismipc_30x30.toml +python $RUN_DIR/run_forward.py ismipc_30x30.toml +python $RUN_DIR/run_eigendec.py ismipc_30x30.toml +python $RUN_DIR/run_errorprop.py ismipc_30x30.toml mpirun -n 4 python $RUN_DIR/run_obs_sens_prop.py ismipc_30x30.toml diff --git a/tests/test_runs.py b/tests/test_runs.py index f47acea..6640988 100644 --- a/tests/test_runs.py +++ b/tests/test_runs.py @@ -59,13 +59,19 @@ def test_run_inversion(persistent_temp_model, monkeypatch): J_inv = mdl_out.solvers[0].J_inv.value() + if pytest.parallel: + tol = 1e-2 + + else: + tol = 1e-5 + pytest.check_float_result(cntrl_norm, expected_cntrl_norm, - work_dir, 'expected_cntrl_norm') + work_dir, 'expected_cntrl_norm', tol=tol) pytest.check_float_result(J_inv, expected_J_inv, - work_dir, 'expected_J_inv') + work_dir, 'expected_J_inv', tol=tol) @pytest.mark.tv def test_tv_run_inversion(persistent_temp_model, monkeypatch): @@ -157,13 +163,19 @@ def test_run_forward(existing_temp_model, monkeypatch, setup_deps): delta_qoi = slvr.Qval_ts[-1] - slvr.Qval_ts[0] u_norm = norm(slvr.U) + if pytest.parallel: + tol = 1e-3 + + else: + tol = 1e-5 + pytest.check_float_result(delta_qoi, expected_delta_qoi, - work_dir, 'expected_delta_qoi', tol=1.0e-5) + work_dir, 'expected_delta_qoi', tol=tol) pytest.check_float_result(u_norm, expected_u_norm, - work_dir, 'expected_u_norm', tol=1.0e-5) + work_dir, 'expected_u_norm', tol=tol) @pytest.mark.tv def test_tv_run_forward(existing_temp_model, monkeypatch, setup_deps): @@ -254,7 +266,11 @@ def test_run_eigendec(existing_temp_model, monkeypatch, setup_deps): evals_sum = np.sum(slvr.eigenvals) evec0_norm = norm(slvr.eigenfuncs[0]) - tol = 1e-5 + if pytest.parallel: + tol = 1e-2 + + else: + tol = 1e-5 pytest.check_float_result(evals_sum, expected_evals_sum, @@ -286,7 +302,7 @@ def test_run_errorprop(existing_temp_model, monkeypatch, setup_deps): Q_sigma_prior = mdl_out.Q_sigma_prior[-1] if pytest.parallel: - tol = 5e-5 + tol = 5e-3 else: tol = 1e-5