[Openmp-commits] [PATCH] D100181: [OpenMP] [OMPD] [1/6] Implementation of OMPD debugging library - libompd. Code changes in openmp/runtime to support libompd.

Vignesh Balasubramanian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Apr 9 05:21:55 PDT 2021


Vigneshbalu created this revision.
Herald added subscribers: guansong, yaxunl, mgorny.
Vigneshbalu requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

These patches propose the implementation of OMPD, a debugging interface to support debugging of OpenMP programs.

"libompd.so" acts as an interface to the third-party tools, typically the debuggers. The tool accesses the state of the OpenMP program through the library and libompd can read or write the state of the OpenMP program that has begun execution through the callback function provided by the tool.

A brief talk regarding the upstreaming plans was provided a few months back in the LLVM-OpenMP committee meeting, the notes of which were provided at:
https://docs.google.com/document/d/1OeibmJ41dndC7xqVFNHwfLJx3hM5uFErBrsmp2nrV2w/edit?usp=sharing

Most of the implementation has been contributed to by folks from RWTH-Aachen University, LLNL, Rice University, Perforce, AMD and others. (Might have missed out some of the contributors – apologies for that).  It has been developed and maintained in https://github.com/OpenMPToolsInterface/llvm-project/tree/ompd-tests/openmp

OMPD support is restricted only to CPU and Linux currently.

OMPD APIs are implemented as per the OpenMP 5.0 standard https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5.0.pdf .
These patches also have gdb-plugin code which is a python module loaded directly into GDB and provides utilities like ompd specific gdb commands, load and initialize libompd.so when “ompd init” invoked, allow filtration of frames.

CMake build system and directory structure are similar to the openmp/runtime and openmp/libomptarget.
Testing is done by two methods. First by comparing the output of OMPT and OMPD, second through gdb-plugin using llvm-lit and Filecheck.

The breakdown of patches is below. 
Note: Patches should be applied in the below order.

1. Code changes in openmp/runtime to support libompd.
2. TargetValue: Access OpenMP runtime state through callbacks provided by the tool.
3. omp-debug: Implementation of OMPD APIs.
4. omp-icv: OMPD Internal control variable handlers.
5. gdb-plugin: A Plugin code to gdb to leverage libompd to provide debugging support.
6. libompd-tests: Testcases for libompd.

Another set of around 50 testcases will be pushed subsequently.

Please let me know if the patches need to be reorganized.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100181

Files:
  openmp/runtime/CMakeLists.txt
  openmp/runtime/src/CMakeLists.txt
  openmp/runtime/src/include/omp-tools.h.var
  openmp/runtime/src/kmp.h
  openmp/runtime/src/kmp_config.h.cmake
  openmp/runtime/src/kmp_csupport.cpp
  openmp/runtime/src/kmp_gsupport.cpp
  openmp/runtime/src/kmp_runtime.cpp
  openmp/runtime/src/kmp_settings.cpp
  openmp/runtime/src/kmp_settings.h
  openmp/runtime/src/kmp_tasking.cpp
  openmp/runtime/src/kmp_wait_release.h
  openmp/runtime/src/ompd-specific.cpp
  openmp/runtime/src/ompd-specific.h
  openmp/runtime/src/ompt-general.cpp
  openmp/runtime/src/ompt-specific.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100181.336407.patch
Type: text/x-patch
Size: 43284 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210409/b169e3bc/attachment-0001.bin>


More information about the Openmp-commits mailing list