Changes between Version 15 and Version 16 of openmp_programming
- Timestamp:
- May 23, 2008, 12:02:13 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
openmp_programming
v15 v16 111 111 {{{ 112 112 113 PROGRAM HELLO //Program_Name: HELLO 113 PROGRAM HELLO //Program_Name: HELLO // OpenMP Directives 114 114 115 115 INTEGER VAR1, VAR2, VAR3 … … 123 123 Specify variable scoping 124 124 125 !$OMP PARALLEL PRIVATE(VAR1, VAR2) SHARED(VAR3) 125 !$OMP PARALLEL PRIVATE(VAR1, VAR2) SHARED(VAR3) // OpenMP Directives 126 126 127 127 Parallel section executed by all threads 128 128 . 129 . 129 . // Parallel Region 130 130 . 131 131 132 132 All threads join master thread and disband 133 133 134 !$OMP END PARALLEL 134 !$OMP END PARALLEL // OpenMP Directives 135 135 136 136 Resume serial code … … 147 147 {{{ 148 148 149 #include <omp.h> 149 #include <omp.h> //include the OpenMP header 150 150 151 151 main () { … … 161 161 Specify variable scoping 162 162 163 #pragma omp parallel private(var1, var2) shared(var3) 163 #pragma omp parallel private(var1, var2) shared(var3) // OpenMP Directives 164 164 { 165 165 166 166 Parallel section executed by all threads 167 . 168 . 167 . 168 . // Parallel Region 169 169 . 170 170