Interesting thread. I've been using more and more assumed shape arrays just
for convenience. Now perhaps I should become more educated.
Is there a simple definition/example of copy-in/copy-out. Not sure what
this means.
-----Original Message-----
From: Richard Maine [mailto:[log in to unmask]]
Sent: Wednesday, November 20, 2002 10:07 AM
To: [log in to unmask]
Subject: performance (again): assumed vs explicit shape
Pierre Hugonnet writes:
> it has been discussed and observed many times that assumed shape dummy
> arguments may cause performance penalty, but I have caught this morning
> a case where I gained more that 50% cut in CPU just by reverting to an
> explicit shape interface instead of assumed shape:
[shows some code]
I didn't spend much (scarcely any) time looking at the code, but I
noticed right away that you didn't show the call. The biggest single
gotcha for assumed-shape dummies is the possibility of triggering
copy-in/copy-out, which can result in performance penalties of
multiple orders of magnitude in extreme cases. But one has to look at
the calling code to analyze this; you can't tell just from the called
code. (And it also depends *HIGHLY* on the particular compiler -
there are some widely used compilers that are pretty abysmal in this
area).
If it isn't the copy-in/copy-out problem, you might also want to
try relevant compiler switches, at least if you have the NAG
compiler; it has switches to do things like assume contiguous
assumed-shape array arguments, since allowing for the possible
noncontiguity is another significant source of performance
penalty.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|