Community
cancel
Showing results for 
Search instead for 
Did you mean: 
davidjward30
Beginner
62 Views

Equivalent of omp parallel sections?

Jump to solution

Hello,

I know that tbb is not supposed to be a direct replacement for openmp, but having dabbled with openmp a little bit I think that in general TBB suits my needs more than openmp so I was planning to use tbb exclusively

However, I'm still unsure how I would effect an omp parallel sections piece of code:

e.g.

#pragma omp parallel sections
{
#pragma omp section
XAXIS();
#pragma omp section
YAXIS();
#pragma omp section
ZAXIS();
}

I would guess that using the task scheduler directly is the way to do it?

Regards,

David.

0 Kudos
1 Solution
Alexey_K_Intel3
Employee
62 Views
5 Replies
RafSchietekat
Black Belt
62 Views
"I would guess that using the task scheduler directly is the way to do it?" You could do that. I would go with parallel_for myself.

davidjward30
Beginner
62 Views
Quoting - Raf Schietekat
"I would guess that using the task scheduler directly is the way to do it?" You could do that. I would go with parallel_for myself.

I feel silly for asking, but could you possible give me some (psuedo)-code for the above problem? Thanks.

RafSchietekat
Black Belt
62 Views

Please see the tutorial; in the body, use a switch()on theiteration value.

Alexey_K_Intel3
Employee
63 Views
davidjward30
Beginner
62 Views

Thanks for the answers. I must admit the "switch in the body" did occur to me - I just thought it was just a bit too clumsy and assumed I was missing out on something else. I think task groups are probably what I'm seeking.

Cheers.

Reply