9090)
9191def test_cg (par ):
9292 """CG with MPIBlockDiag"""
93- np .random .seed (42 )
9493 A = np .ones ((par ["ny" ], par ["nx" ])) + par [
9594 "imag" ] * np .ones ((par ["ny" ], par ["nx" ]))
9695 Aop = MatrixMult (np .conj (A .T ) @ A , dtype = par ['dtype' ])
@@ -127,7 +126,7 @@ def test_cg(par):
127126 x0 = None
128127 y1 = BDiag * x_global
129128 xinv1 = pylops .cg (BDiag , y1 , x0 = x0 , niter = par ["nx" ], tol = 1e-5 , show = True )[0 ]
130- assert_allclose (xinv_array , xinv1 , rtol = 1e-12 )
129+ assert_allclose (xinv_array , xinv1 , rtol = 1e-14 )
131130
132131
133132@pytest .mark .mpi (min_size = 2 )
@@ -136,7 +135,6 @@ def test_cg(par):
136135)
137136def test_cgls (par ):
138137 """CGLS with MPIBlockDiag"""
139- np .random .seed (42 )
140138 A = np .ones ((par ["ny" ], par ["nx" ])) + par [
141139 "imag" ] * np .ones ((par ["ny" ], par ["nx" ]))
142140 Aop = MatrixMult (np .conj (A .T ) @ A + 1e-5 * np .eye (par ["nx" ], dtype = par ['dtype' ]),
@@ -175,7 +173,7 @@ def test_cgls(par):
175173 x0 = None
176174 y1 = BDiag * x_global
177175 xinv1 = pylops .cgls (BDiag , y1 , x0 = x0 , niter = par ["nx" ], tol = 1e-5 , show = True )[0 ]
178- assert_allclose (xinv_array , xinv1 , rtol = 1e-12 )
176+ assert_allclose (xinv_array , xinv1 , rtol = 1e-14 )
179177
180178
181179@pytest .mark .mpi (min_size = 2 )
@@ -184,7 +182,6 @@ def test_cgls(par):
184182)
185183def test_cgls_broadcastdata (par ):
186184 """CGLS with broadcasted data vector"""
187- np .random .seed (42 )
188185 A = (rank + 1 ) * np .ones ((par ["ny" ], par ["nx" ])) + (rank + 2 ) * par [
189186 "imag"
190187 ] * np .ones ((par ["ny" ], par ["nx" ]))
@@ -222,7 +219,7 @@ def test_cgls_broadcastdata(par):
222219 x0 = None
223220 y1 = Hstack @ x_global
224221 xinv1 = pylops .cgls (Hstack , y1 , x0 = x0 , niter = par ["nx" ], tol = 1e-5 , show = True )[0 ]
225- assert_allclose (xinv_array , xinv1 , rtol = 1e-12 )
222+ assert_allclose (xinv_array , xinv1 , rtol = 1e-14 )
226223
227224
228225@pytest .mark .mpi (min_size = 2 )
@@ -231,7 +228,6 @@ def test_cgls_broadcastdata(par):
231228)
232229def test_cgls_broadcastmodel (par ):
233230 """CGLS with broadcasted model vector"""
234- np .random .seed (42 )
235231 A = np .ones ((par ["ny" ], par ["nx" ])) + par [
236232 "imag" ] * np .ones ((par ["ny" ], par ["nx" ]))
237233 Aop = MatrixMult (np .conj (A .T ) @ A + 1e-5 * np .eye (par ["nx" ], dtype = par ['dtype' ]),
@@ -272,7 +268,7 @@ def test_cgls_broadcastmodel(par):
272268 x0 = None
273269 y1 = Vstack @ x_global
274270 xinv1 = pylops .cgls (Vstack , y1 , x0 = x0 , niter = par ["nx" ], tol = 1e-5 , show = True )[0 ]
275- assert_allclose (xinv_array , xinv1 , rtol = 1e-12 )
271+ assert_allclose (xinv_array , xinv1 , rtol = 1e-14 )
276272
277273
278274@pytest .mark .mpi (min_size = 2 )
@@ -281,7 +277,6 @@ def test_cgls_broadcastmodel(par):
281277)
282278def test_cg_stacked (par ):
283279 """CG with MPIStackedBlockDiag"""
284- np .random .seed (42 )
285280 A = np .ones ((par ["ny" ], par ["nx" ])) + par [
286281 "imag" ] * np .ones ((par ["ny" ], par ["nx" ]))
287282 Aop = MatrixMult (np .conj (A .T ) @ A + 1e-5 * np .eye (par ["nx" ], dtype = par ['dtype' ]),
@@ -336,7 +331,7 @@ def test_cg_stacked(par):
336331 x0 = None
337332 y1 = StackedBDiag * x_global
338333 xinv1 = pylops .cg (StackedBDiag , y1 , x0 = x0 , niter = par ["nx" ], tol = 1e-5 , show = True )[0 ]
339- assert_allclose (xinv_array , xinv1 , rtol = 1e-12 )
334+ assert_allclose (xinv_array , xinv1 , rtol = 1e-14 )
340335
341336
342337@pytest .mark .mpi (min_size = 2 )
@@ -345,7 +340,6 @@ def test_cg_stacked(par):
345340)
346341def test_cgls_stacked (par ):
347342 """CGLS with MPIStackedBlockDiag"""
348- np .random .seed (42 )
349343 A = np .ones ((par ["ny" ], par ["nx" ])) + par [
350344 "imag" ] * np .ones ((par ["ny" ], par ["nx" ]))
351345 Aop = MatrixMult (np .conj (A .T ) @ A + 1e-5 * np .eye (par ["nx" ], dtype = par ['dtype' ]),
@@ -402,4 +396,4 @@ def test_cgls_stacked(par):
402396 x0 = None
403397 y1 = StackedBDiag * x_global
404398 xinv1 = pylops .cgls (StackedBDiag , y1 , x0 = x0 , niter = par ["nx" ], tol = 1e-5 , show = True )[0 ]
405- assert_allclose (xinv_array , xinv1 , rtol = 1e-12 )
399+ assert_allclose (xinv_array , xinv1 , rtol = 1e-14 )
0 commit comments