I'm new to OpenMP and working on a recursive problem that has the form
void compute()
{
partiotionData();
// TODO: if primary thread spawn new thread to handle the following recursive call
compute();
// other stuff including termination condition
}
As shown in the above snippet, I'd like the primary thread only to spawn or dispatch a thread that will handle a subsequent recursive call compute()
i.e. no other thread can spawn or dispatch threads. How can this be achieved?