This is NOT an issue of PInsight, but it is something important that we should know and we can file a issue/question to OMPT standard group.
The value of codeptr_ra for the callback of the standard is generally implementation defined. While it is tempting to use since it provides link between runtime and source code, the tools developed based on it could be runtime dependent. For LLVM OpenMP, below is the observation by running test code:
- For
parallel, codeptr_ra for parallel_begin, parallel_end, AND the barrier_begin, wait_barrier_begin, wait_barrier_end and barrier_end of the MASTER thread (master thread only) are the same. For worker thread, codeptr of barrier-related events for parallel are the same, and it is NULL.
- For for (
omp for or omp parallel for), master, and single, codeptr for scope_begin and score_end are different
- For
parallel for, codeptr for parallel_begin/end and work_begin (loop_begin) are different.
- For
single with barrier, the codeptr for single-related events and for the barrier-related events are different.
- For explicit barrier or barrier in for/single, codeptr for both begin and end events of barrier or wait_barrier are all the same, not NULL for both master and worker threads.
Thus, utilizing codeptr_ra overall should be very careful. It is both construct-dependent implementation dependent, as how it is written in the spec.
This is NOT an issue of PInsight, but it is something important that we should know and we can file a issue/question to OMPT standard group.
The value of codeptr_ra for the callback of the standard is generally implementation defined. While it is tempting to use since it provides link between runtime and source code, the tools developed based on it could be runtime dependent. For LLVM OpenMP, below is the observation by running test code:
parallel, codeptr_ra for parallel_begin, parallel_end, AND the barrier_begin, wait_barrier_begin, wait_barrier_end and barrier_end of the MASTER thread (master thread only) are the same. For worker thread, codeptr of barrier-related events for parallel are the same, and it is NULL.omp fororomp parallel for),master, andsingle, codeptr for scope_begin and score_end are differentparallel for, codeptr for parallel_begin/end and work_begin (loop_begin) are different.singlewith barrier, the codeptr for single-related events and for the barrier-related events are different.Thus, utilizing codeptr_ra overall should be very careful. It is both construct-dependent implementation dependent, as how it is written in the spec.