[Openmp-commits] [PATCH] D23116: Do not block on explicit task depending on proxy task

Jonas Hahnfeld via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 5 00:33:10 PDT 2016


Hahnfeld added a comment.

In https://reviews.llvm.org/D23116#505993, @AndreyChurbanov wrote:

> Jonas,
>
> What if you add one more dependent task (not on the proxy task)? E.g.
>
>   int dep;
>   #pragma omp target nowait depend(out: dep)
>   {
>       sleep(1);
>   }
>   #pragma omp task depend(in: dep)
>   {
>       printf("Task with dependency\n");
>   }
>   #pragma omp task depend(out: dep)
>   {
>       printf("Another task with dependency\n");
>   }
>   printf("Doing some work...\n");
>   
>
> The second dependent task will be lost (unless it also has "in" dependency and thus only depends on the proxy task). It should not be hard to allow all serial dependent tasks be deferred in the presence of proxy task, just couple more changes in the
>
>   __kmp_task_finish()
>
> routine can solve this I think. But is it what you want?  If you want to only allow tasks those depend on the proxy task be deferred letting other serial dependent tasks be undeferred, then more changes may be needed.  Library will need to distinguish tasks dependent on proxy task (among possible multiple dependencies) from tasks dependent on only regular tasks.


Good catch, thanks! I think I've modified `__kmp_task_finish()` as you said to release eventual deps and added another dependent task to the test.

I think this will only allow dependency chains with a proxy task as its origin. Otherwise the previous tasks in the serial team will already have finished.
This probably means some no-op checking for serial tasks with dependencies after a proxy task has occured but I think that this is better than blocking on a dependent task.

Thanks,
Jonas


https://reviews.llvm.org/D23116





More information about the Openmp-commits mailing list