Skip to content

Commit

Permalink
Fixes to actual testing
Browse files Browse the repository at this point in the history
  • Loading branch information
william-dawson committed Jun 20, 2024
1 parent daa77a0 commit 4564a7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion UnitTests/test_psmatrixalgebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.'''
Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit 4564a7d

Please sign in to comment.