Basic HTML version of Foils prepared 19 September 98

Foil 79 Jacobi Iteration: update and error

From MPI Message Passing Interface Computational Science for Simulations -- Fall Semester 1998. by Geoffrey C. Fox, Nancy McCracken


myerr = 0.0
DO j=1, nylocal-1
  • DO i = 1, nxlocal-1
    • unew(i,j) = (u(i-1,j)+u(i+1,j)
    • +u(i,j-1)+u(i,j+1)+f(i,j))/4
    • myerr = max(err, ABS(unew(i,j)-u(i,j)))
  • END DO
END DO
CALL MPI_ALLREDUCE(myerr,err,
1,MPI_REAL,MPI_MAX,MPI_COMM_WORLD,ierr)
DO j=1, nylocal-1
  • DO i = 1, nxlocal-1
    • u(i,j) = unew(i,j)
  • END DO
END DO
END DO



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Apr 11 1999