Basic HTML version of Foils prepared 17 Sept 1996

Foil 65 Vector Indices in FORALL's

From New CPS615HPF and Fortran90 Discussion Sept 17 96 Basic Simulation Track for Computational Science CPS615 -- Fall Semester 96. by Geoffrey C. Fox, Tom Haupt


1 Consider FORALL( i=1:n ) a(ix(i)) = a(i)
2 is allowed in HPF but will only give sensible reproducible results if ix(i) is a true permutation of 1...n
  • but if ix(i) has repeated values, then the result is undefined
3 Of course we always use "old" value" of a(i) on rhs so that if ix(i)= i+1 and a(0) defined, then result is
  • a(i)/new = a(i-1)/old
  • and not result of recursion
  • a(1)/new =a(0)/old
  • a(2)/new = a(1)/new just calculated = a(0)/old

in Table To:


© on Tue Oct 7 1997