Skip to content

Commit

Permalink
add dJdm to taylor_test calls
Browse files Browse the repository at this point in the history
  • Loading branch information
colinjcotter committed Jul 12, 2024
1 parent e011ac7 commit 8645c6d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/ensemble_reduced_functional/test_reduced_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def test_verification():
dJdm = rf.derivative()
assert_allclose(ensemble_J, size, rtol=1e-12)
assert_allclose(dJdm.dat.data_ro, 2.0 * size, rtol=1e-12)
dJdm = ensemble.ensemble_comm.allreduce(sendobj=dJdm, op=MPI.SUM)
assert taylor_test(rf, x, Function(R, val=0.1)) > 1.9


Expand All @@ -63,7 +62,7 @@ def test_verification_gather_functional_adjfloat():
assert_allclose(ensemble_J, 1.0**4+2.0**4, rtol=1e-12)
assert_allclose(dJdm.dat.data_ro, 4*(rank+1)**3, rtol=1e-12)
dJdm = ensemble.ensemble_comm.allreduce(sendobj=dJdm, op=MPI.SUM)
assert taylor_test(rf, x, Function(R, val=0.1)) > 1.9
assert taylor_test(rf, x, Function(R, val=0.1), dJdm=dJdm) > 1.9


@pytest.mark.parallel(nprocs=4)
Expand All @@ -88,7 +87,7 @@ def test_verification_gather_functional_Function():
assert_allclose(ensemble_J, 1.0**4+2.0**4, rtol=1e-12)
assert_allclose(dJdm.dat.data_ro, 4*(rank+1)**3, rtol=1e-12)
dJdm = ensemble.ensemble_comm.allreduce(sendobj=dJdm, op=MPI.SUM)
assert taylor_test(rf, x, Function(R, val=0.1)) > 1.9
assert taylor_test(rf, x, Function(R, val=0.1), dJdm=dJdm) > 1.9


@pytest.mark.parallel(nprocs=6)
Expand Down

0 comments on commit 8645c6d

Please sign in to comment.