[Developers] ifndef in DXYDG_guts.h

John Shalf jshalf at lbl.gov
Wed Mar 14 10:10:17 CST 2007


Well, the conditionals caused lots of problems for the vector  
machines when we were trying to get the code running on the Earth  
Simulator a few years ago.  (they get implemented as vector mask  
operations, which are wasteful).  However, I think the X2 may well be  
one of the last vector machines we will see for a while. If we start  
using GPUs or Cell processors (not likely very soon), then branch  
penalties will become something to worry about again.

It is certainly interesting to perform the experiment (perhaps even  
using standalone_BSSN) to ensure that our assumptions about the  
quality of branch-prediction are indeed true.  But the intuition  
about modern branch predictors is probably true (they are pretty  
damned good these days).

-john

On Mar 14, 2007, at 8:56 AM, Ian Hinder wrote:
> 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:
>>> 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...


More information about the Developers mailing list