Re: ELEMENTAL functions and performance



Hi

I'd like to know too -- any chance of you writing some variant codes,
comparing them and posting your results ?

Regards

Mark

On Jul 29, 6:57 pm, deltaquattro <deltaquat...@xxxxxxxxx> wrote:
Hi,

I would like to know if the attribute ELEMENTAL for a function/
subroutine can negatively affect performance or not.

I am going to code a lot of small functions, for things like Jacobi
polynomial evalution, Gauss point generation, etc. etc., to be used in
a "huge" code. I would like the functions to work for scalar as well
as for rank-1 array input/output. I'd prefer to write them as
ELEMENTAL, rather than forcing the user to read/write a scalar into a
rank-1 array of size 1 each time he has to use the subroutine for
scalars.
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?
Thanks,

Best Regards,

deltaquattro

.



Relevant Pages

  • Re: ELEMENTAL functions and performance
    ... subroutine can negatively affect performance or not. ... I would like the functions to work for scalar as well ... as for rank-1 array input/output. ...
    (comp.lang.fortran)
  • Re: ELEMENTAL functions and performance
    ... subroutine can negatively affect performance or not. ... I would like the functions to work for scalar as well ... as for rank-1 array input/output. ... I can't tell what your compiler does, but if you call the ELEMENTAL function on scalars I think it is quite probable that ELEMENTAL or not ELEMENTAL does not matter in this case (except that ELEMENTAL procedures have to be PURE for your point of view). ...
    (comp.lang.fortran)
  • Re: reference to a hash
    ... understand why you have to pass the check_items_for_all subroutine a ... Why can't you just pass it the hash itself... ... Subroutines take arguments in scalar context. ...
    (perl.beginners)
  • Re: Scalar or array argument - How to on MODULE?
    ... program the variable is scalar but the argument, in a subroutine, is ... if not all compilers but it's still an error; ... no chance to catch when files are compiled separately w/ no interface ...
    (comp.lang.fortran)
  • Call sub with substiuted args
    ... My problem is I need to call a subroutine but the number of args can be ... template and capture the data from the template into a scalar and then ...
    (comp.lang.perl)