Commit 60672433 authored by Martin Reinecke's avatar Martin Reinecke

workaround for problem with random numers and MPI

parent f1709dd5
Pipeline #48171 passed with stages
in 17 minutes and 25 seconds
......@@ -72,7 +72,7 @@ def _full_implementation(op, domain_dtype, target_dtype, atol, rtol,
def _check_linearity(op, domain_dtype, atol, rtol):
fld1 = from_random("normal", op.domain, dtype=domain_dtype)
fld2 = from_random("normal", op.domain, dtype=domain_dtype)
alpha = np.random.random()
alpha = np.random.random() # FIXME: this can break badly with MPI!
val1 = op(alpha*fld1+fld2)
val2 = alpha*op(fld1)+op(fld2)
_assert_allclose(val1, val2, atol=atol, rtol=rtol)
......
......@@ -37,6 +37,7 @@ _pow_spaces = [ift.PowerSpace(ift.RGSpace((17, 38), harmonic=True))]
pmp = pytest.mark.parametrize
dtype = list2fixture([np.float64, np.complex128])
np.random.seed(42)
@pmp('sp', _p_RG_spaces)
def testLOSResponse(sp, dtype):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment