ttg 1.0.0-alpha
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
ttg::BinaryTreeBroadcast< Value, OutKey > Class Template Reference

generic binary broadcast of a value to a set of {key,value} pairs More...

#include <broadcast.h>

Inheritance diagram for ttg::BinaryTreeBroadcast< Value, OutKey >:
[legend]
Collaboration diagram for ttg::BinaryTreeBroadcast< Value, OutKey >:
[legend]

Public Types

using baseT = typename BinaryTreeBroadcast::ttT
 
- Public Types inherited from ttg_parsec::TT< keyT, output_terminalsT, derivedT, input_valueTs, Space >
using ttT = TT
 
using key_type = keyT
 
using input_terminals_type = ttg::detail::input_terminals_tuple_t< keyT, input_tuple_type >
 
using input_args_type = actual_input_tuple_type
 
using input_edges_type = ttg::detail::edges_tuple_t< keyT, ttg::meta::decayed_typelist_t< input_tuple_type > >
 
using input_values_full_tuple_type = ttg::meta::void_to_Void_tuple_t< ttg::meta::decayed_typelist_t< actual_input_tuple_type > >
 
using input_refs_full_tuple_type = ttg::meta::add_glvalue_reference_tuple_t< ttg::meta::void_to_Void_tuple_t< actual_input_tuple_type > >
 
using input_values_tuple_type = ttg::meta::drop_void_t< ttg::meta::decayed_typelist_t< input_tuple_type > >
 
using input_refs_tuple_type = ttg::meta::drop_void_t< ttg::meta::add_glvalue_reference_tuple_t< input_tuple_type > >
 
using output_terminals_type = output_terminalsT
 
using output_edges_type = typename ttg::terminals_to_edges< output_terminalsT >::type
 

Public Member Functions

 BinaryTreeBroadcast (Edge< int, Value > &in, Edge< OutKey, Value > &out, std::vector< OutKey > local_keys, int root=0, World world=ttg::default_execution_context(), int max_key=-1, Edge< int, Value > inout_l=Edge< int, Value >{}, Edge< int, Value > inout_r=Edge< int, Value >{})
 
void op (const int &key, typename baseT::input_values_tuple_type &&indata, std::tuple< Out< int, Value >, Out< int, Value >, Out< int, Value > > &outdata)
 
- Public Member Functions inherited from ttg_parsec::TT< keyT, output_terminalsT, derivedT, input_valueTs, Space >
ttg::World get_world () const override final
 
template<std::size_t i>
void set_static_argstream_size (std::size_t size)
 
template<std::size_t i, typename Key >
std::enable_if_t<!ttg::meta::is_void_v< Key >, voidset_argstream_size (const Key &key, std::size_t size)
 
template<std::size_t i, typename Key = keyT>
std::enable_if_t< ttg::meta::is_void_v< Key >, voidset_argstream_size (std::size_t size)
 
template<std::size_t i, typename Key >
std::enable_if_t<!ttg::meta::is_void_v< Key >, voidfinalize_argstream (const Key &key)
 finalizes stream for input i
 
template<std::size_t i, bool key_is_void = ttg::meta::is_void_v<keyT>>
std::enable_if_t< key_is_void, voidfinalize_argstream ()
 finalizes stream for input i
 
template<typename Value >
void copy_mark_pushout (const Value &value)
 
template<std::size_t i, typename Value , typename RemoteCheckFn >
std::enable_if_t<!std::is_void_v< std::decay_t< Value > >, voiddo_prepare_send (const Value &value, RemoteCheckFn &&remote_check)
 
template<std::size_t i, typename Key , typename Value >
std::enable_if_t<!ttg::meta::is_void_v< Key > &&!std::is_void_v< std::decay_t< Value > >, voidprepare_send (const ttg::span< const Key > &keylist, const Value &value)
 
template<std::size_t i, typename Key , typename Value >
std::enable_if_t< ttg::meta::is_void_v< Key > &&!std::is_void_v< std::decay_t< Value > >, voidprepare_send (const Value &value)
 
