Basic HTML version of Foils prepared August 7 98

Foil 9 Why Use FORALL?

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


1 Assignments to array sections
  • FORALL ( i = 1:4, j = 2:4 ) a(i,j) = a(i,j-1)
  • FORALL ( i = 1:4 ) a(i,i) = a(i,i) * scale
  • FORALL ( i = 1:4 )
    • FORALL ( j=i:4 ) a(i,j) = a(i,j) / a(i,i)
  • END FORALL
  • FORALL ( i=1:4 )
    • FORALL (j=ilo(i):ihi(i)) x(j) = x(j)*y(i)
  • END FORALL
2 Calculating based on a subscript
  • FORALL (i=0:n,j=0:n) a(i,j) = SQRT(1.0*(i*i+j*j))/n

in Table To:


© 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 9 1998