- Page 1 and 2: OpenMP Application Programming Inte
- Page 3 and 4: Contents Introduction 1 Examples 2
- Page 5 and 6: 4.5.3. declare target and end decla
- Page 7 and 8: 9.5. Nested Loop Constructs . . . .
- Page 9 and 10: 1 Examples 2 3 4 5 6 7 8 9 10 11 Th
- Page 11 and 12: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 13 and 14: 1 2 3 4 5 1.2 The parallel Construc
- Page 15 and 16: 1 2 3 4 5 1.3 Controlling the Numbe
- Page 17 and 18: S-29 !$omp single S-30 ! If OMP_NUM
- Page 19 and 20: 1 2 3 4 Example nthrs_dynamic.2.c C
- Page 21 and 22: S-7 S-8 DO 100 I = 1,10 S-9 !$OMP D
- Page 23 and 24: S-19 ENDDO S-20 !$OMP END DO NOWAIT
- Page 25 and 26: 1 2 3 4 5 6 7 8 9 10 11 12 1.7 The
- Page 27 and 28: Fortran 1 2 3 4 5 6 7 8 9 10 11 12
- Page 29 and 30: 1 2 3 4 5 6 1.8 linear Clause in Lo
- Page 31 and 32: 1 2 3 4 5 6 1.9 The parallel sectio
- Page 33 and 34: Fortran 1 Example fpriv_sections.1.
- Page 35 and 36: Fortran 1 Example single.1.f S-1 SU
- Page 37 and 38: Fortran (cont.) 1 2 3 4 5 6 7 8 9 1
- Page 39 and 40: S-14 S-15 END SUBROUTINE WSHARE6_WR
- Page 41: Fortran 1 Example master.1.f S-1 SU
- Page 45 and 46: 1 2 3 4 5 6 1.16 The omp_get_num_th
- Page 47 and 48: 1 CHAPTER 2 2 OpenMP Affinity 3 4 5
- Page 49 and 50: 1 2 3 4 5 6 2.1 The proc_bind Claus
- Page 51 and 52: Fortran 1 2 3 4 5 6 7 8 9 10 11 12
- Page 53 and 54: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 55 and 56: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 57 and 58: S-24 S-25 socket_num = omp_get_plac
- Page 59 and 60: 1 2 3 4 5 6 7 8 3.1 The task and ta
- Page 61 and 62: Fortran 1 2 3 4 5 The following exa
- Page 63 and 64: 1 2 3 4 5 6 7 8 9 10 Example taskin
- Page 65 and 66: Fortran 1 2 3 4 5 6 7 8 9 10 11 Exa
- Page 67 and 68: 1 2 Example tasking.7.c C / C++ S-1
- Page 69 and 70: Fortran 1 2 3 4 5 6 7 8 9 Example t
- Page 71 and 72: 1 2 Example tasking.10.c C / C++ S-
- Page 73 and 74: Fortran 1 2 3 4 5 6 7 Example taski
- Page 75 and 76: S-16 state = new_state; S-17 } S-18
- Page 77 and 78: Fortran 1 Example tasking.14.f90 S-
- Page 79 and 80: S-17 call compute_array(matrix(:, i
- Page 81 and 82: Fortran 1 2 3 The program will alwa
- Page 83 and 84: 1 2 3 4 S-13 printf("x = %d\n", x);
- Page 85 and 86: Fortran 1 2 3 4 5 The last two task
- Page 87 and 88: 1 2 3 4 5 6 7 8 9 10 3.4 The taskgr
- Page 89 and 90: S-22 endif S-23 !$omp task S-24 cal
- Page 91 and 92: S-13 call something_critical() S-14
- Page 93 and 94:
Fortran 1 Example taskloop.1.f90 S-
- Page 95 and 96:
1 2 3 4 5 6 4.1 target Construct 4.
- Page 97 and 98:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 99 and 100:
1 2 3 4 5 6 7 8 9 C / C++ In C, the
- Page 101 and 102:
1 2 3 4 5 6 7 S-12 for (i=0; iTHRES
- Page 103 and 104:
1 2 3 4 5 6 7 8 9 10 11 4.2 target
- Page 105 and 106:
1 2 3 4 5 6 Example target_data.2.c
- Page 107 and 108:
1 2 3 4 5 6 C / C++ In the followin
- Page 109 and 110:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 C
- Page 111 and 112:
S-12 subroutine vec_mult(p1,v3,v4,N
- Page 113 and 114:
S-12 do i=1,N S-13 p(i) = v1(i) * v
- Page 115 and 116:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 117 and 118:
Fortran 1 Example target_unstructur
- Page 119 and 120:
S-19 p[i] = p[i] + (v1[i] * v2[i]);
- Page 121 and 122:
Fortran 1 Example target_update.2.f
- Page 123 and 124:
Fortran 1 2 3 4 5 6 7 Example decla
- Page 125 and 126:
1 2 3 4 5 6 7 implicit device data
- Page 127 and 128:
Fortran 1 Example declare_target.4.
- Page 129 and 130:
Fortran 1 Example declare_target.5.
- Page 131 and 132:
S-27 #pragma omp parallel for S-28
- Page 133 and 134:
1 2 3 4 5 6 7 8 9 10 11 4.6 teams C
- Page 135 and 136:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 137 and 138:
1 2 Example teams.3.c C / C++ S-1 f
- Page 139 and 140:
Fortran 1 Example teams.4.f90 S-1 m
- Page 141 and 142:
1 2 3 4 5 6 7 8 9 4.6.6 target team
- Page 143 and 144:
1 2 3 4 5 6 C / C++ The Fortran ver
- Page 145 and 146:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 147 and 148:
1 2 Example async_target.3.c C / C+
- Page 149 and 150:
1 2 Example async_target.4.c C / C+
- Page 151 and 152:
1 2 3 4 5 6 7 8 9 4.8 Array Section
- Page 153 and 154:
1 2 3 4 Example array_sections.3.c
- Page 155 and 156:
1 2 3 4 5 6 4.9 Device Routines 4.9
- Page 157 and 158:
1 2 3 4 5 4.9.2 omp_get_num_devices
- Page 159 and 160:
1 2 3 4 5 6 7 8 9 10 11 12 4.9.4 Ta
- Page 161 and 162:
1 CHAPTER 5 2 SIMD 3 4 5 6 7 8 9 10
- Page 163 and 164:
Fortran 1 2 3 4 5 6 7 8 9 10 11 12
- Page 165 and 166:
S-9 end do S-10 call work(a, b, N )
- Page 167 and 168:
1 2 3 4 5 6 Example SIMD.4.c C / C+
- Page 169 and 170:
1 2 Example SIMD.6.c C / C++ S-1 #p
- Page 171 and 172:
1 2 Example SIMD.7.c C / C++ S-1 #i
- Page 173 and 174:
1 Example SIMD.8.c C / C++ S-1 #inc
- Page 175 and 176:
S-43 print 2, "passed", pri S-44 el
- Page 177 and 178:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 Th
- Page 179 and 180:
S-12 S-13 !$OMP CRITICAL(YAXIS) S-1
- Page 181 and 182:
1 2 3 4 5 6 7 8 9 10 6.2 Worksharin
- Page 183 and 184:
1 2 3 4 5 6 7 8 9 10 11 6.3 Binding
- Page 185 and 186:
1 2 3 4 5 6 7 8 9 6.4 The atomic Co
- Page 187 and 188:
S-37 S-38 DO I = 1,1000 S-39 X(I) =
- Page 189 and 190:
S-14 * Use fetch_and_add to impleme
- Page 191 and 192:
1 2 3 4 6.5 Restrictions on the ato
- Page 193 and 194:
S-15 !$OMP ATOMIC UPDATE S-16 I = I
- Page 195 and 196:
S-40 /* because they were not acces
- Page 197 and 198:
1 2 3 4 5 6.7 The ordered Clause an
- Page 199 and 200:
Fortran 1 2 3 4 Example ordered.2.f
- Page 201 and 202:
1 2 3 4 5 6 7 8 9 10 11 12 13 6.8 D
- Page 203 and 204:
S-14 A[i][j] = foo(i, j); S-15 S-16
- Page 205 and 206:
S-16 p(k,j,i) = (tmp1 + tmp2 + tmp3
- Page 207 and 208:
1 2 6.9 Lock Routines This section
- Page 209 and 210:
Fortran 1 2 3 4 5 6 7 8 9 10 11 12
- Page 211 and 212:
1 2 Example simple_lock.1.c C / C++
- Page 213 and 214:
1 2 3 4 6.9.5 Nestable Lock Routine
- Page 215 and 216:
S-43 SUBROUTINE NESTLOCK(P) S-44 US
- Page 217 and 218:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 219 and 220:
1 2 3 4 5 6 The following example d
- Page 221 and 222:
Fortran (cont.) S-11 !$OMP END PARA
- Page 223 and 224:
1 2 3 4 5 6 7 S-25 END PROGRAM INC_
- Page 225 and 226:
Fortran 1 Example default_none.1.f
- Page 227 and 228:
Fortran 1 2 3 4 5 Example private.1
- Page 229 and 230:
1 S-10 for (i=0; i
- Page 231 and 232:
S-19 !$OMP END SINGLE S-20 !$OMP EN
- Page 233 and 234:
Fortran (cont.) 1 2 3 4 5 6 7 The f
- Page 235 and 236:
Fortran (cont.) S-1 PROGRAM PRIV_RE
- Page 237 and 238:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 239 and 240:
1 2 3 4 5 6 7.8 The lastprivate Cla
- Page 241 and 242:
1 2 3 S-16 END DO S-17 S-18 END SUB
- Page 243 and 244:
Fortran (cont.) S-10 S-11 END PROGR
- Page 245 and 246:
Fortran 1 2 3 4 5 6 7 Example reduc
- Page 247 and 248:
1 2 3 4 5 7.10 The copyin Clause Th
- Page 249 and 250:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 251 and 252:
1 2 3 4 S-11 S-12 !$OMP BARRIER S-1
- Page 253 and 254:
1 2 3 4 5 6 7 8 9 10 7.12 C++ Refer
- Page 255 and 256:
S-1 program example S-2 integer ::
- Page 257 and 258:
1 2 3 4 5 6 7 8 9 8.1 The OpenMP Me
- Page 259 and 260:
1 Example mem_model.2.c C / C++ S-1
- Page 261 and 262:
1 Example mem_model.3.c C / C++ S-1
- Page 263 and 264:
1 2 8.2 Race Conditions Caused by I
- Page 265 and 266:
1 2 3 4 5 6 CONTROL VARIABLES Inter
- Page 267 and 268:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
- Page 269 and 270:
Fortran 1 Example icv.1.f S-1 progr
- Page 271 and 272:
Fortran 1 Example standalone.1.f90
- Page 273 and 274:
1 Example standalone.2.f90 S-1 SUBR
- Page 275 and 276:
S-34 #pragma omp barrier S-35 phase
- Page 277 and 278:
S-35 #pragma omp taskwait S-36 } S-
- Page 279 and 280:
1 2 3 4 5 9.5 Nested Loop Construct
- Page 281 and 282:
Fortran 1 Example nested_loop.2.f S
- Page 283 and 284:
Fortran 1 2 3 The following orphane
- Page 285 and 286:
1 2 3 4 5 Example nesting_restrict.
- Page 287 and 288:
1 2 Example nesting_restrict.6.c C
- Page 289 and 290:
1 2 3 4 5 A.2 Changes from 4.0.1 to