OpenMP® Forum

Discussion on the OpenMP specification run by the OpenMP ARB. OpenMP and the OpenMP logo are registered trademarks of the OpenMP Architecture Review Board in the United States and other countries. All rights reserved.

You can set the number of threads to be used with the environment variable OMP_NUM_THREADS. You can set the number of threads to be used for following parallel regions with omp_set_num_threads() . In Fortran you probably want to include 'omp.h' or use the module omp_lib (use omp_lib).

You cannot control the number of physical processors/cores available for OpenMP threads; that is a function of the operating system and its environment.