template<typename keymapT = ttg::detail::default_keymap<keyT>, typename priomapT = ttg::detail::default_priomap<keyT>>
 TT (const std::string &name, const std::vector< std::string > &innames, const std::vector< std::string > &outnames, ttg::World world, keymapT &&keymap_=keymapT(), priomapT &&priomap_=priomapT())
 
template<typename keymapT = ttg::detail::default_keymap<keyT>, typename priomapT = ttg::detail::default_priomap<keyT>>
 TT (const std::string &name, const std::vector< std::string > &innames, const std::vector< std::string > &outnames, keymapT &&keymap=keymapT(ttg::default_execution_context()), priomapT &&priomap=priomapT())
 
template<typename keymapT = ttg::detail::default_keymap<keyT>, typename priomapT = ttg::detail::default_priomap<keyT>>
 TT (const input_edges_type &inedges, const output_edges_type &outedges, const std::string &name, const std::vector< std::string > &innames, const std::vector< std::string > &outnames, ttg::World world, keymapT &&keymap_=keymapT(), priomapT &&priomap=priomapT())
 
template<typename keymapT = ttg::detail::default_keymap<keyT>, typename priomapT = ttg::detail::default_priomap<keyT>>
 TT (const input_edges_type &inedges, const output_edges_type &outedges, const std::string &name, const std::vector< std::string > &innames, const std::vector< std::string > &outnames, keymapT &&keymap=keymapT(ttg::default_execution_context()), priomapT &&priomap=priomapT())
 
virtual ~TT ()
 
void print_incomplete_tasks ()
 
virtual void release () override
 
void do_release ()
 
template<std::size_t i, typename Reducer >
void set_input_reducer (Reducer &&reducer)
 
template<std::size_t i, typename Reducer >
void set_input_reducer (Reducer &&reducer, std::size_t size)
 
template<std::size_t i>
std::tuple_element_t< i, input_terminals_type > * in ()
 
template<std::size_t i>
std::tuple_element_t< i, output_terminalsT > * out ()
 
template<typename Key = keyT>
std::enable_if_t<!ttg::meta::is_void_v< Key > &&!ttg::meta::is_empty_tuple_v< input_values_tuple_type >, voidinvoke (const Key &key, const input_values_tuple_type &args)
 
template<typename Key = keyT>
std::enable_if_t< ttg::meta::is_void_v< Key > &&!ttg::meta::is_empty_tuple_v< input_values_tuple_type >, voidinvoke (const input_values_tuple_type &args)
 
template<typename Key = keyT>
std::enable_if_t<!ttg::meta::is_void_v< Key > &&ttg::meta::is_empty_tuple_v< input_values_tuple_type >, voidinvoke (const Key &key)
 
template<typename Key = keyT>
std::enable_if_t< ttg::meta::is_void_v< Key > &&ttg::meta::is_empty_tuple_v< input_values_tuple_type >, voidinvoke ()
 
void invoke () override
 
template<typename Key = keyT, typename Arg , typename... Args>
std::enable_if_t<!ttg::meta::is_void_v< Key > &&!ttg::meta::is_empty_tuple_v< input_values_tuple_type >, voidinvoke (const Key &key, Arg &&arg, Args &&... args)
 
void set_defer_writer (bool value)
 
bool get_defer_writer (bool value)
 
void make_executable () override
 Marks this executable.
 
const decltype(keymap) & get_keymap () const
 
template<typename Keymap >
void set_keymap (Keymap &&km)
 keymap setter
 
const decltype(priomap) & get_priomap () const
 
template<typename Priomap >
void set_priomap (Priomap &&pm)
 
template<typename Devicemap >
void set_devicemap (Devicemap &&dm)
 
auto get_devicemap ()
 
template<typename Constraint >
void add_constraint (std::shared_ptr< Constraint > c)
 
template<typename Constraint >
void add_constraint (Constraint &&c)
 
template<typename Constraint , typename Mapper >
void add_constraint (std::shared_ptr< Constraint > c, Mapper &&map)
 
