Skip to content

Commit

Permalink
fix(mpiarray): remove unnecessary MPI import
Browse files Browse the repository at this point in the history
  • Loading branch information
ljgray committed Sep 17, 2024
1 parent 51a99d2 commit 9f47cf2
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions caput/mpiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,6 @@ def comm(self, var):

def __new__(cls, global_shape, axis=0, comm=None, *args, **kwargs):
"""Make a new MPIArray."""
# if mpiutil.world is None:
# raise RuntimeError('There is no mpi4py installation. Aborting.')

if comm is None:
comm = mpiutil.world

Expand Down Expand Up @@ -1619,10 +1616,8 @@ def _partition_io(self, skip=False, threshold=1.99):
partitions : list of slice objects
List of slices.
"""
from mpi4py import MPI

threshold_bytes = threshold * 2**30
largest_size = self.comm.allreduce(self.nbytes, op=MPI.MAX)
largest_size = self.comm.allreduce(self.nbytes, op=mpiutil.MAX)
min_axis_size = int(np.ceil(largest_size / threshold_bytes))

# Return early if we can
Expand Down

0 comments on commit 9f47cf2

Please sign in to comment.