Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Global array operations: a performance hit?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
glen herrmannsfeldt  
View profile  
 More options Jun 18 2008, 6:00 pm
Newsgroups: comp.lang.fortran
From: glen herrmannsfeldt <g...@ugcs.caltech.edu>
Date: Wed, 18 Jun 2008 14:00:39 -0800
Local: Wed, Jun 18 2008 6:00 pm
Subject: Re: Global array operations: a performance hit?
Dennis Wassel wrote:

(snip)

> Is (compiler) optimisation of array operations that much of a
> nontrivial task or just something that nobody has come around to
> doing, yet? Judging from their mailing list, gfortran seems to have
> many construction sites and a number of them apparently with higher
> priorities.

If you do exactly the same thing in both cases, the compiler
should do pretty well, except in cases that modify the source array.
There are cases where you know that no array elements are used
after they are modified (using DO loops), but the compiler doesn't
(using array expressions).

Using vector subscripts as an example, say you have arrays X and Y,
both dimensioned N, where X has a permutation of the numbers from
1 to N.

       DO I=1,N
          Y(I)=Y(X(I))
       ENDDO

reorders Y based on the permutation, where you know that
the values in X are unique.

       Y=Y(X)

does it using vector subscripts, but the compiler does not
know that the values are unique, so a temporary array is
needed.  If you read in X from a file, there is no way
that the compiler could possibly know the values are unique.
If you generated X directly, it is unlikely that even the
best optimizer would figure it out.

-- glen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.