Basic HTML version of Foils prepared 16 Sept 1995

Foil 36 Examples of FORALL statements in HPF

From HPFtutorial CPS615 Basic Simulation Track for Computational Science -- Fall Semester 95. by Geoffrey C. Fox(Tomasz Haupt)


FORALL (i=1:100,k=1:100) a(i,k) = b(i,k) A = B
FORALL (i=2:100:2) a(i) = a(i-1) A(2:100:2) = A(1:99:2)
FORALL (i=1:100) a(i) = i A = [1..100]
FORALL (i=1:100, j=1:100) a(i, j) = i+j
FORALL (i=1,100) a(i,i) = b(i)
FORALL (i=1,100,j=1:100) a(i,j) = b(j,i)
FORALL (i=1,100) a(i, 1:100) = b(1:100, i)
FORALL (i=1:100, j=1:100, y(i,j).NE.0) x(i,j) = REAL(i+j)/y(i,j)
FORALL (i=1,100) a(i,ix(i)) = x(i)
FORALL (i=1,9) x(i) = SUM(x(1:10:i))
FORALL (i= 1,100) a(i) = myfunction(a(i+1))



© on Tue Oct 7 1997