|
|
От: | barmale-y | |
| Дата: | 10.09.10 09:33 | ||
| Оценка: | |||
Restrictions:
* Variables in the list must be named scalar variables. They can not be array or structure type variables. They must also be declared SHARED in the enclosing context.
#include <stdio.h>
main() {
int s = 0, i;
#pragma omp parallel for shared(s) private(i) reduction(+:s)
for(i=0; i<100; ++i) {
s += i;
}
printf("s=%i",s);
}
error: ‘s’ appears more than once in data clauses