source:
CIVL/mods/dev.civl.abc/examples/omp/nested.c
| Last change on this file was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 252 bytes | |
| Line | |
|---|---|
| 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.
