Support for OMPT in mainstream compilers?

497 views Asked by At

The OpenMP specification from version 5.0 defines the OMPT interface to allow external tools to query the openmp runtime.

I wanted to give it a try but i am really confused about how mainstream compilers actually support this.

  • GCC-11 claims to have extended support for openmp 5.0 support but regarding OMPT, i could not find the corresponding ompt.h header file (in my case, the Ubuntu package libgcc-11-dev provides omp.h).

  • clang-12 does provide ompt.h (package libomp-12-dev) however the compilation of example programs fails, first error being unknown type name 'ompt_invoker_t' and indeed this struct can't be found in ompt.h.

The current state of support is very unclear to me. I could not find a precise status for GCC, while clang provides this information https://clang.llvm.org/docs/OpenMPSupport.html from which i cannot figure out what is behind mostly done.

Could anyone help me find up-to-date information or any hint on this ?

1

There are 1 answers

3
Joachim On

The OMPT-examples linked above refer to an early stage of OMPT (~OpenMP TR6). Several details in the interface changed before the final version in OpenMP 5.0. I currently have a student working on an update of the OMPT-examples.

As a reference OMPT tool I always suggest to look at:

https://github.com/llvm/llvm-project/blob/main/openmp/runtime/test/ompt/callback.h

This tool will always be in sync with the LLVM implementation of OMPT, as this tool is used for CI testing. The OMPT header file was renamed to omp-tools.h (see OpenMP spec). It was just for convenience to have the file still there. I guess we should add a deprecation warning in this file rather than keeping the copy in LLVM.

Regarding compiler support: LLVM and Intel share their OMPT support. All other LLVM-based compilers might also share the OMPT support.

For GNU compilers it might work to link the code with -lomp and also profit from the OMPT support in LLVM. Check with ldd that libomp and no libgomp is linked into the application.

"mostly done" means everything besides OMPT for device constructs and device routines is considered to be implemented. If you find some issues in the implementation, please file a bug against LLVM/OpenMP/runtime.