template<typename Constraint , typename Mapper >
void add_constraint (Constraint c, Mapper &&map)
 
void register_static_op_function (void)
 
- Public Member Functions inherited from ttg::TTBase
virtual ~TTBase ()=default
 
bool set_trace_instance (bool value)
 
bool tracing () const
 
template<typename T , typename... Ts>
void trace (const T &t, const Ts &...ts)
 Like ttg::trace(), but only produces tracing output if this->tracing()==true
 
bool set_lazy_pull_instance (bool value)
 
bool is_lazy_pull ()
 
std::optional< std::reference_wrapper< const TTBase > > ttg () const
 
const TTBasettg_ptr () const
 
bool is_ttg () const
 
void set_name (const std::string &name)
 Sets the name of this operation.
 
const std::string & get_name () const
 Gets the name of this operation.
 
std::string get_class_name () const
 Gets the demangled class name (uses RTTI)
 
const std::vector< TerminalBase * > & get_inputs () const
 Returns the vector of input terminals.
 
const std::vector< TerminalBase * > & get_outputs () const
 Returns the vector of output terminals.
 
ttg::TerminalBasein (size_t i)
 Returns a pointer to the i'th input terminal.
 
ttg::TerminalBaseout (size_t i)
 Returns a pointer to the i'th output terminal.
 
template<std::size_t i>
ttg::TerminalBasein ()
 Returns a pointer to the i'th input terminal ... to make API consistent with TT.
 
template<std::size_t i>
ttg::TerminalBaseout ()
 Returns a pointer to the i'th output terminal ... to make API consistent with TT.
 
auto get_instance_id () const
 
bool is_executable () const
 

Additional Inherited Members

- Static Public Member Functions inherited from ttg_parsec::TT< keyT, output_terminalsT, derivedT, input_valueTs, Space >
template<typename DerivedT = derivedT>
static constexpr bool derived_has_cuda_op ()
 
template<typename DerivedT = derivedT>
static constexpr bool derived_has_hip_op ()
 
template<typename DerivedT = derivedT>
static constexpr bool derived_has_level_zero_op ()
 
template<typename DerivedT = derivedT>
static constexpr bool derived_has_device_op ()
 
template<std::size_t i, typename resultT , typename InTuple >
static resultT get (InTuple &&intuple)
 
template<std::size_t i, typename InTuple >
static auto & get (InTuple &&intuple)
 
static void ht_iter_cb (void *item, void *cb_data)
 
- Static Public Member Functions inherited from ttg::TTBase
static bool set_trace_all (bool value)
 
static bool set_lazy_pull (bool value)
 
static const std::vector< TerminalBase * > * get_outputs_tls_ptr ()
 Returns this thread's pointer to the vector of output terminals.
 
- Static Public Attributes inherited from ttg_parsec::TT< keyT, output_terminalsT, derivedT, input_valueTs, Space >
static constexpr int numinvals
 
static constexpr const ttg::Runtime runtime = ttg::Runtime::PaRSEC
 
- Protected Member Functions inherited from ttg_parsec::TT< keyT, output_terminalsT, derivedT, input_valueTs, Space >
const autoget_output_terminals () const
 
template<typename T >
uint64_t unpack (T &obj, void *_bytes, uint64_t pos)
 
template<typename T >
uint64_t pack (T &obj, void *bytes, uint64_t pos, detail::ttg_data_copy_t *copy=nullptr)
 
parsec_thread_mempool_tget_task_mempool (void)
 
template<size_t i, typename valueT >
void set_arg_from_msg_keylist (ttg::span< keyT > &&keylist, detail::ttg_data_copy_t *copy)
 
template<std::size_t i>
void set_arg_from_msg (void *data, std::size_t size)
 
template<std::size_t i>
void finalize_argstream_from_msg (void *data, std::size_t size)
 
template<std::size_t i>
void argstream_set_size_from_msg (void *data, std::size_t size)
 
template<std::size_t i>
void get_from_pull_msg (void *data, std::size_t size)
 
