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


1 COMMON /mine/ z
2 INTEGER x(3), y(3), z
3 !$OMP THREADPRIVATE(mine)
4 !$OMP PARALLEL DO DEFAULT(PRIVATE), SHARED(x)
5 DO k = 1, 3
6 x(k) = k
7 y(k) = k*k
8 z = z + x(i)*y(i)
9 END DO
10 !$OMP END PARALLEL DO
11 SHARED MEMORY
12 x
13 1
14 2
15 3
16 z
17 36
18 Thread 0
19 z'
20 1
21 y
22 1
23 Thread 1
24 z'
25 4
26 y
27 4
28 Thread 2
29 z'
30 9
31 y
32 9

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