Cornell Theory Center


Tools for HPF Programmers

Donna Bergmark

SC97 Tutorial on HPF


Table of Contents


[Next Page]


The Challenge

However, at Cornell, we have put together a tool selection that helps HPF programming to some degree.

These are described next, but first let us consider the HPF programming life cycle.

[Previous Page] [Table of Contents] [Next Page]


The Programming Cycle

Chart of the Programming Cycle
This is the programming life cycle for writing programs in languages ranging from C to Java to HPF. The HPF programmer can use tools at just about any possible stage shown here.

[Previous Page] [Table of Contents] [Next Page]


Kinds of Tools Used

Life Cycle Diagram with Tools

[Previous Page] [Table of Contents] [Next Page]


Creating HPF Source

[Previous Page] [Table of Contents] [Next Page]


Cleaning up the Source

[Previous Page] [Table of Contents] [Next Page]


Tools for Fixing up the Source

Often you know what loop you want to run in parallel (and you'd better have one!), but if not use any available profiling tool to pick out the "hot spots". Some tools for choosing a data distribution exist in Europe, but mostly research tools and related to Vienna Fortran. The other three categories have tools that can help.

[Previous Page] [Table of Contents] [Next Page]


Analyzing Data Dependencies

Fortunately there are a number of helpful tools for picking out data dependencies between iterations of a loop you might want to parallelize. A few of them are: All of these analyze loops and classify variables.

[Previous Page] [Table of Contents] [Next Page]


Seeding the Program

Plus if you use -plist to save the parallelization report, you'll get more information about parallel loop inhibitors.

[Previous Page] [Table of Contents] [Next Page]


Random Numbers

Many high performance codes deal with simulation of physical phenomena. If these codes are parallelized without regard for maintaining independent streams of random numbers, you could wind up replacing one lengthy stream with many smaller, identical ones.

A handy way to get independent streams is to associate a different stream with each index of the loop you wish to parallelize. We have a locally developed tool at Cornell to do just that:

          real*8 function prng_next (i)
          integer i
Suppose that "i" is your do loop index. Then x = prng_next(i) would have a per-iteration sequence of numbers. This makes your output repeatable whether run 1-way or 7-way.

Available from ftp.tc.cornell.edu as pub/utilities/prng.tar.Z.

[Previous Page] [Table of Contents] [Next Page]


Compiling

Example: Same error, different messages

Example: Different report formats

[Previous Page] [Table of Contents] [Next Page]


Debugging

Then you run the program.
  1. 1-way: test accuracy of program cleanup

  2. 2-way: test parallelism

  3. You should hope the answers are right, because
    most parallel debuggers are clueless about HPF

[Previous Page] [Table of Contents] [Next Page]


If the Answers Aren't Right ...

Example: using print statements

Example: an HPF debugger

[Previous Page] [Table of Contents] [Next Page]


Performance Tools

Usually the answers will be right until you begin adding INDEPENDENT directives in front of loops that the compiler has declined to parallelize. So what do you do if you have speed-down? Also, program markers are used to delimit program phases in the trace.

[Previous Page] [Table of Contents] [Next Page]


Examples

Note: parsing tools like AIMS have not yet learned to deal with HPF

[Previous Page] [Table of Contents] [Next Page]


How to use These Tools

[Previous Page] [Table of Contents] [Next Page]


Summary