Learning openMP
// array b
#pragma omp parallel for // reduction(&&: b[i])?
for (i=2; i<=N; i++)
{
// create local array for each thread
int *localb;
localb = (int*) malloc(N*sizeof(int));
memcpy(localb, b, N*sizeof(localb));
#pragma omp for private(j)
for (j=i+1; j<=N; j++)
{
if (j%i == 0)
localb[j] = 0;
}
Is it possible to reduce each element in global array b using reduction(&&: b[i]) so that b[i] = localb[j] && b[i]? All data is either 0 or 1; 0 if j is divisible by i, and 1 otherwise.