Basic HTML version of Foils prepared August 29 98

Foil 20 OpenMP Data Environments

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.)


COMMON /mine/ z
INTEGER x(3), y(3), z
!$OMP THREADPRIVATE(mine)
!$OMP PARALLEL DO DEFAULT(PRIVATE), SHARED(x)
DO k = 1, 3
x(k) = k
y(k) = k*k
z = z + x(i)*y(i)
END DO
!$OMP END PARALLEL DO
SHARED MEMORY
x
1
2
3
z
36
Thread 0
z'
1
y
1
Thread 1
z'
4
y
4
Thread 2
z'
9
y
9



© 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