HOME
| OPENMP API Specification: Version 5.1 November 2020

5.5.7  Task Handles

5.5.7.1 ompd_get_curr_task_handle

Summary The ompd_get_curr_task_handle function obtains a pointer to the task handle for the current task region that is associated with an OpenMP thread.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_get_curr_task_handle( 
  ompd_thread_handle_t *thread_handle, 
  ompd_task_handle_t **task_handle 
);  

SVG-Viewer needed.

Description The ompd_get_curr_task_handle function obtains a pointer to the task handle for the current task region that is associated with an OpenMP thread. This call is meaningful only if the thread for which the handle is provided is stopped. The task handle must be released with ompd_rel_task_handle.

Description of Arguments The thread_handle argument is an opaque handle that selects the thread on which to operate. On return, the task_handle argument points to a location that points to a handle for the task that the thread is currently executing.

Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5 or the following return code:

Cross References

5.5.7.2 ompd_get_generating_task_handle

Summary The ompd_get_generating_task_handle function obtains a pointer to the task handle of the generating task region.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_get_generating_task_handle( 
  ompd_task_handle_t *task_handle, 
  ompd_task_handle_t **generating_task_handle 
);  

SVG-Viewer needed.

Description The ompd_get_generating_task_handle function obtains a pointer to the task handle for the task that encountered the OpenMP task construct that generated the task represented by task_handle. The generating task is the OpenMP task that was active when the task specified by task_handle was created. This call is meaningful only if the thread that is executing the task that task_handle specifies is stopped. The generating task handle must be released with ompd_rel_task_handle.

Description of Arguments The task_handle argument is an opaque handle that selects the task on which to operate. On return, the generating_task_handle argument points to a location that points to a handle for the generating task.

Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5 or the following return code:

Cross References

5.5.7.3 ompd_get_scheduling_task_handle

Summary The ompd_get_scheduling_task_handle function obtains a task handle for the task that was active at a task scheduling point.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_get_scheduling_task_handle( 
  ompd_task_handle_t *task_handle, 
  ompd_task_handle_t **scheduling_task_handle 
);  

SVG-Viewer needed.

Description The ompd_get_scheduling_task_handle function obtains a task handle for the task that was active when the task that task_handle represents was scheduled. This call is meaningful only if the thread that is executing the task that task_handle specifies is stopped. The scheduling task handle must be released with ompd_rel_task_handle.

Description of Arguments The task_handle argument is an opaque handle for a task and selects the task on which to operate. On return, the scheduling_task_handle argument points to a location that points to a handle for the task that is still on the stack of execution on the same thread and was deferred in favor of executing the selected task.

Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5 or the following return code:

Cross References

5.5.7.4 ompd_get_task_in_parallel

Summary The ompd_get_task_in_parallel function obtains handles for the implicit tasks that are associated with a parallel region.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_get_task_in_parallel( 
  ompd_parallel_handle_t *parallel_handle, 
  int thread_num, 
  ompd_task_handle_t **task_handle 
);  

SVG-Viewer needed.

Description The ompd_get_task_in_parallel function obtains handles for the implicit tasks that are associated with a parallel region. A successful invocation of ompd_get_task_in_parallel returns a pointer to a task handle in the location to which task_handle points. This call yields meaningful results only if all OpenMP threads in the parallel region are stopped.

Description of Arguments The parallel_handle argument is an opaque handle that selects the parallel region on which to operate. The thread_num argument selects the implicit task of the team to be returned. The thread_num argument is equal to the thread-num-var ICV value of the selected implicit task. On return, the task_handle argument points to a location that points to an opaque handle for the selected implicit task.

Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5 or the following return code:

Restrictions Restrictions on the ompd_get_task_in_parallel function are as follows:

Cross References

5.5.7.5 ompd_rel_task_handle

Summary This ompd_rel_task_handle function releases a task handle.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_rel_task_handle( 
  ompd_task_handle_t *task_handle 
);  

SVG-Viewer needed.

Description Task handles are opaque to tools; thus tools cannot release them directly. Instead, when a tool is finished with a task handle it must use the ompd_rel_task_handle function to release it.

Description of Arguments The task_handle argument is an opaque task handle to be released.

Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5.

Cross References

5.5.7.6 ompd_task_handle_compare

Summary The ompd_task_handle_compare function compares task handles.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_task_handle_compare( 
  ompd_task_handle_t *task_handle_1, 
  ompd_task_handle_t *task_handle_2, 
  int *cmp_value 
);  

SVG-Viewer needed.

