| title | OMP_NUM_THREADS | Microsoft Docs | |
|---|---|---|
| ms.custom | ||
| ms.date | 11/04/2016 | |
| ms.reviewer | ||
| ms.suite | ||
| ms.technology |
|
|
| ms.tgt_pltfrm | ||
| ms.topic | article | |
| f1_keywords |
|
|
| dev_langs |
|
|
| helpviewer_keywords |
|
|
| ms.assetid | 4b558124-1387-4c30-a6a5-ff5345a9ced6 | |
| caps.latest.revision | 8 | |
| author | mikeblome | |
| ms.author | mblome | |
| manager | ghogen |
Sets the maximum number of threads in the parallel region, unless overridden by omp_set_num_threads or num_threads.
set OMP_NUM_THREADS[=num]
where,
num
The maximum number of threads you want in the parallel region, up to 64 in the Visual C++ implementation.
The OMP_NUM_THREADS environment variable can be overridden by the omp_set_num_threads function or by num_threads.
The default value of num in the Visual C++ implementation of the OpenMP standard is the number of virtual processors, including hyperthreading CPUs.
For more information, see 4.2 OMP_NUM_THREADS.
The following command sets the OMP_NUM_THREADS environment variable to 16:
set OMP_NUM_THREADS=16
The following command displays the current setting of the OMP_NUM_THREADS environment variable:
set OMP_NUM_THREADS