Thrill
0.1
|
Modules | |
Mock Network API | |
TCP Socket API | |
MPI Network API | |
Classes | |
class | AsyncReadBuffer |
class | AsyncReadByteBlock |
class | AsyncWriteBlock |
class | AsyncWriteBuffer |
class | Buffer |
Simple buffer of characters without initialization or growing functionality. More... | |
class | BufferBuilder |
BufferBuilder represents a dynamically growable area of memory, which can be modified by appending integral data types via Put() and other basic operations. More... | |
class | BufferReader |
BufferReader represents a BufferRef with an additional cursor with which the memory can be read incrementally. More... | |
class | BufferRef |
BufferRef represents a reference to a memory area as pointer and valid length. More... | |
class | Connection |
A Connection represents a link to another peer in a network group. More... | |
class | Dispatcher |
Dispatcher is a high level wrapper for asynchronous callback processing. More... | |
class | DispatcherThread |
DispatcherThread contains a net::Dispatcher object and an associated thread that runs in the dispatching loop. More... | |
class | Exception |
A Exception is thrown by Connection on all errors instead of returning error codes. More... | |
class | FixedBufferBuilder< Capacity > |
Represents a FIXED length area of memory, which can be modified by appending integral data types via Put() and other basic operations. More... | |
class | FlowControlChannel |
Provides a blocking collection for communication. More... | |
class | FlowControlChannelManager |
class | Group |
A network Group is a collection of enumerated communication links, which provides point-to-point communication and MPI-like collective primitives. More... | |
class | Manager |
Initializes communication channels, manages communication channels and handles errors. More... | |
struct | Traffic |
Typedefs | |
using | AsyncCallback = tlx::delegate< bool(), mem::GPoolAllocator< char > > |
Signature of async connection readability/writability callbacks. More... | |
using | AsyncDispatcherThreadCallback = tlx::delegate< void(class Dispatcher &), mem::GPoolAllocator< char > > |
Signature of generic dispatcher callback. More... | |
using | AsyncReadBufferCallback = tlx::delegate< void(Connection &c, Buffer &&buffer), mem::GPoolAllocator< char > > |
Signature of async read Buffer callbacks. More... | |
using | AsyncReadByteBlockCallback = tlx::delegate< void(Connection &c, data::PinnedByteBlockPtr &&bytes), mem::GPoolAllocator< char > > |
Signature of async read ByteBlock callbacks. More... | |
using | AsyncReadCallback = tlx::delegate< void(Connection &c, Buffer &&buffer), mem::GPoolAllocator< char > > |
Signature of async read callbacks. More... | |
using | AsyncWriteCallback = tlx::delegate< void(Connection &), mem::GPoolAllocator< char > > |
Signature of async write callbacks. More... | |
using | GroupPtr = std::unique_ptr< Group > |
unique pointer to a Group. More... | |
using | TimerCallback = tlx::delegate< bool(), mem::GPoolAllocator< char > > |
Signature of timer callbacks. More... | |
Functions | |
template<> | |
void | AllReduce (int &value, std::plus< int >) |
template<> | |
void | AllReduce (int &value, common::minimum< int >) |
template<> | |
void | AllReduce (int &value, common::maximum< int >) |
template<> | |
void | AllReduce (unsigned int &value, std::plus< unsigned int >) |
template<> | |
void | AllReduce (unsigned int &value, common::minimum< unsigned int >) |
template<> | |
void | AllReduce (unsigned int &value, common::maximum< unsigned int >) |
template<> | |
void | AllReduce (long &value, std::plus< long >) |
template<> | |
void | AllReduce (long &value, common::minimum< long >) |
template<> | |
void | AllReduce (long &value, common::maximum< long >) |
template<> | |
void | AllReduce (unsigned long &value, std::plus< unsigned long >) |
template<> | |
void | AllReduce (unsigned long &value, common::minimum< unsigned long >) |
template<> | |
void | AllReduce (unsigned long &value, common::maximum< unsigned long >) |
template<> | |
void | AllReduce (long long &value, std::plus< long long >) |
template<> | |
void | AllReduce (long long &value, common::minimum< long long >) |
template<> | |
void | AllReduce (long long &value, common::maximum< long long >) |
template<> | |
void | AllReduce (unsigned long long &value, std::plus< unsigned long long >) |
template<> | |
void | AllReduce (unsigned long long &value, common::minimum< unsigned long long >) |
template<> | |
void | AllReduce (unsigned long long &value, common::maximum< unsigned long long >) |
template<typename T , typename BinarySumOp = std::plus<T>> | |
T TLX_ATTRIBUTE_WARN_UNUSED_RESULT | AllReduce (const T &value, const BinarySumOp &sum_op=BinarySumOp()) |
Reduces a value of a serializable type T over all workers given a certain reduce function. More... | |
template<> | |
void | Broadcast (int &value, size_t origin) |
template<> | |
void | Broadcast (unsigned int &value, size_t origin) |
template<typename T > | |
T TLX_ATTRIBUTE_WARN_UNUSED_RESULT | Broadcast (const T &value, size_t origin=0) |
Broadcasts a value of a serializable type T from the master (the worker with id 0) to all other workers. More... | |
template<> | |
void | Broadcast (long &value, size_t origin) |
template<> | |
void | Broadcast (unsigned long &value, size_t origin) |
template<> | |
void | Broadcast (long long &value, size_t origin) |
template<> | |
void | Broadcast (unsigned long long &value, size_t origin) |
template<typename Group , typename GroupCalled > | |
void | ExecuteGroupThreads (const std::vector< std::unique_ptr< Group > > &groups, const std::function< void(GroupCalled *)> &thread_function) |
template<> | |
void | ExPrefixSum (int &value, std::plus< int >, const int &initial) |
template<> | |
void | ExPrefixSum (unsigned int &value, std::plus< unsigned int >, const unsigned int &initial) |
template<> | |
void | ExPrefixSum (long &value, std::plus< long >, const long &initial) |
template<> | |
void | ExPrefixSum (unsigned long &value, std::plus< unsigned long >, const unsigned long &initial) |
template<> | |
void | ExPrefixSum (long long &value, std::plus< long long >, const long long &initial) |
template<> | |
void | ExPrefixSum (unsigned long long &value, std::plus< unsigned long long >, const unsigned long long &initial) |
template<typename T , typename BinarySumOp = std::plus<T>> | |
T TLX_ATTRIBUTE_WARN_UNUSED_RESULT | ExPrefixSumTotal (T &value, const BinarySumOp &sum_op=BinarySumOp(), const T &initial=T()) |
Calculates the exclusive prefix sum over all workers, and delivers the total sum as well. More... | |
template<> | |
void | PrefixSum (int &value, std::plus< int >, const int &initial) |
template<> | |
void | PrefixSum (unsigned int &value, std::plus< unsigned int >, const unsigned int &initial) |
template<> | |
void | PrefixSum (long &value, std::plus< long >, const long &initial) |
template<> | |
void | PrefixSum (unsigned long &value, std::plus< unsigned long >, const unsigned long &initial) |
template<> | |
void | PrefixSum (long long &value, std::plus< long long >, const long long &initial) |
template<> | |
void | PrefixSum (unsigned long long &value, std::plus< unsigned long long >, const unsigned long long &initial) |
template<typename T , typename BinarySumOp = std::plus<T>> | |
T TLX_ATTRIBUTE_WARN_UNUSED_RESULT | PrefixSumBase (const T &value, const BinarySumOp &sum_op=BinarySumOp(), const T &initial=T(), bool inclusive=true) |
Calculates the prefix sum over all workers, given a certain sum operation. More... | |
void | RunLoopbackGroupTest (size_t num_hosts, const std::function< void(Group *)> &thread_function) |
Variables | |
static constexpr bool | debug_async = false |
static constexpr bool | debug_async_recv = false |
static constexpr bool | debug_async_send = false |
Synchronous Collective Communication Functions | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | PrefixSum (T &value, BinarySumOp sum_op=BinarySumOp(), const T &initial=T()) |
Calculate inclusive prefix sum. More... | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | ExPrefixSum (T &value, BinarySumOp sum_op=BinarySumOp(), const T &initial=T()) |
Calculate exclusive prefix sum. More... | |
template<typename T > | |
void | Broadcast (T &value, size_t origin=0) |
Broadcast a value from the worker "origin". More... | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | Reduce (T &value, size_t root=0, BinarySumOp sum_op=BinarySumOp()) |
Reduce a value from all workers to the worker 0. More... | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | AllReduce (T &value, BinarySumOp sum_op=BinarySumOp()) |
Reduce a value from all workers to all workers. More... | |
Additional Synchronous Collective Communication Functions | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | PrefixSumDoubling (T &value, BinarySumOp sum_op=BinarySumOp(), const T &initial=T(), bool inclusive=true) |
Calculate for every worker his prefix sum. More... | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | PrefixSumHypercube (T &value, BinarySumOp sum_op=BinarySumOp()) |
Calculate for every worker his prefix sum. More... | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | PrefixSumSelect (T &value, BinarySumOp sum_op=BinarySumOp(), const T &initial=T(), bool inclusive=true) |
select prefixsum implementation (often due to total number of processors) More... | |
template<typename T > | |
void | BroadcastTrivial (T &value, size_t origin=0) |
Broadcasts the value of the peer with index 0 to all the others. More... | |
template<typename T > | |
void | BroadcastBinomialTree (T &value, size_t origin=0) |
Broadcasts the value of the worker with index "origin" to all the others. More... | |
template<typename T > | |
void | BroadcastSelect (T &value, size_t origin=0) |
select broadcast implementation (often due to total number of processors) More... | |
template<typename T > | |
void | AllGatherRecursiveDoublingPowerOfTwo (T *values, size_t n) |
template<typename T > | |
void | AllGatherBruck (T *values, size_t n) |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | AllReduceSimple (T &value, BinarySumOp sum_op=BinarySumOp()) |
Perform an All-Reduce on the workers. More... | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | AllReduceAtRoot (T &value, BinarySumOp sum_op=BinarySumOp()) |
Broadcasts the value of the peer with index 0 to all the others. More... | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | AllReduceHypercube (T &value, BinarySumOp sum_op=BinarySumOp()) |
Perform an All-Reduce for powers of two. More... | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | AllReduceElimination (T &value, BinarySumOp sum_op=BinarySumOp()) |
Perform an All-Reduce using the elimination protocol described in R. More... | |
template<typename T , typename BinarySumOp > | |
T | SendReceiveReduce (size_t peer, const T &value, BinarySumOp sum_op) |
Helper method for AllReduce(). More... | |
template<typename T , typename BinarySumOp > | |
void | AllReduceEliminationProcess (size_t host_id, size_t group_size, size_t remaining_hosts, size_t send_to, T &value, BinarySumOp sum_op) |
Helper method for AllReduce(). More... | |
template<typename T , typename BinarySumOp = std::plus<T>> | |
void | AllReduceSelect (T &value, BinarySumOp sum_op=BinarySumOp()) |
select allreduce implementation (often due to total number of processors) More... | |
typedef tlx::delegate< bool(), mem::GPoolAllocator< char > > AsyncCallback |
Signature of async connection readability/writability callbacks.
Definition at line 45 of file dispatcher.hpp.
using AsyncDispatcherThreadCallback = tlx::delegate< void (class Dispatcher&), mem::GPoolAllocator<char> > |
Signature of generic dispatcher callback.
Definition at line 54 of file dispatcher_thread.hpp.
using AsyncReadBufferCallback = tlx::delegate< void (Connection& c, Buffer&& buffer), mem::GPoolAllocator<char> > |
Signature of async read Buffer callbacks.
Definition at line 49 of file dispatcher.hpp.
typedef tlx::delegate< void(Connection &c, data::PinnedByteBlockPtr &&block), mem::GPoolAllocator< char > > AsyncReadByteBlockCallback |
Signature of async read ByteBlock callbacks.
Definition at line 54 of file dispatcher.hpp.
using AsyncReadCallback = tlx::delegate< void (Connection& c, Buffer&& buffer), mem::GPoolAllocator<char> > |
Signature of async read callbacks.
Definition at line 41 of file dispatcher_thread.hpp.
typedef tlx::delegate< void(Connection &), mem::GPoolAllocator< char > > AsyncWriteCallback |
Signature of async write callbacks.
Definition at line 58 of file dispatcher.hpp.
typedef tlx::delegate< bool(), mem::GPoolAllocator< char > > TimerCallback |
Signature of timer callbacks.
Definition at line 42 of file dispatcher.hpp.
void AllGatherBruck | ( | T * | values, |
size_t | n | ||
) |
Definition at line 279 of file collective.hpp.
References Group::connection(), min(), Group::my_host_rank(), Group::num_hosts(), Connection::ReceiveN(), and Connection::SendN().
Referenced by FlowControlChannel::AllGather(), and Group::ReceiveFrom().
void AllGatherRecursiveDoublingPowerOfTwo | ( | T * | values, |
size_t | n | ||
) |
Definition at line 260 of file collective.hpp.
References Group::connection(), tlx::integer_log2_ceil(), Group::my_host_rank(), Group::num_hosts(), and Connection::SendReceive().
Referenced by FlowControlChannel::AllGather(), and Group::ReceiveFrom().
void AllReduce | ( | T & | value, |
BinarySumOp | sum_op = BinarySumOp() |
||
) |
Reduce a value from all workers to all workers.
Perform an All-Reduce on the workers.
This is done by aggregating all values according to a summation operator and sending them backto all workers.
value | The value to be added to the aggregation |
sum_op | A custom summation operator |
Definition at line 568 of file collective.hpp.
References Group::AllReduceSelect().
Referenced by FlowControlChannel::AllReduce(), FlowControlChannel::Barrier(), and Group::ReceiveFrom().
|
inline |
Definition at line 383 of file group.hpp.
References Group::AllReducePlusInt().
|
inline |
Definition at line 387 of file group.hpp.
References Group::AllReduceMinimumInt().
|
inline |
Definition at line 391 of file group.hpp.
References Group::AllReduceMaximumInt().
|
inline |
Definition at line 407 of file group.hpp.
References Group::AllReducePlusUnsignedInt().
|
inline |
Definition at line 411 of file group.hpp.
References Group::AllReduceMinimumUnsignedInt().
|
inline |
Definition at line 415 of file group.hpp.
References Group::AllReduceMaximumUnsignedInt().
|
inline |
Definition at line 431 of file group.hpp.
References Group::AllReducePlusLong().
|
inline |
Definition at line 435 of file group.hpp.
References Group::AllReduceMinimumLong().
|
inline |
Definition at line 439 of file group.hpp.
References Group::AllReduceMaximumLong().
|
inline |
Definition at line 455 of file group.hpp.
References Group::AllReducePlusUnsignedLong().
|
inline |
Definition at line 459 of file group.hpp.
References Group::AllReduceMinimumUnsignedLong().
|
inline |
Definition at line 463 of file group.hpp.
References Group::AllReduceMaximumUnsignedLong().
|
inline |
Definition at line 479 of file group.hpp.
References Group::AllReducePlusLongLong().
|
inline |
Definition at line 483 of file group.hpp.
References Group::AllReduceMinimumLongLong().
|
inline |
Definition at line 487 of file group.hpp.
References Group::AllReduceMaximumLongLong().
|
inline |
Definition at line 503 of file group.hpp.
References Group::AllReducePlusUnsignedLongLong().
|
inline |
Definition at line 507 of file group.hpp.
References Group::AllReduceMinimumUnsignedLongLong().
|
inline |
Definition at line 511 of file group.hpp.
References Group::AllReduceMaximumUnsignedLongLong().
|
inline |
Reduces a value of a serializable type T over all workers given a certain reduce function.
This method is blocking. The reduce happens in order as with prefix sum. The operation is assumed to be associative.
value | The value to use for the reduce operation. |
sum_op | The operation to use for calculating the reduced value. The default operation is a normal addition. |
Definition at line 599 of file flow_control_channel.hpp.
References Group::AllReduce(), FlowControlChannel::barrier_, FlowControlChannel::count_allreduce_, FlowControlChannel::debug, FlowControlChannel::enable_stats, FlowControlChannel::GetNextStep(), FlowControlChannel::group_, LOG, FlowControlChannel::SetLocalShared(), FlowControlChannel::thread_count_, FlowControlChannel::timer_allreduce_, FlowControlChannel::timer_communication_, gen_data::value, and ThreadBarrierSpin::wait().
Referenced by HyperLogLogNode< p, ValueType >::Execute(), SizeNode< ValueType >::Execute(), AllReduceNode< ValueType, ReduceFunction >::Execute(), ConcatNode< ValueType >::Execute(), DuplicateDetection::FindNonDuplicates(), MergeNode< ValueType, Comparator, kNumInputs >::GetGlobalRanks(), FlowControlChannel::LocalBarrier(), MergeNode< ValueType, Comparator, kNumInputs >::MainOp(), FlowControlChannel::Predecessor(), MergeNode< ValueType, Comparator, kNumInputs >::Stats::Print(), and MergeNode< ValueType, Comparator, kNumInputs >::SelectPivots().
void AllReduceAtRoot | ( | T & | value, |
BinarySumOp | sum_op = BinarySumOp() |
||
) |
Broadcasts the value of the peer with index 0 to all the others.
This is a trivial broadcast from peer 0.
value | The value to be broadcast / receive into. |
sum_op | A custom summation operator |
Definition at line 382 of file collective.hpp.
References Group::my_host_rank(), Group::num_hosts(), Group::ReceiveFrom(), and Group::SendTo().
Referenced by Group::ReceiveFrom().
void AllReduceElimination | ( | T & | value, |
BinarySumOp | sum_op = BinarySumOp() |
||
) |
Perform an All-Reduce using the elimination protocol described in R.
Rabenseifner and J. L. Traeff. "More Efficient Reduction Algorithms for Non-Power-of-Two Number of Processors in Message-Passing Parallel Systems." In Recent Advances in Parallel Virtual Machine and Message Passing Interface, 36–46. LNCS 3241. Springer, 2004.
value | The value to be added to the aggregation |
sum_op | A custom summation operator |
Definition at line 459 of file collective.hpp.
References Group::AllReduceEliminationProcess(), Group::my_host_rank(), and Group::num_hosts().
Referenced by Group::AllReduceSelect(), and Group::ReceiveFrom().
|
protected |
Helper method for AllReduce().
used for the recursive implementation of the elimination protocol
Definition at line 479 of file collective.hpp.
References Group::my_host_rank(), Group::ReceiveFrom(), Group::SendReceiveReduce(), and Group::SendTo().
Referenced by Group::AllReduceElimination(), and Group::ReceiveFrom().
void AllReduceHypercube | ( | T & | value, |
BinarySumOp | sum_op = BinarySumOp() |
||
) |
Perform an All-Reduce for powers of two.
This is done with the Hypercube algorithm from the ParAlg script.
value | The value to be added to the aggregation |
sum_op | A custom summation operator |
Definition at line 414 of file collective.hpp.
References Group::connection(), Group::my_host_rank(), Group::num_hosts(), Connection::ReceiveSend(), and Connection::SendReceive().
Referenced by Group::ReceiveFrom().
void AllReduceSelect | ( | T & | value, |
BinarySumOp | sum_op = BinarySumOp() |
||
) |
select allreduce implementation (often due to total number of processors)
Definition at line 551 of file collective.hpp.
References Group::AllReduceElimination().
Referenced by Group::AllReduce(), and Group::ReceiveFrom().
void AllReduceSimple | ( | T & | value, |
BinarySumOp | sum_op = BinarySumOp() |
||
) |
Perform an All-Reduce on the workers.
This is done by aggregating all values according to a summation operator and sending them backto all workers.
value | The value to be added to the aggregation |
sum_op | A custom summation operator |
Definition at line 368 of file collective.hpp.
References Group::Broadcast(), and Group::Reduce().
Referenced by Group::ReceiveFrom().
void Broadcast | ( | T & | value, |
size_t | origin = 0 |
||
) |
Broadcast a value from the worker "origin".
Broadcasts the value of the worker with index 0 to all the others.
This is a binomial tree broadcast method.
value | The value to be broadcast / receive into. |
origin | The PE to broadcast value from. |
Definition at line 252 of file collective.hpp.
References Group::BroadcastSelect().
Referenced by Group::AllReduceSimple(), FlowControlChannel::Broadcast(), FlowControlChannel::ExPrefixSumTotal(), and Group::ReceiveFrom().
|
inline |
Definition at line 379 of file group.hpp.
References Group::BroadcastInt().
|
inline |
Definition at line 403 of file group.hpp.
References Group::BroadcastUnsignedInt().
|
inline |
Broadcasts a value of a serializable type T from the master (the worker with id 0) to all other workers.
This method is blocking on all workers except the master.
value | The value to broadcast. This value is ignored for each worker except the master. We use this signature to keep the decision wether a node is the master transparent. |
origin | Worker number to broadcast value from. |
Definition at line 424 of file flow_control_channel.hpp.
References FlowControlChannel::barrier_, Group::Broadcast(), FlowControlChannel::count_broadcast_, FlowControlChannel::debug, FlowControlChannel::enable_stats, FlowControlChannel::GetNextStep(), FlowControlChannel::group_, FlowControlChannel::local_id_, LOG, FlowControlChannel::SetLocalShared(), FlowControlChannel::thread_count_, FlowControlChannel::timer_broadcast_, FlowControlChannel::timer_communication_, TLX_ATTRIBUTE_WARN_UNUSED_RESULT, gen_data::value, and ThreadBarrierSpin::wait().
Referenced by SampleNode< ValueType >::Execute(), FlowControlChannel::LocalBarrier(), MergeNode< ValueType, Comparator, kNumInputs >::MainOp(), examples::select::PickPivots(), FlowControlChannel::Predecessor(), and examples::select::Select().
|
inline |
Definition at line 427 of file group.hpp.
References Group::BroadcastLong().
|
inline |
Definition at line 451 of file group.hpp.
References Group::BroadcastUnsignedLong().
|
inline |
Definition at line 475 of file group.hpp.
References Group::BroadcastLongLong().
|
inline |
Definition at line 499 of file group.hpp.
References Group::BroadcastUnsignedLongLong().
void BroadcastBinomialTree | ( | T & | value, |
size_t | origin = 0 |
||
) |
Broadcasts the value of the worker with index "origin" to all the others.
This is a binomial tree broadcast method.
value | The value to be broadcast / receive into. |
origin | The PE to broadcast value from. |
Definition at line 205 of file collective.hpp.
References debug, tlx::ffs(), Group::my_host_rank(), Group::num_hosts(), Group::ReceiveFrom(), tlx::round_up_to_power_of_two(), Group::SendTo(), and sLOG.
Referenced by Group::BroadcastSelect(), and Group::ReceiveFrom().
void BroadcastSelect | ( | T & | value, |
size_t | origin = 0 |
||
) |
select broadcast implementation (often due to total number of processors)
Definition at line 239 of file collective.hpp.
References Group::BroadcastBinomialTree().
Referenced by Group::Broadcast(), and Group::ReceiveFrom().
void BroadcastTrivial | ( | T & | value, |
size_t | origin = 0 |
||
) |
Broadcasts the value of the peer with index 0 to all the others.
This is a trivial broadcast from peer 0.
value | The value to be broadcast / receive into. |
origin | The PE to broadcast value from. |
Definition at line 181 of file collective.hpp.
References Group::my_host_rank(), Group::num_hosts(), Group::ReceiveFrom(), and Group::SendTo().
Referenced by Group::ReceiveFrom().
void thrill::net::ExecuteGroupThreads | ( | const std::vector< std::unique_ptr< Group > > & | groups, |
const std::function< void(GroupCalled *)> & | thread_function | ||
) |
Construct a mock Group using a complete graph of local stream sockets for testing, and starts a thread for each client, which gets passed the Group object. This is ideal for testing network communication protocols.
Definition at line 299 of file group.hpp.
References Group::Close(), Group::num_hosts(), and thrill::net::RunLoopbackGroupTest().
Referenced by thrill::net::RunLoopbackGroupTest().
Calculate exclusive prefix sum.
Definition at line 165 of file collective.hpp.
References Group::PrefixSumSelect().
Referenced by FlowControlChannel::ExPrefixSumTotal(), FlowControlChannel::PrefixSumBase(), and Group::ReceiveFrom().
|
inline |
Definition at line 375 of file group.hpp.
References Group::ExPrefixSumPlusInt().
|
inline |
Definition at line 399 of file group.hpp.
References Group::ExPrefixSumPlusUnsignedInt().
|
inline |
Definition at line 423 of file group.hpp.
References Group::ExPrefixSumPlusLong().
|
inline |
Definition at line 447 of file group.hpp.
References Group::ExPrefixSumPlusUnsignedLong().
|
inline |
Definition at line 471 of file group.hpp.
References Group::ExPrefixSumPlusLongLong().
|
inline |
Definition at line 495 of file group.hpp.
References Group::ExPrefixSumPlusUnsignedLongLong().
|
inline |
Calculates the exclusive prefix sum over all workers, and delivers the total sum as well.
The input value parameter is set to the PE's exclusive prefix sum value and the total sum is returned.
This method blocks until the sum is calculated. Values are applied in order, that means sum_op(sum_op(a, b), c) if a, b, c are the values of workers 0, 1, 2.
value | The local value of this worker. |
sum_op | The operation to use for |
initial | The initial element of the body defined by T and SumOp calculating the prefix sum. The default operation is a normal addition. |
Definition at line 351 of file flow_control_channel.hpp.
References FlowControlChannel::barrier_, Group::Broadcast(), FlowControlChannel::count_prefixsum_, FlowControlChannel::debug, FlowControlChannel::enable_stats, Group::ExPrefixSum(), FlowControlChannel::GetNextStep(), FlowControlChannel::group_, FlowControlChannel::host_rank_, LOG, FlowControlChannel::num_hosts_, FlowControlChannel::SetLocalShared(), FlowControlChannel::thread_count_, FlowControlChannel::timer_communication_, FlowControlChannel::timer_prefixsum_, TLX_ATTRIBUTE_WARN_UNUSED_RESULT, gen_data::value, and ThreadBarrierSpin::wait().
Referenced by RebalanceNode< ValueType >::Execute(), SampleNode< ValueType >::Execute(), FlowControlChannel::LocalBarrier(), ZipNode< ValueType, ZipFunction, Pad, UnequalCheck, NoRebalance, kNumInputs >::MainOp(), SortNode< ValueType, CompareFunction, SortAlgorithm, Stable >::MainOp(), and FlowControlChannel::Predecessor().
Calculate inclusive prefix sum.
Definition at line 160 of file collective.hpp.
References Group::PrefixSumSelect().
Referenced by Group::ReceiveFrom().
|
inline |
Definition at line 371 of file group.hpp.
References Group::PrefixSumPlusInt().
|
inline |
Definition at line 395 of file group.hpp.
References Group::PrefixSumPlusUnsignedInt().
|
inline |
Definition at line 419 of file group.hpp.
References Group::PrefixSumPlusLong().
|
inline |
Definition at line 443 of file group.hpp.
References Group::PrefixSumPlusUnsignedLong().
|
inline |
Definition at line 467 of file group.hpp.
References Group::PrefixSumPlusLongLong().
|
inline |
Definition at line 491 of file group.hpp.
References Group::PrefixSumPlusUnsignedLongLong().
|
inline |
Calculates the prefix sum over all workers, given a certain sum operation.
This method blocks until the sum is caluclated. Values are applied in order, that means sum_op(sum_op(a, b), c) if a, b, c are the values of workers 0, 1, 2.
value | The local value of this worker. |
initial | The initial element for the body defined by T and sum_op |
sum_op | The operation to use for calculating the prefix sum. The default operation is a normal addition. |
inclusive | Whether the prefix sum is inclusive or exclusive. |
Definition at line 236 of file flow_control_channel.hpp.
References FlowControlChannel::barrier_, FlowControlChannel::count_prefixsum_, FlowControlChannel::debug, FlowControlChannel::enable_stats, Group::ExPrefixSum(), FlowControlChannel::GetNextStep(), FlowControlChannel::group_, LOG, FlowControlChannel::SetLocalShared(), FlowControlChannel::thread_count_, FlowControlChannel::timer_communication_, FlowControlChannel::timer_prefixsum_, TLX_ATTRIBUTE_WARN_UNUSED_RESULT, gen_data::value, and ThreadBarrierSpin::wait().
Referenced by FlowControlChannel::ExPrefixSum(), FlowControlChannel::LocalBarrier(), FlowControlChannel::Predecessor(), and FlowControlChannel::PrefixSum().
void PrefixSumDoubling | ( | T & | value, |
BinarySumOp | sum_op = BinarySumOp() , |
||
const T & | initial = T() , |
||
bool | inclusive = true |
||
) |
Calculate for every worker his prefix sum.
The prefix sum is the aggregation of the values of all workers with lesser index, including himself, according to a summation operator. The run-time is in O(log n).
value | The value to be summed up |
sum_op | A custom summation operator |
initial | Initial value of prefix sum |
inclusive | Inclusive prefix sum if true (default) |
Definition at line 52 of file collective.hpp.
References debug, Group::my_host_rank(), Group::num_hosts(), Group::ReceiveFrom(), Group::SendTo(), sLOG, and gen_data::value.
Referenced by Group::PrefixSumSelect(), and Group::ReceiveFrom().
void PrefixSumHypercube | ( | T & | value, |
BinarySumOp | sum_op = BinarySumOp() |
||
) |
Calculate for every worker his prefix sum.
Works only for worker numbers which are powers of two.
The prefix sum is an aggregatation of the values of all workers with smaller index, including itself, according to an associative summation operator. This function currently only supports worker numbers which are powers of two.
value | The value to be summed up |
sum_op | A custom summation operator |
Definition at line 113 of file collective.hpp.
References debug, Group::my_host_rank(), Group::num_hosts(), Group::ReceiveFrom(), Group::SendTo(), sLOG, and gen_data::value.
Referenced by Group::ReceiveFrom().
void PrefixSumSelect | ( | T & | value, |
BinarySumOp | sum_op = BinarySumOp() , |
||
const T & | initial = T() , |
||
bool | inclusive = true |
||
) |
select prefixsum implementation (often due to total number of processors)
Definition at line 154 of file collective.hpp.
References Group::PrefixSumDoubling().
Referenced by Group::ExPrefixSum(), Group::PrefixSum(), and Group::ReceiveFrom().
void Reduce | ( | T & | value, |
size_t | root = 0 , |
||
BinarySumOp | sum_op = BinarySumOp() |
||
) |
Reduce a value from all workers to the worker 0.
Perform a reduction on all workers in a group.
This function aggregates the values of all workers in the group according with a specified reduction operator. The result will be returned in the input variable at the root node.
value | The input value to be used in the reduction. Will be overwritten with the result (on the root) or arbitrary data (on other ranks). |
root | The rank of the root |
sum_op | A custom reduction operator (optional) |
Definition at line 331 of file collective.hpp.
References debug, Group::my_host_rank(), Group::num_hosts(), Group::ReceiveFrom(), Group::SendTo(), and sLOG.
Referenced by Group::AllReduceSimple(), Group::ReceiveFrom(), and FlowControlChannel::Reduce().
void RunLoopbackGroupTest | ( | size_t | num_hosts, |
const std::function< void(Group *)> & | thread_function | ||
) |
Construct a mock or tcp-loopback Group network and run a thread for each client. The selected network implementation is platform dependent and must run without further configuration.
Definition at line 27 of file group.cpp.
References Group::ConstructLoopbackMesh(), and thrill::net::ExecuteGroupThreads().
Referenced by thrill::net::ExecuteGroupThreads().
Helper method for AllReduce().
Sends, receives, and reduces a serializable type from the given peer and returns the value after reduction
peer | The peer to exchange the fixed length type with. |
value | Reference to the value exchange. |
sum_op | Reduction operation. |
Definition at line 465 of file collective.hpp.
References Group::connection(), Group::my_host_rank(), Connection::ReceiveSend(), and Connection::SendReceive().
Referenced by Group::AllReduceEliminationProcess(), and Group::ReceiveFrom().
|
static |
Definition at line 62 of file dispatcher.hpp.
Referenced by AsyncRequest::AsyncRequest(), and AsyncRequest::~AsyncRequest().
|
static |
Definition at line 64 of file dispatcher.hpp.
|
static |
Definition at line 63 of file dispatcher.hpp.