33 #ifndef UG_PARALLEL_NODES_H_
34 #define UG_PARALLEL_NODES_H_
114 typedef std::map<AlgebraID,size_t>::iterator
iterator;
120 #define OT_SLAVE_FLAG 4
121 #define OT_MASTER_FLAG 2
122 #define OT_INNER_FLAG 1
213 out <<
"notification that node " << n.
id <<
" is slave on " << n.
newSlaveOnPID <<
" ";
353 return m_OLtype[i].is_master_or_inner();
370 return m_OLtype[i].distance_to_master_or_inner();
Definition: smart_pointer.h:296
Performs communication between interfaces on different processes.
Definition: pcl_interface_communicator.h:68
You may add elements to this interface and iterate over them.
Definition: pcl_communication_structs.h:207
Definition: pcl_process_communicator.h:70
pcl::OrderedInterface< size_t, std::vector > Interface
Interface type.
Definition: pcl_communication_structs.h:467
Definition: parallel_nodes.h:112
const AlgebraID & local_to_global(size_t i) const
Definition: parallel_nodes.h:278
std::map< int, std::set< size_t > > newSlaves
Definition: parallel_nodes.h:261
size_t m_originalSize
Definition: parallel_nodes.h:229
std::vector< OverlapType > m_OLtype
Definition: parallel_nodes.h:230
std::set< int > slavePIDs
Definition: parallel_nodes.h:235
std::map< int, std::vector< NewSlaveNotification > > newSlaveNotifications
Definition: parallel_nodes.h:259
bool is_inner(size_t i) const
Definition: parallel_nodes.h:356
void issue(pcl::InterfaceCommunicator< IndexLayout > &communicator)
Definition: parallel_nodes.cpp:297
void process()
Definition: parallel_nodes.cpp:320
IndexLayout totalMasterLayout
Definition: parallel_nodes.h:226
void insert_into_layout_sorted(std::map< int, std::set< size_t > > &m, IndexLayout &layout)
void append_nodes_without_comm(size_t n)
Appending masters (without comm skills)
Definition: parallel_nodes.cpp:393
std::map< int, std::set< size_t > > notified
map for marking nodes
Definition: parallel_nodes.h:258
const pcl::ProcessCommunicator & proc_comm() const
Definition: parallel_nodes.h:346
const OverlapType & overlap_type(size_t i)
returns the overlap type (inner, master, slave or distanceToMasterOrInner=X)
Definition: parallel_nodes.h:380
std::set< int > masterPIDs
Definition: parallel_nodes.h:234
void sort_layout(IndexLayout &layout)
Definition: parallel_nodes.cpp:193
BufferMap notificationBufferMap
Definition: parallel_nodes.h:237
const IndexLayout & slave_layout() const
Definition: parallel_nodes.h:336
std::vector< AlgebraID > m_localToGlobal
Definition: parallel_nodes.h:224
std::map< AlgebraID, size_t >::const_iterator const_iterator
Definition: parallel_nodes.h:115
void insert_into_interface_sorted(std::vector< size_t > &v, IndexLayout::Interface &interface)
Definition: parallel_nodes.cpp:150
std::map< int, BinaryBuffer > BufferMap
Definition: parallel_nodes.h:232
ConstSmartPtr< AlgebraLayouts > m_layout
Definition: parallel_nodes.h:221
void create_node(const AlgebraID &globalID, size_t localIndex, int pid)
Definition: parallel_nodes.cpp:232
void sort_interface(IndexLayout::Interface &interface)
Definition: parallel_nodes.cpp:181
size_t get_local_index_or_create_new(const AlgebraID &globalIndex, int distanceToMasterOrInner, bool &bCreated)
get_index_or_create_new: returns a local index by creating and saving a new one or returning an old
Definition: parallel_nodes.cpp:107
size_t get_original_size()
Definition: parallel_nodes.h:268
bool is_master(size_t i) const
Definition: parallel_nodes.h:364
std::map< int, std::set< size_t > > newMasters
Definition: parallel_nodes.h:260
IndexLayout & get_total_slave_layout()
Definition: parallel_nodes.h:326
size_t local_size() const
Definition: parallel_nodes.h:273
pcl::InterfaceCommunicator< IndexLayout > & comm() const
Definition: parallel_nodes.h:341
void insert_into_layout_sorted(std::map< int, std::vector< size_t > > &m, IndexLayout &layout)
void sort_by_global_id(std::vector< size_t > &v)
Definition: parallel_nodes.h:306
IndexLayout totalSlaveLayout
Definition: parallel_nodes.h:227
size_t global_to_local(const AlgebraID &globalIndex) const
Definition: parallel_nodes.cpp:141
void create_node(size_t localIndex, int pid)
Definition: parallel_nodes.h:425
bool is_slave(size_t i) const
Definition: parallel_nodes.h:360
std::map< AlgebraID, size_t >::iterator iterator
Definition: parallel_nodes.h:114
void create_node(const AlgebraID &globalID, int pid)
Definition: parallel_nodes.h:415
IndexLayout & get_total_master_layout()
Definition: parallel_nodes.h:322
const AlgebraID & operator[](size_t i) const
Definition: parallel_nodes.h:284
size_t get_local_index_if_available(const AlgebraID &globalIndex, bool &bHasIndex) const
returns a local index by returning a old local one or a saved created one
Definition: parallel_nodes.cpp:83
size_t distance_to_master_or_inner(size_t i) const
Definition: parallel_nodes.h:368
void create_mark_map(const IndexLayout &masterLayout)
Definition: parallel_nodes.cpp:200
ParallelNodes(const ParallelNodes &)
void print() const
Definition: parallel_nodes.h:372
bool is_master_or_inner(size_t i) const
Definition: parallel_nodes.h:351
size_t create_slave_node(const AlgebraID &globalID, int distanceToMasterOrInner)
Definition: parallel_nodes.cpp:219
std::map< AlgebraID, size_t > m_globalToLocal
Definition: parallel_nodes.h:223
void add_new_layouts_to(IndexLayout &newMasterLayout, IndexLayout &newSlaveLayout)
Definition: parallel_nodes.cpp:382
const IndexLayout & master_layout() const
Definition: parallel_nodes.h:331
CompareIndicesByClass< TCompareValues, false > CompareIndicesBy(const TCompareValues &values)
Definition: sort_util.h:114
#define UG_LOG(msg)
Definition: log.h:367
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
#define OT_INNER_FLAG
Definition: parallel_nodes.h:122
#define OT_SLAVE_FLAG
Definition: parallel_nodes.h:120
#define OT_MASTER_FLAG
Definition: parallel_nodes.h:121
this type is used to identify distributed objects.
Definition: algebra_id.h:46
Definition: parallel_nodes.h:204
friend std::ostream & operator<<(std::ostream &out, const NewSlaveNotification &n)
Definition: parallel_nodes.h:211
NewSlaveNotification()
Definition: parallel_nodes.h:205
NewSlaveNotification(const AlgebraID &_id, int _newSlaveOnPID)
Definition: parallel_nodes.h:206
int newSlaveOnPID
Definition: parallel_nodes.h:217
AlgebraID id
Definition: parallel_nodes.h:216
Definition: parallel_nodes.h:119
int type
Definition: parallel_nodes.h:195
void set_inner()
Definition: parallel_nodes.h:158
bool is_master_or_inner() const
Definition: parallel_nodes.h:139
friend std::ostream & operator<<(std::ostream &out, const OverlapType &o)
Definition: parallel_nodes.h:183
size_t distance_to_master_or_inner() const
Definition: parallel_nodes.h:178
OverlapType()
Definition: parallel_nodes.h:128
bool is_master() const
Definition: parallel_nodes.h:144
bool is_inner() const
Definition: parallel_nodes.h:153
void set_distance_to_master_or_inner(size_t i)
Definition: parallel_nodes.h:173
eOverlapType
Definition: parallel_nodes.h:125
@ OT_MASTER
Definition: parallel_nodes.h:126
@ OT_SLAVE
Definition: parallel_nodes.h:126
@ OT_OUTER
Definition: parallel_nodes.h:126
void set_master()
Definition: parallel_nodes.h:163
OverlapType(int distanceToMasterOrInner)
Definition: parallel_nodes.h:134
bool is_slave() const
Definition: parallel_nodes.h:148
void set_slave()
Definition: parallel_nodes.h:168