MemDatasetDistributed#
- class caput.memdata.MemDatasetDistributed(shape, dtype, axis=0, comm=None, chunks=None, compression=None, compression_opts=None, **kwargs)[source]#
Bases:
MemDatasetParallel, in-memory implementation of
h5py.Dataset.Inherits from
MemDataset. Encapsulates anMPIArraymocked up to look like anh5pydataset. Similar to h5py datasets, this implements slicing like a numpy array but as it is not actually a many operations won’t work (e.g. ufuncs).- Parameters:
- shape
tuple[int, …] Shape of array to initialise. This is the global shape.
- dtype
dtype Type of array to create.
- axis
int, optional Index of axis to distribute the array over. Default is 0.
- comm
MPI.Comm|None MPI communicator to distribute over. If
NoneuseMPI.COMM_WORLD.- chunks
tuple[int, …] |None Chunk sizes. If
None, dataset is not chunked. Default isNone.- compression
str|int|NOne Name or identifier of HDF5 or Zarr compression filter.
- compression_opts
dict|None See HDF5 and Zarr documentation for compression filters. Compression options for the dataset.
- **kwargsAny
Arbitrary keyword arguments passed to
MemDatasetconstructor.
- shape
- property global_shape[source]#
Global shape of the distributed dataset.
The shape of the whole array that is distributed between multiple nodes.
Methods#
|
Initialise from a |
|
Change the axis that the dataset is distributed over. |