22 Group& group,
size_t local_id,
size_t thread_count,
24 std::atomic<size_t>& generation)
26 host_rank_(group_.my_host_rank()), num_hosts_(group_.num_hosts()),
28 thread_count_(thread_count),
29 barrier_(barrier), shmem_(shmem), generation_(generation) { }
33 <<
"FCC worker" <<
my_rank() <<
":" 60 LOG <<
"FCC::Barrier() COMMUNICATE BEGIN" 67 LOG <<
"FCC::Barrier() COMMUNICATE END" 82 const size_t&,
const std::plus<size_t>&,
const size_t&,
bool);
85 const std::array<size_t, 2>&,
87 const std::array<size_t, 2>&,
bool);
89 const std::array<size_t, 3>&,
91 const std::array<size_t, 3>&,
bool);
93 const std::array<size_t, 4>&,
95 const std::array<size_t, 4>&,
bool);
98 size_t&,
const std::plus<size_t>&,
const size_t&);
101 std::array<size_t, 2>&,
103 const std::array<size_t, 2>&);
105 std::array<size_t, 3>&,
107 const std::array<size_t, 3>&);
109 std::array<size_t, 4>&,
111 const std::array<size_t, 4>&);
116 const std::array<size_t, 2>&,
size_t);
118 const std::array<size_t, 3>&,
size_t);
120 const std::array<size_t, 4>&,
size_t);
123 const size_t&,
const std::plus<size_t>&);
common::AtomicMovable< size_t > count_broadcast_
void Barrier()
A trivial global barrier.
Timer timer_prefixsum_
Synchronization timer.
#define sLOGC(cond)
Explicitly specify the condition for logging.
common::AtomicMovable< size_t > count_barrier_
RIAA class for running the timer until destruction.
common::AtomicMovable< size_t > count_allreduce_
common::AtomicMovable< size_t > count_prefixsum_
Synchronization counters.
Timer timer_communication_
static constexpr bool debug
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.
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.
common::ThreadBarrier & barrier_
template for computing the component-wise sum of std::array or std::vector.
void AllReduce(T &value, BinarySumOp sum_op=BinarySumOp())
Reduce a value from all workers to all workers.
Group & group_
The group associated with this channel.
common::AtomicMovable< size_t > count_predecessor_
void LocalBarrier()
A trivial local thread barrier.
static constexpr bool enable_stats
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...
A network Group is a collection of enumerated communication links, which provides point-to-point comm...
void wait(Lambda lambda=Lambda())
Waits for n threads to arrive.
size_t my_rank() const
Return the worker's global rank.
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 worke...
#define LOG
Default logging method: output if the local debug variable is true.
common::AtomicMovable< size_t > count_reduce_
Implements a thread barrier using atomics and a spin lock that can be used to synchronize threads...
FlowControlChannel(Group &group, size_t local_id, size_t thread_count, common::ThreadBarrier &barrier, LocalData *shmem, std::atomic< size_t > &generation)
Creates a new instance of this class, wrapping a net::Group.