source:
CIVL/examples/omp/single.c@
d01ddb3
| Last change on this file since d01ddb3 was 9a94b18, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 229 bytes | |
| Line | |
|---|---|
| 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 |
| 9 | //#pragma omp single private(i) |
| 10 | if (omp_get_thread_num() == 0) |
| 11 | { |
| 12 | int i; |
| 13 | for(i=0; i<N; i++) |
| 14 | a[i] = 0; |
| 15 | } |
| 16 | |
| 17 | } |
Note:
See TracBrowser
for help on using the repository browser.
