Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. double maxLocalDeviation = 0;
  2. for (i = 1; i < mx1; i++)
  3.     for (j = 1; j < my1; j++)
  4.     {
  5.         double df = fabs(newf[i][j] - f[i][j]);
  6.         if (df > maxLocalDeviation)
  7.             maxLocalDeviation = df;
  8.     }
  9.  
  10. double globalDeviation = 0;
  11. MPI_Allreduce(&maxLocalDeviation, &globalDeviation, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
  12.  
  13. if (globalDeviation < EPS)
  14.     break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement