      program simpelGE
      parameter (n=8)
      real a(n,n),t,res,row(n),vec(n)

!HPF$ processors p(4)
!HPF$ template temp(n)
!HPF$ distribute temp(block)
!HPF$ align a(*,i) with temp(i) 

! initialization
      do i=1,n
        forall(j=i:n) a(i,j)=2
      end do

      do i=1,n
        vec(i) = 2*(n-i+1)
      end do

! elimination
      do i=1,n
        t = a(i,i)
        forall (k=1:n) a(i,k) = a(i,k)/t
        vec(i) = vec(i)/t
        do j=i+1,n
! could be k=i+1,n+1, but I want regularity
          t = a(j,i)
          forall (k=1:n) a(j,k) = a(j,k) - a(i,k)*t
          vec(j) = vec(j) - vec(i)*t
        end do
      end do

! back substitution
      do i=n,2,-1
        do j=i-1,1,-1
          t = a(j,i)
          forall (k=1:n)  a(j,k) = a(j,k) - a(i,k)*t
          vec(j) = vec(j) - vec(i)*t
        end do
      end do

      print *, (vec(i),i=1,n)

      stop
      end

