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)


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

in Table To:


© on Tue Oct 7 1997