Dune Core Modules (2.6.0)
The indices present on remote processes. More...
#include <dune/common/parallel/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. | |
Public Member Functions | |
RemoteIndices (const ParallelIndexSet &source, const ParallelIndexSet &destination, const MPI_Comm &comm, const std::vector< int > &neighbours=std::vector< int >(), bool includeSelf=false) | |
Constructor. More... | |
void | setIncludeSelf (bool includeSelf) |
Tell whether sending from indices of the processor to other indices on the same processor is enabled even if the same indexset is used on both the sending and receiving side. More... | |
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. More... | |
~RemoteIndices () | |
Destructor. | |
template<bool ignorePublic> | |
void | rebuild () |
Rebuilds the set of remote indices. More... | |
bool | isSynced () const |
Checks whether the remote indices are synced with the indexsets. More... | |
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. More... | |
const_iterator | find (int proc) const |
Find an iterator over the remote index lists of a specific process. More... | |
const_iterator | begin () const |
Get an iterator over all remote index lists. More... | |
const_iterator | end () const |
Get an iterator over all remote index lists. More... | |
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. More... | |
const ParallelIndexSet & | sourceIndexSet () const |
Get the index set at the source. | |
const ParallelIndexSet & | destinationIndexSet () const |
Get the index set at destination. | |
Detailed Description
class Dune::RemoteIndices< T, A >
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).
- Template Parameters
-
T The type of the underlying index set. A The type of the allocator to use.
Constructor & Destructor Documentation
◆ RemoteIndices()
|
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). includeSelf If true, sending from indices of the processor to other indices on the same processor is enabled even if the same indexset is used on both the sending and receiving side.
References Dune::RemoteIndices< T, A >::neighbours().
Member Function Documentation
◆ begin()
|
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::IndicesSyncer< T >::sync().
◆ end()
|
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::buildInterface(), and Dune::IndicesSyncer< T >::sync().
◆ find()
|
inline |
Find an iterator over the remote index lists of a specific process.
- Parameters
-
proc The identifier of the process.
- Returns
- The iterator the remote index lists postioned at the process. If theres is no list for this process, the end iterator is returned.
◆ getModifier()
|
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 Parameters
-
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.
◆ isSynced()
|
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.
◆ neighbours()
|
inline |
Get the number of processors we share indices with.
- Returns
- The number of neighbours.
Referenced by Dune::RemoteIndices< T, A >::RemoteIndices(), and Dune::IndicesSyncer< T >::sync().
◆ 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.
◆ setIncludeSelf()
void Dune::RemoteIndices< T, A >::setIncludeSelf | ( | bool | includeSelf | ) |
Tell whether sending from indices of the processor to other indices on the same processor is enabled even if the same indexset is used on both the sending and receiving side.
- Parameters
-
includeSelf If true it is enabled.
◆ setIndexSets()
void Dune::RemoteIndices< T, A >::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.
- 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).
Referenced by Dune::OwnerOverlapCopyCommunication< GlobalIdType, LocalIdType >::OwnerOverlapCopyCommunication().
The documentation for this class was generated from the following file:
- dune/common/parallel/remoteindices.hh