Re: Strange Performance Hit on 2D-Loop

2011-01-13 Thread Andreas Schäfer
Just for the records: I finally found the issue here. It's a problem of both, alignment and cache thrashing. When using aligned memory (e.g. via posix_memalign()) and using a suitable offset within that memory, the effect goes away. So it's a processor effect, not a compiler issue. :-) Best -Andr

Re: Strange Performance Hit on 2D-Loop

2009-07-09 Thread Andreas Schäfer
On 16:37 Thu 09 Jul , Richard Guenther wrote: > Depends on the GCC version used. First of all > > printAddress(&gridNew[0][0]); > printAddress(&gridOld[0][0]); > > makes the addresses escape and GCC versions other than the > current development trunk think that the malloced address c

Re: Strange Performance Hit on 2D-Loop

2009-07-09 Thread Richard Guenther
On Thu, Jul 9, 2009 at 4:19 PM, Andreas Schäfer wrote: > Hey guys, > > I noticed a strange performance hit in one of our stencil codes, > causing it to run twice as long. > > To nail down the error, I reduced our code to the two attached demo > programs. Basically they take two matrices and average

Strange Performance Hit on 2D-Loop

2009-07-09 Thread Andreas Schäfer
Hey guys, I noticed a strange performance hit in one of our stencil codes, causing it to run twice as long. To nail down the error, I reduced our code to the two attached demo programs. Basically they take two matrices and average each matrix element with its four direct neighbors. Depending on