perun.comm ========== .. py:module:: perun.comm .. autoapi-nested-parse:: Comm module. Attributes ---------- .. autoapisummary:: perun.comm.log Classes ------- .. autoapisummary:: perun.comm.Comm Module Contents --------------- .. py:data:: log .. py:class:: Comm Wrapper around MPI COMM_WORLD. Does nothing if MPI is not initialized. .. py:attribute:: _enabled :value: False .. py:attribute:: _initialized :value: False .. py:attribute:: _rank :value: 0 .. py:attribute:: _size :value: 1 .. py:method:: _mpi_init() .. py:method:: Get_rank() -> int Get local MPI rank. Returns ------- int MPI Rank .. py:method:: Get_size() -> int MPI World size. Returns ------- int World Size .. py:method:: gather(obj: Any, root: int = 0) -> Optional[List[Any]] MPI gather operation. Parameters ---------- obj : Any Object to be gathered. root : int, optional Reciever rank, by default 0 Returns ------- Optional[List[Any]] List with the gathered objects. .. py:method:: allgather(obj: Any) -> List[Any] MPI allgather operation. Parameters ---------- obj : Any Object to be gathered. Returns ------- List[Any] List with the gathered objects. .. py:method:: bcast(obj: Any, root: int = 0) -> Any MPI broadcast operation. Parameters ---------- obj : Any Object to be broadcasted. root : int, optional Sender rank, by default 0 Returns ------- Any Broadcasted object. .. py:method:: barrier() MPI barrier operation. .. py:method:: Abort(errorcode: int) MPI Abort operation. .. py:method:: gather_from_ranks(obj: Any, ranks: List[int], root: int = 0) -> Optional[List[Any]] 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 ------- Optional[List[Any]] List with the gathered objects. .. py:method:: check_available_ranks() -> List[int] Return an array with all the ranks that are capable of responding to a single send/recv. Returns ------- List[int] List with responsive MPI ranks.