Thread Information

Functions

kmp_int32 __kmpc_bound_num_threads (ident_t *loc)
kmp_int32 __kmpc_bound_thread_num (ident_t *loc)
kmp_int32 __kmpc_global_num_threads (ident_t *loc)
kmp_int32 __kmpc_global_thread_num (ident_t *loc)
kmp_int32 __kmpc_in_parallel (ident_t *loc)

Detailed Description

These functions return information about the currently executing thread.


Function Documentation

kmp_int32 __kmpc_bound_num_threads ( ident_t loc  ) 
Parameters:
loc Source location information.
Returns:
The number of threads in the innermost active parallel construct.

Definition at line 177 of file kmp_csupport.c.

References __kmp_entry_thread(), and KC_TRACE.

Referenced by FTN_GET_NUM_THREADS().

kmp_int32 __kmpc_bound_thread_num ( ident_t loc  ) 
Parameters:
loc Source location information.
Returns:
The thread number of the calling thread in the innermost active parallel construct.

Definition at line 165 of file kmp_csupport.c.

References __kmp_entry_gtid, __kmp_tid_from_gtid, and KC_TRACE.

kmp_int32 __kmpc_global_num_threads ( ident_t loc  ) 
Parameters:
loc Source location information.
Returns:
The number of threads under control of the OpenMP* runtime

This function can be called in any context. It returns the total number of threads under the control of the OpenMP runtime. That is not a number that can be determined by any OpenMP standard calls, since the library may be called from more than one non-OpenMP thread, and this reflects the total over all such calls. Similarly the runtime maintains underlying threads even when they are not active (since the cost of creating and destroying OS threads is high), this call counts all such threads even if they are not waiting for work.

Definition at line 151 of file kmp_csupport.c.

References __kmp_nth, KC_TRACE, and TCR_4.

kmp_int32 __kmpc_global_thread_num ( ident_t loc  ) 
Parameters:
loc Source location information.
Returns:
The global thread index of the active thread.

This function can be called in any context.

If the runtime has ony been entered at the outermost level from a single (necessarily non-OpenMP*) thread, then the thread number is that which would be returned by omp_get_thread_num() in the outermost active parallel construct. (Or zero if there is no active parallel construct, since the master thread is necessarily thread zero).

If multiple non-OpenMP threads all enter an OpenMP construct then this will be a unique thread identifier among all the threads created by the OpenMP runtime (but the value cannote be defined in terms of OpenMP thread ids returned by omp_get_thread_num()).

Definition at line 128 of file kmp_csupport.c.

References __kmp_entry_gtid, and KC_TRACE.

kmp_int32 __kmpc_in_parallel ( ident_t loc  ) 
Parameters:
loc Source location information.
Returns:
1 if this thread is executing inside an active parallel region, zero if not.

Definition at line 255 of file kmp_csupport.c.

References __kmp_entry_thread().


Generated on 25 Aug 2013 for libomp_oss by  doxygen 1.6.1