Description The internal structure of task handles is opaque; so tools cannot directly determine if handles at two different addresses refer to the same underlying task. The ompd_task_handle_compare function compares task handles. After a successful call to ompd_task_handle_compare, the value of the location to which cmp_value points is a signed integer that indicates how the underlying tasks compare: a value less than, equal to, or greater than 0 indicates that the task that corresponds to task_handle_1 is, respectively, less than, equal to, or greater than the task that corresponds to task_handle_2. The means by which task handles are ordered is implementation defined.

Description of Arguments The task_handle_1 and task_handle_2 arguments are opaque handles that correspond to tasks. On return, the cmp_value argument points to a location in which a signed integer value indicates how the underlying tasks compare.

Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5.

Cross References

5.5.7.7 ompd_get_task_function

Summary This ompd_get_task_function function returns the entry point of the code that corresponds to the body of a task.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_get_task_function ( 
  ompd_task_handle_t *task_handle, 
  ompd_address_t *entry_point 
);  

SVG-Viewer needed.

Description The ompd_get_task_function function returns the entry point of the code that corresponds to the body of code that the task executes.

Description of Arguments The task_handle argument is an opaque handle that selects the task on which to operate. On return, the entry_point argument is set to an address that describes the beginning of application code that executes the task region.

Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5.

Cross References

5.5.7.8 ompd_get_task_frame

Summary The ompd_get_task_frame function extracts the frame pointers of a task.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_get_task_frame ( 
  ompd_task_handle_t *task_handle, 
  ompd_frame_info_t *exit_frame, 
  ompd_frame_info_t *enter_frame 
);  

SVG-Viewer needed.

Description An OpenMP implementation maintains an ompt_frame_t object for every implicit or explicit task. The ompd_get_task_frame function extracts the enter_frame and exit_frame fields of the ompt_frame_t object of the task that task_handle identifies.

Description of Arguments The task_handle argument specifies an OpenMP task. On return, the exit_frame argument points to an ompd_frame_info_t object that has the frame information with the same semantics as the exit_frame field in the ompt_frame_t object that is associated with the specified task. On return, the enter_frame argument points to an ompd_frame_info_t object that has the frame information with the same semantics as the enter_frame field in the ompt_frame_t object that is associated with the specified task.

Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5.

Cross References

5.5.7.9 ompd_enumerate_states

Summary The ompd_enumerate_states function enumerates thread states that an OpenMP implementation supports.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_enumerate_states ( 
  ompd_address_space_handle_t *address_space_handle, 
  ompd_word_t current_state, 
  ompd_word_t *next_state, 
  const char **next_state_name, 
  ompd_word_t *more_enums 
);  

SVG-Viewer needed.

Description An OpenMP implementation may support only a subset of the states that the ompt_state_t enumeration type defines. In addition, an OpenMP implementation may support implementation-specific states. The ompd_enumerate_states call enables a tool to enumerate the thread states that an OpenMP implementation supports.

When the current_state argument is a thread state that an OpenMP implementation supports, the call assigns the value and string name of the next thread state in the enumeration to the locations to which the next_state and next_state_name arguments point.

On return, the third-party tool owns the next_state_name string. The OMPD library allocates storage for the string with the memory allocation callback that the tool provides. The tool is responsible for releasing the memory.

On return, the location to which the more_enums argument points has the value 1 whenever one or more states are left in the enumeration. On return, the location to which the more_enums argument points has the value 0 when current_state is the last state in the enumeration.

Description of Arguments The address_space_handle argument identifies the address space. The current_state argument must be a thread state that the OpenMP implementation supports. To begin enumerating the supported states, a tool should pass ompt_state_undefined as the value of current_state. Subsequent calls to ompd_enumerate_states by the tool should pass the value that the call returned in the next_state argument. On return, the next_state argument points to an integer with the value of the next state in the enumeration. On return, the next_state_name argument points to a character string that describes the next state. On return, the more_enums argument points to an integer with a value of 1 when more states are left to enumerate and a value of 0 when no more states are left.

Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5 or the following return code:

Cross References

5.5.7.10 ompd_get_state

Summary The ompd_get_state function obtains the state of a thread.

Format

SVG-Viewer needed.

 

 
ompd_rc_t ompd_get_state ( 
  ompd_thread_handle_t *thread_handle, 
  ompd_word_t *state, 
  ompd_wait_id_t *wait_id 
);  

SVG-Viewer needed.

Description The ompd_get_state function returns the state of an OpenMP thread.

Description of Arguments The thread_handle argument identifies the thread. The state argument represents the state of that thread as represented by a value that ompd_enumerate_states returns. On return, if the wait_id argument is non-null then it points to a handle that corresponds to the wait_id wait identifier of the thread. If the thread state is not one of the specified wait states, the value to which wait_id points is undefined.

Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5.

Cross References