perun.comm

Comm module.

Module Contents

Classes

Comm

Wrapper around MPI COMM_WORLD. Does nothing if MPI is not initialized.

Attributes

log

perun.comm.log
class perun.comm.Comm

Wrapper around MPI COMM_WORLD. Does nothing if MPI is not initialized.

_mpi_init()
Get_rank() int

Get local MPI rank.

Returns

int

MPI Rank

Get_size() int

MPI World size.

Returns

int

World Size

gather(obj: Any, root: int = 0) List[Any] | None

MPI gather operation.

Parameters

objAny

Object to be gathered.

rootint, optional

Reciever rank, by default 0

Returns

Optional[List[Any]]

List with the gathered objects.

allgather(obj: Any) List[Any]

MPI allgather operation.

Parameters

objAny

Object to be gathered.

Returns

List[Any]

List with the gathered objects.

bcast(obj: Any, root: int = 0) Any

MPI broadcast operation.

Parameters

objAny

Object to be broadcasted.

rootint, optional

Sender rank, by default 0

Returns

Any

Broadcasted object.

barrier()

MPI barrier operation.

Abort(errorcode: int)

MPI Abort operation.

gather_from_ranks(obj: Any, ranks: List[int], root: int = 0) List[Any] | None

Collect python objects from specific ranks at the determined root.

Parameters

objAny

Object to be collected.

ranksList[int]

List of ranks that need to send the object.

rootint, optional

Reciever rank, by default 0

Returns

Optional[List[Any]]

List with the gathered objects.

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.