I'm in the process of converting a large piece of f77 code which we use in
our numerical model of the atmosphere. The code runs on HPC machines (cray etc)
and the efficiency of the code is very important - it needs to run as fast
as possible.
Now, in the f77 code I've used PARAMETERs to control loop lengths so that
the vectorizing compiler knows the loop limits at compile time which
reduces the runtime overhead. I know from previous tests with the f77 code
this is significant for our application.
However, the problem with this approach is that the code needs to be
recompiled when parameters change. In moving to f90 I could make this code
use allocatable arrays so that the array sizes, and hence loop lengths, are
set at runtime. This would remove the inconvenience of recompiling and make
the code much more 'user-proof' (so students don't forget to change
parameters before they compile for instance).
My worry is that I will lose some of the efficiency I gained by setting
constant loop limits. But since so much else will have changed in the code
in going from f77 to f90 I wonder whether this is such an issue.
I'd welcome replies from people who've already gone down this road. Yes, I
can always try it and see what happens but to implement the change will
take alot of man hours (mine!) and I'd like to be a bit more certain it'll
not be wasted.
Thanks
Glenn
----
Dr. Glenn Carver, Senior Research Associate,
Centre for Atmospheric Science, Chemistry Dept., Cambridge University, UK
Email: [log in to unmask] Web: http://www.atm.ch.cam.ac.uk/
"The fool doth think he is wise but the wise man knows himself to be a fool"
- Shakespear, As you like it.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|