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

Object returned by plugin::GridCommunicator::make_grid_communicator() representing a grid communicator which enables alltoall communication with a latency in sqrt(p) where p is the size of the original communicator. More...

#include <alltoall_grid.hpp>

Public Types

using LevelCommunicator = kamping::Communicator<DefaultContainerType>
 Type of row and column communicator.
 

Public Member Functions

template<template< typename... > typename = DefaultContainerType, template< typename, template< typename... > typename > typename... Plugins>
 GridCommunicator (kamping::Communicator< DefaultContainerType, Plugins... > const &comm)
 Creates a two dimensional grid by splitting the given communicator of size p into a row and a column communicator each of size about sqrt(p).
 
template<MessageEnvelopeLevel envelope_level = MessageEnvelopeLevel::no_envelope, typename... Args>
auto alltoallv_with_envelope (Args... args) const
 Indirect two dimensional grid based personalized alltoall exchange. The following parameters are required:
 
template<typename... Args>
auto alltoallv (Args... args) const
 Indirect two dimensional grid based personalized alltoall exchange. The following parameters are required:
 

Detailed Description

template<template< typename... > typename DefaultContainerType>
class kamping::plugin::grid::GridCommunicator< DefaultContainerType >

Object returned by plugin::GridCommunicator::make_grid_communicator() representing a grid communicator which enables alltoall communication with a latency in sqrt(p) where p is the size of the original communicator.

Template Parameters
DefaultContainerTypeContainer type of the original communicator.

Constructor & Destructor Documentation

◆ GridCommunicator()

template<template< typename... > typename DefaultContainerType>
template<template< typename... > typename = DefaultContainerType, template< typename, template< typename... > typename > typename... Plugins>
kamping::plugin::grid::GridCommunicator< DefaultContainerType >::GridCommunicator ( kamping::Communicator< DefaultContainerType, Plugins... > const & comm)
inline

Creates a two dimensional grid by splitting the given communicator of size p into a row and a column communicator each of size about sqrt(p).

Template Parameters
CommType of the communicator.
Parameters
commCommunicator to be split into a two-dimensional grid.

Member Function Documentation

◆ alltoallv()

template<template< typename... > typename DefaultContainerType>
template<typename... Args>
auto kamping::plugin::grid::GridCommunicator< DefaultContainerType >::alltoallv ( Args... args) const
inline

Indirect two dimensional grid based personalized alltoall exchange. The following parameters are required:

  • kamping::send_buf() containing the data that is sent to each rank. The size of this buffer has to be at least the sum of the send_counts argument.
  • kamping::send_counts() containing the number of elements to send to each rank.

The following parameters are optional:

  • kamping::send_displs() containing the offsets of the messages in send_buf. The send_counts[i] elements starting at send_buf[send_displs[i]] will be sent to rank i. If omitted, this is calculated as the exclusive prefix-sum of send_counts.
  • kamping::recv_counts() containing the number of elements to receive from each rank.
  • kamping::recv_buf() containing a buffer for the output. Afterwards, this buffer will contain

the data received as specified for send_buf. The buffer will be resized according to the buffer's kamping::BufferResizePolicy. If resize policy is kamping::BufferResizePolicy::no_resize, the buffer's underlying storage must be large enough to store all received elements.

Internally, alltoallv_with_envelope() is called.

Template Parameters
envelope_levelDetermines the contents of the envelope of each returned element (no_envelope = use the actual data type of an exchanged element, source = augment the actual data type with the source PE, source_and_destination = argument the actual data type with the source and destination PE).
ArgsAutomatically deducted template parameters.
Parameters
argsAll required and any number of the optional buffers described above.
Returns
Result type wrapping the output buffer and recv_counts (if requested).

◆ alltoallv_with_envelope()

template<template< typename... > typename DefaultContainerType>
template<MessageEnvelopeLevel envelope_level = MessageEnvelopeLevel::no_envelope, typename... Args>
auto kamping::plugin::grid::GridCommunicator< DefaultContainerType >::alltoallv_with_envelope ( Args... args) const
inline

Indirect two dimensional grid based personalized alltoall exchange. The following parameters are required:

The following parameters are optional:

  • kamping::send_displs() containing the offsets of the messages in send_buf. The send_counts[i] elements starting at send_buf[send_displs[i]] will be sent to rank i. If omitted, this is calculated as the exclusive prefix-sum of send_counts.

Internally, each element in the send buffer is wrapped in an envelope to facilitate the indirect routing. The envelope consists at least of the destination PE of each element but can be extended to also hold the source PE of the element. The caller can specify whether they want to keep this information also in the output via the

Template Parameters
envelope_level.
envelope_levelDetermines the contents of the envelope of each returned element (no_envelope = use the actual data type of an exchanged element, source = augment the actual data type with the source PE, source_and_destination = argument the actual data type with the source and destination PE).
ArgsAutomatically deducted template parameters.
Parameters
argsAll required and any number of the optional buffers described above.
Returns

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