[pythran] Re: Compiler troubles on diffusion demo

  • From: serge Guelton <serge.guelton@xxxxxxxxxxxxxxxx>
  • To: pythran@xxxxxxxxxxxxx
  • Date: Thu, 10 Apr 2014 17:12:08 +0200

> #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

Other related posts: