On Aug 12, 2009, at 11:14 AM, Bill Broadley wrote:
* For the compilers that tend to be better at stream (open64 and
pathscale),
you lose the performance if you just replace double a[],b[],c[] with
double *a,*b,*c. Patch[1] available. I don't have a work around for
this, suggestions welcome. Is it really necessary for dynamic arrays
to be substantially slower than static?
Yes -- when pointers, the compiler assumes (by default) that the
pointers can alias each other, which can prevent aggressive
optimizations that are otherwise possible with arrays. C99 has
introduced the 'restrict' keyword to allow programmers to assert that
pointers of the same type cannot alias each other. However, restrict
is just a hint and some compilers may or may not take advantage of it.
You can also consult your compiler's documentation to see if there are
other compiler-specific hints (asserting no loop-carried dependencies,
loop fusion/fission). I remember stacking half a dozen pragmas over a
3-line loop on a Cray C compiler years ago to ensure that accesses
where suitably optimized (or in this case, vectorized).
. . christian
_______________________________________________
Beowulf mailing list, Beowulf@beowulf.org sponsored by Penguin Computing
To change your subscription (digest mode or unsubscribe) visit
http://www.beowulf.org/mailman/listinfo/beowulf