Technical data

107
Chapter 6
6. Compiling and Debugging Parallel Fortran
This chapter gives instructions on how to compile and debug a parallel
Fortran program and contains the following sections:
•“Compiling and Running explains how to compile and run a parallel
Fortran program.
•“Proling a Parallel Fortran Program describes how to use the system
proler, prof, to examine execution proles.
•“Debugging Parallel Fortran presents some standard techniques for
debugging a parallel Fortran program.
•“Parallel Programming Exercise explains how to apply Fortran
loop-level parallelism to an existing application.
This chapter assumes you have read Chapter 5, Fortran Enhancements for
Multiprocessors, and have reviewed the techniques and vocabulary for
parallel processing in the IRIX environment.
Compiling and Running
After you have written a program for parallel processing, you should debug
your program in a single-processor environment by calling the Fortran
compiler with the f77 command. After your program has executed
successfully on a single processor, you can compile it for multiprocessing.
Check the f77(1) manual page for multiprocessing options.
To turn on multiprocessing, add mp to the f77 command line. This option
causes the Fortran compiler to generate multiprocessing code for the
particular les being compiled. When linking, you can specify both object
les produced with the mp ag and object les produced without it. If any
or all of the les are compiled with mp, the executable must be linked with
mp so that the correct libraries are used.