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

Plugin providing a sparse alltoall exchange method. More...

#include <alltoall_sparse.hpp>

Inheritance diagram for kamping::plugin::SparseAlltoall< Comm, DefaultContainerType >:
Collaboration diagram for kamping::plugin::SparseAlltoall< Comm, DefaultContainerType >:

Public Member Functions

template<typename... Args>
void alltoallv_sparse (Args... args) const
 Sparse alltoall exchange using the NBX algorithm(Hoefler et al., "Scalable communication protocols for dynamic sparse data", ACM Sigplan Noctices 45.5, 2010.)
 

Detailed Description

template<typename Comm, template< typename... > typename DefaultContainerType>
class kamping::plugin::SparseAlltoall< Comm, DefaultContainerType >

Plugin providing a sparse alltoall exchange method.

See also
SparseAlltoall::alltoallv_sparse() for more information.

Member Function Documentation

◆ alltoallv_sparse()

template<typename Comm , template< typename... > typename DefaultContainerType>
template<typename... Args>
void kamping::plugin::SparseAlltoall< Comm, DefaultContainerType >::alltoallv_sparse ( Args... args) const

Sparse alltoall exchange using the NBX algorithm(Hoefler et al., "Scalable communication protocols for dynamic sparse data", ACM Sigplan Noctices 45.5, 2010.)

This function provides a sparse interface for personalized all-to-all communication using direct message exchange and thus achieving linear complexity in the number of messages to be sent (in contrast to MPI_Alltoallv which exhibits complexity (at least) linear in the size of the communicator due to its interface). To achieve this time complexity we can no longer rely on an array of size of the communicator for send counts. Instead we use a sparse representation of the data to be sent.

The following parameters are required:

  • sparse_alltoall::sparse_send_buf() containing the messages to be sent to other ranks. Differently from plain alltoallv, in alltoallv_sparse send_buf() encapsulates a container consisting of destination-message pairs. Each such pair has to be decomposable via structured bindings with the first parameter being convertible to int and the second parameter being the actual message to be sent for which we require the usual send_buf properties (i.e., either scalar types or existance data() and size() member function and the exposure of a value_type)). Messages of size 0 are not sent.
  • sparse_alltoall::on_message() containing a callback function cb which is responsible to process the received messages via a sparse_alltoall::ProbedMessage object. The callback function cb gets called for each probed message ready to be received via cb(probed_message). See sparse_alltoall::ProbedMessage for the member functions to be called on the object.

The following buffers are optional:

  • kamping::send_type() specifying the MPI datatype to use as send type. If omitted, the MPI datatype is derived automatically based on each message's underlying value_type.
  • kamping::tag() the tag added to the directly exchanged messages. Defaults to the communicator's default tag (Communicator::default_tag()) if not present.
Template Parameters
ArgsAutomatically deducted template parameters.
Parameters
argsAll required and any number of the optional parameters described above.

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