Basic HTML version of Foils prepared August 29 98

Foil 45 (Flawed) Plan For a Good Reduction

From Designing and Building Parallel Programs 2: openMP Shared Memory Programming Language DoD Modernization Tutorial -- 1995-1998. by Ian Foster, Gina Goff, Ehtesham Hayder, Chuck Koelbel(Some foils prepared by Kuck & Associates, Inc.)


1 Incorrect parallel program:
2 c$omp parallel private(suml,i)
3 c$omp& shared(sum,a,n)
4 suml = 0.0
5 c$omp do
6 do 10 i=1,n
7 10 suml = suml + a(i)
8 cbug -- need critical section next
9 sum = sum + suml
10 c$omp end parallel

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Apr 11 1999