19 lines
376 B
C
19 lines
376 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <omp.h>
|
|
|
|
int main(int argc, const char *argv[])
|
|
{
|
|
omp_set_num_threads(2);
|
|
|
|
int value = 42;
|
|
// Suppose we want value to be a private variable
|
|
// The code inside the parallel section should print 42
|
|
#pragma omp parallel private(value)
|
|
{
|
|
printf("Value: %d\n", value);
|
|
}
|
|
|
|
return 0;
|
|
}
|