Skip to content

Latest commit

 

History

History
55 lines (43 loc) · 1.75 KB

omp-num-threads.md

File metadata and controls

55 lines (43 loc) · 1.75 KB
title OMP_NUM_THREADS | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic article
f1_keywords
OMP_NUM_THREADS
dev_langs
C++
helpviewer_keywords
OMP_NUM_THREADS OpenMP environment variable
ms.assetid 4b558124-1387-4c30-a6a5-ff5345a9ced6
caps.latest.revision 8
author mikeblome
ms.author mblome
manager ghogen

OMP_NUM_THREADS

Sets the maximum number of threads in the parallel region, unless overridden by omp_set_num_threads or num_threads.

Syntax

set OMP_NUM_THREADS[=num]  

Remarks

where,

num
The maximum number of threads you want in the parallel region, up to 64 in the Visual C++ implementation.

Remarks

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.

Example

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  

See Also

Environment Variables