mpi_helper – Convenience functions for dealing with MPI

Module providing additional convenience methods to handle issues around MPI.

tracesuite.mpi_helper.barrier(comm: ~mpi4py.MPI.Comm = <mpi4py.MPI.Intracomm object>) → None[source]

Wait for all processes in comm.

tracesuite.mpi_helper.broadcast(obj: ~typing.Any, root: int, comm: ~mpi4py.MPI.Comm = <mpi4py.MPI.Intracomm object>) → Any[source]

Broadcast object from root to all members of comm.

tracesuite.mpi_helper.get_rank(comm: ~mpi4py.MPI.Comm = <mpi4py.MPI.Intracomm object>) → int[source]

Get the rank of this process on a given communicator.

tracesuite.mpi_helper.is_master(comm: ~mpi4py.MPI.Comm = <mpi4py.MPI.Intracomm object>) → bool[source]

Return if this process master on a given communicator.

tracesuite.mpi_helper.is_single_process(comm: ~mpi4py.MPI.Comm = <mpi4py.MPI.Intracomm object>) → bool[source]

Return if there is only one process in the communicator.

tracesuite.mpi_helper.print_on_master(*arg: ~typing.Any, comm: ~mpi4py.MPI.Comm = <mpi4py.MPI.Intracomm object>, **kwarg: ~typing.Any) → None[source]

Print something on the master only.