Subject: Re: about shift

From: Zheng Gengbin <[email-masked]>
Date: Fri, 9 Jan 1998 16:02:45 +0800 (EAT)

> The template range is given by
> 
>   Range Range :: tem()
> 
> You need to compare the extent and distribution code of the template
> range.  These are given by `size', again, and
> 
>   Format Range :: format()
>

	template Range must be new. I cannot find this in my version.
 
> > > 
> > > 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.
> > 
> 
> I guess you need to give me the example you're really interested in.
> 

here is an example:

integer a(4)
forall (i=1:3) a(i)=sum(b(i:10))

Assume a is block-distributed onto 4 processors, so the node programs on
processor node 1-3 will be

do pcrc_i=0,0,1
  a(pcrc_i) = sum(b(i:10))       ! sum() need some translation
enddo

however in processor 4, the code will be

do pcrc_i=0,-10000,1
...
enddo

which will do nothing in loop, because it hold no array element to compute.

So the problem is how to translate the function call 'sum' here.Since i is
appeared in the sum function call, the function seems can not be extracted
out of the forall statement.

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

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