Skip to content

tenzr::execution::Communicator

Process-group communication handle exposing its rank, its size, and a barrier.

#include <collective.h>

Public Functions

Name
Communicator(int rank, int size)
virtual ~Communicator() =default
int Rank() const
Rank of this process within the group.
int Size() const
Number of processes in the group.
virtual void Barrier() const
Synchronize all processes in the group.
Communicator & World()
Access the default world communicator.

Public Functions Documentation

function Communicator

Communicator(
    int rank,
    int size
)

Parameters:

  • rank This process's rank, in [0, size).
  • size Total number of ranks, at least 1.

Create a communicator for a given rank and world size.

function ~Communicator

virtual ~Communicator() =default

function Rank

inline int Rank() const

Rank of this process within the group.

function Size

inline int Size() const

Number of processes in the group.

function Barrier

virtual void Barrier() const

Synchronize all processes in the group.

Synchronize all ranks; currently a no-op for the in-process communicator.

function World

static Communicator & World()

Access the default world communicator.

Return: Reference to the process-wide Communicator.

Get the singleton world communicator.