next up previous

HPFC: a Prototype HPF Compiler



Hpfc is an High Performance Fortran Compiler which is being developed at CRI. This project aims at building a prototype compiler to be able to test new optimization techniques for compiling HPF. It has been supported by PARADIGME [1]. The compiler is implemented on top of PIPS [5, 7, 6] (Scientific Programs Interprocedural Parallelizer) which provides many program analyses such as effects, regions, etc. Realistic codes (hundreds of lines, heavy I/Os, not fully optimizable) are compiled by the prototype and have run on a network of workstations and on a CM5. Some experiments were also performed on an alpha farm.

NEW The prototype compiler is available at the source level and as SunOS4 and Solaris2 binaries with the PIPS distribution (CRI/ENSMP). Note that this implementation is a working research prototype! This means that despite it has shown to work on real HPF codes, and sometimes to perform better than commercial compilers, it remains a prototypes with bugs, core dumps, limitations and small documentation and small support.

Compiler input language

The compiler does not take as input full HPF, but includes both simplification and extensions (FC directives).

Base language

The base language is mainly FORTRAN 77, plus some extensions toward HPF.

Static mapping directives

The HPF mapping directives are both simplified and extended on a syntactic point of view:

Dynamic mapping directives

The mapping of an array may be modified dynamically within the program or at subroutine boundaries. Dynamic directives are as constrained as static directives.

HPF Parallelism directives

Parallelism can be expressed:

Extensions to HPF

Hpfc incorporates many extensions of HPF, the need of which was encountered in real applications.

Compiler output

The compiler generates code for the SPMD message passing programming model. It includes many optimizations. The generated code is based on a runtime support library. The communications are handled by PVM. The whole compilation process is driven and automated by shell scripts.

Target programming model

Hpfc's target programming model is a host-node distributed memory message passing model. The host is in charge of I/Os and of the process management. The nodes perform the computations. Two programs are generated by the compiler. One for the host, and an SPMD code for the nodes, which is parametrized by the node id. The generated codes rely on a runtime library which provides many services. Lower level issues in the process management (spawning of tasks, etc.) and basic communications are handled by PVM.

Compiler optimizations

The basic compilation technique is known as the runtime resolution of accesses to distributed arrays. Each processor executes the whole control flow of the original program, and each reference to distributed data is resolved dynamically, and elementary messages are exchanged, following the Owner Computes Rule. This is of course very inefficient, and optimizations are needed if the program is expected to run quicker on a parallel machine.

The following optimizations are implemented within Hpfc:

Runtime library

The Hpfc generated code relies on a runtime library and on runtime datastrutures. These functions are written in FORTRAN 77 on top of PVM3. Many functions are generated automatically from m4 templates, depending on the manipulated data types and arities. Parts of the library are ported to use the CM5 communication library instead of PVM3. The runtime library was successfully compiled on the following PVM architectures: SUN4 SUNMP RS6K ALPHA CM5.

Runtime data structures:

Runtime functions:

Driver and utilities

Hpfc is integrated in PIPS, a prototype parallelizer. There are many utilities used by Hpfc or that can be used to manipulate Hpfc.

Figure 1: HPFC overview

Figure 1 shows an overview of Hpfc within PIPS, decomposed into several interacting phases within the compiler.


Hpfc is a prototype HPF compiler in which some of our techniques have been implemented. It serves as a realistic testbed for testing new optimization techniques. The compiler includes 18,000 lines of ANSI C code as a PIPS module, plus 1,300 of shell and other sed scripts for the drivers, and finally 3,500 lines of M4/FORTRAN 77 for the runtime support library (expanded to +10,000).

Related work

Prototype compilers that generate code from FORTRAN (more or less HPF) or C for distributed-memory machines: See the excellent survey maintained by Jean-Louis Pazat at IRISA.


Luc Bougé. ParaDigme - Le parallélisme de données comme modèle fondamental pour le calcul massivement parallèle. Rapport final, ENS-Lyon, December 1994. Thème 10 : Langages, modèles d'exécution et architectres pour le parallélisme massif, appel d'offres du Ministère de la Recherche et de l'Espace.

Fabien Coelho. Étude de la Compilation du High Performance Fortran. Master's thesis, Université Paris VI, September 1993. Rapport de DEA Systèmes Informatiques. TR EMP E/178/CRI.

Fabien Coelho. Compilation of I/O Communications for HPF. In 5th Symposium on the Frontiers of Massively Parallel Computation, pages 102-109, February 1995.

Fabien Coelho and Corinne Ancourt. Optimal Compilation of HPF Remappings. CRI TR A 277, CRI, École des mines de Paris, October 1995. To appear in JPDC, 1996.

François Irigoin, Pierre Jouvelot, and Rémi Triolet. Semantical interprocedural parallelization: An overview of the PIPS project. In ACM International Conference on Supercomputing, pages 144-151, June 1991.

Ronan Keryell. WPips and EPips User Manual (Paralléliseur Interprocédural de Programmes Scientifiques) -- Linear Algebra based Automatic Parallelizer and Program Transformer. CRI, École des mines de Paris, April 1996. Also report A-288.

Ronan Keryell, Corinne Ancourt, Fabien Coelho, Béatrice Creusillet, François Irigoin, and Pierre Jouvelot. PIPS: A Framework for Building Interprocedural Compilers, Parallelizers and Optimizers. Technical Report 289, CRI, École des mines de Paris, April 1996.

This document URL is:

next up previous

Wed Mar 26 13:24:56 MET 1997