DIY  3.0
data-parallel out-of-core C++ library
 All Classes Namespaces Functions Typedefs Groups Pages
Classes | Public Member Functions | List of all members
diy::Master::Proxy Struct Reference

Communication proxy, used for enqueueing and dequeueing items for future exchange. More...

#include <diy/proxy.hpp>

Inheritance diagram for diy::Master::Proxy:
diy::Master::ProxyWithLink diy::ReduceProxy

Classes

struct  EnqueueIterator
 

Public Member Functions

 Proxy (Master *master, int gid)
 
int gid () const
 
template<class T >
void enqueue (const BlockID &to, const T &x, void(*save)(BinaryBuffer &, const T &)=&::diy::save< T >) const
 Enqueue data whose size can be determined automatically, e.g., an STL vector. More...
 
template<class T >
void enqueue (const BlockID &to, const T *x, size_t n, void(*save)(BinaryBuffer &, const T &)=&::diy::save< T >) const
 Enqueue data whose size is given explicitly by the user, e.g., an array. More...
 
template<class T >
void dequeue (int from, T &x, void(*load)(BinaryBuffer &, T &)=&::diy::load< T >) const
 Dequeue data whose size can be determined automatically (e.g., STL vector) and that was previously enqueued so that diy knows its size when it is received. In this case, diy will allocate the receive buffer; the user does not need to do so. More...
 
template<class T >
void dequeue (int from, T *x, size_t n, void(*load)(BinaryBuffer &, T &)=&::diy::load< T >) const
 Dequeue an array of data whose size is given explicitly by the user. In this case, the user needs to allocate the receive buffer prior to calling dequeue. More...
 
template<class T >
EnqueueIterator< T > enqueuer (const T &x, void(*save)(BinaryBuffer &, const T &)=&::diy::save< T >) const
 
IncomingQueues * incoming () const
 
MemoryBufferincoming (int from) const
 
void incoming (std::vector< int > &v) const
 
OutgoingQueues * outgoing () const
 
MemoryBufferoutgoing (const BlockID &to) const
 
template<class T , class Op >
void all_reduce (const T &in, Op op) const
 Post an all-reduce collective using an existing communication proxy. Available operators are: maximum<T>, minimum<T>, std::plus<T>, std::multiplies<T>, std::logical_and<T>, and std::logical_or<T>. More...
 
template<class T >
read () const
 Return the result of a proxy collective without popping it off the collectives list (same result would be returned multiple times). The list can be cleared with collectives()->clear().
 
template<class T >
get () const
 Return the result of a proxy collective; result is popped off the collectives list.
 
template<class T >
void scratch (const T &in) const
 
CollectivesList * collectives () const
 Return the list of proxy collectives (values and operations)
 
Mastermaster () const
 

Detailed Description

Communication proxy, used for enqueueing and dequeueing items for future exchange.

Examples:
reduce/sample-sort.cpp.

Member Function Documentation

template<class T >
void diy::Master::Proxy::dequeue ( int  from,
T &  x,
void(*)(BinaryBuffer &, T &)  load = &::diy::load<T> 
) const
inline

Dequeue data whose size can be determined automatically (e.g., STL vector) and that was previously enqueued so that diy knows its size when it is received. In this case, diy will allocate the receive buffer; the user does not need to do so.

Parameters
fromtarget block gid
xdata (eg. STL vector)
loadoptional serialization function
Examples:
reduce/all-done.cpp, reduce/kd-tree.cpp, reduce/merge-reduce.cpp, reduce/sort.cpp, reduce/swap-reduce.cpp, and simple/simple.cpp.
template<class T >
void diy::Master::Proxy::dequeue ( int  from,
T *  x,
size_t  n,
void(*)(BinaryBuffer &, T &)  load = &::diy::load<T> 
) const

Dequeue an array of data whose size is given explicitly by the user. In this case, the user needs to allocate the receive buffer prior to calling dequeue.

Parameters
fromtarget block gid
xpointer to the data (eg. address of start of vector)
nsize in data elements (eg. ints)
loadoptional serialization function
template<class T >
void diy::Master::Proxy::enqueue ( const BlockID to,
const T &  x,
void(*)(BinaryBuffer &, const T &)  save = &::diy::save<T> 
) const
inline

Enqueue data whose size can be determined automatically, e.g., an STL vector.

Parameters
totarget block (gid,proc)
xdata (eg. STL vector)
saveoptional serialization function
Examples:
reduce/all-done.cpp, reduce/all-to-all.cpp, reduce/kd-tree.cpp, reduce/merge-reduce.cpp, reduce/sort.cpp, reduce/swap-reduce.cpp, and simple/simple.cpp.
template<class T >
void diy::Master::Proxy::enqueue ( const BlockID to,
const T *  x,
size_t  n,
void(*)(BinaryBuffer &, const T &)  save = &::diy::save<T> 
) const

Enqueue data whose size is given explicitly by the user, e.g., an array.

Parameters
totarget block (gid,proc)
xpointer to the data (eg. address of start of vector)
nsize in data elements (eg. ints)
saveoptional serialization function

The documentation for this struct was generated from the following file: