MHPCC  Maui High Performance Computing Center
© Copyright 1995 Maui High Performance Computing Center.

High Performance Fortran (HPF) /
Fortran 90 (F90)

Table of Contents

  1. History

  2. Background for HPF
    1. Why Fortran / HPF?
    2. What is HPF

  3. HPF Subset

  4. Steps for porting to HPF

  5. Automatic parallelization tools

  6. Data distribution
    1. Distribute
    2. Align
    3. Processors
    4. Template
    5. Realign and Redistribute

  7. INDEPENDENT do loops

  8. Data Parallel Constructs and Attributes
    1. Array Processing
    2. Masked array assignments - WHERE
    3. Non-conformable array assignments - FORALL
    4. "PURE" Procedures
    5. Intrinsics
    6. Extrinsic

  9. Program control
    1. Branching Statements
    2. Blocks and Control Constructs
    3. IF Construct
    4. DO Construct
    5. CASE Construct
    6. Other Control Statements
    7. Scope and Association
    8. Procedure Interface Blocks
    9. Using Internal Procedures and Module

  10. References, Acknowledgements, WWW Resources

  11. Exercises

History of Fortran

More History of Fortran

Fortran 90 (1992)

HPF History


Why High Performance Fortran?


What is High Performance Fortran?


High Performance Fortran Subset

A subset of HPF has been determined to encourage the release of HPF compilers.

  • Fortran 90 features not in the HPF subset

    Steps for porting to HPF




    It is very important to fully understand your requirements for performance and scalability when porting to High Performance Fortran. Be sure to research performance and scalability of the various HPF compilers before starting development. It is often wise to do your own benchmarks with code segments which are representative of the code stream before starting a large software development effort.
    1. You should understand the performance and scalability of your serial code before starting. This is important for determining just how well your HPF version is running.

    2. Always try to compile your serial code with the HPF compiler you intend to use. The code should just compile and run. There is a good chance it might not. You may be using features that are not a yet supported. Make sure the answers are the same. There is always a chance that the run might meet your requirements. It is of course a outside chance.

    3. An optional step is to try one of the various tools which will analyze a code and automatically parallelize the code. See the section on automatic parallelization tools.

    4. HPF provides statements like DISTRIBUTE, ALIGN, PROCESSORS and TEMPLATE that give the compiler and run time system information to locate the data arrays over many processors. Calculations which are performed locally to a processor are commonly an order of magnitude faster than calculations which require data from other processors. Care should be taken when distributing arrays to insure performance.

    5. Fortran 90 and HPF provide many constructs to improve the compiler's ability to create parallel code.

      • The first step is often to add the INDEPENDENT command to do loops. The INDEPENDENT statement lets the compiler know that there are no dependencies within the loop so it may process many iterations of the loop in parallel. Many codes have expensive calculations within do loops these codes can often show great benefit from this approach.

      • F90 / HPF often achieves better performance working on large arrays all at the same time in parallel. Commonly serial codes may perform many calculations on each element of an array iteratively. F90 / HPF offer new constructs like Array Operations, WHERE and FORALL which allow large parallel array calculations.

    6. There are often many different ways to do the exact same thing in F90 / HPF. Different approaches may have very different performance characteristics. Often performance can be improved be simplifying large complex statements into many simpler statements.

    7. Hopefully you have chosen algorithms which are parallel in nature from the beginning. There are often many different approaches to the same calculations. Algorithms which work well on serial computers often have more parallel versions for the same algorithm.

    8. If after all that work the performance or scalability does not meet your needs you have two choices. You can either wait for the compiler to improve or write your code using message passing.

    Automatic parallelization tools and HPF


    There are a number of products on the market which attempt to automatically parallelize fortran. Both Applied Parallel Research's FORGE and the Portland Group's HPF have automatic parallelizing functionality. These tools analyze the fortran source and parallel constructs such as "do loops".

    These tools have many drawbacks.
    Automatic parallelization tools may be good for: But may not be good for:

    Data distribution with High Performance Fortran


    References, Acknowledgements, WWW Resources

    Additional Information on the WWW

    References and Acknowledgements

    © Copyright 1996, Maui High Performance Computing Center. All rights reserved.

    Documents located on the Maui High Performance Computing Center's WWW server are copyrighted by the MHPCC. Educational institutions are encouraged to reproduce and distribute these materials for educational use as long as credit and notification are provided. Please retain this copyright notice and include this statement with any copies that you make. Also, the MHPCC requests that you send notification of their use to help@mail.mhpcc.edu.

    Commercial use of these materials is prohibited without prior written permission.

    Revised: 13 February 1996 franko@mhpcc.edu