HOME
| OPENMP API Specification: Version 5.0 November 2018

4.5.1  Initialization and Finalization Callback Signature

4.5.1.1 ompt_initialize_t

SummaryA callback with type signature ompt_initialize_t initializes use of the OMPT interface.

Format

SVG-Viewer needed.

 

 
typedef int (*ompt_initialize_t) ( 
  ompt_function_lookup_t lookup, 
  int initial_device_num, 
  ompt_data_t *tool_data 
);  

SVG-Viewer needed.

DescriptionTo use the OMPT interface, an implementation of ompt_start_tool must return a non-null pointer to an ompt_start_tool_result_t structure that contains a non-null pointer to a tool initializer with type signature ompt_initialize_t. An OpenMP implementation will call the initializer after fully initializing itself but before beginning execution of any OpenMP construct or completing execution of any environment routine invocation. The initializer returns a non-zero value if it succeeds.

Description of ArgumentsThe lookup argument is a callback to an OpenMP runtime routine that must be used to obtain a pointer to each runtime entry point in the OMPT interface. The initial_device_num argument provides the value of omp_get_initial_device(). The tool_data argument is a pointer to the tool_data field in the ompt_start_tool_result_t structure that ompt_start_tool returned. The expected actions of an initializer are described in Section 4.2.3.

Cross References

4.5.1.2 ompt_finalize_t

SummaryA tool implements a finalizer with the type signature ompt_finalize_t to finalize the tool’s use of the OMPT interface.

Format

SVG-Viewer needed.

 

 
typedef void (*ompt_finalize_t) ( 
  ompt_data_t *tool_data 
);  

SVG-Viewer needed.

DescriptionTo use the OMPT interface, an implementation ofompt_start_tool must return a non-null pointer to an ompt_start_tool_result_t structure that contains a non-null pointer to a tool finalizer with type signature ompt_finalize_t. An OpenMP implementation will call the tool finalizer after the last OMPT event as the OpenMP implementation shuts down.

Description of ArgumentsThe tool_data argument is a pointer to the tool_data field in the ompt_start_tool_result_t structure returned by ompt_start_tool.

Cross References