| Jugoslav Dujic 2006-01-10, 9:58 pm |
| Paul Van Delst wrote:
| Richard E Maine wrote:
|| Paul Van Delst <Paul.vanDelst@noaa.gov> wrote:
||
||
||| Not necessarily. It's not clear to me whether or not that some compilers
||| will /still/ make copies regardless of whether the dummy arg is declared
||| assumed shape. The IBM xlf compiler comes to mind -- but I still haven't
||| managed to get a definitive answer on this from an "official" source.
||
||
|| IIRC, Nag has an option that causes copying of noncontiguous arguments
|| even with assumed shape dummies. The idea is that in some cases there
|| can be sufficient performance benefit to justify the copy. However, that
|| argument is not on by default. I'd be surprised if XLF did this by
|| default, but I don't actually know.
|
| Well, I finally pulled my finger out and asked an IBM person. The reply I got
| was that xlf generates array copies for both array subsets and array
| triplets. Even when the array subsets are contiguous.
|
| I did try the test program that James van Buskirk posted yesterday and xlf
| printed: 'The compiler passes the test'
| so the issue isn't that cut and dried (if I correctly understand what's
| supposed to happen).
Note that James's test program is not closely related to that issue --
namely, with assumed-shape dummy and a non-contiguous array section
(excluding vector subscripted ones, which I anyway count as an "expression"
in my book) as real argument, a copy *never* has to be made. A compiler
might do that for performance reasons (although it more often degrades
performance than not)...
Still, it seems the simple case of passing contiguous
| array slices/subsets, or regularly strided array triplets, as actual
| arguments will generate a copy "by default" in xlf. I used the quotes since
| the optimisation opportunity of handling these arguments in a more, uh,
| sophisticated manner was acknowledged followed by the statement that it
| hasn't been done yet. So there would appear to be no switch to turn this
| behaviour off.
....rather, I think that XLF always copies array subsets when they
match an *assumed-size* dummy. That's plausible, but often degrades
performance (and causes misbehavior with MPI, which is where we started
from). I wouldn't expect a compiler switch though -- it's more like a
not-implemented feature. Early versions of CVF suffered from that too.
--
Jugoslav
___________
www.xeffort.com
Please reply to the newsgroup.
You can find my real e-mail on my home page above.
|