perun.comm¶
Comm module.
Attributes¶
Classes¶
Wrapper around MPI COMM_WORLD. Does nothing if MPI is not initialized. |
Module Contents¶
- class perun.comm.Comm[source]¶
Wrapper around MPI COMM_WORLD. Does nothing if MPI is not initialized.
- get_mpi_version() str[source]¶
Get MPI version.
- Returns:
Tuple with MPI version and subversion, or None if not available.
- Return type:
Optional[Tuple[int, int]]
- gather(obj: Any, root: int = 0) list[Any] | None[source]¶
MPI gather operation.
- Parameters:
obj (Any) – Object to be gathered.
root (int, optional) – Reciever rank, by default 0
- Returns:
List with the gathered objects.
- Return type:
list[Any] | None
- allgather(obj: Any) list[Any][source]¶
MPI allgather operation.
- Parameters:
obj (Any) – Object to be gathered.
- Returns:
List with the gathered objects.
- Return type:
list[Any]
- bcast(obj: Any, root: int = 0) Any[source]¶
MPI broadcast operation.
- Parameters:
obj (Any) – Object to be broadcasted.
root (int, optional) – Sender rank, by default 0
- Returns:
Broadcasted object.
- Return type:
Any
- gather_from_ranks(obj: Any, ranks: list[int], root: int = 0) list[Any] | None[source]¶
Collect python objects from specific ranks at the determined root.
- Parameters:
obj (Any) – Object to be collected.
ranks (list[int]) – List of ranks that need to send the object.
root (int, optional) – Reciever rank, by default 0
- Returns:
List with the gathered objects.
- Return type:
list[Any] | None