wrench::Communicator

class Communicator

A class that implements a communicator (ala MPI) abstractions.

Public Functions

~Communicator()

Destructor.

void barrier()

Barrier method (all participants wait for each other), using standard WRENCH/SimGrid mechanisms.

unsigned long getNumRanks()

Get the number of processes participating in the communicator.

Returns:

a number of processes

unsigned long join()

Join the communicator and obtain a rank, which will block until all other communicator participants have joined (or just obtain the rank and return immediately if already joined).

Returns:

a rank

unsigned long join(unsigned long desired_rank)

Join the communicator with a particular rank, which will block until all other communicator participants have joined (or return immediately if already joined).

Parameters:

desired_rank – the desired rank

Returns:

the desired rank

void MPI_Alltoall(sg_size_t bytes, std::string config = "ompi")

Perform an MPI AllToAll collective, using SimGrid’s SMPI implementation.

Parameters:
  • bytes – the number of bytes in each message sent/received

  • config – the SMPI config option

void MPI_Barrier(std::string config = "ompi")

Perform an MPI Barrier, using SimGrid’s SMPI implementation.

Parameters:

config – the SMPI config option

void MPI_Bcast(int root_rank, sg_size_t bytes, std::string config = "ompi")

Perform an MPI cast collective, using SimGrid’s SMPI implementation.

Parameters:
  • root_rank – the rank of the root of the broadcast

  • bytes – the number of bytes in each message sent/received

  • config – the SMPI config option

void sendAndReceive(const std::map<unsigned long, sg_size_t> &sends, int num_receives)

Perform asynchronous sends and receives operations, using standard WRENCH/SimGrid point to point communications.

Parameters:
  • sends – the specification of all outgoing communications as <rank, volume in bytes> pairs

  • num_receives – the number of expected received (from any source)

void sendReceiveAndCompute(const std::map<unsigned long, sg_size_t> &sends, int num_receives, double flops)

Perform concurrent asynchronous sends, receives, and a computation, using standard WRENCH/SimGrid point to point communications.

Parameters:
  • sends – the specification of all outgoing communications as <rank, volume in bytes> pairs

  • num_receives – the number of expected received (from any source)

  • flops – the number of floating point operations to compute

Public Static Functions

static std::shared_ptr<Communicator> createCommunicator(unsigned long size)

Factory method to construct a communicator.

Parameters:

size – the size of the communicator (# of processes)

Returns:

a shared pointer to a communicator