Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

A Pipeline with a Feeder

meisel
Beginner
520 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
501 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.


DMITRY_T_Intel
Employee
470 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!


DMITRY_T_Intel
Employee
433 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!


Reply