Without this patch a simple #pragma omp parallel num_threads(1) leads to
ompt_event_parallel_begin: parent_task_id=3, [...], parallel_id=2, [...] ompt_event_parallel_end: parallel_id=2, task_id=4, [...]
Differential D16714
[OMPT] Fix wrong parent_task_id in serialized parallel_begin with GCC Hahnfeld on Jan 29 2016, 12:58 AM. Authored by
Details Without this patch a simple #pragma omp parallel num_threads(1) leads to ompt_event_parallel_begin: parent_task_id=3, [...], parallel_id=2, [...] ompt_event_parallel_end: parallel_id=2, task_id=4, [...]
Diff Detail
Event TimelineComment Actions I haven't had the time to analyze this patch in detail. To me, it looks like it fixes a symptom (an incorrect argument passed to a callback) rather than an underlying cause (information about the top task frame may be improperly updated). If the information for the task at depth 0 before the serialized parallel is what should be presented to the parallel begin callback, then is the information at depth 0 wrong? Remember, a tool using asynchronous sampling could observe this task at any time - either before or after the serialized parallel. Comment Actions Not sure if I completely get your point... Comment Actions Move callback up to execute in correct context. This way, there will only be wrong ids reported between __kmp_serialized_parallel and the creation of the lightweight task. Comment Actions Is it OK that ompt_parallel_id_new() is called several times for one region? First in line 393 and then inside kmp_serialized_parallel() it can be called once or twice. Comment Actions While this isn't good from a performance perspective I think this won't hurt for correctness: It will skip some ids but contiguous ids aren't required by the standard. |