source:
CIVL/examples/omp/single.c@
d48b845
| Last change on this file since d48b845 was 9a94b18, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 229 bytes | |
| Rev | Line | |
|---|---|---|
| [2aec900] | 1 | #include <omp.h> |
| 2 | #define N 10 | |
| 3 | ||
| 4 | int main (int argc, char * argv[]){ | |
| 5 | double a[N]; | |
| 6 | int i; | |
| 7 | ||
| 8 | #pragma omp parallel | |
| [9a94b18] | 9 | //#pragma omp single private(i) |
| 10 | if (omp_get_thread_num() == 0) | |
| 11 | { | |
| 12 | int i; | |
| [2aec900] | 13 | for(i=0; i<N; i++) |
| 14 | a[i] = 0; | |
| 15 | } | |
| [9a94b18] | 16 | |
| 17 | } |
Note:
See TracBrowser
for help on using the repository browser.
