[Developers] ifndef in DXYDG_guts.h

Ian Hinder hinder at gravity.psu.edu
Wed Mar 14 09:56:04 CST 2007


Erik Schnetter wrote:
> On Mar 14, 2007, at 10:15:42, Ian Hinder wrote:
> 
>> Erik Schnetter wrote:
>>> On Mar 14, 2007, at 09:20:01, Erik Schnetter wrote:
>>>
>>>> On Mar 13, 2007, at 18:05:01, jtao at cct.lsu.edu wrote:
>>>>
>>>>> I am also concerned about the usage of the spatial order
>>>>> parameter in the loops. Shouldn't it be better to define the
>>>>> order of spatial derivatives with a macro and keep the same
>>>>> interface for all the derivatives ? Conditional statments
>>>>> will not appear in the loops and it is still easy to
>>>>> go to other orders.
>>>
>>> I have heard that Penn State uses Kranc
>>> <http://numrel.aei.mpg.de/Research/Kranc/> to generate code
>>> automatically.  I have heard that they generate different routines for
>>> each spatial differencing order.  This still allows switching at run
>>> time (since several routines are present), but allows each routine to be
>>> optimised independently.
>>
>> Indeed, however this was done based on the *assumption* that having an
>> if statement in the inner loop would be expensive.  I suspect that it
>> might be possible to add such a statement without incurring a
>> performance penalty (for the reasons Erik stated in his previous email).
>>  It is on my list of things to try, as it would make the code (both the
>> script, and the generated code) a lot cleaner.
> 
> *assumption*: See "root of all evil", aka "premature optimisation".

Agreed, though in my defense, it was also easier to do it this way (a
change in the user script) than to modify Kranc at the time...

-- 
Ian Hinder
hinder at gravity.psu.edu
http://www.gravity.psu.edu/~hinder


More information about the Developers mailing list