Re: amber-developers: ene and ener array mess in sander

From: Scott Brozell <sbrozell.scripps.edu>
Date: Sun, 23 Nov 2008 17:56:34 -0800 (PST)

Hi,

Yes, there is no inline keyword in Fortran (even 2003 standard)
unlike in C++ and C99. However, any decent compiler turns on the
interprocedural analyzer (IPA) at some not extremely aggressive
optimization level. There are usually additional controls
that enable the ipa at lower -O's, specify the size of inlinable
routines, or name specific routines to be inlined.
Most compilers nowadays are decent. You can probably find one
that chokes on trivial inlining (like get/set), but many Fortran
compilers have the same backend as C++/C and thus already have
almost all the necessary stuff to inline.

Scott


On Sun, 23 Nov 2008, Robert Duke wrote:

> A lot of s/w engineering is a matter
> of taste and religion; I agree in general that clarity is a really really good
> thing, though :-) I do think that get()/set() routines here would be
> overkill, though, and I am not aware of an inlining standard for f90/95 (maybe
> I missed something, but I did just drag down the iso/ansi reference). For
> c++, this is a no-brainer, given that you have a situation where you want to
> limit the modification scope.

> > On sun, 23 Nov 2008, scott:
> >
> > The main advantages of get/set seemed to be
> > an improved chance of correctness and easier debugging:
> > these routines would be a good spot for detailed verification
> > with special test cases, tracing, and breakpoints.
> > I also thought get/set might be good locations for investigating race
> > conditions which i thought we might be having with psander.
> >
> > The main disadvantage of get/set seemed to be the anti-computer-science
> > bent of some in the amber community. I figured that they wouldnt be
> > convinced by a simple statement that any decent compiler would inline
> > away those get/set routines. However, consistently chosen get/set names
> > could be easily globally replaced into array references.
> > (And globally re-replaced if the debugging need arised.)
Received on Fri Dec 05 2008 - 16:30:20 PST
Custom Search