Skip to content

Commit

Permalink
bugfix omp pragma
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanalesmayo authored Jan 15, 2017
1 parent 6554181 commit 78cbbf7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jacobi_par.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define BC_COLD 0.0
#define INITIAL_GRID 0.5
// Jacobi constants
#define MAX_ITERATIONS 1000
#define MAX_ITERATIONS 10000
#define TOL 1.0e-4

struct timeval tv;
Expand Down Expand Up @@ -304,7 +304,10 @@ int main(int argc, char* argv[]) {
j=0;
b[i][j] = 0.2*(a[i][j]+a[i-1][j]+a[i+1][j]+rfcbuff[i]+a[i][j+1]);
if (fabs(b[i][j]-a[i][j]) > maxdiff) maxdiff = fabs(b[i][j]-a[i][j]);

}

#pragma omp parallel for reduction(max:maxdiff)
for(i=1;i<subprob_size-1;i++){
// j=subprob_size-1
j=subprob_size-1;
b[i][j] = 0.2*(a[i][j]+a[i-1][j]+a[i+1][j]+a[i][j-1]+rlcbuff[i]);
Expand Down

0 comments on commit 78cbbf7

Please sign in to comment.