An OpenMP implementation examines the tool-var ICV as one of its first initialization steps. If the value of tool-var is disabled, the initialization continues without a check for the presence of a tool and the functionality of the OMPT interface will be unavailable as the program executes. In this case, the OMPT interface state remains inactive.
Otherwise, the OMPT interface state changes to pending and the OpenMP implementation activates any first-party tool that it finds. A tool can provide a definition of ompt_start_tool to an OpenMP implementation in three ways:
If the value of tool-var is enabled, the OpenMP implementation must check if a tool has provided an implementation of ompt_start_tool. The OpenMP implementation first checks if a tool-provided implementation of ompt_start_tool is available in the address space, either statically-linked into the application or in a dynamically-linked library loaded in the address space. If multiple implementations of ompt_start_tool are available, the OpenMP implementation will use the first tool-provided implementation of ompt_start_tool that it finds.
If the implementation does not find a tool-provided implementation of ompt_start_tool in the address space, it consults the tool-libraries-var ICV, which contains a (possibly empty) list of dynamically-linked libraries. As described in detail in Section 6.19 on page 1682, the libraries in tool-libraries-var are then searched for the first usable implementation of ompt_start_tool that one of the libraries in the list provides.
If the implementation finds a tool-provided definition of ompt_start_tool, it invokes that method; if a NULL pointer is returned, the OMPT interface state remains pending and the implementation continues to look for implementations of ompt_start_tool; otherwise a non-null pointer to an ompt_start_tool_result_t structure is returned, the OMPT interface state changes to active and the OpenMP implementation makes the OMPT interface available as the program executes. In this case, as the OpenMP implementation completes its initialization, it initializes the OMPT interface.
If no tool can be found, the OMPT interface state changes to inactive.