Subject: Proposal for Generalized Blocks

From: Piyush Mehrotra <[email-masked]>
Date: Fri, 21 Jul 1995 09:30:36 -0400

Generalized Block Distributions:

Proposal by:  Barbara Chapman, Piyush Mehrotra, Guy Robinson and Hans Zima

TO H309 add:

	dist-format	is BLOCK ...
			or CYCLIC ....
			or *
			or GEN_BLOCK (int-array)

	Constraint: int-array must be a one-dimensional integer array
	of size equal to the extent of the corresponding
	dimension of the target processor array.

	Constraint: 
	The sum of the values of int-array must match the size of the
	dimension of the array being distributed using this distribution.

This distribution maps contiguous blocks of the array elements
onto processor with the sizes of the blocks being
given by the integer array <int-array>.  
Thus, if S(i) = lb + sum of k = 1 to i int-array(i),
the lb is the lower bound of the array being distributed,
then P(1) owns the array elements [ lb : S(1)-1]
and P(i) owns array elements [ S(i-1)+1, S(i)]]

Example:
	PARAMETER (START = /4,46,46,4/)
!HPF$ PROCESSORS P(4)
	REAL A(100), B(200), new(4)
!HPF$ DISTRIBUTE A( GEN_BLOCK( START) ) ONTO P
!HPF$ DYNAMIC  B
	...

       new = ...

!HPF$  REDISTRIBUTE ( B(GEN_BLOCK (new) )

Array elements A(1:4) are on P(1)
	       A(5:50) are on P(2)
               A(51:96) are on P(3)
               A(97:100) are on P(4)

General block distributions have
been implemented in the Vienna Fortran Compilation System.