I am experimenting Intel Graph Flow from TBB. I am super satisfied by the results and I found the product amazing, with unlimited possibilities. However I was confronted to a pb that I fixed but I am not satisfied. The pb is the following.
message
A ----------\ tuple<message,message> WHATEVER
message join ------------------------- C------------------------
B ----------/
This pattern is applied when we want to sync and avoidto propagate n times a message (and his value). Intel provides an example which explained well the pb (and the solution - Intel example). My pb is the tupple constructed and the construction of the graph which used static approach. It is fully static, specially if the number of input edge (input_port<i>
in the Intel example) to the join node are variables.
Does a guru of TBB-graph flow knows a "dynamic approach" to this pb ?
Best,
Tim [EDIT my code real pb]
I can do:
std::vector<tbb::flow::function_node<std::size_t, message>> vec_node;
for (int i(0) ; i < 3 ;++i)
nodes_cont_.emplace_back(my_amazing_function_to_create_node(g_));
tbb::flow::make_edge(vec_node[0], tbb::flow::input_port<0>
tbb::flow::make_edge(vec_node[1], tbb::flow::input_port<1>(node_join_));
tbb::flow::make_edge(vec_node[2], tbb::flow::input_port<2>(node_join_));
I can not do:
for(int i(0); i < vec_node.size(); ++i)
tbb::flow::make_edge(vec_node[i], tbb::flow::input_port<i>(node_join_));
Due to the "tuple" and the "tbb::flow::input_port" function.