Basic HTML version of Foils prepared 17 Sept 1996

Foil 68 PURE Functions in HPF

From New CPS615HPF and Fortran90 Discussion Sept 17 96 Basic Simulation Track for Computational Science CPS615 -- Fall Semester 96. by Geoffrey C. Fox, Tom Haupt


PURE functions have no side effects
  • ALL Intrinsics are PURE
DO loops can call any functions and parallelism unclear as function call can destroy parallelism
  • DO I=1,1000
    • A(I) = FUNC(A(I-1),X)
  • END DO
If FUNC alters A(I-1) or in fact A(any index except I), then this loop cannot be easily parallelized
FORALL statements can only call PURE functions and these must NOT define any global (e.g. any element of A in example) or dummy (A(i-1) or X) variable
  • PURE functions can only INHERIT distribution and alignment statements



© on Tue Oct 7 1997