template<std::size_t i, typename Key , typename Value >
std::enable_if_t<!ttg::meta::is_void_v< Key > &&!std::is_void_v< std::decay_t< Value > >, voidset_arg_local (const Key &key, Value &&value)
 
template<std::size_t i, typename Key = keyT, typename Value >
std::enable_if_t< ttg::meta::is_void_v< Key > &&!std::is_void_v< std::decay_t< Value > >, voidset_arg_local (Value &&value)
 
template<std::size_t i, typename Key , typename Value >
std::enable_if_t<!ttg::meta::is_void_v< Key > &&!std::is_void_v< std::decay_t< Value > >, voidset_arg_local (const Key &key, const Value &value)
 
template<std::size_t i, typename Key = keyT, typename Value >
std::enable_if_t< ttg::meta::is_void_v< Key > &&!std::is_void_v< std::decay_t< Value > >, voidset_arg_local (const Value &value)
 
template<std::size_t i, typename Key = keyT, typename Value >
std::enable_if_t< ttg::meta::is_void_v< Key > &&!std::is_void_v< std::decay_t< Value > >, voidset_arg_local (std::shared_ptr< const Value > &valueptr)
 
template<typename Key >
task_tcreate_new_task (const Key &key)
 
template<std::size_t i>
detail::reducer_task_tcreate_new_reducer_task (task_t *task, bool is_first)
 
template<std::size_t i, typename Key , typename Value >
void set_arg_local_impl (const Key &key, Value &&value, detail::ttg_data_copy_t *copy_in=nullptr, parsec_task_t **task_ring=nullptr)
 
bool check_constraints (task_t *task)
 
template<typename Key = keyT>
std::enable_if_t< ttg::meta::is_void_v< Key >, voidrelease_constraint (std::size_t cid)
 
template<typename Key = keyT>
std::enable_if_t<!ttg::meta::is_void_v< Key >, voidrelease_constraint (std::size_t cid, const std::span< Key > &keys)
 
void release_task (task_t *task, parsec_task_t **task_ring=nullptr)
 
template<std::size_t i, typename Key , typename Value >
std::enable_if_t<!ttg::meta::is_void_v< Key > &&!std::is_void_v< std::decay_t< Value > >, voidset_arg (const Key &key, Value &&value)
 
template<std::size_t i, typename Key , typename Value >
std::enable_if_t< ttg::meta::is_void_v< Key > &&!std::is_void_v< std::decay_t< Value > >, voidset_arg (Value &&value)
 
template<std::size_t i, typename Key = keyT>
std::enable_if_t< ttg::meta::is_void_v< Key >, voidset_arg ()
 
template<std::size_t i, typename Key >
std::enable_if_t<!ttg::meta::is_void_v< Key >, voidset_arg (const Key &key)
 
template<typename Value , typename Key >
bool can_inline_data (Value *value_ptr, detail::ttg_data_copy_t *copy, const Key &key, std::size_t num_keys)
 
template<std::size_t i, typename Key , typename Value >
void set_arg_impl (const Key &key, Value &&value, detail::ttg_data_copy_t *copy_in=nullptr)
 
template<int i, typename Iterator , typename Value >
void broadcast_arg_local (Iterator &&begin, Iterator &&end, const Value &value)
 
template<std::size_t i, typename Key , typename Value >
std::enable_if_t<!ttg::meta::is_void_v< Key > &&!std::is_void_v< std::decay_t< Value > >, voidbroadcast_arg (const ttg::span< const Key > &keylist, const Value &value)
 
template<typename Key , typename... Ts, size_t... Is, size_t... Js>
std::enable_if_t< ttg::meta::is_none_void_v< Key >, voidset_args (std::index_sequence< Is... >, std::index_sequence< Js... >, const Key &key, const std::tuple< Ts... > &args)
 
template<typename Key , typename... Ts, size_t... Is>
std::enable_if_t< ttg::meta::is_none_void_v< Key >, voidset_args (std::index_sequence< Is... > is, const Key &key, const std::tuple< Ts... > &args)
 
