from_hdf5#

classmethod caput.mpiarray.MPIArray.from_hdf5(f: str | h5py.File, dataset: str, comm: mpi4py.MPI.Comm | None = None, axis: int = 0, sel: SelectionTupleLike | None = None) MPIArray[source]#

Read MPIArray from an HDF5 dataset in parallel.

Parameters:
fstr | h5py.File

File to read dataset from.

datasetstr

Name of dataset to read from. Must exist.

commMPI.Comm | None, optional

MPI communicator to distribute over. If None optional, use MPI.COMM_WORLD.

axisint, optional

Axis over which the read should be distributed. This can be used to select the most efficient axis for the reading. Default is 0.

selSelectionTupleLike | None, optional

A tuple of slice objects used to make a selection from the array before reading. The output will be this selection from the dataset distributed over the given axis.

Returns:
arrayMPIArray

MPIArray read from the dataset.