The OMP_NUM_THREADS=num environment variable gives you full control over the number of user threads used to run your program. Some applications cannot use more threads than the maximum number of processors available. Other applications can experience significant performance improvements if they use more threads than there are processors.
num represents the number of parallel threads requested, which is usually equivalent to the number of processors available on the system. This number can be overridden by calling the omp_set_num_threads runtime library function.
The default value for num is the number of processors available on the system.
You can override the setting of OMP_NUM_THREADS for a given parallel section by using the num_threads clause available in several #pragma omp directives.