Subject: Re: about shift

From: Zheng Gengbin <[email-masked]>
Date: Tue, 6 Jan 1998 17:06:54 +0800 (EAT)

On Mon, 29 Dec 1997, Bryan Carpenter wrote:

> >    Another interest thing is that if Adlib provide a function that can 
> > decide if two arrays(DAD) have same data mapping patterns during runtime?
> > I found it will be very convenient 
> 
> Yes, this function would be needed for the run-time checks mentioned
> above, so it could be made available in the external interface.
>

  I am trying to figure out how many things we must compare in order to 
decide two DADs are same distributed . The first thing I think is to compare
the rank, element type, process group. Then I must compare the two ranges, 
include the g_lb, g_ub and extent. One thing I am not sure is how to compare
the distcode ?
And are these enough? 

> > 
> >    I also encountered a problem when using transformation functions. I think 
> > these collective functions have inherit collision with our owner-compute 
> > rule. There is a very simple example(maybe unresonable):
> > 
> > 	integer a(1:4),b(1:4)
> > 	forall (i=1:3)
> > 		a(i)=sum(b)
> > 
> > Suppose there are 4 processors(P) and block mapping is assumed to a and b , 
> > according to owner-compute rule, processors: P(1)-P(3) will enter the do 
> > loop to compute their holding part of a. But the execution of sum require that 
> > all processors participate in the computation. This will cause deadlock 
> > of the node programs. It is also very hard to extract the execution of sum 
> > out of the do-loop, because the parameters of sum may contain the loop 
> > variables. 
> 
> Clearly you can't use both naive owner-computes *and* collective
> computation of `sum' in this situation.  But I'd say that's the
> compiler's problem, not the library's.  The library supports *either*
> owner computes:
> 
>   integer tmp(1:4)
>   align tmp(*) with a(*)       ! collapsed-replicated alignment
> 
>   adlib_remap(tmp, b) ;
> 
>   forall(i = 1 : 3)
>     a(i) = sum(tmp)            ! sequential sum, repeated on every processor
> 

	So forall have to be done as do , a sequential one ?

> 
> *or* parallel sum:
> 
>   integer tmp
>   align tmp with a(*)          ! replicated alignment
> 
>   adlib_sum(tmp, b) ;          ! distributed sum
> 
>   forall(i = 1 : 3)
>     a(i) = tmp
> 

	If the sum function contains a parameter with loop variable i,then
this strategy cannot work.

Gengbin Zheng
---------------------------------
Dept. of Computer Science and Technology
Peking University

home page: http://pact0.cs.pku.edu.cn/users/zhenggb
E-mail:    [email-masked]