The indices present on remote processes. More...
#include <dune/istl/remoteindices.hh>
Public Types | |
typedef T | ParallelIndexSet |
Type of the index set we use, e.g. ParallelLocalIndexSet. | |
typedef CollectiveIterator< T, A > | CollectiveIteratorT |
The type of the collective iterator over all remote indices. | |
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 A::template rebind < RemoteIndex >::other | 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. | |
typedef RemoteIndexMap::const_iterator | const_iterator |
Public Member Functions | |
RemoteIndices (const ParallelIndexSet &source, const ParallelIndexSet &destination, const MPI_Comm &comm, const std::vector< int > &neighbours=std::vector< int >()) | |
Constructor. | |
RemoteIndices () | |
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. | |
template<typename C > | |
void | setNeighbours (const C &neighbours) |
~RemoteIndices () | |
Destructor. | |
template<bool ignorePublic> | |
void | rebuild () |
Rebuilds the set of remote indices. | |
bool | operator== (const RemoteIndices &ri) |
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, A, 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> | |
CollectiveIteratorT | 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. | |
const ParallelIndexSet & | sourceIndexSet () const |
Get the index set at the source. | |
const ParallelIndexSet & | destinationIndexSet () const |
Get the index set at destination. | |
template<bool ignorePublic> | |
void | packEntries (IndexPair< GlobalIndex, LocalIndex > **pairs, const ParallelIndexSet &indexSet, char *p_out, MPI_Datatype type, int bufferSize, int *position, int n) |
Friends | |
class | InterfaceBuilder |
class | IndicesSyncer< T > |
template<typename T1 , typename A1 , typename A2 > | |
void | repairLocalIndexPointers (std::map< int, SLList< typename T1::GlobalIndex, A1 > > &, RemoteIndices< T1, A2 > &, const T1 &) |
template<class G , class T1 , class T2 > | |
void | fillIndexSetHoles (const G &graph, Dune::OwnerOverlapCopyCommunication< T1, T2 > &oocomm) |
Fills the holes in an index set. | |
std::ostream & | operator<< (std::ostream &, const 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).
T | The type of the underlying index set. | |
A | The type of the allocator to use. |
typedef A::template rebind<RemoteIndex>::other Dune::RemoteIndices< T, A >::Allocator |
The type of the allocator for the remote index list.
typedef LocalIndex::Attribute Dune::RemoteIndices< T, A >::Attribute |
The type of the attribute.
typedef CollectiveIterator<T,A> Dune::RemoteIndices< T, A >::CollectiveIteratorT |
The type of the collective iterator over all remote indices.
typedef RemoteIndexMap::const_iterator Dune::RemoteIndices< T, A >::const_iterator |
typedef ParallelIndexSet::GlobalIndex Dune::RemoteIndices< T, A >::GlobalIndex |
The type of the global index.
typedef ParallelIndexSet::LocalIndex Dune::RemoteIndices< T, A >::LocalIndex |
The type of the local index.
typedef T Dune::RemoteIndices< T, A >::ParallelIndexSet |
Type of the index set we use, e.g. ParallelLocalIndexSet.
typedef Dune::RemoteIndex<GlobalIndex,Attribute> Dune::RemoteIndices< T, A >::RemoteIndex |
Type of the remote indices we manage.
typedef Dune::SLList<RemoteIndex,Allocator> Dune::RemoteIndices< T, A >::RemoteIndexList |
The type of the remote index list.
typedef std::map<int, std::pair<RemoteIndexList*,RemoteIndexList*> > Dune::RemoteIndices< T, A >::RemoteIndexMap |
The type of the map from rank to remote index list.
Dune::RemoteIndices< T, A >::RemoteIndices | ( | const ParallelIndexSet & | source, | |
const ParallelIndexSet & | destination, | |||
const MPI_Comm & | comm, | |||
const std::vector< int > & | neighbours = std::vector<int>() | |||
) | [inline] |
Constructor.
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, A >::setNeighbours().
Dune::RemoteIndices< T, A >::RemoteIndices | ( | ) | [inline] |
Dune::RemoteIndices< T, A >::~RemoteIndices | ( | ) | [inline] |
Destructor.
References Dune::RemoteIndices< T, A >::free().
std::map< int, std::pair< SLList< typename RemoteIndices< T, A >::RemoteIndex, typename RemoteIndices< T, A >::Allocator > *, SLList< typename RemoteIndices< T, A >::RemoteIndex, typename RemoteIndices< T, A >::Allocator > * > >::const_iterator Dune::RemoteIndices< T, A >::begin | ( | ) | const [inline] |
Get an iterator over all remote index lists.
Referenced by Dune::storeGlobalIndicesOfRemoteIndices(), and Dune::IndicesSyncer< T >::sync().
MPI_Comm Dune::RemoteIndices< T, A >::communicator | ( | ) | const [inline] |
Get the mpi communicator used.
Referenced by Dune::IndicesSyncer< T >::IndicesSyncer().
const RemoteIndices< T, A >::ParallelIndexSet & Dune::RemoteIndices< T, A >::destinationIndexSet | ( | ) | const [inline] |
Get the index set at destination.
std::map< int, std::pair< SLList< typename RemoteIndices< T, A >::RemoteIndex, typename RemoteIndices< T, A >::Allocator > *, SLList< typename RemoteIndices< T, A >::RemoteIndex, typename RemoteIndices< T, A >::Allocator > * > >::const_iterator Dune::RemoteIndices< T, A >::end | ( | ) | const [inline] |
Get an iterator over all remote index lists.
Referenced by Dune::RemoteIndices< T, A >::packEntries(), Dune::storeGlobalIndicesOfRemoteIndices(), and Dune::IndicesSyncer< T >::sync().
void Dune::RemoteIndices< T, A >::free | ( | ) | [inline] |
RemoteIndexListModifier< T, A, mode > Dune::RemoteIndices< T, A >::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.
mode | If true the index set corresponding to the remote indices might get modified. Therefore the internal pointers to the indices need to be repaired. | |
send | If true the remote index information at the sending side will be modified, if false the receiving side. |
bool Dune::RemoteIndices< T, A >::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.
Referenced by Dune::RemoteIndices< T, A >::rebuild().
RemoteIndices< T, A >::CollectiveIteratorT Dune::RemoteIndices< T, A >::iterator | ( | ) | const [inline] |
Get an iterator for colletively iterating over the remote indices of all remote processes.
int Dune::RemoteIndices< T, A >::neighbours | ( | ) | const [inline] |
Get the number of processors we share indices with.
Referenced by Dune::RemoteIndices< T, A >::operator==(), and Dune::IndicesSyncer< T >::sync().
bool Dune::RemoteIndices< T, A >::operator== | ( | const RemoteIndices< T, A > & | ri | ) | [inline] |
References Dune::RemoteIndices< T, A >::neighbours().
void Dune::RemoteIndices< T, A >::packEntries | ( | IndexPair< GlobalIndex, LocalIndex > ** | pairs, | |
const ParallelIndexSet & | indexSet, | |||
char * | p_out, | |||
MPI_Datatype | type, | |||
int | bufferSize, | |||
int * | position, | |||
int | n | |||
) | [inline] |
void Dune::RemoteIndices< T, A >::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, A >::free(), and Dune::RemoteIndices< T, A >::isSynced().
void Dune::RemoteIndices< T, A >::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.
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, A >::free(), and Dune::RemoteIndices< T, A >::setNeighbours().
Referenced by Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::OwnerOverlapCopyCommunication().
void Dune::RemoteIndices< T, A >::setNeighbours | ( | const C & | neighbours | ) | [inline] |
const RemoteIndices< T, A >::ParallelIndexSet & Dune::RemoteIndices< T, A >::sourceIndexSet | ( | ) | const [inline] |
Get the index set at the source.
void fillIndexSetHoles | ( | const G & | graph, | |
Dune::OwnerOverlapCopyCommunication< T1, T2 > & | oocomm | |||
) | [friend] |
Fills the holes in an index set.
In general the index set only needs to know those indices where communication my occur. In usual FE computations these are just those near the processor boundaries.
For the repartitioning we need to know all all indices for which data is stored. The missing indices will be created in this method.
graph | The graph to reparition. | |
oocomm | The communication information. |
friend class IndicesSyncer< T > [friend] |
friend class InterfaceBuilder [friend] |
std::ostream& operator<< | ( | std::ostream & | , | |
const RemoteIndices< T > & | ||||
) | [friend] |
void repairLocalIndexPointers | ( | std::map< int, SLList< typename T1::GlobalIndex, A1 > > & | , | |
RemoteIndices< T1, A2 > & | , | |||
const T1 & | ||||
) | [friend] |