Subject: Re: Aligment_def

From: Zheng Gengbin <[email-masked]>
Date: Thu, 3 Apr 1997 09:24:42 +0800 (EAT)

On Wed, 2 Apr 1997, Guansong Zhang wrote:

> On Apr 2, 10:21am, Zheng Gengbin wrote:
> > Subject: Re: 1.75
> > On Mon, 31 Mar 1997, Guansong Zhang wrote:
> >
> > > So could you please let me know your new defination of Alignment_def, how
> do
> > > you record align replicate, and I will rewrite this function.
> > >
> >
> >
> > 	I have added 2 member variable in it :
> >   int align_with_dim;  // this record the dimension of the align with
> > 				subscript dimension .
> >   int align_pair[MAX_ALIGN_DIM]; // this record the align pair dimension .
> >
> >
> > > Also, I compare the node generation part in your 1.75, it seems your change
> > > have nothing to do with these two functions. I don't know how you shot cut
> > > them. I think it is better doing in my way, because a lot of thing need to
> be
> > > done in this part.
> > >
> >
> > 	For the first function , I use align_with_dim and align_pair (descirbe
> > above) to get the right dimension of align with  . You can find this in
> > defintion.C line 261 of mine version , there is a line :
> >
> > int to_dim = adef->getAlignPair(j)+1;
> >
> > which will get the counterpart of align with.
> >
> 
> First, still about alignment_def.
> 
> When I coding node program generation part, it is assumed that Align directive
> only support stride and offside, there is no
> 
> 1) permutation: align a (i, j) with t1 (j, i)
> 2) collapsing:  align b (*, i) with t2 (i) [ or align b (j, i) with t2 (i) ]
> 3) replication: align c (i) with t3 (i, *)
> 
> so the defination of the structure to record the alignment is stright forward,
> and things like function get_partioned_dim, which try to find the distributed
> dimention of an array, are trival.
> 
> If you are going to improve the dad generation part of the node program
> generation, you need to enhance Alignment_def to record all the above. I guess
> the align_with_dim and the align_pair are used for permutation. ( Could you
> please give me an example use, I don't understand your explaination well. )
> What about the other two possibilities?
> 

	See the function add_dimention() in distarray.C yourself , I have
no time to explain every of my change .
	But I will say something about replicate , if a dimension is replicate
 (in align with ), we need not record any thing in align_pair . Leave that
dimension untouched and Adlib will take care of them .

> Second.
> 
> I also found you change stride and offset to an expression instead of an
> integer in the old version. I don't see the reason. As our specification of the
> data mapping statement, the stride and offset are always constant, in both main
> program and procedures. (See prof. Li's email about hpf language we are goind
> to deal. This restriction is meaningful, because allow varible stride and
> offset will complicated compiling time detect communication, and do not have
> signifficant using in practical programming. )
> 
> Changing to expression make trans0 must depends on trans1 whenever minus
> operation exist in align directive. I think it also caused a bug in
> set_array_align
> 
> So I suggest you change those back to integers.
> 

	Change the stride and offset to expression is necessary .Think
about an array align with a dummy whose size cannot determined in compiling
time , if no explicit stride and offset is given , we must caculate them
according to the array size , so they may be an expression .

	I think we must consider more general case , even we donot
implement it . You can see the result of your inconsideration of the
data mapping data structure . We should left the interface for later 
implementation .
	Also , if the expression is caculable , I always caculate it and
make it as simple as possible , this is not conflict with the current
strategy . I won't change it back .

> As we know more about the existing problem, we can begin to improve the code.
> 
> I still think it is a good idea to use the 1.75 I sent to you as a base. You
> can improve trans1 as you do in your 1.75. I will work on get_partitioned_dim
> to let it first work for alignment with only stride and offset. After that we
> can deal the improved data mapping part together.
> 

	If that is the case , I will simply left the data mapping part to
you since you don't believe any of my change . In fact , I cannot see
any error of my version to generate the node program of forall3.f and
forall4.f , if you want to do the repeated work , I have nothing to say .
But I suggest you concentrate your energy on forall , not data mapping .

Zheng