Skip to content
Snippets Groups Projects
Commit 60672433 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

workaround for problem with random numers and MPI

parent f1709dd5
No related branches found
No related tags found
2 merge requests!324New gridder (again!),!318switch from numpy.fft to pypocketfft
Pipeline #48171 passed
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment