(j3.2006) "Contiguous" doesn't quite do what I need

Aleksandar Donev donev1
Mon Mar 26 13:18:15 EDT 2007


On Monday 26 March 2007 09:43, Bill Long wrote:

> Actually, you can effectively do that already by creating a
> derived type with, for example, a 2 x 2 array component. Then declare an
> assumed or deferred shape array of the parent type to get the remaining
> dimensions. That structure probably more accurately captures the
> algorithmic intent anyway.
Usually one needs both, that is, sometimes one looks at each of the 2x2 blocks 
individually. But sometimes one needs a 2x2xN array, not an array of derived 
types. Our array pointers are versatile enough to allow one to have different 
views of the same data...the problem being that they have complex efficiency 
impacts that are difficult for the programmer to know (I cannot know what 
every optimizer for all the compilers I use will do with a particular loop!). 
Also, they are too heavy (arbitrary strides, shapes, and addresses), making 
their overhead high for smaller arrays.

As to the "more advanced compiler technology is needed to make any use of the 
actual value in generating optimal code," I am pretty sure most compilers 
have that for a 2x2 array, including Cray's. I would hope you use such info 
in determining what to do with short loops or array statements over 
dimensions of size 2...

In any case, my point is that while I agree that Van needs to wait for adding 
complex proposals to the standard, I most certainly do not agree with "we 
already have what you need"...cause we don't, as programmers doing these 
kinds of things know from experience.

Best,
Aleks

-- 
Aleksandar Donev, Ph.D.
Lawrence Postdoctoral Fellow @ LLNL
High Performance Computational Materials Science and Chemistry
E-mail: donev1 at llnl.gov
Phone: (925) 424-6816  Fax: (925) 423-0785
Address: P.O.Box 808, L-367, Livermore, CA 94551-9900
Web: http://cherrypit.princeton.edu/donev



More information about the J3 mailing list