The reason for the private offer is that you do not need to change the code .
The only way to parallelize the following code without a personal reason
int i,j; #pragma omp parallel for private(j) for(i = 0; i < n; i++) { for(j = 0; j < n; j++) {
- change the code. For example, for example:
int i #pragma omp parallel for for(i = 0; i < n; i++) { int j; for(j = 0; j < n; j++) {
This code is completely correct C89 / C90, but one of the goals of OpenMP is not to change your code, except to add pragma statements that can be turned on or off at compile time.
Z boson May 04 '15 at 9:09 a.m. 2015-05-04 09:09
source share