variables.c 337 Bytes
Newer Older
jansik's avatar
jansik committed
1
2
3
4
5
6
7
8
9
10
11
12
#include <omp.h>
#include <stdio.h>
 
int main(void)
{
int tid;
int var1;

var1 = -10;

printf ("Serial var1= %d, &var1= %p\n",var1,&var1);

Branislav Jansik's avatar
Branislav Jansik committed
13
#pragma omp parallel private(tid)
jansik's avatar
jansik committed
14
15
{
tid = omp_get_thread_num();
Branislav Jansik's avatar
Branislav Jansik committed
16
 
jansik's avatar
jansik committed
17
18
19
20
21
22
printf ("Thread %d var1= %d, &var1= %p\n",tid,var1,&var1);
}

printf ("Serial var1= %d, &var1= %p\n",var1,&var1);
    return 0;
}