Dune::RemoteIndices< T > Class Template Reference
[ISTL Communication]

#include <remoteindices.hh>

List of all members.


Detailed Description

template<class T>
class Dune::RemoteIndices< T >

The indices present on remote processes.

To set up communication between the set of processes active in the communication every process needs to know which indices are also known to other processes and which attributes are attached to them on the remote side.

This information is managed by this class. The information can either be computed automatically calling rebuild (which requires information to be sent in a ring) or set up by hand using the RemoteIndexListModifiers returned by function getModifier(int).

Public Types

typedef T ParallelIndexSet
 Type of the index set we use, e.g. ParallelLocalIndexSet.
typedef
ParallelIndexSet::GlobalIndex 
GlobalIndex
 The type of the global index.
typedef
ParallelIndexSet::LocalIndex 
LocalIndex
 The type of the local index.
typedef LocalIndex::Attribute Attribute
 The type of the attribute.
typedef Dune::RemoteIndex
< GlobalIndex, Attribute
RemoteIndex
 Type of the remote indices we manage.
typedef Dune::PoolAllocator
< RemoteIndex, 1 > 
Allocator
 The type of the allocator for the remote index list.
typedef Dune::SLList
< RemoteIndex, Allocator
RemoteIndexList
 The type of the remote index list.
typedef std::map< int,
std::pair< RemoteIndexList
*, RemoteIndexList * > > 
RemoteIndexMap
 The type of the map from rank to remote index list.

Public Member Functions

 RemoteIndices (const ParallelIndexSet &source, const ParallelIndexSet &destination, const MPI_Comm &comm, const std::vector< int > &neighbours=std::vector< int >())
 Constructor.
void setIndexSets (const ParallelIndexSet &source, const ParallelIndexSet &destination, const MPI_Comm &comm, const std::vector< int > &neighbours=std::vector< int >())
 Set the index sets and communicator we work with.
 ~RemoteIndices ()
 Destructor.
template<bool ignorePublic>
void rebuild ()
 Rebuilds the set of remote indices.
bool isSynced () const
 Checks whether the remote indices are synced with the indexsets.
MPI_Comm communicator () const
 Get the mpi communicator used.
template<bool mode, bool send>
RemoteIndexListModifier< T, mode > getModifier (int process)
 Get a modifier for a remote index list.
const_iterator begin () const
 Get an iterator over all remote index lists.
const_iterator end () const
 Get an iterator over all remote index lists.
template<bool send>
CollectiveIterator< T > iterator () const
 Get an iterator for colletively iterating over the remote indices of all remote processes.
void free ()
 Free the index lists.
int neighbours () const
 Get the number of processors we share indices with.


Constructor & Destructor Documentation

template<typename T>
Dune::RemoteIndices< T >::RemoteIndices ( const ParallelIndexSet source,
const ParallelIndexSet destination,
const MPI_Comm &  comm,
const std::vector< int > &  neighbours = std::vector<int>() 
) [inline]

Constructor.

Parameters:
comm The communicator to use.
source The indexset which represents the global to local mapping at the source of the communication
destination The indexset to which the communication which represents the global to local mapping at the destination of the communication. May be the same as the source indexset.
neighbours Optional: The neighbours the process shares indices with. If this parameter is omitted a ring communication with all indices will take place to calculate this information which is O(P).


Member Function Documentation

template<class T>
void Dune::RemoteIndices< T >::setIndexSets ( const ParallelIndexSet source,
const ParallelIndexSet destination,
const MPI_Comm &  comm,
const std::vector< int > &  neighbours = std::vector<int>() 
) [inline]

Set the index sets and communicator we work with.

Warning:
All remote indices already setup will be deleted!
Parameters:
comm The communicator to use.
source The indexset which represents the global to local mapping at the source of the communication
destination The indexset to which the communication which represents the global to local mapping at the destination of the communication. May be the same as the source indexset.
neighbours Optional: The neighbours the process shares indices with. If this parameter is omitted a ring communication with all indices will take place to calculate this information which is O(P).

References Dune::RemoteIndices< T >::free().

Referenced by Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::OwnerOverlapCopyCommunication().

template<typename T>
template<bool ignorePublic>
void Dune::RemoteIndices< T >::rebuild (  )  [inline]

Rebuilds the set of remote indices.

This has to be called whenever the underlying index sets change.

If the template parameter ignorePublic is true all indices will be treated as public.

References Dune::RemoteIndices< T >::free(), and Dune::RemoteIndices< T >::isSynced().

template<typename T>
bool Dune::RemoteIndices< T >::isSynced (  )  const [inline]

Checks whether the remote indices are synced with the indexsets.

If they are not synced the remote indices need to be rebuild.

Returns:
True if they are synced.

Referenced by Dune::InterfaceBuilder< T >::buildInterface(), and Dune::RemoteIndices< T >::rebuild().

template<typename T>
template<bool mode, bool send>
RemoteIndexListModifier< T, mode > Dune::RemoteIndices< T >::getModifier ( int  process  )  [inline]

Get a modifier for a remote index list.

Sometimes the user knows in advance which indices will be present on other processors, too. Then he can set them up using this modifier.

Warning:
Use with care. If the remote index list is inconsistent after the modification the communication might result in a dead lock!

template<typename T>
std::map< int, std::pair< SLList< typename RemoteIndices< T >::RemoteIndex, PoolAllocator< typename RemoteIndices< T >::RemoteIndex, 1 > > *, SLList< typename RemoteIndices< T >::RemoteIndex, PoolAllocator< typename RemoteIndices< T >::RemoteIndex, 1 > > * > >::const_iterator Dune::RemoteIndices< T >::begin (  )  const [inline]

Get an iterator over all remote index lists.

Returns:
The iterator over all remote index lists postioned at the first process.

Referenced by Dune::InterfaceBuilder< T >::buildInterface(), and Dune::IndicesSyncer< T >::sync().

template<typename T>
std::map< int, std::pair< SLList< typename RemoteIndices< T >::RemoteIndex, PoolAllocator< typename RemoteIndices< T >::RemoteIndex, 1 > > *, SLList< typename RemoteIndices< T >::RemoteIndex, PoolAllocator< typename RemoteIndices< T >::RemoteIndex, 1 > > * > >::const_iterator Dune::RemoteIndices< T >::end (  )  const [inline]

Get an iterator over all remote index lists.

Returns:
The iterator over all remote index lists postioned at the end.

Referenced by Dune::InterfaceBuilder< T >::buildInterface(), and Dune::IndicesSyncer< T >::sync().

template<typename T>
int Dune::RemoteIndices< T >::neighbours (  )  const [inline]

Get the number of processors we share indices with.

Returns:
The number of neighbours.

Referenced by Dune::IndicesSyncer< T >::sync().


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

Generated on Thu Apr 2 10:40:17 2009 for dune-istl by  doxygen 1.5.6