Taskgroup

I just stumbled across a code snippet which defines a taskgroup over n tasks. When I analyse this code, it needs n+1 threads, i.e. the master is actively waiting. This is not the vision behind Peano where any idle thread should do enclave/background tasks. So this does not work:

#pragma omp taskgroup
{
  for (int i=0; i<N; i++) {
    #pragma omp task
    {
      [...]

If I manually extract task 0, then I get way better performance:

#pragma omp taskgroup
{
for (int i=1; i<N; i++) {
  #pragma omp task
  {
  [...]
  }

  do task[0]

Not sure, but this seems to be a performance bug.

Leave a Reply

Your email address will not be published. Required fields are marked *