33 #ifndef __H__PCL__PCL_INTERFACE_COMMUNICATOR__
34 #define __H__PCL__PCL_INTERFACE_COMMUNICATOR__
66 template <
class TLayout>
73 typedef typename Layout::Type
Type;
97 void send_raw(
int targetProc,
const void* pBuff,
int bufferSize,
98 bool bSizeKnownAtTarget =
false);
155 void receive_raw(
int srcProc,
void* bufOut,
int bufSize);
197 template <
class TLayoutMap>
199 const typename TLayoutMap::Key& keyFrom,
200 const typename TLayoutMap::Key& keyTo,
287 std::set<int>& curProcs,
288 const TLayout& layout);
291 std::set<int>& curProcs,
292 const TLayout& layout,
296 std::set<int>& curProcs,
297 const TLayout& layout,
307 std::map<int, int>* pMapBuffSizesOut,
317 std::map<int, int>* pMapBuffSizesOut,
349 assert((srcProc == -1) || ((srcProc >= 0) && (srcProc <
pcl::NumProcs())));
specializations are responsible to pack and unpack interface data during communication.
Definition: pcl_communication_structs.h:790
Performs communication between interfaces on different processes.
Definition: pcl_interface_communicator.h:68
BufferMap m_bufMapIn
holds the buffers that are used to receive data
Definition: pcl_interface_communicator.h:371
std::vector< MPI_Request > m_vReceiveRequests
Definition: pcl_interface_communicator.h:380
ICommunicationPolicy< Layout > CommPol
Definition: pcl_interface_communicator.h:76
bool communicate_and_resume(int tag=749345)
collects data and communicates it with other processes without waiting for receive
Definition: pcl_interface_communicator_impl.hpp:420
void prepare_receiver_buffer_map(BufferMap &bufMap, std::set< int > &curProcs, const TLayout &layout)
prepare stream-pack-in
Definition: pcl_interface_communicator_impl.hpp:230
void wait()
waits for the data communicated by communicate_and_resume() and extracts it
Definition: pcl_interface_communicator_impl.hpp:674
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
TLayout Layout
Definition: pcl_interface_communicator.h:71
Layout::Type Type
Definition: pcl_interface_communicator.h:73
bool m_bDebugCommunication
true if the communication shall be debugged.
Definition: pcl_interface_communicator.h:390
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
bool m_bSendBuffersFixed
holds info whether all send-buffers are of predetermined fixed size.
Definition: pcl_interface_communicator.h:394
ExtractorInfoList m_extractorInfos
holds information about the extractors that are awaiting data.
Definition: pcl_interface_communicator.h:376
std::set< int > m_curOutProcs
stores out-procs for the next communication step
Definition: pcl_interface_communicator.h:368
Layout::Interface Interface
Definition: pcl_interface_communicator.h:72
BufferMap m_bufMapOut
holds the buffers that are used to send data
Definition: pcl_interface_communicator.h:366
void extract_data(const TLayout &layout, BufferMap &bufMap, CommPol &extractor)
extract data from stream-pack
Definition: pcl_interface_communicator_impl.hpp:350
ProcessCommunicator m_debugProcComm
This procComm holds the processes that shall participate during communication-debugging.
Definition: pcl_interface_communicator.h:383
InterfaceCommunicator()
Definition: pcl_interface_communicator_impl.hpp:50
bool communicate(int tag=749345)
sends and receives the collected data.
Definition: pcl_interface_communicator_impl.hpp:409
void send_data(int targetProc, const Interface &interface, ICommunicationPolicy< TLayout > &commPol)
collects data that will be send during communicate.
Definition: pcl_interface_communicator_impl.hpp:80
void exchange_data(const TLayoutMap &layoutMap, const typename TLayoutMap::Key &keyFrom, const typename TLayoutMap::Key &keyTo, ICommunicationPolicy< TLayout > &commPol)
internally calls send_data and receive_data with the specified layouts.
Definition: pcl_interface_communicator_impl.hpp:213
bool communication_debugging_enabled()
returns true if communication debugging is enabled
Definition: pcl_interface_communicator_impl.hpp:767
std::set< int > m_curInProcs
stores in-procs for the next communication step
Definition: pcl_interface_communicator.h:373
void disable_communication_debugging()
disables debugging of communication
Definition: pcl_interface_communicator_impl.hpp:760
std::vector< MPI_Request > m_vSendRequests
used by communicate, communicate_and_resume and wait, to check whether communication is done.
Definition: pcl_interface_communicator.h:379
void receive_data(int srcProc, const Interface &interface, ICommunicationPolicy< TLayout > &commPol)
registers a communication-policy to receive data on communicate.
Definition: pcl_interface_communicator_impl.hpp:188
void enable_communication_debugging(const ProcessCommunicator &involvedProcs=ProcessCommunicator(PCD_WORLD))
enables debugging of communication. This has a severe effect on performance!
Definition: pcl_interface_communicator_impl.hpp:745
int m_curComTag
This is the tag for the currently performed communication.
Definition: pcl_interface_communicator.h:387
std::list< ExtractorInfo > ExtractorInfoList
A list that holds information about extractors.
Definition: pcl_interface_communicator.h:362
bool collect_layout_buffer_sizes(const TLayout &layout, ICommunicationPolicy< TLayout > &commPol, std::map< int, int > *pMapBuffSizesOut, const layout_tags::single_level_layout_tag &)
collects buffer sizes for a given layout and stores them in a map
Definition: pcl_interface_communicator_impl.hpp:282
std::map< int, ug::BinaryBuffer > BufferMap
Definition: pcl_interface_communicator.h:272
Definition: pcl_process_communicator.h:70
A Buffer for binary data.
Definition: binary_buffer.h:56
int NumProcs()
returns the number of processes
Definition: pcl_base.cpp:91
@ PCD_WORLD
Definition: pcl_process_communicator.h:55
Definition: parallel_grid_layout.h:46