| FEAT 3
    Finite Element Analysis Toolbox | 
Global multiplexer/demultiplexer implementation. More...
#include <muxer.hpp>
| Public Types | |
| typedef LAFEM::DenseVector< DataType, IndexType > | BufferType | 
| the internal buffer vector type  More... | |
| typedef LocalVector_::DataType | DataType | 
| the data type  More... | |
| typedef LocalVector_::IndexType | IndexType | 
| the index type  More... | |
| typedef LocalVector_ | LocalVectorType | 
| the local vector type  More... | |
| typedef Mirror_ | MirrorType | 
| the mirror type  More... | |
| template<typename LocalVector2_ , typename Mirror2_ > | |
| using | MuxerType = Muxer< LocalVector2_, Mirror2_ > | 
| Our 'base' class type.  More... | |
| template<typename DataType2_ , typename IndexType2_ > | |
| using | MuxerTypeByDI = Muxer< typename LocalVector_::template ContainerType< DataType2_, IndexType2_ >, typename Mirror_::template MirrorType< DataType2_, IndexType2_ > > | 
| this typedef lets you create a gate container with new Data and Index types  More... | |
| Public Member Functions | |
| Muxer () | |
| standard constructor  More... | |
| Muxer (Muxer &&other) | |
| move-constructor  More... | |
| virtual | ~Muxer () | 
| virtual destructor  More... | |
| std::size_t | bytes () const | 
| Returns the internal data size in bytes.  More... | |
| void | compile (const LocalVector_ &vec_tmp_) | 
| Compiles the muxer.  More... | |
| template<typename LVT2_ > | |
| void | convert (const Muxer< LVT2_, Mirror_ > &other, LocalVector_ &&vector, LAFEM::CloneMode mode=LAFEM::CloneMode::Shallow) | 
| Conversion function for different vector container type.  More... | |
| template<typename LVT2_ , typename MT2_ > | |
| void | convert (const Muxer< LVT2_, MT2_ > &other) | 
| Conversion function for same vector container type but with different MDI-Type.  More... | |
| const std::vector< Mirror_ > & | get_child_mirrors () const | 
| Returns the child mirror vector.  More... | |
| const Mirror_ & | get_parent_mirror () const | 
| Returns the parent mirror.  More... | |
| int | get_parent_rank () const | 
| Returns the parent rank.  More... | |
| const Dist::Comm * | get_sibling_comm () const | 
| Returns the sibling communicator.  More... | |
| bool | is_child () const | 
| Specifies whether this process represents a child in the muxer.  More... | |
| bool | is_ghost () const | 
| Specifies whether this process is a ghost in the muxer.  More... | |
| bool | is_parent () const | 
| Specifies whether this process represents a parent in the muxer.  More... | |
| void | join (const LocalVector_ &vec_src, LocalVector_ &vec_trg) const | 
| Performs a join operation on the parent process.  More... | |
| void | join_send (const LocalVector_ &vec_src) const | 
| Sends a join operation to the parent process.  More... | |
| Muxer & | operator= (Muxer &&other) | 
| move-assignment operator  More... | |
| void | push_child (Mirror_ &&child_mirror) | 
| Adds a child rank and mirror for a parent process.  More... | |
| void | set_parent (const Dist::Comm *sibling_comm_, int parent_rank, Mirror_ &&parent_mirror) | 
| Sets the sibling communicator.  More... | |
| void | split (LocalVector_ &vec_trg, const LocalVector_ &vec_src) const | 
| Performs a split operation on the parent process.  More... | |
| void | split_recv (LocalVector_ &vec_trg) const | 
| Receives a split operation from the parent process.  More... | |
| Public Attributes | |
| Index | _buffer_size | 
| buffer size  More... | |
| std::vector< Mirror_ > | _child_mirrors | 
| child mirrors (only on parent)  More... | |
| Mirror_ | _parent_mirror | 
| parent mirror (on all children)  More... | |
| int | _parent_rank | 
| the rank of the parent  More... | |
| const Dist::Comm * | _sibling_comm | 
| the sibling communicator  More... | |
Global multiplexer/demultiplexer implementation.
This class provides the functionality for the transfer of primal and dual vectors between different (nested) partitionings in the domain decomposition approach, including the N:1 joining and 1:N splitting of vectors from a partitioned mesh to the unpartitioned mesh, which is provided by the Global::Splitter class, which uses the Global::Muxer to outsource the actual dirty work. This class is effectively only required by an application directly when using a multigrid hierarchy in combination with recursive partitioning.
Just like Gate class, each Muxer object is bound to a single space-vector pair, so if you require muxer functionality for different vector types, you have to create a different Muxer for each space-vector type pair. You can also utilize the convert() functions to create a new Muxer object from an existing one, assuming that the space object is the same.
| LocalVector_ | The local vector type that the muxer is to be applied onto. | 
| Mirror_ | The mirror type that is to be used. | 
To set up an object of this class, one requires various information from the underlying partitioning, especially regarding the parent-child and sibling relations between the processes that are joined/split when transitioning between two partitionings. Basically, the following steps have to be performed:
To perform the actual transition between two partitionings, the functions required to be called differ depending on the whether the calling process is a parent process, i.e. it is an active process in both the child and parent communicators, or whether it is only a simple child process, i.e. is only active in the child communicator. On each parent process, the caller has to call the join() or split() functions, which require both the coarse and fine partitioning input/output vectors. On all other child processes, the caller has to call the join_send() function, which only requires the fine partitioning input vector, or the split_recv() function, which only requires the fine partitioning output vector.
| typedef LAFEM::DenseVector<DataType, IndexType> FEAT::Global::Muxer< LocalVector_, Mirror_ >::BufferType | 
| typedef LocalVector_::DataType FEAT::Global::Muxer< LocalVector_, Mirror_ >::DataType | 
| typedef LocalVector_::IndexType FEAT::Global::Muxer< LocalVector_, Mirror_ >::IndexType | 
| typedef LocalVector_ FEAT::Global::Muxer< LocalVector_, Mirror_ >::LocalVectorType | 
| typedef Mirror_ FEAT::Global::Muxer< LocalVector_, Mirror_ >::MirrorType | 
| using FEAT::Global::Muxer< LocalVector_, Mirror_ >::MuxerType = Muxer<LocalVector2_, Mirror2_> | 
| using FEAT::Global::Muxer< LocalVector_, Mirror_ >::MuxerTypeByDI = Muxer< typename LocalVector_::template ContainerType<DataType2_, IndexType2_>, typename Mirror_::template MirrorType<DataType2_, IndexType2_> > | 
| 
 | inline | 
