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:
- f
str|h5py.File File to read dataset from.
- dataset
str Name of dataset to read from. Must exist.
- comm
MPI.Comm|None, optional MPI communicator to distribute over. If None optional, use MPI.COMM_WORLD.
- axis
int, 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.
- sel
SelectionTupleLike|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.
- f
- Returns:
- array
MPIArray MPIArrayread from the dataset.
- array