| OPENMP API Specification: Version 5.0 November 2018

4.2.1  ompt_start_tool

SummaryIn order to use the OMPT interface provided by an OpenMP implementation, a tool must implement the ompt_start_tool function, through which the OpenMP implementation initializes the tool.


SVG-Viewer needed.


ompt_start_tool_result_t *ompt_start_tool( 
  unsigned int omp_version, 
  const char *runtime_version 

SVG-Viewer needed.

DescriptionFor a tool to use the OMPT interface that an OpenMP implementation provides, the tool must define a globally-visible implementation of the function ompt_start_tool. The tool indicates that it will use the OMPT interface that an OpenMP implementation provides by returning a non-null pointer to an ompt_start_tool_result_t structure from the ompt_start_tool implementation that it provides. The ompt_start_tool_result_t structure contains pointers to tool initialization and finalization callbacks as well as a tool data word that an OpenMP implementation must pass by reference to these callbacks. A tool may return NULL from ompt_start_tool to indicate that it will not use the OMPT interface in a particular execution. A tool may use the omp_version argument to determine if it is compatible with the OMPT interface that the OpenMP implementation provides.

Description of ArgumentsThe argument omp_version is the value of the _OPENMP version macro associated with the OpenMP API implementation. This value identifies the OpenMP API version that an OpenMP implementation supports, which specifies the version of the OMPT interface that it supports. The argument runtime_version is a version string that unambiguously identifies the OpenMP implementation.

Constraints on ArgumentsThe argument runtime_version must be an immutable string that is defined for the lifetime of a program execution.

EffectIf a tool returns a non-null pointer to an ompt_start_tool_result_t structure, an OpenMP implementation will call the tool initializer specified by the initialize field in this structure before beginning execution of any OpenMP construct or completing execution of any environment routine invocation; the OpenMP implementation will call the tool finalizer specified by the finalize field in this structure when the OpenMP implementation shuts down.

Cross References