Skip to content

Commit

Permalink
add some simple determinism tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener committed Jun 27, 2024
1 parent 3825b1c commit 89b773f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/test_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ def _test_mpi_boundary_swap(dim, order, num_groups):
part_id_to_part = partition_mesh(mesh,
membership_list_to_map(
np.random.randint(mpi_comm.size, size=mesh.nelements)))

assert list(part_id_to_part.keys()) == list(range(mpi_comm.size))
parts = [part_id_to_part[i] for i in range(mpi_comm.size)]

local_mesh = mpi_comm.scatter(parts)
Expand Down Expand Up @@ -424,6 +426,11 @@ def _test_mpi_boundary_swap(dim, order, num_groups):
conns = bdry_setup_helper.complete_some()
if not conns:
break

expected_keys = list(range(mpi_comm.size))
expected_keys.remove(mpi_comm.rank)
assert list(conns.keys()) == expected_keys

for i_remote_part, conn in conns.items():
check_connection(actx, conn)
remote_to_local_bdry_conns[i_remote_part] = conn
Expand Down

0 comments on commit 89b773f

Please sign in to comment.