pyuoi.mpi_utils¶
Helper functions for loading data and managing arrays across ranks with MPI.
-
pyuoi.mpi_utils.
Bcast_from_root
(send, comm=None, root=0)[source]¶ Broadcast an array from root to all MPI ranks.
-
pyuoi.mpi_utils.
Gatherv_rows
(send, comm=None, root=0)[source]¶ Concatenate arrays along the first axis using Gatherv on root.
-
pyuoi.mpi_utils.
check_valid_ndarray
(X)[source]¶ Checks whether X is a ndarray and returns a contiguous version.
-
pyuoi.mpi_utils.
load_data_MPI
(h5_name, X_key='X', y_key='y', comm=None, root=0)[source]¶ Load data from an HDF5 file and broadcast it across MPI ranks.
This is a helper function. It is also possible to load the data without this function.
- Parameters
- Returns
X (ndarray) – Features on all MPI ranks.
y (ndarray) – Targets on all MPI ranks.