Skip to content

Commit 54432c9

Browse files
committed
accept general integral types as MPI ranks
1 parent a05c626 commit 54432c9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

grudge/discretization.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,12 @@ def as_part_id(mesh_part_id):
120120
# Single-volume
121121
if mpi_communicator is not None:
122122
# Accept PartID or rank
123+
from numbers import Integral
123124
def as_part_id(mesh_part_id):
124125
if isinstance(mesh_part_id, PartID):
125126
return mesh_part_id
126-
elif isinstance(mesh_part_id, int):
127-
return PartID(VTAG_ALL, mesh_part_id)
127+
elif isinstance(mesh_part_id, Integral):
128+
return PartID(VTAG_ALL, int(mesh_part_id))
128129
else:
129130
raise TypeError(f"Unable to convert {mesh_part_id} to PartID.")
130131
else:

0 commit comments

Comments
 (0)