Dune::VariableSizeCommunicator< Allocator > Class Template Reference
[Parallel Computing based on Indexsets]

A buffered communicator where the amount of data sent does not have to be known a priori. More...

#include <dune/common/parallel/variablesizecommunicator.hh>

List of all members.

Public Types

typedef std::map< int,
std::pair
< InterfaceInformation,
InterfaceInformation >
, std::less< int >, typename
Allocator::template rebind
< std::pair< const int,
std::pair
< InterfaceInformation,
InterfaceInformation >
> >::other > 
InterfaceMap
 The type of the map form process number to InterfaceInformation for sending and receiving to and from it.

Public Member Functions

 VariableSizeCommunicator (MPI_Comm comm, const InterfaceMap &inf)
 Creates a communicator with the default maximum buffer size.
 VariableSizeCommunicator (const Interface &inf)
 Creates a communicator with the default maximum buffer size.
 VariableSizeCommunicator (MPI_Comm comm, const InterfaceMap &inf, std::size_t max_buffer_size)
 Creates a communicator with a specific maximum buffer size.
 VariableSizeCommunicator (const Interface &inf, std::size_t max_buffer_size)
 Creates a communicator with a specific maximum buffer size.
 ~VariableSizeCommunicator ()
template<class DataHandle >
void forward (DataHandle &handle)
 Communicate forward.
template<class DataHandle >
void backward (DataHandle &handle)
 Communicate backwards.

Detailed Description

template<class Allocator = std::allocator<std::pair<InterfaceInformation,InterfaceInformation> >>
class Dune::VariableSizeCommunicator< Allocator >

A buffered communicator where the amount of data sent does not have to be known a priori.

In contrast to BufferedCommunicator the amount of data is determined by the container whose entries are sent and not known at the receiving side a priori.


Member Typedef Documentation

template<class Allocator = std::allocator<std::pair<InterfaceInformation,InterfaceInformation> >>
typedef std::map<int,std::pair<InterfaceInformation,InterfaceInformation>, std::less<int>, typename Allocator::template rebind<std::pair<const int,std::pair<InterfaceInformation,InterfaceInformation> > >::other> Dune::VariableSizeCommunicator< Allocator >::InterfaceMap

The type of the map form process number to InterfaceInformation for sending and receiving to and from it.


Constructor & Destructor Documentation

template<class Allocator = std::allocator<std::pair<InterfaceInformation,InterfaceInformation> >>
Dune::VariableSizeCommunicator< Allocator >::VariableSizeCommunicator ( MPI_Comm  comm,
const InterfaceMap inf 
) [inline]

Creates a communicator with the default maximum buffer size.

The default size ist either what the macro DUNE_MAX_COMMUNICATION_BUFFER_SIZE is set to or 32768 if is not set.

template<class Allocator = std::allocator<std::pair<InterfaceInformation,InterfaceInformation> >>
Dune::VariableSizeCommunicator< Allocator >::VariableSizeCommunicator ( const Interface inf  )  [inline]

Creates a communicator with the default maximum buffer size.

Parameters:
inf The communication interface.
template<class Allocator = std::allocator<std::pair<InterfaceInformation,InterfaceInformation> >>
Dune::VariableSizeCommunicator< Allocator >::VariableSizeCommunicator ( MPI_Comm  comm,
const InterfaceMap inf,
std::size_t  max_buffer_size 
) [inline]

Creates a communicator with a specific maximum buffer size.

Parameters:
comm The MPI communicator to use.
inf The communication interface.
max_buffer_size The maximum buffer size allowed.
template<class Allocator = std::allocator<std::pair<InterfaceInformation,InterfaceInformation> >>
Dune::VariableSizeCommunicator< Allocator >::VariableSizeCommunicator ( const Interface inf,
std::size_t  max_buffer_size 
) [inline]

Creates a communicator with a specific maximum buffer size.

Parameters:
inf The communication interface.
max_buffer_size The maximum buffer size allowed.
template<class Allocator = std::allocator<std::pair<InterfaceInformation,InterfaceInformation> >>
Dune::VariableSizeCommunicator< Allocator >::~VariableSizeCommunicator (  )  [inline]

Member Function Documentation

template<class Allocator = std::allocator<std::pair<InterfaceInformation,InterfaceInformation> >>
template<class DataHandle >
void Dune::VariableSizeCommunicator< Allocator >::backward ( DataHandle &  handle  )  [inline]

Communicate backwards.

Template Parameters:
DataHandle The type of the handle describing the data. This type has to adhere to the following interface:

 {.cpp}
 // returns whether the number of data items per entry is fixed
 bool fixedsize();
 // get the number of data items for an entry with index i
 std::size_t size(std::size_t i);
 // gather the data at index i
 template<class MessageBuffer>
 void gather(MessageBuffer& buf, std::size_t  i);
 // scatter the n data items to index i
 template<class MessageBuffer>
 void scatter(MessageBuffer& buf, std::size_t i, std::size_t n);
Parameters:
handle A handle responsible for describing the data, gathering, and scattering it.
template<class Allocator = std::allocator<std::pair<InterfaceInformation,InterfaceInformation> >>
template<class DataHandle >
void Dune::VariableSizeCommunicator< Allocator >::forward ( DataHandle &  handle  )  [inline]

Communicate forward.

Template Parameters:
DataHandle The type of the handle describing the data. This type has to adhere to the following interface:

 {.cpp}
 // returns whether the number of data items per entry is fixed
 bool fixedsize();
 // get the number of data items for an entry with index i
 std::size_t size(std::size_t i);
 // gather the data at index i
 template<class MessageBuffer>
 void gather(MessageBuffer& buf, std::size_t  i);
 // scatter the n data items to index i
 template<class MessageBuffer>
 void scatter(MessageBuffer& buf, std::size_t i, std::size_t n);
Parameters:
handle A handle responsible for describing the data, gathering, and scattering it.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 25 Mar 2018 for dune-common by  doxygen 1.6.1