source:
CIVL/examples/omp/nested.c@
2ad5b29
| Last change on this file since 2ad5b29 was 0fc4e04a, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 250 bytes | |
| Rev | Line | |
|---|---|---|
| [0fc4e04a] | 1 | #include <omp.h> |
| 2 | ||
| 3 | int main (int argc, char *argv[]){ | |
| 4 | int sum = 0, localsum=0; | |
| 5 | int n = 10; | |
| 6 | int i; | |
| 7 | #pragma omp parallel shared(sum) private(i) | |
| 8 | #pragma omp for | |
| 9 | for(i = 0; i < n; i++){ | |
| 10 | localsum += i; | |
| 11 | } | |
| 12 | sum += localsum; | |
| 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