| 
 | inline | 
| 
 | inlinevirtual | 
| 
 | inline | 
Returns the internal data size in bytes.
Definition at line 211 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_child_mirrors, and FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_mirror.
Referenced by FEAT::Control::BlockedBasicSystemLevel< dim_, DataType_, IndexType_, BlockedMatrix_, TransferMatrix_ >::bytes(), FEAT::Control::ScalarBasicSystemLevel< DataType_, IndexType_, ScalarMatrix_, TransferMatrix_ >::bytes(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::bytes().
| 
 | inline | 
Compiles the muxer.
| [in] | vec_tmp_ | A transient reference to a temporary vector for internal use. | 
Definition at line 334 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_child_mirrors, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_mirror, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_rank, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm, FEAT::Dist::Comm::bcast(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_child(), FEAT::Math::max(), FEAT::Dist::Comm::rank(), and XASSERT.
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::compile(), and FEAT::Global::Muxer< LocalVector_, Mirror_ >::convert().
| 
 | inline | 
Conversion function for different vector container type.
This function (re)creates this gate from another muxer with a different vector type, but the same mirrors. This can be used to create a gate using DenseVectorBlocked from a muxer using DenseVector or vice versa.
| [in] | other | A (transient) reference to the muxer using the other vector type to create this muxer from. | 
| [in] | vector | A temporary vector allocated to the correct size that is to be used for internal initialization. | 
| [in] | mode | The clone-mode to be used for cloning the mirrors. Defaults to shallow clone. | 
Definition at line 188 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::compile().
| 
 | inline | 
Conversion function for same vector container type but with different MDI-Type.
| [in] | other | A transient reference to the muxer to convert from | 
Definition at line 155 of file muxer.hpp.
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::convert().
| 
 | inline | 
Returns the child mirror vector.
Definition at line 323 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_child_mirrors.
| 
 | inline | 
Returns the parent mirror.
Definition at line 302 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_mirror.
| 
 | inline | 
Returns the parent rank.
Definition at line 292 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_rank.
| 
 | inline | 
Returns the sibling communicator.
Definition at line 260 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm.
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_root(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_single().
| 
 | inline | 
Specifies whether this process represents a child in the muxer.
true, if this process is a child, otherwise false. Definition at line 225 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm, and FEAT::Dist::Comm::size().
Referenced by FEAT::Global::Muxer< LocalVector_, Mirror_ >::compile(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_ghost(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::prol(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::rest(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::split(), and FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::trunc().
| 
 | inline | 
Specifies whether this process is a ghost in the muxer.
true, if this process is a ghost, otherwise false. Definition at line 250 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_child(), and FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_parent().
Referenced by FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::is_ghost(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::prol_recv(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::rest_send(), and FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::trunc_send().
| 
 | inline | 
Specifies whether this process represents a parent in the muxer.
true, if this process is a parent, otherwise false. Definition at line 236 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_rank, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm, and FEAT::Dist::Comm::rank().
Referenced by FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_ghost(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_root(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::prol(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::rest(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::split(), and FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::trunc().
| 
 | inline | 
Performs a join operation on the parent process.
| [in] | vec_src | A transient reference to the type-0 child vector that is to be joined on the parent process. | 
| [in] | vec_trg | A transient reference to the joined type-0 parent vector. | 
Definition at line 401 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_buffer_size, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_child_mirrors, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_mirror, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_rank, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm, FEAT::LAFEM::DenseVector< DT_, IT_ >::elements(), FEAT::Dist::Comm::gather(), FEAT::Dist::Comm::rank(), FEAT::Dist::Comm::size(), and XASSERT.
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::rest(), and FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::trunc().
| 
 | inline | 
Sends a join operation to the parent process.
| [in] | vec_src | A transient reference to the type-0 child vector that is to be joined on the parent process. | 
Definition at line 375 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_buffer_size, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_mirror, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_rank, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm, FEAT::LAFEM::DenseVector< DT_, IT_ >::elements(), FEAT::Dist::Comm::gather(), FEAT::Dist::Comm::rank(), FEAT::Dist::Comm::size(), and XASSERT.
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::rest_send(), and FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::trunc_send().
| 
 | inline | 
move-assignment operator
Definition at line 134 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_buffer_size, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_child_mirrors, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_mirror, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_rank, and FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm.
| 
 | inline | 
Adds a child rank and mirror for a parent process.
| [in] | child_mirror | The mirror of the child patch of this parent process. | 
Definition at line 313 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_child_mirrors.
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::push_patch().
| 
 | inline | 
Sets the sibling communicator.
| [in] | sibling_comm_ | A resident pointer to the sibling communicator. | 
| [in] | parent_rank | The rank of the parent process in the sibling comm. | 
| [in] | parent_mirror | The parent mirror. | 
Definition at line 277 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_mirror, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_rank, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm, and XASSERT.
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::set_root().
| 
 | inline | 
Performs a split operation on the parent process.
| [out] | vec_trg | A transient reference to the split type-1 child vector. | 
| [in] | vec_src | A transient reference to the type-1 parent vector that is to be split | 
Definition at line 476 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_buffer_size, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_child_mirrors, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_mirror, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_rank, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm, FEAT::LAFEM::DenseVector< DT_, IT_ >::elements(), FEAT::Dist::Comm::rank(), FEAT::Dist::Comm::scatter(), FEAT::Dist::Comm::size(), and XASSERT.
Referenced by FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::prol(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::split().
| 
 | inline | 
Receives a split operation from the parent process.
| [out] | vec_trg | A transient reference to the split type-1 child vector. | 
Definition at line 449 of file muxer.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::_buffer_size, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_mirror, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_rank, FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm, FEAT::LAFEM::DenseVector< DT_, IT_ >::elements(), FEAT::Dist::Comm::rank(), FEAT::Dist::Comm::scatter(), FEAT::Dist::Comm::size(), and XASSERT.
Referenced by FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::prol_recv(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::split().
| Index FEAT::Global::Muxer< LocalVector_, Mirror_ >::_buffer_size | 
buffer size
Definition at line 99 of file muxer.hpp.
Referenced by FEAT::Global::Muxer< LocalVector_, Mirror_ >::join(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join_send(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::operator=(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split(), and FEAT::Global::Muxer< LocalVector_, Mirror_ >::split_recv().
| std::vector<Mirror_> FEAT::Global::Muxer< LocalVector_, Mirror_ >::_child_mirrors | 
child mirrors (only on parent)
Definition at line 105 of file muxer.hpp.
Referenced by FEAT::Global::Muxer< LocalVector_, Mirror_ >::bytes(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::compile(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::get_child_mirrors(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::operator=(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::push_child(), and FEAT::Global::Muxer< LocalVector_, Mirror_ >::split().
| Mirror_ FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_mirror | 
parent mirror (on all children)
Definition at line 102 of file muxer.hpp.
Referenced by FEAT::Global::Muxer< LocalVector_, Mirror_ >::bytes(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::compile(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::get_parent_mirror(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join_send(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::operator=(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::set_parent(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split(), and FEAT::Global::Muxer< LocalVector_, Mirror_ >::split_recv().
| int FEAT::Global::Muxer< LocalVector_, Mirror_ >::_parent_rank | 
the rank of the parent
Definition at line 96 of file muxer.hpp.
Referenced by FEAT::Global::Muxer< LocalVector_, Mirror_ >::compile(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::get_parent_rank(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_parent(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join_send(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::operator=(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::set_parent(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split(), and FEAT::Global::Muxer< LocalVector_, Mirror_ >::split_recv().
| const Dist::Comm* FEAT::Global::Muxer< LocalVector_, Mirror_ >::_sibling_comm | 
the sibling communicator
Definition at line 93 of file muxer.hpp.
Referenced by FEAT::Global::Muxer< LocalVector_, Mirror_ >::compile(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::get_sibling_comm(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_child(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_parent(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join_send(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::operator=(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::set_parent(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split(), and FEAT::Global::Muxer< LocalVector_, Mirror_ >::split_recv().