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.
- 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:
Optional[List[Any]]
- 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:
Optional[List[Any]]