
\part{Fortran 90 and data-parallel computation}

     Fortran 90, and especially its extension, High Performance
Fortran, are designed to express of the kind of parallelism which
occurs most frequently in numerical programs---{\em data-parallelism}.

     In computations involving large arrays it often happens that
processing can happen independently for each element of a data
structure.  Under favourable conditions, one can exploit a
correspondingly large number processors to execute all the elemental
computations in parallel.  This provides scope for a potentially
enormous increase in execution speed.

     There are various obstacles to exploiting the data-parallelism
inherent in many numerical algorithms.  The first problem is to write
the algorithm in a form which makes the potential parallelism
explicit.  The second, less obviously, is to somehow ensure that each
processor has rapid access to the array elements required to complete
its individual task.  Otherwise the costs of moving data between many
processors may outweigh the benefits of parallel execution.

     The second task is probably the more painful one, and much of HPF
is dedicated to providing the programmer with means of approaching it.
The first part of this document, however, concentrates on the way in
which parallelism itself is expressed in HPF.

     As it turns out, the language extensions needed to express
data-parallelism are quite modest.  Essentially all that is needed
is the facility to manipulate arrays-valued variables and expressions
on a similar footing to scalars.  This is as much as pure Fortran 90
provides to support parallelism.  HPF goes a little further, and
provides a \verb$FORALL$ construct, which is something like a
parallel \verb$DO$ loop.

     The first section here describes the new Fortran 90 array
features.  The second describes the HPF \verb$FORALL$
construct.  Both sections include many illustrative code fragments.
Section \ref{examples} contains some more complete examples of parallel
codes.

     Fortran 90 contains many new features which are not discussed
here, including modules and derived types.  These are extremely useful,
but are not essentially connected with {\em parallel} programming.
Also, the syntax of Fortran has been extended to allow more structured
layout of programs.  We assume that readers will not be too unnerved to
see \verb$ENDDO$ appearing in the examples instead of \verb$CONTINUE$,
or statements starting before column 7!  Fortran traditionalists (and
people with old codes to port) can rest assured that all the
idiosyncracies of earlier standards are retained in Fortran 90,
alongside the more modern forms.

\input{data-parallel}
\input{hpf-extensions}
\input{parallel-examples}

\newpage

