[Openmp-dev] Status of detached tasks in Clang

Joseph Schuchart via Openmp-dev openmp-dev at lists.llvm.org
Thu Apr 9 02:42:11 PDT 2020


Ahh, good point! The issue with local variables seems to be specific to 
untied tasks. I removed all untied tasks in my application but every 
other run I'm still hitting asserts in the same code path (when calling 
omp_fulfill_event):

Assertion failure at kmp_tasking.cpp(3744): taskdata->td_flags.complete 
== 1.
Assertion failure at kmp_tasking.cpp(710): taskdata->td_flags.executing 
== 0.

Although they are different assertions they are probably just different 
symptoms of the same problem. My use-case involves MPI (and an 
experimental extension) so it is hard to boil that down to a simple 
reproducer.

Just so I know whether it's a direction to investigate: could these 
asserts be triggered by calling omp_fulfill_event twice on the same 
event? Or is that case handled explicitly? I don't know how this could 
happen in my current setup but if it's not handled by libomp I will 
investigate that possibility.

Thanks for the help so far :)

Cheers
Joseph

On 4/8/20 6:54 PM, Alexey.Bataev wrote:
> Hi Joseph, I see, you have an issue with untied tasks. Yes, they are not 
> fully supported in terms of capturing local variables.
> 
> -------------
> Best regards,
> Alexey Bataev
> 
> 08.04.2020 12:47 PM, Joseph Schuchart пишет:
>> Alexey,
>>
>> I am having a hard time trying to come up with a simple reproducer. 
>> However, I got hit by an issue that looks similar to what I reported a 
>> while ago:
>> https://bugs.llvm.org/show_bug.cgi?id=37671
>>
>> I updated it with a simpler reproducer. Maybe this issue causes havoc 
>> in my actual application and leads to the assert somehow. Maybe 
>> someone can take a look at that #37671 now with the simpler test case?
>>
>> I will try and work a reproducer for the assert and report back if I 
>> find one.
>>
>> Cheers
>> Joseph
>>
>> On 4/8/20 2:15 PM, Alexey.Bataev wrote:
>>> Hi Joseph, do you have a reproducer? I'll try to reproduce it myself 
>>> but it would be better if you could provide one.
>>>
>>> -------------
>>> Best regards,
>>> Alexey Bataev
>>>
>>> 08.04.2020 8:02 AM, Joseph Schuchart via Openmp-dev пишет:
>>>> Johannes, Alexey,
>>>>
>>>> Thanks for the pointers. I will try to call in to the telco tomorrow.
>>>>
>>>> In the meantime: I was able to install trunk and run tests with 
>>>> detached tasks. However, every once in a while I end up in an assert 
>>>> inside libomp:
>>>>
>>>> OMP: Error #13: Assertion failure at kmp_tasking.cpp(920).
>>>>
>>>> The relevant code is in __kmp_task_finish:
>>>>
>>>>   if (taskdata->td_flags.destructors_thunk) {
>>>>     kmp_routine_entry_t destr_thunk = task->data1.destructors;
>>>>     KMP_ASSERT(destr_thunk); // <- this assert triggers
>>>>     destr_thunk(gtid, task);
>>>>   }
>>>>
>>>>
>>>> My first suspicion is that there is a race condition when one thread 
>>>> fulfills the event while the executing task completes it. I have not 
>>>> been able to spot this issue in the code but maybe someone familiar 
>>>> with it has an idea about what might be going wrong?
>>>>
>>>> Thanks,
>>>> Joseph
>>>>
>>>> On 4/4/20 6:20 PM, Johannes Doerfert wrote:
>>>>> Hi Joseph,
>>>>>
>>>>>
>>>>> I'm not sure who is working on this but we might be able to figure 
>>>>> this out on our bi-weekly call Wednesday.
>>>>>
>>>>> Feel free to call but we should figure this out either way.
>>>>>
>>>>>
>>>>> Apologies for the delay,
>>>>>
>>>>>    Johannes
>>>>>
>>>>>
>>>>>
>>>>> On 4/3/20 7:18 AM, Joseph Schuchart via Openmp-dev wrote:
>>>>>> Dear all,
>>>>>>
>>>>>> I am eager to play around with detached tasks in OpenMP. It seems 
>>>>>> that support has gone into the runtime about a year ago [1] but 
>>>>>> even with Clang 10 I get a warning that the detach clause is ignored:
>>>>>>
>>>>>> $ clang-10 -fopenmp test_detached.c
>>>>>> test_detached.c:25:47: warning: extra tokens at the end of 
>>>>>> '#pragma omp task' are ignored [-Wextra-tokens]
>>>>>>   #pragma omp task detach(event)
>>>>>>
>>>>>> The status website lists detached tasks as work in progress [2]. 
>>>>>> Is there a way to try detached tasks in some experimental version 
>>>>>> of Clang? Or am I just missing a flag to enable them in the Clang 
>>>>>> release?
>>>>>>
>>>>>> Thanks a lot,
>>>>>> Joseph
>>>>>>
>>>>>> [1] https://reviews.llvm.org/D62485
>>>>>> [2] https://clang.llvm.org/docs/OpenMPSupport.html
>>>>>> _______________________________________________
>>>>>> Openmp-dev mailing list
>>>>>> Openmp-dev at lists.llvm.org
>>>>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>>>> _______________________________________________
>>>> Openmp-dev mailing list
>>>> Openmp-dev at lists.llvm.org
>>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev


More information about the Openmp-dev mailing list