Subject: Template

From: Yan Mi <[email-masked]>
Date: Thu, 7 Nov 1996 10:19:59 +0800 (EAT)

Hi,
	I am tseting the three templates Prof. Li gave us before. 
Template 1 and Template 2 are ok. But when I transform template 3,
it appear  bus error (coredump).
Yanmi

	program main
	REAL X(100,100),Y(100,100)
!HPF$	PROCESSORS P(4)
!HPF$	TEMPLATE	TX(200,200),TY(100,100)
!HPF$	DISTRIBUTE TX(BLOCK,*) ONTO P
!HPF$	DISTRIBUTE TY(BLOCK,*) ONTO P
!HPF$   ALIGN X(I,J) WITH TX(2*I,2*J)
!HPF$	ALIGN Y(I,J) WITH TY(I,J)
	FORALL(I=1:100,J=1:100) X(I,J)=0
	FORALL(I=1:100,J=1:100) Y(I,J)=I+J

	FORALL(I=26:50,J=26:50)  X(I,J)=Y(I+1,J)+Y(I,J+1)
	FORALL(I=1:100:2,J=1:100:2,X(I,J)>0)  X(I,J)=1 
	CALL FOO(X(1:100:2,1))
	PRINT *,(X(I,1),I=1,100,2)

	END

	SUBROUTINE	FOO(X)
	REAL	X(50)
!HPF$	INHERIT	X
	REAL Y(50)
!HPF$	PROCESSORS P(4)
!HPF$	DISTRIBUTE Y(BLOCK) ONTO P

	FORALL(I=1:50)  Y(I)=2

	FORALL(I=1:50)  X(I)=Y(I)+1 
	END