0

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?

Olumide
  • 5,397
  • 10
  • 55
  • 104
  • possible duplicate of [OpenMP recursive tasks](http://stackoverflow.com/questions/22621157/openmp-recursive-tasks) – aruisdante Nov 03 '14 at 15:13
  • 1
    Though, generally speaking, the point of OpenMP isn't to just spawn a single thread to do a single task. It's to exploit task-level parallelism as simply as possible; I.E. run partitioned iterations of a `for` loop in parallel at the same time. – aruisdante Nov 03 '14 at 15:17

0 Answers0