Dick,
>So, in this sense F90 has "destroyed" some of the efficiency of
>F77. But, as someone else (O'Brien I think) has said, the new
>intrinsics give greater flexibility and improve user time by
>covering all of the odd cases. You can make a pretty good argument
>that for most people programmer time is the dominant cost, not
>run-time (and yes, I know about weather forecasts, but most
>people don't do them). The tradeoff is that the vendors have
>to do a little (grin) more work on optimizing the easy cases.
I might have said something similar, but not as eloquently :-)
>----
>New topic
>
>One thing I haven't seen discussed is the effect of array dimensions
>on vector syntax. In physics problems there tend to be lots of
>arrays, but very few actual dimension sets. Most arrays have the
>same shape or are sub-shapes of other arrays. But given a
>Subroutine like
>
> Subroutine add_em_up(a,b,c,d,e,f)
> real a(:,:), b(:,:), c(:,:), d(:,:), e(:,:), f(:,:)
> a = b+c
> d = e+f
> end
>
>a compiler won't know that. It will almost for sure translate
>that into 2 DO loop nests when almost for sure one nest would
>be good enough. Also, it's likely to have to compute an index
>function ("I-1 + d1*(J-1))" for each of the 6 arrays, rather than
>one function for all 6. This isn't much of a problem for smallish
>codes, it's only 3 integer adds in the inner loop and that shouldn't
>be a major time hit. But in bigger codes it adds to register
>pressure and potentially adds a couple of cycles.
O.K., do compilers know what a(:,:) size is? I guessed it was like a(*) where
it was assumed a 1,n loop was valid for n without being able to check bounds.
I would have assumed that with that declaration, I must say a(:n,:m) = etc.,
where n and m are declared in common or as arguments. If that is not the case,
and standard, such that all compilers must support it, this is my new knowledge
for today -- even geriatrics are supposed to learn something new daily :-)
Regards, Paddy
Paddy O'Brien,
Transmission Development,
TransGrid,
PO Box A1000, Sydney South,
NSW 2000, Australia
(Street address, 201 Elizabeth Street)
Tel: +61 2 9284-3063
Fax: +61 2 9284-3050
Email: [log in to unmask]
Either "\'" or "\s" (to escape the apostrophe) seems to work for most people,
but that little whizz-bang apostrophe gives me little spam.
|