Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

A Pipeline with a Feeder

meisel
Beginner
1,642 Views

I have a set of objects that I want to process in parallel. The results of this should have further processing done in serial. The gist of it is:

parallel_pipeline(ntokens, 
tbb::make_filter<T,U>( tbb::filter::parallel, MyInputFunc(input_file) )
& tbb::make_filter<U,V>( tbb::filter::serial_out_of_order, MyTransformFunc() )

 However, for some of the U objects, before the serial processing can start, there needs to be further processing done on child objects of it in parallel. One way to solve this would be to have a feeder into the first filter, if that's possible, and generalize it to work on T objects or on children of U objects. Another would be to have parallel_do for each U's child objects, but I don't know if that will typically introduce a lot of performance overhead. Any ideas?

0 Kudos
3 Replies
NoorjahanSk_Intel
Moderator
1,623 Views

Hi,

Thanks for reaching out to us.

We are looking into this issue internally. We will get back to you soon.


Thanks & Regards

Noorjahan.


0 Kudos
DMITRY_T_Intel
Employee
1,592 Views

Hi Michael,

It seems that you don't need parallel_do() in your task. Since additional work appears at the time of U creation (the initial stage of the pipeline), then it can be performed in the same place. Nested parallelism can be used in this context. For a solution, you can use parallel_for() or task_group(): “run + wait” inside the initial stage of the pipeline.

Thanks!


0 Kudos
DMITRY_T_Intel
Employee
1,555 Views

Hi Michael,

I think I answered your question and I'm closing this case for now. Just create an new case if you would like to continue investigation or if you have a new issue.

Thank you very much!


0 Kudos
Reply