Skip to content

Commit 7a8dd5d

Browse files
authored
Fix test_func_comparison_mpi: actually test communicated value, fix lazy (#244)
1 parent c17b7d3 commit 7a8dd5d

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

test/test_mpi_communication.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,21 @@ def _test_func_comparison_mpi_communication_entrypoint(actx):
150150
bdry_faces_func = op.project(dcoll, BTAG_ALL, dd_af,
151151
op.project(dcoll, dd_vol, BTAG_ALL, myfunc))
152152

153-
hopefully_zero = (
154-
op.project(
155-
dcoll, "int_faces", "all_faces",
156-
dcoll.opposite_face_connection()(int_faces_func)
157-
)
158-
+ sum(op.project(dcoll, tpair.dd, "all_faces", tpair.int)
159-
for tpair in op.cross_rank_trace_pairs(dcoll, myfunc,
160-
comm_tag=SimpleTag))
161-
) - (all_faces_func - bdry_faces_func)
153+
def hopefully_zero():
154+
return (
155+
op.project(
156+
dcoll, "int_faces", "all_faces",
157+
dcoll.opposite_face_connection()(int_faces_func)
158+
)
159+
+ sum(op.project(dcoll, tpair.dd, "all_faces", tpair.ext)
160+
for tpair in op.cross_rank_trace_pairs(dcoll, myfunc,
161+
comm_tag=SimpleTag))
162+
) - (all_faces_func - bdry_faces_func)
163+
164+
hopefully_zero_result = actx.compile(hopefully_zero)()
162165

163-
error = actx.to_numpy(flat_norm(hopefully_zero, ord=np.inf))
166+
error = actx.to_numpy(flat_norm(hopefully_zero_result, ord=np.inf))
164167

165-
print(__file__)
166168
with np.printoptions(threshold=100000000, suppress=True):
167169
logger.debug(hopefully_zero)
168170
logger.info("error: %.5e", error)

0 commit comments

Comments
 (0)