HOME
| OPENMP API Specification: Version 5.0 November 2018

5.5.9  Accessing Scope-Specific Information

5.5.9.1 ompd_enumerate_icvs

SummaryThe ompd_enumerate_icvs function enumerates ICVs.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_enumerate_icvs ( 
  ompd_address_space_handle_t *handle, 
  ompd_icv_id_t current, 
  ompd_icv_id_t *next_id, 
  const char **next_icv_name, 
  ompd_scope_t *next_scope, 
  int *more 
);  

SVG-Viewer needed.

DescriptionIn addition to the ICVs listed in Table 2.1, an OpenMP implementation must support the OMPD specific ICVs listed in Table 5.2. An OpenMP implementation may support additional implementation specific variables. An implementation may store ICVs in a different scope than Table 2.3 indicates. The ompd_enumerate_icvs function enables a tool to enumerate the ICVs that an OpenMP implementation supports and their related scopes. When the current argument is set to the identifier of a supported ICV, ompd_enumerate_icvs assigns the value, string name, and scope of the next ICV in the enumeration to the locations to which the next_id, next_icv_name, and next_scope arguments point. On return, the third-party tool owns the next_icv_name string. The OMPD library uses the memory allocation callback that the tool provides to allocate the string storage; the tool is responsible for releasing the memory.

On return, the location to which the more argument points has the value of 1 whenever one or more ICV are left in the enumeration. on return, that location has the value 0 when current is the last ICV in the enumeration.

Description of ArgumentsThe address_space_handle argument identifies the address space. The current argument must be an ICV that the OpenMP implementation supports. To begin enumerating the ICVs, a tool should pass ompd_icv_undefined as the value of current. Subsequent calls to ompd_enumerate_icvs should pass the value returned by the call in the next_id output argument. On return, the next_id argument points to an integer with the value of the ID of the next ICV in the enumeration. On return, the next_icv argument points to a character string with the name of the next ICV. On return, the next_scope argument points to the scope enum value of the scope of the next ICV. On return, the more_enums argument points to an integer with the value of 1 when more ICVs are left to enumerate and the value of 0 when no more ICVs are left.

Constraints on ArgumentsAny string that next_icv returns must be immutable and defined for the lifetime of a program execution.


Table 5.2: OMPD-specific ICVs



Variable

Scope

Meaning




ompd-num-procs-var

device

return value of omp_get_num_procs() when executed on this device

ompd-thread-num-var

task

return value of omp_get_thread_num() when executed in this task

ompd-final-var

task

return value of omp_in_final() when executed in this task

ompd-implicit-var

task

the task is an implicit task

ompd-team-size-var

team

return value of omp_get_num_threads() when executed in this team





Cross References

5.5.9.2 ompd_get_icv_from_scope

SummaryThe ompd_get_icv_from_scope function returns the value of an ICV.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_get_icv_from_scope ( 
  void *handle, 
  ompd_scope_t scope, 
  ompd_icv_id_t icv_id, 
  ompd_word_t *icv_value 
);  

SVG-Viewer needed.

DescriptionThe ompd_get_icv_from_scope function provides access to the ICVs that ompd_enumerate_icvs identifies.

Description of ArgumentsThe handle argument provides an OpenMP scope handle. The scope argument specifies the kind of scope provided in handle. The icv_id argument specifies the ID of the requested ICV. On return, the icv_value argument points to a location with the value of the requested ICV.

Constraints on ArgumentsIf the ICV cannot be represented by an integer type value then the function returns ompd_rc_incompatible. The provided handle must match the scope as defined in Section 5.3.10 on page 1503.

The provided scope must match the scope for icv_id as requested by ompd_enumerate_icvs.

Cross References

5.5.9.3 ompd_get_icv_string_from_scope

SummaryThe ompd_get_icv_string_from_scope function returns the value of an ICV.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_get_icv_string_from_scope ( 
  void *handle, 
  ompd_scope_t scope, 
  ompd_icv_id_t icv_id, 
  const char **icv_string 
);  

SVG-Viewer needed.

DescriptionThe ompd_get_icv_string_from_scope function provides access to the ICVs that ompd_enumerate_icvs identifies.

Description of ArgumentsThe handle argument provides an OpenMP scope handle. The scope argument specifies the kind of scope provided in handle. The icv_id argument specifies the ID of the requested ICV. On return, the icv_string argument points to a string representation of the requested ICV. On return, the third-party tool owns the icv_string string. The OMPD library allocates the string storage with the memory allocation callback that the tool provides. The tool is responsible for releasing the memory.

Constraints on ArgumentsThe provided handle must match the scope as defined in Section 5.3.10 on page 1503. The provided scope must match the scope for icv_id as requested by ompd_enumerate_icvs.

Cross References

5.5.9.4 ompd_get_tool_data

SummaryThe ompd_get_tool_data function provides access to the OMPT data variable stored for each OpenMP scope.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_get_tool_data( 
  void* handle, 
  ompd_scope_t scope, 
  ompd_word_t *value, 
  ompd_address_t *ptr 
);  

SVG-Viewer needed.

DescriptionThe ompd_get_tool_data function provides access to the OMPT tool data stored for each scope. If the runtime library does not support OMPT then the function returns ompd_rc_unsupported.

Description of ArgumentsThe handle argument provides an OpenMP scope handle. The scope argument specifies the kind of scope provided in handle. On return, the value argument points to the value field of the ompt_data_t union stored for the selected scope. On return, the ptr argument points to the ptr field of the ompt_data_t union stored for the selected scope.

Cross References