[ HPF Home | Versions | Compilers | Projects | Publications | Applications | Benchmarks | Events | Contact ] |
! The global actual arguments passed to LB1, UB1, LB2, and UB2
! have only one element apiece and so can be treated as scalars
! in the local Fortran 77 procedures
INTEGER LB1, UB1, LB2, UB2
! NX contains the global extent of the first dimension
! of the global array associated with local array X
INTEGER NX
! Note that X may have no local elements.
REAL X ( LB1 : UB1 , LB2 : UB2 )
! Initialize the elements of the array, if any
DO J = LB2, UB2
DO I = LB2, UB2
X(I,J) = I + (J-1) * NX
END DO
END DO
END
SUBROUTINE LOCAL2(N,X,R)
! Here, the rank of the original array is unimportant
! Only the total number of local elements is needed
! INTEGER N
REAL X(N), R
! If N is zero, local array X has no elements, but R
! still computes the correct local sum
R = 0.
DO I = 1, N
R = R + X(I)
END DO
END
©2000-2006 Rice University | [ Contact Us | HiPerSoft | Computer Science ] |