I have a doubt and I did not find the correct response in the OpenMP documentation. If I have a loop like this:
int i;
#pragma omp parallel for
for(i=0;i<10;i++)
//do some stuff
Is the variable i
implicit private, am I right? Or i have to define as private , like #pragma omp parallel for private(i)
?
Instead if I have a loop like this:
int i,j;
#pragma omp parallel for
for(i=0;i<10;i++)
for(j=i+1;j<10;j++)
//do some stuff
Only the variable i
will be implicit private, and the variable j
will be shared because by default OpenMP "forces" as private only the control loop variable of the underlying loop, am I right?
Can I have some references to confirm these assumptions?