I've heard that it's a good idea to declare constants as parameters
whenever possible, this way the compiler is better able to optimize.
For example, if a matrix A(n,n) is used repeatedly in a MATMUL, when
the constant n is declared as a parameter, the compiler knows the
size of the matrix apriori, therefore it could make better decisions
how to optimize the MATMUL.
Consider 3 cases:
1. the size and elements of the matrix A are determined at run-time.
2. the size is fixed by declaring n as a parameter, the elements of
matrix A are determined at run-time.
3. the size n and the elements of matrix A are declared as parameters.
Case 1. would be preferred if all performed equally well, but generality
could be sacrificed if the performance is significantly improved by
going to case 2. or 3.
In general, how much of a gain in performance would one see in going
from case #1 to case #2, from case #2 to case #3. ??
I know this is architecture/compiler dependent, how about for the
xlf90 compiler on an SP2?
thanks
_______________________________________________________________________
| Pete Bismuti |
| Supercomputer Computations Research Institute |
| Florida State University - Department of Mathematics |
| [log in to unmask] (904)644-6263 |
|_____________________________________________________________________|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|