Basic HTML version of Foils prepared August 7 98

Foil 17 Gaussian Elimination: HPF Program

From DoD HPF Training -- 5. Parallel Programming in HPF DoD Training and Others -- 1995-98. by Chuck Koelbel -- Rice University


REAL a(n,n), tmp(n)
!HPF$ DISTRIBUTE a(CYCLIC,CYCLIC)
!HPF$ ALIGN tmp(i) WITH a(*,i)
DO k = 1, n-1
  • ! Select the pivot
  • ipivot = MAXLOC( ABS(a(k:n,k)) ) + k - 1
  • ! Swap the rows
  • tmp(k:n) = a(ipivot,k:n)
  • a(ipivot,k:n) = a(k,k:n)
  • a(k,k:n) = tmp(k:n)
  • ! Update the submatrix
  • FORALL ( i=k+1:n, j=k+1:n ) &
    • & a(i,j) = a(i,j) - a(i,k)/tmp(k)*tmp(j)
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 Aug 16 1998