
\section{Introduction}

There are four primary language features in HPF that enable programmer
to describe data parallelism.

\begin{itemize}
\item Array (array section) assingment statement (conditional or not);
\item FORALL statement (construct);
\item Intrinsic functions with array as argument; and
\item DO independent directive.
\end{itemize}

FORALL statement is of core importance, since 
\begin{itemize}
\item
It's semantics is a `true super set' of array assignment statement;
\item
The most prominent addition from Fortran 90 to Fortran 95 is the FORALL 
statement/construct; and
\item
FORALL construct can be equivalently seen as a sequence of FORALL statements.
\end{itemize}

Thus, effective compilation of FORALL statements is essential for an
effective HPF compiler.

As we know, the same problem has been discussed by others, such 
as in \cite{hpf:4} and \cite{hpf:3}. But
we found that they are not general enough and can not be directly 
used for our current activity, though ideas are borrowed. We need a document for
directly guiding our compiler implementation.

In general, a compiler for data parallel language has four kinds of job
to do.

\begin{itemize}
\item Data partitioning;
\item Computation partitioning;
\item Communication detection and insertion; and
\item node program generation.
\end{itemize}

If we see a source program as a system, compilation process as an optimization
process. This is indeed a highly complicated, convoluted optimization problem.
HPF language tries to free the compiler from the first item by encouraging
programmer to specify data partition; if we follow {\em owner computes rule},
the second item is also essentially removed, though sometimes it's non
trivial to determine who is the owner. Thus, our compiler has been left with
two items to work on. It's great ! This report mainly addresses the first of
the two, while some flavor of node program generation will be observed on
the way.

