1.23
2.0
acw/focus-triggers
main
test-branch
| Line | |
|---|
| 1 | // simple -- operation
|
|---|
| 2 | #include <stdlib.h>
|
|---|
| 3 | int main(int argc, char* argv[])
|
|---|
| 4 | {
|
|---|
| 5 | int i;
|
|---|
| 6 | int len=100;
|
|---|
| 7 |
|
|---|
| 8 | if (argc>1)
|
|---|
| 9 | len = atoi(argv[1]);
|
|---|
| 10 |
|
|---|
| 11 | int numNodes=len, numNodes2=0;
|
|---|
| 12 | int x[len];
|
|---|
| 13 |
|
|---|
| 14 | for (i=0; i< len; i++)
|
|---|
| 15 | {
|
|---|
| 16 | if (i%2==0)
|
|---|
| 17 | x[i]=5;
|
|---|
| 18 | else
|
|---|
| 19 | x[i]= -5;
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | #pragma omp parallel for
|
|---|
| 23 | for (i=numNodes-1 ; i>-1 ; --i) {
|
|---|
| 24 | if (x[i]<=0) {
|
|---|
| 25 | numNodes2-- ;
|
|---|
| 26 | }
|
|---|
| 27 | }
|
|---|
| 28 | return 0;
|
|---|
| 29 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.