Jeffrey D. Pursel wrote:
>Hello all,
>
>We are developing some software in which it would be nice to group some
>arrays into a derived type. However these arrays will be accessed in
>critical regions of our code and I am therefore concerned about degrading
>performance. A number of questions have come to mind. For example, are
>arrays within a derived type typically stored in array element order?
>
yes.
> Does
>the order in which the arrays are declared within the data type matter?
>
no.
> If
>so, should the array with the largest leading dimension be first?
>
>The leading dimension of these arrays will be modest (~1024) and we will be
>performing vector operations on them. Generally speaking, will compilers on
>high performance (Cray, SGI, IBM) machines be able to vectorize/pipeline
>operations with these arrays?
>
yes. If you find evidence to the contrary, a bug report would be
appropriate.
As is the case with any array (component or otherwise), avoiding the
pointer attribute will help the optimizer. If you just need run-time
sized array components, make them allocatable rather than pointers.
Parameterized derived types (another way to parameterize the sizes of
array components) are new in Fortran 2003, so compiler support for them
will be somewhat less mature.
Another Fortran 2003 feature that can make code written with lots of
derived type components easier to read and maintain is the ASSOCIATE
construct. If you are writing a new code, that might be worth trying.
> While we intend for this code to be portable,
>our target platform is the Cray X1 (so I'm hoping that Bill Long will
>comment).
>
Excellent choice. :)
Cheers,
Bill
>
>Thank you,
>
>Jeffrey D. Pursel
>Riverside Research Institute
>212 502 1706
>
>
--
Bill Long [log in to unmask]
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
|