| title |
omp_in_parallel | 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 |
omp_in_parallel OpenMP function |
|
| ms.assetid |
1f01a1b4-78c5-496a-afb7-a43ecdad83d6 |
| caps.latest.revision |
10 |
| author |
mikeblome |
| ms.author |
mblome |
| manager |
ghogen |
| translation.priority.ht |
cs-cz |
de-de |
es-es |
fr-fr |
it-it |
ja-jp |
ko-kr |
pl-pl |
pt-br |
ru-ru |
tr-tr |
zh-cn |
zh-tw |
|
Returns nonzero if called from within a parallel region.
Remarks
For more information, see 3.1.6 omp_in_parallel Function.
// omp_in_parallel.cpp
// compile with: /openmp
#include <stdio.h>
#include <omp.h>
int main( )
{
omp_set_num_threads(4);
printf_s("%d\n", omp_in_parallel( ));
#pragma omp parallel
#pragma omp master
{
printf_s("%d\n", omp_in_parallel( ));
}
}
Functions