Fortran optimization

Bruno Wolff III bruno at convex.csd.uwm.edu
Fri Apr 5 07:31:02 AEST 1991


In article <1991Apr3.062644.23436 at eagle.lerc.nasa.gov> fsjohnv at alliant1.lerc.nasa.gov (Richard Mulac) writes:
%
%   While optimizing a code last year I ran across a situation which on the
%surface appears to contradict some of the basic rules one abides by when
%trying to write efficient Fortran code.  I was trying to merge several DO
%loop blocks to eliminate the overhead associated with redundant index
%calculations and also to reduce memory access.  The code was written to
%be run on a CRAY Y-MP, compiling with cft77 4.0.1.6.  What I found can
%be described using the following program TEST, which calls subroutines
%JOINED and SPLIT (It's a few hundred lines long, but the majority of the
%code is redundant).

Possibly this is caused by the loop not fitting in the instruction cache.
It can be more efficient to have several small loops each of which entirely
fits in the instruction cache instead of a larger loop which doesn't.



More information about the Comp.unix.cray mailing list