OpenMPToolsInterface / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Note: the repository does not accept github pull requests at this moment. Please submit your patches at http://reviews.llvm.org.
http://llvm.org
2 stars 4 forks source link

Incorrect entry point obtained by ompd_get_task_function() for the implicit task associated with a serialized parallel region #6

Closed jinisusan closed 4 years ago

jinisusan commented 4 years ago

"t_pkfn" of the implicit task associated with a serialized parallel region gets initialized to -1, (due to the code snippet below in kmp_runtime.cpp), and remains unchanged -- causing the entry point address returned by ompd_get_task_function() for the implicit task to be set incorrectly to -1.

3193 #if USE_DEBUGGER 3194 // Non-NULL value should be assigned to make the debugger display the root 3195 // team. 3196 TCW_SYNC_PTR(root_team->t.t_pkfn, (microtask_t)(~0)); 3197 #endif

Proposing to correct this by setting "t_pkfn" of the implicit task associated with the serialized parallel region to 'microtask' in __kmp_fork_call.

jinisusan commented 4 years ago

Thank you, @jprotze, for the review, and for pointing out the other call to __kmpd_serialized_parallel. I have modified the code to have the t_pkfn after the other call to __kmpc_serialized_parallel to point to the right microtask. The absence of this was causing the implicit task details associated with the serialized parallel region following a teams construct to be set to the those of the enclosing teams construct.

At this point, I am leaving the random ompd_bp_parallel_end() at line 1558 since I plan to address that as a separate issue -- it needs to be moved to the right location. Do let me know if addressing this as a separate issue is not OK with you.

Requesting you to merge this if you find this ok.

jprotze commented 4 years ago

Agreed, LGTM