(Flawed) Plan For a Good Reduction
Incorrect parallel program:
c$omp parallel private(suml,i)
c$omp& shared(sum,a,n)
suml = 0.0
c$omp do
do 10 i=1,n
10 suml = suml + a(i)
cbug — need critical section next
sum = sum + suml
c$omp end parallel
Previous slide
Next slide
Back to first slide
View graphic version