Skip to content
ketch edited this page Apr 18, 2011 · 3 revisions

Rewriting arrays for interleaved storage

Currently in two space dimensions, for example, the main solution array in classic Clawpack is dimensioned as q(1:meqn, 1-mbc:mx+mbc, 1-mbc:my+mbc), with the index for the component of the system first, followed by (i,j) for the location in the grid. Because of the way Fortran stores arrays, this means that the memory stride between q(1,i,j) and q(2,i,j) for example is (mx+2*mbc) * (my+2*mbc), leading to inefficient cache performance.

The plan is to revamp all of Clawpack so that this array will be dimensioned as q(1-mbc:mx+mbc, 1-mbc:my+mbc, 1:meqn), with analogous changes to the aux arrays. New versions of PyClaw, PetClaw, and the Python visualization routines (Visclaw) have already been written in this way. Several of the 'Classic' routines and many of the Riemann solvers have been updated as well.

Clone this wiki locally