Skip to content

Commit ed3b585

Browse files
committed
Fix internal check for MPIMatrixMult
1 parent 4e39068 commit ed3b585

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pylops_mpi/basicoperators/MatrixMult.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ def __init__(
130130
size = base_comm.Get_size()
131131

132132
# Determine grid dimensions (P_prime × C) such that P_prime * C ≥ size
133-
self._P_prime = int(math.ceil(math.sqrt(size)))
134-
self._C = int(math.ceil(size / self._P_prime))
133+
self._P_prime = math.isqrt(size)
134+
self._C = self._P_prime
135135
if self._P_prime * self._C != size:
136136
raise Exception(f"Number of processes must be a square number, provided {size} instead...")
137137

0 commit comments

Comments
 (0)