33 #ifndef __H__LIB_ALGEBRA__PARALLELIZATION__NEW_LAYOUT_CREATOR_H_
34 #define __H__LIB_ALGEBRA__PARALLELIZATION__NEW_LAYOUT_CREATOR_H_
50 int pid = masterLayout.
proc_id(iter);
52 std::set<size_t> &mark =
notified[pid];
55 size_t localIndex = interface.get_element(iter2);
56 mark.insert(localIndex);
70 out <<
"notification that node " << n.
id <<
" is slave on " << n.
newSlaveOnPID <<
" ";
129 UG_DLOG(
LIB_ALG_MATRIX, 4,
"created new slave with GID " << globalID <<
" with local index " << localIndex <<
" and distanceToMasterOrInner=" << distanceToMasterOrInner <<
"\n");
170 UG_DLOG(
LIB_ALG_MATRIX, 4,
" adding node " << localIndex <<
" to master interface to processor " << pid <<
"\n");
281 for(std::map<
int, std::set<size_t> >::iterator it =
newMasters.begin(); it !=
newMasters.end(); ++it)
283 for(std::map<
int, std::set<size_t> >::iterator it =
newSlaves.begin(); it !=
newSlaves.end(); ++it)
Performs communication between interfaces on different processes.
Definition: pcl_interface_communicator.h:68
void send_raw(int targetProc, const void *pBuff, int bufferSize, bool bSizeKnownAtTarget=false)
sends raw data to a target-proc.
Definition: pcl_interface_communicator_impl.hpp:61
void receive_raw(int srcProc, ug::BinaryBuffer &bufOut, int bufSize=-1)
registers a binary-stream to receive data from a source-proc.
Definition: pcl_interface_communicator_impl.hpp:166
You may add elements to this interface and iterate over them.
Definition: pcl_communication_structs.h:207
iterator end(size_t level=0)
returns the iterator to the last interface of the layout.
Definition: pcl_communication_structs.h:492
iterator begin(size_t level=0)
returns the iterator to the first interface of the layout.
Definition: pcl_communication_structs.h:486
int proc_id(iterator iter) const
returns the target process of the interface given in iterator
Definition: pcl_communication_structs.h:509
InterfaceMap::iterator iterator
An iterator that allows to iterate over the interfaces stored in the layout.
Definition: pcl_communication_structs.h:476
A Buffer for binary data.
Definition: binary_buffer.h:56
char * buffer()
returns the raw buffer pointer or NULL if the buffer is empty (capacity() == 0)
Definition: binary_buffer_impl.h:94
size_t write_pos() const
returns the current write-pos (in bytes)
Definition: binary_buffer_impl.h:53
bool eof()
returns true if the read-position reached the write-position
Definition: binary_buffer_impl.h:99
Definition: new_layout_creator.h:40
std::set< int > slavePIDs
Definition: new_layout_creator.h:82
std::set< int > masterPIDs
Definition: new_layout_creator.h:81
NewLayoutCreator(ParallelNodes &_PN, IndexLayout &masterLayout, IndexLayout &slaveLayout)
Definition: new_layout_creator.h:112
ParallelNodes & PN
Definition: new_layout_creator.h:80
std::map< int, std::set< size_t > > newSlaves
Definition: new_layout_creator.h:108
void create_node(const AlgebraID &globalID, int pid)
Definition: new_layout_creator.h:136
std::map< int, BinaryBuffer > BufferMap
Definition: new_layout_creator.h:78
void create_node(const AlgebraID &globalID, size_t localIndex, int pid)
Definition: new_layout_creator.h:147
std::map< int, std::set< size_t > > notified
map for marking nodes
Definition: new_layout_creator.h:105
void create_mark_map(IndexLayout &masterLayout)
Definition: new_layout_creator.h:42
size_t create_slave_node(const AlgebraID &globalID, int distanceToMasterOrInner)
Definition: new_layout_creator.h:121
void add_new_layouts_to(IndexLayout &newMasterLayout, IndexLayout &newSlaveLayout)
Definition: new_layout_creator.h:277
void issue(pcl::InterfaceCommunicator< IndexLayout > &communicator)
Definition: new_layout_creator.h:212
void process()
Definition: new_layout_creator.h:235
std::map< int, std::vector< NewSlaveNotification > > newSlaveNotifications
Definition: new_layout_creator.h:106
BufferMap notificationBufferMap
Definition: new_layout_creator.h:84
void create_node(size_t localIndex, int pid)
Definition: new_layout_creator.h:141
std::map< int, std::set< size_t > > newMasters
Definition: new_layout_creator.h:107
Definition: parallel_nodes.h:112
const AlgebraID & local_to_global(size_t i) const
Definition: parallel_nodes.h:278
void insert_into_layout_sorted(std::map< int, std::set< size_t > > &m, IndexLayout &layout)
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 global_to_local(const AlgebraID &globalIndex) const
Definition: parallel_nodes.cpp:141
int ProcRank()
returns the rank of the process
Definition: pcl_base.cpp:83
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_DLOG(__debugID__, level, msg)
Definition: log.h:298
DebugID LIB_ALG_MATRIX
Definition: debug_id.h:130
IndexLayout::Interface::iterator find(IndexLayout::Interface &interface, size_t i)
Definition: parallel_index_layout.h:77
void Deserialize(TIStream &buf, ParallelVector< T > &v)
Deerialize for ParallelVector<T>
Definition: restart_bridge.cpp:112
void Serialize(TOStream &buf, const ParallelVector< T > &v)
Serialize for ParallelVector<T>
Definition: restart_bridge.cpp:103
#define PROFILE_FUNC()
Definition: profiler.h:257
this type is used to identify distributed objects.
Definition: algebra_id.h:46
int master_proc() const
Definition: algebra_id.h:54
size_t index_on_master() const
Definition: algebra_id.h:55
Definition: new_layout_creator.h:61
int newSlaveOnPID
Definition: new_layout_creator.h:74
friend std::ostream & operator<<(std::ostream &out, const NewSlaveNotification &n)
Definition: new_layout_creator.h:68
NewSlaveNotification(const AlgebraID &_id, int _newSlaveOnPID)
Definition: new_layout_creator.h:63
NewSlaveNotification()
Definition: new_layout_creator.h:62
AlgebraID id
Definition: new_layout_creator.h:73