Technical data

112
Chapter 6: Compiling and Debugging Parallel Fortran
Check for EQUIVALENCE problems. Two variables of different names
may in fact refer to the same storage location if they are associated
through an EQUIVALENCE.
Check for the use of uninitialized variables. Some programs assume
uninitialized variables have the value 0. This works with the static
ag, but without it, uninitialized values assume the value left on the
stack. When compiling with mp, the program executes differently and
the stack contents are different. You should suspect this type of problem
when a program compiled with mp and run on a single processor
gives a different result when it is compiled without mp. One way to
track down a problem of this type is to compile suspected routines with
static. If an uninitialized variable is the problem, it should be xed by
initializing the variable rather than by continuing to compile static.
Try compiling with the C option for range checking on array
references. If arrays are indexed out of bounds, a memory location may
be referenced in unexpected ways. This is particularly true of adjacent
arrays in a COMMON block.
If the analysis of the loop was incorrect, one or more arrays that are
SHARE may have data dependencies. This sort of error is seen only
when running multiprocessed code. When stepping through the code
in the debugger, the program executes correctly. In fact, this sort of error
often is seen only intermittently, with the program working correctly
most of the time.
The most likely candidates for this error are arrays with complicated
subscripts. If the array subscripts are simply the index variables of a
DO loop, the analysis is probably correct. If the subscripts are more
involved, they are a good choice to examine rst.
If you suspect this type of error, as a nal resort print out all the values
of all the subscripts on each iteration through the loop. Then use
uniq(1) to look for duplicates. If duplicates are found, then there is a
data dependency.