diff --git a/UnitTests/test_psmatrixalgebra.py b/UnitTests/test_psmatrixalgebra.py index a8529b5d..8726a1a2 100644 --- a/UnitTests/test_psmatrixalgebra.py +++ b/UnitTests/test_psmatrixalgebra.py @@ -121,7 +121,8 @@ def check_result(self): def check_floats(self, val1, val2): from helpers import THRESHOLD normval = abs(val1 - val2) - self.assertLessEqual(normval, THRESHOLD) + global_norm = comm.bcast(normval, root=0) + self.assertLessEqual(global_norm, THRESHOLD) def test_addition_pg(self): '''Test routines to add together matrices with an explicit grid.''' @@ -302,6 +303,7 @@ def test_asymmetry(self): diff = matrix1 - matrix1.H ref = norm(diff.todense(), ord=inf) comp = ntmatrix1.MeasureAsymmetry() + comm.barrier() self.check_floats(ref, comp) @@ -324,6 +326,8 @@ def test_symmetrize(self): ntmatrix1.WriteToMatrixMarket(self.result_file) comm.barrier() + self.check_result() + def test_scalediag(self): '''Test routines to scale by a diagonal matrix.''' from copy import deepcopy