In this Section, we would like to give an example to show expressive power of Fortran 90D/HPF distribution directives on a real application.
Consider the data partitioning schema
for matrix-vector multiplication proposed by
Fox et al.[49] and shown in Figure .
The matrix vector multiplication can be described as
where and
are vectors of length
, and
is an
matrix.
To create the distribution shown in Figure
, one
can use the following directives in a Fortran 90D/HPF program.
!F90D$ DECOMPOSITION TEMPL(M,M) !F90D$ ALIGN A(I,J) WITH TEMPL(I,J) !F90D$ ALIGN X(J) WITH TEMPL(*,J) !F90D$ ALIGN Y(I) WITH TEMPL(I,*) !F90D$ DISTRIBUTE TEMPL(BLOCK,BLOCK)
If this program is mapped onto a 4x4 physical processor system,
the Fortran 90D/HPF compiler generates the distributions shown
in Figure .
Matrix A is distributed in both dimensions. Hence, a single processor
owns a subset of matrix rows and columns. X is column-distributed and
row-replicated. But Y is row-distributed and column-replicated.