Is it possible with OpenMP, when a function, lower in stack, ignites multiprocessing, then OpenMP facilites ignore multiprocessing requests from functions' bodies, higher in stack?
Is this the way OpenMP always works? If not, can I do this? How?
void do1()
{
#pragma omp parallel for
for (unsigned int i = 0; i < 10; ++i);
}
void do2()
{
#pragma omp parallel for
for (unsigned int i = 0; i < 10; ++i) do1();
}
void do3()
{
#pragma omp parallel for
for (unsigned int i = 0; i < 10; ++i) do2();
}
int main()
{
do1(); // runs in parallel
do2(); // do2() runs in parallel, do1() I want not
do3(); // do3() runs in parallel, do1() and do2() I want not
}