Spremam ispit i nikako nemogu da rijesim ovo pitanje. Nadam se da ce se naci neko da mi pomogne.
Explain what the following OpenMP code does using an SMP architecture with 2 processors? What is the problem with the code and how could it be fixed?
#pragma omp parallel for private(x)
for (i=0; i< N; i++){
x=(i+0.5)/N; // N is constant
area+=4.0/(1.0+x*x);
}
Upomoc :(
Explain what the following OpenMP code does using an SMP architecture with 2 processors? What is the problem with the code and how could it be fixed?
#pragma omp parallel for private(x)
for (i=0; i< N; i++){
x=(i+0.5)/N; // N is constant
area+=4.0/(1.0+x*x);
}
Upomoc :(