41 #ifndef __H__UG__PLUGINS__ELECTROMAGNETISM__MEM_REDUCE__
42 #define __H__UG__PLUGINS__ELECTROMAGNETISM__MEM_REDUCE__
45 namespace Electromagnetism{
58 template <
typename TArray,
typename TLayout,
typename TOp>
99 return interface.size () *
sizeof (
value_type);
116 for (
typename Interface::const_iterator iter = interface.begin ();
117 iter != interface.end (); ++iter)
120 const size_t index = interface.get_element (iter);
141 for (
typename Interface::const_iterator iter = interface.begin ();
142 iter != interface.end (); ++iter)
145 const size_t index = interface.get_element (iter);
167 template <
typename TArray,
typename TLayout>
225 for (
typename Interface::const_iterator iter = interface.begin ();
226 iter != interface.end (); ++iter)
229 const size_t index = interface.get_element (iter);
250 for (
typename Interface::const_iterator iter = interface.begin ();
251 iter != interface.end (); ++iter)
254 const size_t index = interface.get_element (iter);
274 template <
typename TArray,
typename TLayout,
typename TOp>
278 const TLayout& masterLayout,
279 const TLayout& slaveLayout,
Layout::Interface Interface
bool communicate(int tag=749345)
void send_data(const Layout &layout, ICommunicationPolicy< TLayout > &commPol)
void receive_data(const Layout &layout, ICommunicationPolicy< TLayout > &commPol)
Definition: memreduce.h:169
const TArray * m_pMemSrc
Definition: memreduce.h:265
base_type::Interface Interface
Definition: memreduce.h:177
pcl::ICommunicationPolicy< TLayout > base_type
Definition: memreduce.h:171
ComPol_MemCopy(TArray *pMemDst, const TArray *pMemSrc)
Constructor setting the arrays.
Definition: memreduce.h:187
ComPol_MemCopy< TArray, TLayout > this_type
Definition: memreduce.h:170
virtual bool collect(ug::BinaryBuffer &buff, const Interface &interface)
writes the interface values into a buffer that will be sent
Definition: memreduce.h:219
ComPol_MemCopy()
Default constructor.
Definition: memreduce.h:181
virtual bool extract(ug::BinaryBuffer &buff, const Interface &interface)
writes values from a buffer into the interface
Definition: memreduce.h:244
TArray * m_pMemDst
Definition: memreduce.h:264
ComPol_MemCopy(TArray *pVec)
Constructor setting the same arrays for the source and the destination.
Definition: memreduce.h:184
void set_src(const TArray *pMem)
set the source array
Definition: memreduce.h:191
array_type::value_type value_type
Definition: memreduce.h:175
TArray array_type
Definition: memreduce.h:174
virtual int get_required_buffer_size(const Interface &interface)
returns the buffer size
Definition: memreduce.h:206
void set_dst(TArray *pMemDst)
set the destination
Definition: memreduce.h:194
base_type::Layout Layout
Definition: memreduce.h:176
Definition: memreduce.h:60
virtual bool extract(ug::BinaryBuffer &buff, const Interface &interface)
writes values from a buffer into the interface
Definition: memreduce.h:135
const TArray * m_pMemSrc
Definition: memreduce.h:158
void set_dst(TArray *pMemDst)
set the destination
Definition: memreduce.h:85
base_type::Interface Interface
Definition: memreduce.h:68
ComPol_MemOp()
Default constructor.
Definition: memreduce.h:72
pcl::ICommunicationPolicy< TLayout > base_type
Definition: memreduce.h:62
void set_src(const TArray *pMem)
set the source array
Definition: memreduce.h:82
virtual int get_required_buffer_size(const Interface &interface)
returns the buffer size
Definition: memreduce.h:97
ComPol_MemOp(TArray *pVec)
Constructor setting the same arrays for the source and the destination.
Definition: memreduce.h:75
TArray array_type
Definition: memreduce.h:65
virtual bool collect(ug::BinaryBuffer &buff, const Interface &interface)
writes the interface values into a buffer that will be sent
Definition: memreduce.h:110
TArray * m_pMemDst
Definition: memreduce.h:157
ComPol_MemOp(TArray *pMemDst, const TArray *pMemSrc)
Constructor setting the arrays.
Definition: memreduce.h:78
array_type::value_type value_type
Definition: memreduce.h:66
base_type::Layout Layout
Definition: memreduce.h:67
ComPol_MemOp< TArray, TLayout, TOp > this_type
Definition: memreduce.h:61
value_type & entry(std::size_t row, std::size_t col)
void MemAllReduce(TArray *pMem, const TLayout &masterLayout, const TLayout &slaveLayout, pcl::InterfaceCommunicator< TLayout > *pCom=NULL)
Definition: memreduce.h:276
void Serialize(std::ostream &buff, const DenseMatrix< VariableArray2< T > > &mat)
void Deserialize(std::istream &buff, const DenseMatrix< VariableArray2< T > > &mat)