template<typename Key = keyT, typename... Ts, size_t... Is, size_t... Js>
std::enable_if_t< ttg::meta::is_void_v< Key >, voidset_args (std::index_sequence< Is... >, std::index_sequence< Js... >, const std::tuple< Ts... > &args)
 
template<typename Key = keyT, typename... Ts, size_t... Is>
std::enable_if_t< ttg::meta::is_void_v< Key >, voidset_args (std::index_sequence< Is... > is, const std::tuple< Ts... > &args)
 
- Protected Member Functions inherited from ttg::TTBase
void set_input (size_t i, TerminalBase *t)
 
void set_output (size_t i, TerminalBase *t)
 
template<bool out, typename terminalT , std::size_t i, typename setfuncT >
void register_terminal (terminalT &term, const std::string &name, const setfuncT setfunc)
 
template<bool out, std::size_t... IS, typename terminalsT , typename namesT , typename setfuncT >
void register_terminals (std::index_sequence< IS... >, terminalsT &terms, const namesT &names, const setfuncT setfunc)
 
template<typename terminalsT , typename namesT >
void register_input_terminals (terminalsT &terms, const namesT &names)
 
template<typename terminalsT , typename namesT >
void register_output_terminals (terminalsT &terms, const namesT &names)
 
template<std::size_t... IS, typename terminalsT , typename setfuncT >
void set_terminals (std::index_sequence< IS... >, terminalsT &terms, const setfuncT setfunc)
 
template<typename terminalsT , typename setfuncT >
void set_terminals (const terminalsT &terms, const setfuncT setfunc)
 
 TTBase (TTBase &&other)
 
TTBaseoperator= (TTBase &&other)
 
 TTBase (const std::string &name, size_t numins, size_t numouts)
 
void set_outputs_tls_ptr ()
 
void set_outputs_tls_ptr (const std::vector< TerminalBase * > *ptr)
 
- Static Protected Member Functions inherited from ttg_parsec::TT< keyT, output_terminalsT, derivedT, input_valueTs, Space >
static void static_set_arg (void *data, std::size_t size, ttg::TTBase *bop)
 
- Static Protected Member Functions inherited from ttg::TTBase
static const std::vector< TerminalBase * > *& outputs_tls_ptr_accessor ()
 

Detailed Description

template<typename Value, typename OutKey = int>
class ttg::BinaryTreeBroadcast< Value, OutKey >

generic binary broadcast of a value to a set of {key,value} pairs

This broadcasts a Value object through a binary tree of size max_key and at each node broadcasts the value to a set of keys of type OutKey . The input data is keyed by integers. The primary use is for broadcasting to a World, hence by default the keymap is identity (keymap(key) = key) and max_key=world.size() .

Note
this is equivalent to MPI_Bcast.

Definition at line 28 of file broadcast.h.

Member Typedef Documentation

◆ baseT

Definition at line 31 of file broadcast.h.

Constructor & Destructor Documentation

◆ BinaryTreeBroadcast()

template<typename Value , typename OutKey = int>
ttg::BinaryTreeBroadcast< Value, OutKey >::BinaryTreeBroadcast ( Edge< int, Value > &  in,
Edge< OutKey, Value > &  out,
std::vector< OutKey local_keys,
int  root = 0,
World  world = ttg::default_execution_context(),
int  max_key = -1,
Edge< int, Value inout_l = Edge<intValue>{},
Edge< int, Value inout_r = Edge<intValue>{} 
)
inline

Definition at line 33 of file broadcast.h.

Member Function Documentation

◆ op()

template<typename Value , typename OutKey = int>
void ttg::BinaryTreeBroadcast< Value, OutKey >::op ( const int key,
typename baseT::input_values_tuple_type &&  indata,
std::tuple< Out< int, Value >, Out< int, Value >, Out< int, Value > > &  outdata 
)
inline

Definition at line 41 of file broadcast.h.

Here is the call graph for this function:

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