ug4
|
the standard single-level-layout implementation More...
#include <pcl_communication_structs.h>
Public Types | |
typedef layout_tags::single_level_layout_tag | category_tag |
Layout category. More... | |
typedef InterfaceMap::const_iterator | const_iterator |
typedef Interface::Element | Element |
Element type. More... | |
typedef TInterface | Interface |
Interface type. More... | |
typedef std::map< int, TInterface > | InterfaceMap |
an interface-map is a list of interfaces, each associated with a process id. More... | |
typedef InterfaceMap::iterator | iterator |
An iterator that allows to iterate over the interfaces stored in the layout. More... | |
typedef Interface::Type | Type |
Type. More... | |
Public Member Functions | |
iterator | begin (size_t level=0) |
returns the iterator to the first interface of the layout. More... | |
const_iterator | begin (size_t level=0) const |
void | clear () |
clears the layout More... | |
bool | empty (size_t level=0) const |
returns true if the layout has no interfaces. More... | |
iterator | end (size_t level=0) |
returns the iterator to the last interface of the layout. More... | |
const_iterator | end (size_t level=0) const |
iterator | erase (iterator iter, size_t level=0) |
erases the interface at the given iterator. More... | |
bool | has_interface_elements () const |
returns true if the layout contains interface elements More... | |
const Interface & | interface (const_iterator iter) const |
Interface & | interface (int procID, size_t level=0) |
returns the interface to the given process. More... | |
const Interface & | interface (int procID, size_t level=0) const |
Interface & | interface (iterator iter) |
returns the interface to the given iterator. More... | |
bool | interface_exists (int procID, size_t level=0) const |
returns true if an interface to the given procID already exists. More... | |
size_t | num_interface_elements () const |
returns the sum of the interface sizes More... | |
size_t | num_interfaces (size_t level=0) const |
returns the number of interfaces in the layout More... | |
size_t | num_levels () const |
returns 1 More... | |
int | proc_id (const_iterator iter) const |
int | proc_id (iterator iter) const |
returns the target process of the interface given in iterator More... | |
SingleLevelLayout () | |
template<class TCompare > | |
void | sort_interface_entries (TCompare cmp) |
sort the entries in all interfaces of this layout More... | |
Protected Attributes | |
InterfaceMap | m_interfaceMap |
holds the interfaces in a map. More... | |
the standard single-level-layout implementation
A Layout is a collection of interfaces. Each interface is associated with a process-id.
This layout type supports the requirements of the pcl::layout_tags::single_level_layout_tag category.
The layout passes its local srcID on to created interfaces.
Additionally it features methods that allow to add new interfaces
In order to allow one method to operate both on a SingleLevelLayout and a MultiLevelLayout, the (size_t level = 0) convenience parameter has been added to some methods. Those parameters are ignored throughout the whole implementation.
typedef layout_tags::single_level_layout_tag pcl::SingleLevelLayout< TInterface >::category_tag |
Layout category.
typedef InterfaceMap::const_iterator pcl::SingleLevelLayout< TInterface >::const_iterator |
typedef Interface::Element pcl::SingleLevelLayout< TInterface >::Element |
Element type.
typedef TInterface pcl::SingleLevelLayout< TInterface >::Interface |
Interface type.
typedef std::map<int, TInterface> pcl::SingleLevelLayout< TInterface >::InterfaceMap |
an interface-map is a list of interfaces, each associated with a process id.
typedef InterfaceMap::iterator pcl::SingleLevelLayout< TInterface >::iterator |
An iterator that allows to iterate over the interfaces stored in the layout.
typedef Interface::Type pcl::SingleLevelLayout< TInterface >::Type |
Type.
|
inline |
|
inline |
returns the iterator to the first interface of the layout.
You should access the values of this iterator using the methods Layout::interface and Layout::proc_id.
References pcl::SingleLevelLayout< TInterface >::m_interfaceMap.
Referenced by ug::AddAllFromLayout(), ug::AddConnectionsBetweenSlaves(), ug::AddExtraProcessEntriesToSubdomainLayout(), ug::BuildDomainDecompositionLayouts(), ug::GenerateOverlapClass< matrix_type >::calculate(), ug::ParallelVector< TVector >::check_storage_type(), ug::CommunicateConnections(), ug::CommunicateOnInterfaces(), ug::CopyInterfaceEntrysToDomainDecompositionLayouts(), ug::ParallelNodes::create_mark_map(), ug::NewLayoutCreator::create_mark_map(), ug::CreateGlobalLayout(), pcl::SingleLevelLayout< TInterface >::empty(), ug::FindPositionInInterfaces(), ug::GetHighestReferencedIndex(), pcl::SingleLevelLayout< TInterface >::has_interface_elements(), ug::RowSendingScheme< matrix_type >::issue_send(), ug::LogIndexLayout(), ug::MarkAllFromLayout(), ug::MatExtractDiagOnLayout(), ug::MatWriteDiagOnLayout(), ug::NewLayoutCreator::NewLayoutCreator(), pcl::SingleLevelLayout< TInterface >::num_interface_elements(), ug::NumIndices(), ug::operator<<(), ug::PermuteIndicesInIndexLayout(), ug::RowSendingScheme< matrix_type >::process(), ug::BGLParallelMatrix< T >::refresh(), ug::SlicingData< TVec, N >::replace_indices_in_layout(), ug::ReplaceIndicesInLayout(), ug::ScaleLayoutValues(), ug::Serialize(), ug::SerializeLayout(), ug::SetLayoutValues(), pcl::SingleLevelLayout< TInterface >::sort_interface_entries(), and ug::ParallelNodes::sort_layout().
|
inline |
|
inline |
clears the layout
References pcl::SingleLevelLayout< TInterface >::m_interfaceMap.
Referenced by ug::HorizontalAlgebraLayouts::clear(), ug::AlgebraLayouts::clear(), ug::CollectMatrixOnOneProc(), ug::CreateLayoutFromGlobalLayout(), ug::CreateLevelIndexLayout(), and ug::DoFDistribution::reinit_index_layout().
|
inline |
returns true if the layout has no interfaces.
Note that this method only tells whether there are interfaces or not. To check whether there are any elements use has_interface_elements.
References pcl::SingleLevelLayout< TInterface >::begin(), and pcl::SingleLevelLayout< TInterface >::end().
Referenced by ug::BuildOneToManyLayout().
|
inline |
returns the iterator to the last interface of the layout.
You should access the values of this iterator using the methods Layout::interface and Layout::proc_id.
References pcl::SingleLevelLayout< TInterface >::m_interfaceMap.
Referenced by ug::AddAllFromLayout(), ug::AddConnectionsBetweenSlaves(), ug::AddExtraProcessEntriesToSubdomainLayout(), ug::BuildDomainDecompositionLayouts(), ug::GenerateOverlapClass< matrix_type >::calculate(), ug::ParallelVector< TVector >::check_storage_type(), ug::CommunicateConnections(), ug::CommunicateOnInterfaces(), ug::CopyInterfaceEntrysToDomainDecompositionLayouts(), ug::ParallelNodes::create_mark_map(), ug::NewLayoutCreator::create_mark_map(), ug::CreateGlobalLayout(), pcl::SingleLevelLayout< TInterface >::empty(), ug::FindPositionInInterfaces(), ug::GetHighestReferencedIndex(), pcl::SingleLevelLayout< TInterface >::has_interface_elements(), ug::RowSendingScheme< matrix_type >::issue_send(), ug::LogIndexLayout(), ug::MarkAllFromLayout(), ug::MatExtractDiagOnLayout(), ug::MatWriteDiagOnLayout(), ug::NewLayoutCreator::NewLayoutCreator(), pcl::SingleLevelLayout< TInterface >::num_interface_elements(), ug::NumIndices(), ug::operator<<(), ug::PermuteIndicesInIndexLayout(), ug::RowSendingScheme< matrix_type >::process(), ug::BGLParallelMatrix< T >::refresh(), ug::SlicingData< TVec, N >::replace_indices_in_layout(), ug::ReplaceIndicesInLayout(), ug::ScaleLayoutValues(), ug::Serialize(), ug::SerializeLayout(), ug::SetLayoutValues(), pcl::SingleLevelLayout< TInterface >::sort_interface_entries(), and ug::ParallelNodes::sort_layout().
|
inline |
|
inline |
erases the interface at the given iterator.
returns an iterator to the next interface.
References pcl::SingleLevelLayout< TInterface >::m_interfaceMap.
|
inline |
returns true if the layout contains interface elements
References pcl::SingleLevelLayout< TInterface >::begin(), pcl::SingleLevelLayout< TInterface >::end(), and pcl::SingleLevelLayout< TInterface >::interface().
|
inline |
|
inline |
returns the interface to the given process.
if the queried interface exist, it will be returned. If not it will be created. The new interfaces localSrcID will be set to the localSrcID of this layout.
References pcl::SingleLevelLayout< TInterface >::m_interfaceMap.
|
inline |
References pcl::SingleLevelLayout< TInterface >::m_interfaceMap, and UG_ASSERT.
|
inline |
returns the interface to the given iterator.
Referenced by ug::DoFDistribution::add_indices_from_layouts(), ug::AddAllFromLayout(), ug::AddConnectionsBetweenSlaves(), ug::AddEntriesToIndexLayout_DomainDecomposition(), ug::AddEntriesToLevelIndexLayout(), ug::AddEntriesToSurfaceIndexLayout(), ug::AddExtraProcessEntriesToSubdomainLayout(), ug::CommunicateOnInterfaces(), ug::CopyInterfaceEntrysToDomainDecompositionLayouts(), ug::Deserialize(), ug::DeserializeLayout(), pcl::SingleLevelLayout< TInterface >::has_interface_elements(), ug::MarkAllFromLayout(), pcl::SingleLevelLayout< TInterface >::num_interface_elements(), ug::NumIndices(), ug::ReceiveMatrix(), ug::ReceiveOnInterfaces(), ug::BGLParallelMatrix< T >::refresh(), ug::SlicingData< TVec, N >::replace_indices_in_layout(), ug::SendMatrix(), ug::Serialize(), pcl::SingleLevelLayout< TInterface >::sort_interface_entries(), and ug::ParallelNodes::sort_layout().
|
inline |
returns true if an interface to the given procID already exists.
References pcl::SingleLevelLayout< TInterface >::m_interfaceMap.
|
inline |
returns the sum of the interface sizes
References pcl::SingleLevelLayout< TInterface >::begin(), pcl::SingleLevelLayout< TInterface >::end(), and pcl::SingleLevelLayout< TInterface >::interface().
|
inline |
returns the number of interfaces in the layout
References pcl::SingleLevelLayout< TInterface >::m_interfaceMap.
Referenced by ug::Serialize().
|
inline |
returns 1
|
inline |
|
inline |
returns the target process of the interface given in iterator
Referenced by ug::AddConnectionsBetweenSlaves(), ug::AddExtraProcessEntriesToSubdomainLayout(), ug::BuildDomainDecompositionLayouts(), ug::CommunicateOnInterfaces(), ug::CopyInterfaceEntrysToDomainDecompositionLayouts(), ug::ParallelNodes::create_mark_map(), ug::NewLayoutCreator::create_mark_map(), ug::CreateGlobalLayout(), ug::FindPositionInInterfaces(), ug::RowSendingScheme< matrix_type >::issue_send(), ug::LogIndexLayout(), ug::NewLayoutCreator::NewLayoutCreator(), ug::operator<<(), ug::RowSendingScheme< matrix_type >::process(), ug::BGLParallelMatrix< T >::refresh(), ug::Serialize(), and ug::SerializeLayout().
|
inline |
sort the entries in all interfaces of this layout
References pcl::SingleLevelLayout< TInterface >::begin(), pcl::SingleLevelLayout< TInterface >::end(), and pcl::SingleLevelLayout< TInterface >::interface().
Referenced by pcl::MultiLevelLayout< TInterface >::sort_interface_entries().
|
protected |
holds the interfaces in a map.
Referenced by pcl::SingleLevelLayout< TInterface >::begin(), pcl::SingleLevelLayout< TInterface >::clear(), pcl::SingleLevelLayout< TInterface >::end(), pcl::SingleLevelLayout< TInterface >::erase(), pcl::SingleLevelLayout< TInterface >::interface(), pcl::SingleLevelLayout< TInterface >::interface_exists(), and pcl::SingleLevelLayout< TInterface >::num_interfaces().