KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
kamping::plugin::reproducible_reduce::MessageBuffer< T, Communicator > Class Template Reference

Responsible for storing and communicating intermediate results between PEs. More...

#include <reproducible_reduce.hpp>

Public Member Functions

 MessageBuffer (Communicator const &comm)
 Construct a new message buffer utilizing the given communicator comm.
 
void receive (int const source_rank)
 Receive a message from another PE and store its contents.
 
void flush (void)
 Asynchronously send locally stored intermediate results.
 
void wait (void)
 Wait until the message dispatched by flush() is actually sent and clear any stored values.
 
void put (int const target_rank, size_t const index, T const value)
 Store an intermediate result inside the message buffer for eventual transmission to its destination.
 
T const get (int const source_rank, size_t const index)
 Get the intermediate result with the specified index from source_rank.
 

Detailed Description

template<typename T, typename Communicator>
class kamping::plugin::reproducible_reduce::MessageBuffer< T, Communicator >

Responsible for storing and communicating intermediate results between PEs.

Template Parameters
TType of the stored values.
CommunicatorType of the underlying communicator.

Constructor & Destructor Documentation

◆ MessageBuffer()

Construct a new message buffer utilizing the given communicator comm.

Parameters
commUnderlying communicator used to send the messages.

Member Function Documentation

◆ flush()

Asynchronously send locally stored intermediate results.

If there are none, no message is dispatched.

◆ get()

Get the intermediate result with the specified index from source_rank.

If the value has been received beforehand, it is immediately returned. Otherwise the method blocks until the message from source_rank containing the value arrives.

Parameters
source_rankRank of the PE that holds the desired intermediate result.
indexGlobal index of the intermediate result.

◆ put()

Store an intermediate result inside the message buffer for eventual transmission to its destination.

Triggers a send if

  1. the target rank of the currently stored values does not coincide with target_rank or
  2. the message buffer is already full
  3. the message buffer is full after adding value
Parameters
target_rankRank of the PE which requires the value for further processing.
indexGlobal index of the value being sent.
valueActual value that must be sent.

◆ receive()

Receive a message from another PE and store its contents.

Parameters
source_rankRank of the sender.

The documentation for this class was generated from the following file: