ompd_rc_t ompd_get_thread_in_parallel(
ompd_parallel_handle_t *parallel_handle,
int thread_num,
ompd_thread_handle_t **thread_handle
);
Summary The ompd_get_thread_in_parallel function enables a tool to obtain handles for OpenMP threads that are associated with a parallel region.
Description A successful invocation of ompd_get_thread_in_parallel returns a pointer to a thread handle in the location to which thread_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 for a parallel region and selects the parallel region on which to operate. The thread_num argument selects the thread, the handle of which is to be returned. On return, the thread_handle argument is an opaque handle for the selected thread.
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_thread_in_parallel function are as follows:
Summary The ompd_get_thread_handle function maps a native thread to an OMPD thread handle.
Description The ompd_get_thread_handle function determines if the native thread identifier to which thread_id points represents an OpenMP thread. If so, the function returns ompd_rc_ok and the location to which thread_handle points is set to the thread handle for the OpenMP thread.
Description of Arguments The handle argument is an opaque handle that the tool provides to reference an address space. The kind, sizeof_thread_id, and thread_id arguments represent a native thread identifier. On return, the thread_handle argument provides an opaque handle to the thread within the provided address space.
The native thread identifier to which thread_id points is guaranteed to be valid for the duration of the call. If the OMPD library must retain the native thread identifier, it must copy it.
Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5 or any of the following return codes:
Summary The ompd_rel_thread_handle function releases a thread handle.
Description Thread handles are opaque to tools, which therefore cannot release them directly. Instead, when the tool is finished with a thread handle it must pass it to ompd_rel_thread_handle for disposal.
Description of Arguments The thread_handle argument is an opaque handle for a thread 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.
Summary The ompd_thread_handle_compare function allows tools to compare two thread handles.
Description The internal structure of thread handles is opaque to a tool. While the tool can easily compare pointers to thread handles, it cannot determine whether handles of two different addresses refer to the same underlying thread. The ompd_thread_handle_compare function compares thread handles.
On success, ompd_thread_handle_compare returns in the location to which cmp_value points a signed integer value that indicates how the underlying threads compare: a value less than, equal to, or greater than 0 indicates that the thread corresponding to thread_handle_1 is, respectively, less than, equal to, or greater than that corresponding to thread_handle_2.
Description of Arguments The thread_handle_1 and thread_handle_2 arguments are opaque handles for threads. On return the cmp_value argument is set to a signed integer value.
Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5.
Summary The ompd_get_thread_id maps an OMPD thread handle to a native thread.
Description The ompd_get_thread_id function maps an OMPD thread handle to a native thread identifier.
Description of Arguments The thread_handle argument is an opaque thread handle. The kind argument represents the native thread identifier. The sizeof_thread_id argument represents the size of the native thread identifier. On return, the thread_id argument is a buffer that represents a native thread identifier.
Description of Return Codes This routine must return any of the general return codes listed at the beginning of Section 5.5 or any of the following return codes: