LLVM OpenMP 20.0.0git
bug-nested.c
Go to the documentation of this file.
1// RUN: %libomp-compile && env KMP_AFFINITY=compact %libomp-run
2
3#include <stdio.h>
4#include <stdint.h>
5#include <omp.h>
6#include "omp_testsuite.h"
7
9 int a = 0;
11 #pragma omp parallel num_threads(2) shared(a)
12 {
13 #pragma omp parallel num_threads(2) shared(a) proc_bind(close)
14 {
15 #pragma omp atomic
16 a++;
17 }
18 }
19 return 1;
20}
21
22int main() {
23 int i;
24 int num_failed = 0;
25
26 for (i = 0; i < REPETITIONS; i++) {
28 num_failed++;
29 }
30 }
31 return num_failed;
32}
int test_nested_affinity_bug()
Definition: bug-nested.c:8
int main()
Definition: bug-nested.c:22
#define i
Definition: kmp_stub.cpp:87
#define omp_set_nested
Definition: kmp_stub.cpp:36
int a
#define REPETITIONS
Definition: omp_testsuite.h:13