Re: ELEMENTAL functions and performance



John Harper wrote:
In article <f833019e-602e-4340-9baa-69d753521b35@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
deltaquattro <deltaquattro@xxxxxxxxx> wrote:
Hi,

I would like to know if the attribute ELEMENTAL for a function/
subroutine can negatively affect performance or not.
...
However, sometimes I heard that some "new" features of the language
may have an hit on performance, because they make optimization more
difficult for the compiler. I don't know if this is the case with
ELEMENTAL, however these functions will be called a lot of times, so
it's not a good idea if they are slow. The code will run on parallel
vectorial supercomputers. According to these informations, what would
you suggest me to do?

Try it both ways with a test program, and tell us which is better on
the machine(s) and compiler(s) you used.

-- John Harper, School of Mathematics, Statistics and Computer Science, Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john.harper@xxxxxxxxx phone (+64)(4)463 6780 fax (+64)(4)463 5045

The problem with "functions" is that they can be big or little.
For big ones, calling sequence details tend not to be
important. For little ones, calling sequence time can dominate
function execution time.

So, there's two things to try. Search out the compilers options
for inlining and try it with and without inlining, for computationally
intensive functions and for simple ones.

I think your original post said you were making a package for
others to use. If so, will they be able to compile the package,
or will you give them precompiled .obj and .mod files? They
probably can't get inining with a precompiled versions; having
to recompile your code every time to get the benefit of inlining
is a pain.

*** Hendrickson
.


Quantcast