Re: OON: Comparison between Fortran & C++

From: Kent Budge (kgbudge@valinor.sandia.gov)
Date: Fri Mar 24 2000 - 11:11:12 EST


>
> My observation about the no-aliasing rule in FORTRAN:
>
> 1. Academics who write optimizers love it.
> 2. Most practicing FORTRAN programmers are clueless about it.
>
> For proof of (2), I worked with a lot of FORTRAN programmers in industry
> at one time. I never met one who had heard of the prohibition about aliasing,
> and indeed ran across FORTRAN routines with comments that said that it
> was okay to pass the same actual argument in to two formal arguments to
> get a certain effect.
...

I know of at least one practicing FORTRAN programmer who quite
deliberately "lied" to the compiler to achieve a higher degree of
optimization. The same array was passed to a subroutine through two
different arguments. The compiler assumed no aliasing and vectorized a
reordering operation in which elements of the array (accessed through
the first argument referencing the array) were shuffled and stored back
in the array (accessed through the second argument referencing the
array.) The *programmer* knew that the particulars of his reshuffling
created no dependencies; the *compiler* would not have been able to
figure this out. This is an example of a very sophisticated programmer
programming to a very specific architecture (Cray XMP) and achieving
significantly greater optimization by breaking all the rules.

--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:11 EST