next up previous contents
Next: The INDEPENDENT Directive Up: Data Parallel Execution Previous: Pure Subroutine Example

MIMD Example

Multiple Instructions Multiple Data,

    REAL FUNCTION F(x,i) ! PURE
     IMPLICIT NONE
     REAL, INTENT(IN) :: x    ! element
     INTEGER, INTENT(IN) :: i ! index
      IF (x > 0.0) THEN
       F = x*x
      ELSEIF (i==1 .OR. i==n) THEN
       F = 0.0
      ELSE
       F = x
      END IF
    END FUNCTION F

For more information, click here gif


next up previous contents
Next: The INDEPENDENT Directive Up: Data Parallel Execution Previous: Pure Subroutine Example

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996
Not for commercial use.