next up previous contents
Next: Forall Construct Up: Expressing Parallel Execution Previous: Execution Process

 

Do-loops and Forall Statements

Take care, FORALL semantics are different to DO-loop semantics, Although a FORALL may look a bit like a DO loop it is more akin to an array assignment statement. A DO loop has an implied sequential ordering, a FORALL statement in completed in one go!

    DO i = 2, n-1
     a(i) = a(i-1) + a(i) + a(i+1)
    END DO

is different to,

    FORALL (i=2:n-1) &
     a(i) = a(i-1) + a(i) + a(i+1)

which is the same as,

     a(2:n-1) = a(1:n-2) + a(2:n-1) + a(3:n)

Return to corresponding overview page gif


next up previous contents
Next: Forall Construct Up: Expressing Parallel Execution Previous: Execution Process

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.