hanchenye-llvm-project/openmp
Jonathan Peyton 3fdf3294ab Fix OMPT support for task frames, parallel regions, and parallel regions + loops
This patch makes it possible for a performance tool that uses call stack
unwinding to map implementation-level call stacks from master and worker
threads into a unified global view. There are several components to this patch.

include/*/ompt.h.var
  Add a new enumeration type that indicates whether the code for a master task
    for a parallel region is invoked by the user program or the runtime system
  Change the signature for OMPT parallel begin/end callbacks to indicate whether
    the master task will be invoked by the program or the runtime system. This
    enables a performance tool using call stack unwinding to handle these two
    cases differently. For this case, a profiler that uses call stack unwinding
    needs to know that the call path prefix for the master task may differ from
    those available within the begin/end callbacks if the program invokes the
    master.

kmp.h
  Change the signature for __kmp_join_call to take an additional parameter
  indicating the fork_context type. This is needed to supply the OMPT parallel
  end callback with information about whether the compiler or the runtime
  invoked the master task for a parallel region.

kmp_csupport.c
  Ensure that the OMPT task frame field reenter_runtime_frame is properly set
    and cleared before and after calls to fork and join threads for a parallel
    region.
  Adjust the code for the new signature for __kmp_join_call.
  Adjust the OMPT parallel begin callback invocations to carry the extra
    parameter indicating whether the program or the runtime invokes the master
    task for a parallel region.

kmp_gsupport.c
  Apply all of the analogous changes described for kmp_csupport.c for the GOMP
    interface
  Add OMPT support for the GOMP combined parallel region + loop API to
    maintain the OMPT task frame field reenter_runtime_frame.

kmp_runtime.c:
  Use the new information passed by __kmp_join_call to adjust the OMPT
    parallel end callback invocations to carry the extra parameter indicating
    whether the program or the runtime invokes the master task for a parallel
    region.

ompt_internal.h:
  Use the flavor of the parallel region API (GNU or Intel) to determine who
    invokes the master task.

Differential Revision: http://reviews.llvm.org/D11259

llvm-svn: 242817
2015-07-21 18:03:30 +00:00
..
offload Liboffload: Patch for MPSS > 3.4.x (provided by Tim Cramer) 2015-05-06 10:58:40 +00:00
runtime Fix OMPT support for task frames, parallel regions, and parallel regions + loops 2015-07-21 18:03:30 +00:00
testsuite Apply name change to testsuite file. 2015-06-01 04:24:23 +00:00
www Removed mentioning of OpenMP as unsupported feature (patch2 from A.Bokhanko) 2015-05-13 13:42:59 +00:00
CMakeLists.txt Integrate libiomp CMake into LLVM CMake build system. 2015-05-05 20:02:52 +00:00
CREDITS.txt This patch contains the new files for OMPT and the needed changes to the build infrastructure 2015-04-29 16:22:07 +00:00
LICENSE.txt updated copyright date to 2015 2015-04-16 11:10:17 +00:00