2

I'm new to using tbb::flow and was looking to create a graph that had a portion of it that is embarrassingly parallel. So the idea is to have a message come in to a node that does some pre-processing and then can formulate a set of tasks that can be executed in parallel. And then the data is aggreagated in a multifunction_node that sends the results out to a couple of places.

                       --------------                 ------
                      |parallel nodes|               |Output|
        -----------  /|--------------|\  ---------- / ------
msg -> |pre-process| -|parallel nodes|- |aggregator|
        -----------  \|--------------|/  ---------- \ ------
                      |parallel nodes|               |Output|
                       --------------                 ------

Now the aggregator can't send out it's work until the work is done. So it would need to keep track of the number of answers expected. Can I do this with a tbb::flow::graph or should I create a function node that has a parallel for embedded into it? Other ideas or options?

If I can do it with tbb::flow what are the node types and queueing strategies?

Another way of thinking about this is it is a MapReduce kind of operation with a little preprocessing and the results being sent to a few different places in slightly different forms.

Matt Price
  • 43,887
  • 9
  • 38
  • 44
  • You may want to take a look at [cpp-taskflow](https://github.com/twhuang-uiuc/cpp-taskflow) which can help you solve this problem easier and cleaner compared with `tbb::flow`. – Jes May 04 '18 at 16:55

0 Answers0