High Performance Fortran Translator ----------------------------------- Dr Bryan Carpenter Southampton University Computing Services. Contents -------- Background Why HPF? 1 slide HPFF 1 slide HPF overview 1 slide Parallel computation n slides Distributed distributed data n slides Southampton work PUMA 1 slide (1/2 ?) ADAPT and ADLIB 1 slide (1/2 ?) JISC and SERC projects 1 slide Mapping of computation n slides Run-time library n slides 1. Background ------------- 1.1 Why HPF? ------------ Some extant HPC architectures: * Single processor vector * Single instruction stream, distributed data (SIMD) * Multiple processor (MIMD) * Message-passing * Remote memory access * Shared memory Standardisation efforts within some subclasses (eg MPI), but still great diversity. Parallelisation of sequential languages difficult/intractable. HPF generalises SIMD dialects of Fortran---less baggage than message-passing or general shared memory. ``Bulk-synchronous, parallel random access'' model. Adds some of the flexibility of MIMD model. Can be compiled to any of the above architectures ;-). 1.2 The High Performance Fortran Forum -------------------------------------- Started meeting March 1992. Participation of 40+ organisations, including designers of Fortran D, Vienna Fortran, and manufacturers of parallel computers (Cray, DEC, Fujitsu, HP, IBM, Intel, Maspar, Meiko, nCube, Sun, Thinking Machines...). Language is a development of SIMD Fortran dialects such as Connection Machine Fortran, and distributed memory dialects such as Fortran D and Vienna Fortran. Standard distributed in May '93, published in September. Still no full Subset implementations available. 2. HPF Overview --------------- HPF extends Fortran in two ways: * It adds constructs which specify parallel execution of computations. * It adds directives which specify how program data is ``aligned'' and distributed across multiple memories. 2.1 Parallel Computation ------------------------ HPF includes all the ``array syntax'' and ``array intrinsics'' of Fortran 90. It adds a FORALL construct. Examples of Fortran 90 syntax: \begin{verbatim} REAL X (10), Y (10), LEN (10) LEN = SQRT(X**2 + Y**2) \end{verbatim} All 10 lengths can be computed in parallel. \begin{verbatim} REAL A (10, 10), B (10, 10), C (10, 10) DO I = 1, 10 DO J = 1, 10 A (I, J) = DOT_PRODUCT (A (I, :), B (:, J)) END DO END DO \end{verbatim} The intrinsic {\em DOT_PRODUCT} can be computed by a parallel algorithm (but {\em DO} loops remain sequential). Note syntax for ``array sections''. By combining the F90 array intrinsics with section subscripts (and ``masking''), possible to express many parallel algorithms. {\em But}, array syntax rapidly becomes clumsy for writing practical parallel programs. Can use {\em FORALL} instead \begin{verbatim} FORALL (I = 1 : N, J = 1 : N) U (I, J) = (U (I, J - 1) + U (I, J + 1) + U (I - 1, J) + U (I + 1, J)) / 4 END FORALL \end{verbatim} (a parallel iterative solver). \begin{verbatim} FORALL (I = 1 : N, J = 1 : N) A (I, J) = DOT_PRODUCT (A (I, :), B (:, J)) END FORALL \end{verbatim} (fully parallel version of earlier example).