ug4
|
Exchanges information on the interface-status of connected elements. More...
#include <compol_interface_status.h>
Public Types | |
typedef Layout::Element | Element |
typedef Layout::Type | GeomObj |
typedef Layout::Interface | Interface |
typedef Interface::const_iterator | InterfaceIter |
typedef TLayout | Layout |
Public Types inherited from pcl::ICommunicationPolicy< TLayout > | |
typedef Layout::Interface | Interface |
typedef TLayout | Layout |
Public Member Functions | |
virtual bool | begin_layout_extraction (const Layout *pLayout) |
signals the beginning of a layout extraction. More... | |
virtual void | begin_level_extraction (int level) |
signals that a new layout-level will now be processed. More... | |
virtual bool | collect (ug::BinaryBuffer &buff, const Interface &interface) |
should write data which is associated with the interface elements to the buffer. More... | |
virtual bool | extract (ug::BinaryBuffer &buff, const Interface &interface) |
extract data from the buffer and assigns it to the interface-elements. More... | |
virtual int | get_required_buffer_size (const Interface &interface) |
returns the size of the buffer in bytes, that will be required for interface-communication. More... | |
const std::map< int, std::vector< bool > > & | get_result_map (int level=0) |
const std::vector< bool > & | get_result_vec (int procRank, int level=0) |
returns the vector which holds the results for the interface to the given process More... | |
uint | get_status () |
returns the current status More... | |
void | set_distributed_grid_manager (DistributedGridManager *distGridMgr) |
set the distributed grid manager More... | |
ComPol_InterfaceStatus (uint status=INT_NONE) | |
ComPol_InterfaceStatus (DistributedGridManager *distGridMgr, uint status=INT_NONE) | |
void | set_status (uint status) |
Public Member Functions inherited from pcl::ICommunicationPolicy< TLayout > | |
virtual bool | begin_layout_collection (const Layout *pLayout) |
signals the beginning of a layout collection. More... | |
virtual bool | end_layout_collection (const Layout *pLayout) |
signals the end of a layout collection More... | |
virtual bool | end_layout_extraction (const Layout *pLayout) |
signals the end of a layout extraction More... | |
virtual | ~ICommunicationPolicy () |
Private Types | |
typedef std::map< int, std::vector< bool > > | VecMap |
Private Attributes | |
int | m_curLevel |
DistributedGridManager * | m_distGridMgr |
const TLayout * | m_pLayout |
uint | m_status |
std::vector< VecMap > | m_vecMaps |
Exchanges information on the interface-status of connected elements.
The policy fills bool-vectors for each interface, telling whether the associated elements on the connected processes contain the given status. (at least one of both has to contain it).
The vectors are organized in a map. The rank of the process, to which the interface connects, is used as the key.
typedef Layout::Element ug::ComPol_InterfaceStatus< TLayout >::Element |
typedef Layout::Type ug::ComPol_InterfaceStatus< TLayout >::GeomObj |
typedef Layout::Interface ug::ComPol_InterfaceStatus< TLayout >::Interface |
typedef Interface::const_iterator ug::ComPol_InterfaceStatus< TLayout >::InterfaceIter |
typedef TLayout ug::ComPol_InterfaceStatus< TLayout >::Layout |
|
private |
|
inline |
status | (optional - default: INT_NONE). An or-combination of the constants enumerated in InterfaceNodeTypes. |
|
inline |
status | (optional - default: INT_NONE). An or-combination of the constants enumerated in InterfaceNodeTypes. |
|
inlinevirtual |
signals the beginning of a layout extraction.
the default implementation returns true and does nothing else. This method is only called on processes which extract data.
Reimplemented from pcl::ICommunicationPolicy< TLayout >.
References ug::ComPol_InterfaceStatus< TLayout >::m_pLayout, and ug::ComPol_InterfaceStatus< TLayout >::m_vecMaps.
|
inlinevirtual |
signals that a new layout-level will now be processed.
This is primarily interesting for layout-extraction of multi-level-layouts. Before extract is called for the interfaces of one level of a layout, begin_level_extraction(level) is called. If single-level-layouts are processed, this method is called once with level = 0. This method is called after begin_layout_extraction and before the associated extract calls.
Reimplemented from pcl::ICommunicationPolicy< TLayout >.
References ug::ComPol_InterfaceStatus< TLayout >::m_curLevel, ug::ComPol_InterfaceStatus< TLayout >::m_vecMaps, and UG_ASSERT.
|
inlinevirtual |
should write data which is associated with the interface elements to the buffer.
Implements pcl::ICommunicationPolicy< TLayout >.
References ug::DistributedGridManager::contains_status(), ug::ComPol_InterfaceStatus< TLayout >::m_distGridMgr, ug::ComPol_InterfaceStatus< TLayout >::m_status, UG_ASSERT, and ug::BinaryBuffer::write().
|
inlinevirtual |
extract data from the buffer and assigns it to the interface-elements.
If this method is called between calls to begin_layout_extraction and end_layout_extraction, the interface that is passed to this method belongs to the layout.
Implements pcl::ICommunicationPolicy< TLayout >.
References ug::DistributedGridManager::contains_status(), ug::ComPol_InterfaceStatus< TLayout >::m_curLevel, ug::ComPol_InterfaceStatus< TLayout >::m_distGridMgr, ug::ComPol_InterfaceStatus< TLayout >::m_status, ug::ComPol_InterfaceStatus< TLayout >::m_vecMaps, and ug::BinaryBuffer::read().
|
inlinevirtual |
returns the size of the buffer in bytes, that will be required for interface-communication.
Determines the size of the buffer on which the extract and receive methods for the given interface will operate. If the buffer-size can't be calculated on both sides (sender and receiver) this method should return -1. This will lead to an additional communication step in which buffer-sizes will be exchanged. If the buffer-size can be calculated on both sides, it makes sense to do so, since this leads to less communication and overall improved performance. The buffer-size has to exactly match the size of required memory. Make sure that you completely fill the buffer during collect(...) and that you read all data during extract(...). The default implementation returns -1.
Reimplemented from pcl::ICommunicationPolicy< TLayout >.
|
inline |
|
inline |
returns the vector which holds the results for the interface to the given process
This vector should not be accessed until after communication. After communication the vector has the size of the specified interface in the layout, for which communication was performed.
References ug::ComPol_InterfaceStatus< TLayout >::m_pLayout, ug::ComPol_InterfaceStatus< TLayout >::m_vecMaps, and UG_ASSERT.
|
inline |
returns the current status
References ug::ComPol_InterfaceStatus< TLayout >::m_status.
|
inline |
set the distributed grid manager
References ug::ComPol_InterfaceStatus< TLayout >::m_distGridMgr.
|
inline |
status | (optional - default: INT_NONE). An or-combination of the constants enumerated in InterfaceNodeTypes. |
References ug::ComPol_InterfaceStatus< TLayout >::m_status.
|
private |
|
private |
|
private |
|
private |
|
private |
Referenced by ug::ComPol_InterfaceStatus< TLayout >::begin_layout_extraction(), ug::ComPol_InterfaceStatus< TLayout >::begin_level_extraction(), ug::ComPol_InterfaceStatus< TLayout >::extract(), ug::ComPol_InterfaceStatus< TLayout >::get_result_map(), and ug::ComPol_InterfaceStatus< TLayout >::get_result_vec().