The number of pairs (attribute and process number) we publish to the neighbour process.
Detailed Description
Provides classes for syncing distributed indexed data structures.
In a parallel representation a container , e.g. a plain C-array, cannot be stored with all entries on each process because of limited memory and efficiency reasons. Therefore it is represented by individual pieces , , where is the piece stored on process of the processes participating in the calculation. Although the global representation of the container is not available on any process, a process needs to know how the entries of it's local piece correspond to the entries of the global container , which would be used in a sequential program. In this module we present classes describing the mapping of the local pieces to the global view and the communication interfaces.
Parallel Index Sets
Form an abstract point of view a random access container provides a mapping from an index set onto a set of objects . Note that we do not require to be consecutive. The piece of the container stored on process is a mapping , where . Due to efficiency the entries of should be stored in consecutive memory.
This means that for the local computation the data must be addressable by a consecutive index starting from . When using adaptive discretisation methods there might be the need to reorder the indices after adding and/or deleting some of the discretisation points. Therefore this index does not have to be persistent. Further on we will call this index local index.
For the communication phases of our algorithms these locally stored entries must also be addressable by a global identifier to be able to store the received values tagged with the global identifiers at the correct local index in the consecutive local memory chunk. To ease the addition and removal of discretisation points this global identifier has to be persistent. Further on we will call this global identifier global index.
Classes to build the mapping are ParallelIndexSet and ParallelLocalIndex. As these just provide a mapping from the global index to the local index, the wrapper class GlobalLookupIndexSet facilitates the reverse lookup.
Remote Index Information
To setup communication between the processes every process needs to know what indices are also known to other processes and what attributes are attached to them on the remote side. This information is calculated and encapsulated in class RemoteIndices.
Communication
Based on the information about the distributed index sets, data independent interfaces between different sets of the index sets can be setup using the class Interface. For the actual communication data dependent communicators can be setup using BufferedCommunicator, DatatypeCommunicator VariableSizeCommunicator based on the interface information. In contrast to the former the latter is independent of the class Interface which can work on a map from process number to a pair of index lists describing which local indices are sent and received from that process.
Invalidates all pointers stored to the elements of this index set. The local indices will be ordered according to the global indices: Let be the set of all indices then if and only if for arbitrary .
Map of the interfaces. The key of the map is the process number and the value is the information pair (first the send and then the receive information).
Map of the interfaces. The key of the map is the process number and the value is the information pair (first the send and then the receive information).
Initializes all iterator to first entry and the one before the first entry, respectively.
Parameters
remoteIndices
The list of the remote indices.
globalIndices
The list of the corresponding global indices. This is needed because the the pointers to the local index will become invalid due to the merging of the index sets.
booleans
Whether the remote index was there before the sync process started.
After this function returns the indices are consecutively numbered beginning from 0. Let $(g_i,l_i)$, $(g_j,l_j)$ be two arbitrary index pairs with $g_i<g_j$ then after renumbering $l_i<l_j$ will hold.
Position them to first list entry and the entry before the first entry respectively.
Parameters
remoteIndices
The list of the remote indices.
globalIndices
The list of the corresponding global indices. This is needed because the the pointers to the local index will become invalid due to the merging of the index sets.
booleans
Whether the remote index was there before the sync process started.
Stores the corresponding global indices of the remote index information.
Whenever a ParallelIndexSet is resized all RemoteIndices that use it will be invalided as the pointers to the index set are invalid after calling ParallelIndexSet::Resize() One can rebuild them by storing the global indices in a map with this function and later repairing the pointers by calling repairLocalIndexPointers.
Warning
The RemoteIndices class has to be build with the same index set for both the sending and receiving side
Parameters
globalMap
Map to store the corresponding global indices in.
remoteIndices
The remote index information we need to store the corresponding global indices of.
indexSet
The index set that is for both the sending and receiving side of the remote index information.
Computes the missing indices in the local and the remote index list and adds them. No global communication is necessary! All indices added to the index will become the local index std::numeric_limits<size_t>::max()
Synce the index set and assign local numbers to new indices.
Computes the missing indices in the local and the remote index list and adds them. No global communication is necessary!
Parameters
numberer
Functor providing the local indices for the added global indices. has to provide a function size_t operator()(const TG& global) that provides the local index to a global one. It will be called for ascending global indices.