33 #ifndef __H__UG__compol_interface_status__
34 #define __H__UG__compol_interface_status__
39 #include "../distributed_grid.h"
53 template <
class TLayout>
99 " before results are checked.");
102 "interface to proc " << procRank <<
" on level "
103 << level <<
" does not exist.");
108 std::vector<bool>& result =
m_vecMaps[level][procRank];
111 "result size and interface size do not match."
112 " perform communication directly before querying the results.");
120 " before results are checked.");
133 return interface.size() *
sizeof(char);
154 " before performing communication.");
157 iter != interface.end(); ++iter)
159 Element elem = interface.get_element(iter);
161 buff.
write(&val,
sizeof(
char));
182 vec.reserve(interface.size());
185 iter != interface.end(); ++iter)
187 Element elem = interface.get_element(iter);
189 buff.
read(&val,
sizeof(
char));
191 vec.push_back(((
bool)val) ||
199 typedef std::map<int, std::vector<bool> >
VecMap;
specializations are responsible to pack and unpack interface data during communication.
Definition: pcl_communication_structs.h:790
A Buffer for binary data.
Definition: binary_buffer.h:56
void read(char *buf, size_t size)
reads data of the given size (in bytes)
Definition: binary_buffer_impl.h:58
void write(const char *buf, size_t size)
writes data of the given size (in bytes)
Definition: binary_buffer_impl.h:71
Exchanges information on the interface-status of connected elements.
Definition: compol_interface_status.h:55
std::map< int, std::vector< bool > > VecMap
Definition: compol_interface_status.h:199
void set_status(uint status)
Definition: compol_interface_status.h:81
TLayout Layout
Definition: compol_interface_status.h:57
ComPol_InterfaceStatus(DistributedGridManager *distGridMgr, uint status=INT_NONE)
Definition: compol_interface_status.h:74
Layout::Interface Interface
Definition: compol_interface_status.h:60
Layout::Element Element
Definition: compol_interface_status.h:59
uint m_status
Definition: compol_interface_status.h:204
const TLayout * m_pLayout
Definition: compol_interface_status.h:202
Layout::Type GeomObj
Definition: compol_interface_status.h:58
virtual int get_required_buffer_size(const Interface &interface)
returns the size of the buffer in bytes, that will be required for interface-communication.
Definition: compol_interface_status.h:131
void set_distributed_grid_manager(DistributedGridManager *distGridMgr)
set the distributed grid manager
Definition: compol_interface_status.h:88
virtual void begin_level_extraction(int level)
signals that a new layout-level will now be processed.
Definition: compol_interface_status.h:167
const std::map< int, std::vector< bool > > & get_result_map(int level=0)
Definition: compol_interface_status.h:117
std::vector< VecMap > m_vecMaps
Definition: compol_interface_status.h:201
int m_curLevel
Definition: compol_interface_status.h:205
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
Definition: compol_interface_status.h:96
DistributedGridManager * m_distGridMgr
Definition: compol_interface_status.h:203
ComPol_InterfaceStatus(uint status=INT_NONE)
Definition: compol_interface_status.h:68
virtual bool begin_layout_extraction(const Layout *pLayout)
signals the beginning of a layout extraction.
Definition: compol_interface_status.h:137
uint get_status()
returns the current status
Definition: compol_interface_status.h:85
Interface::const_iterator InterfaceIter
Definition: compol_interface_status.h:61
virtual bool collect(ug::BinaryBuffer &buff, const Interface &interface)
should write data which is associated with the interface elements to the buffer.
Definition: compol_interface_status.h:149
virtual bool extract(ug::BinaryBuffer &buff, const Interface &interface)
extract data from the buffer and assigns it to the interface-elements.
Definition: compol_interface_status.h:174
manages the layouts and interfaces which are associated with a distributed grid.
Definition: distributed_grid.h:88
bool contains_status(TGeomObj *o, byte status) const
returns true if the status of the given object contains the given status.
Definition: distributed_grid.h:135
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
unsigned int uint
Definition: types.h:114
@ INT_NONE
Definition: parallel_grid_layout.h:103