LLVM OpenMP 20.0.0git
|
The OMPT-Multiplexing header file allows a tool to load a second tool to overcome the restriction of the OpenMP to only load one tool at a time. The header file can also be used to load more than two tools using a cascade of tools that include the header file. OMPT-Multiplexing takes care of the multiplexing of OMPT callbacks, data pointers and runtime entry functions.
Examples can be found under ./tests
Either build llvm and find lit+FileCheck in build directory of llvm or install using pip
:
Code of first tool must include the following with the convention, that the environment variable containing the path to the client tool is the tool name with the suffix "_TOOL_LIBRARIES":
Alternatively, the name of the tool can be set as a prefix for both variables:
This define will have the same effect as to two defines above.
Note that functions and variables with prefix "ompt_multiplex" are reserved by the tool
To use both tools execute the following:
Note that EXAMPLE_TOOL_LIBRARIES may also contain a list of paths to tools which will be tried to load in order (similar to lists in OMP_TOOL_LIBRARIES).
To reduce the amount of memory allocations, the user can define macros before including the ompt-multiplex.h file, that specify custom data access handlers:
This will reverse the calling order of the current tool and its client for clean-up events. In order to avoid this, one can specify a custom delete handler as well: