I am currently learning about OpenMP. As default variables declared outside of the parallel region are public, where as variables inside of a parallel region are private. Also stack variables from inside the parallel regions are private.
double A[10];
int index[10];
#pragma omp parallel
{
work(index);
}
printf(%d\n”,index[0]);
But why is "index" on the above example public for each thread? Shouldn't it be private, since its put on the stack, and stack variables are private?
Thanks in advance