HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)
void omp_set_nested(int nested);
The omp_set_nested function enables or disables nested parallelism. If nested evaluates
to 0, which is the default, nested parallelism is disabled, and nested parallel regions are
serialized and executed by the current thread. If nested evaluates to non-zero, nested
parallelism is enabled, and parallel regions that are nested may deploy additional threads
to form the team. This call has precedence over the OMP_NESTED environment variable.
omp_get_nested
#include <omp.h>
int omp_get_nested(void);
The omp_get_nested function returns non-zero if nested parallelism is enabled and 0
if it is disabled.
Lock Functions
The functions described in this section manipulate locks used for synchronization.
For the following functions, the lock variable must have type omp_lock_t. For nestable
lock functions, the lock variable must have type omp_nest_lock_t.
This variable must only be accessed through these functions. All lock functions require
an argument that has a pointer to omp_lock_t type for lock functions and
omp_nest_lock_t for nestable lock functions.
• omp_init_lock and omp_init_nest_lock
• omp_destroy_lock and omp_destroy_nest_lock
• omp_set_lock and omp_set_nest_lock
• omp_unset_lock and omp_unset_nest_lock
• omp_test_lock and omp_test_nest_lock
omp_init_lock and omp_init_nest_lock
#include <omp.h>
void omp_init_lock(omp_lock_t *lock);
void omp_init_nest_lock(omp_nest_lock_t *lock);
These functions provide the only means of initializing a lock. Each function initializes the
lock associated with the parameter lock for use in subsequent calls. The initial state is
unlocked (that is, no thread owns the lock). For a nestable lock, the initial nesting count
is zero
omp_destroy_lock and omp_destroy_nest_lock
#include <omp.h>
void omp_destroy_lock(omp_lock_t *lock);
Parallel Programming Using OpenMP 215