MPIArray#
- class caput.mpiarray.MPIArray(shape, dtype=float, buffer=None, offset=0, strides=None, order=None)[source]#
Bases:
numpy.ndarrayA numpy-like array distributed across multiple processes.
- Parameters:
- global_shape
Sequence[int] The global shape of the array.
- axis
int, optional The axis over which the array is distributed. Default is 0.
- comm
MPI.Comm|None, optional The communicator over which the array is distributed. Default is None, which will use MPI.COMM_WORLD.
- argsAny, optional
Additional positional arguments to pass to the
ndarrayconstructor.- **kwargsAny, optional
Additional keyword arguments to pass to the
ndarrayconstructor.
- global_shape
- property comm: mpi4py.MPI.Comm[source]#
The communicator over which the array is distributed.
- Returns:
- comm
MPI.Comm
- comm
- property global_slice: _global_resolver[source]#
Return an objects that presents a view of the array with global slicing.
- Returns:
- global_slice_resolver
_global_resolver _global_resolverinstance.
- global_slice_resolver
- property local_array: numpy.ndarray[source]#
rank-local
numpy.ndarrayview of the array.- Returns:
- rank_local_array
ndarray
- rank_local_array
- property local_bounds: slice[source]#
Global bounds of the local array along the distributed axis.
- Returns:
- rank_local_bounds
slice
- rank_local_bounds
Methods#
|
Finalizes the creation of the MPIArray, when viewed. |
|
Handles ufunc operations for MPIArray. |
|
Returned a slice view of this array. |
|
Gather a full copy onto each rank. |
|
Perform MPI reduction op within memory buffer. |
|
Return a copy of the MPIArray. |
|
Helper for enumerating over a given axis. |
|
Read MPIArray from an HDF5 dataset or Zarr array on disk in parallel. |
|
Read MPIArray from an HDF5 dataset in parallel. |
|
Gather a full copy onto a specific rank. |
|
Method is explicitly not implemented. |
|
Change the rank distribution axis of the array. |
|
Reshape the array. |
|
Parallel write into a contiguous HDF5/Zarr dataset. |
|
Parallel write into a contiguous HDF5 dataset. |
|
Parallel write into a contiguous Zarr dataset. |
|
Transpose the array axes. |
|
Turn |