CCTLib
Calling-context and data-object attribution library for Intel Pin
test2.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <omp.h>
3 
4 #define N (10000000)
5 
6 int A[N];
7 int B[N/2];
8 
9 void g()
10 {
11  int i=0;
12  for (i = 0; i<N; i++) A[i] ++;
13 }
14 
15 void h()
16 {
17  int i;
18  for (i = 0; i<N/2; i++) B[i]++;
19 }
20 
21 void f()
22 {
23  g();
24 }
25 
26 int main()
27 {
28 #pragma omp parallel num_threads(2)
29 {
30 #pragma omp sections
31 {
32 #pragma omp section
33 {
34  f();
35 }
36 #pragma omp section
37 {
38  h();
39 }
40 }
41 }
42  return 0;
43 }
#define N
Definition: test2.c:4
void h()
Definition: test2.c:15
void g()
Definition: test2.c:9
void f()
Definition: test2.c:21
int main()
Definition: test2.c:26