error C3052: '??_C@_0CG@JLJKIPDP@Thread?5?$CFd?5executes?5loop?5iteratio@' : variable doesn't appear in a data-sharing clause under a default(none) clause
Here follows the source code where the compiler complains:
- Code: Select all
#pragma omp parallel default(none) shared(n,a,b) private(i)
{
#pragma omp single
printf("First for-loop: number of threads is %d\n", #ERROR HERE
omp_get_num_threads());
#pragma omp for schedule(runtime)
for (i=0; i<n; i++)
{
printf("Thread %d executes loop iteration %d\n",
omp_get_thread_num(),i);
a[i] = i;
}
#pragma omp single
printf("Second for-loop: number of threads is %d\n",
omp_get_num_threads());
#pragma omp for schedule(runtime)
for (i=0; i<n; i++)
{
printf("Thread %d executes loop iteration %d\n",
omp_get_thread_num(),i);
b[i] = 2 * a[i];
}
} /*-- End of parallel region --*/
I´ve already compiled some others examples successfully. Any ideas?
