[pythran] Re: Compiler troubles on diffusion demo

  • From: Ian Ozsvald <ian@xxxxxxxxxxxxxx>
  • To: pythran <pythran@xxxxxxxxxxxxx>
  • Date: Sat, 12 Apr 2014 21:57:50 +0100

Hi Serge. I sent you a copy of the memory bug - it does indeed look
like the case you mentioned.

Re. the laplacian - fair enough, I didn't profile it so I wasn't sure.

I have confirmed that the Julia set demo I have works almost as fast
as my best Cython result (single threaded and with omp), so that's in
the book too. I'm very curious about the heat diffusion demo in my
other message, if I can understand why pythran is so fast on that demo
compared to cython/numba, that'd be very useful to discuss in the
book. Hopefully you'll tell me the magic is due to clever AST
expansions?

Ian.

On 10 April 2014 16:12, serge Guelton <serge.guelton@xxxxxxxxxxxxxxxx> wrote:
>> #pythran export evolve(float64[][], float, float64[][])
>> def evolve(grid, dt, new_grid):
>>     D = 1
>>     lap = laplacian(grid)
>>
>>     chunk_size = grid.shape[0] // 8
>>     # openmp the following loop
>>     "omp parallel for shared(grid, new_grid, dt, D, lap)"
>>     for i in xrange(0, grid.shape[0], chunk_size):
>>         j = min(i+chunk_size, grid.shape[0])
>>         new_grid[i:j, :] = grid[i:j, :] + dt * D * lap[i:j, :]
>>     return new_grid
>
> After a few benchmarks : most of the time is spent in laplacian
>



-- 
Ian Ozsvald (A.I. researcher)
ian@xxxxxxxxxxxxxx

http://IanOzsvald.com
http://MorConsulting.com/
http://Annotate.IO
http://SocialTiesApp.com/
http://TheScreencastingHandbook.com
http://FivePoundApp.com/
http://twitter.com/IanOzsvald
http://ShowMeDo.com

Other related posts: