sisl.mpi.Communicator

class sisl.mpi.Communicator[source]

Bases: BaseCommunicator

An mpi4py communicator plus the provenance needed to behave correctly.

A Communicator always wraps real MPI; the serial case is a different implementation of BaseCommunicator, not this one holding a stand-in.

owns_mpi is not bookkeeping: it is the guard that stops sisl finalizing an MPI it did not initialize.

Methods

on_rank0()

True on the rank that should perform single-writer work (IO, printing).

Attributes

comm

The underlying mpi4py communicator.

is_parallel

owns_mpi

Whether sisl initialized MPI, and must therefore finalize it.

rank

Index of this rank within the communicator.

size

Number of ranks in the communicator.

on_rank0()

True on the rank that should perform single-writer work (IO, printing).

Return type:

bool

property comm

The underlying mpi4py communicator.

property is_parallel: bool
property owns_mpi: bool

Whether sisl initialized MPI, and must therefore finalize it.

property rank: int

Index of this rank within the communicator.

property size: int

Number of ranks in the communicator.