+-------------------------------IBM Extension--------------------------------+
The OpenMP specification provides a number of routines which allow you to control and query the parallel execution environment.
Parallel threads created by the run-time environment through the OpenMP
interface are considered independent of the threads you create and control
using calls to the Fortran Pthreads library
module. References within the following descriptions to
"serial portions of the program" refer to portions of the program that are
executed by only one of the threads that have been created by the run-time
environment. For example, you can create multiple threads by using
f_pthread_create. However, if you then call
omp_get_num_threads from outside of an OpenMP parallel block, or from
within a serialized nested parallel region, the function will return
1, regardless of the number of threads that are currently
executing.
Table 29. OpenMP execution environment routines
omp_get_dynamic omp_get_max_threads omp_get_nested omp_get_num_procs omp_get_num_threads |
omp_get_thread_num omp_in_parallel omp_set_dynamic omp_set_nested omp_set_num_threads |
Included in the OpenMP run-time library are two routines that support a
portable wall-clock timer.
Table 30. OpenMP timing routines
omp_get_wtick |
omp_get_wtime |
The OpenMP run-time library also supports a set of simple and nestable lock routines. You must only lock variables through these routines. Simple locks may not be locked if they are already in a locked state. Simple lock variables are associated with simple locks and may only be passed to simple lock routines. Nestable locks may be locked multiple times by the same thread. Nestable lock variables are associated with nestable locks and may only be passed to nestable lock routines.
For all the routines listed below, the lock variable is an integer whose KIND type parameter is denoted either by the symbolic constant omp_lock_kind, or by omp_nest_lock_kind.
This variable is sized according to the compilation mode. It
is set either to '4' for 32-bit applications or '8' for
64-bit.
Table 31. OpenMP simple lock routines
omp_destroy_lock omp_init_lock omp_set_lock |
omp_test_lock omp_unset_lock |
Table 32. OpenMP nestable lock routines
omp_destroy_nest_lock omp_init_nest_lock omp_set_nest_lock |
omp_test_nest_lock omp_unset_nest_lock |