Tight bounds on cache use for stencil operations on rectangular grids

  • Authors:
  • Michael A. Frumkin;Rob F. Van der Wijngaart

  • Affiliations:
  • NASA Ames Research Center, Moffett Field, California;NASA Ames Research Center, Moffett Field, California

  • Venue:
  • Journal of the ACM (JACM)
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

We derive tight bounds on cache misses for evaluation of explicit stencil operators on rectangular grids. Our lower bound is based on the isoperimetric property of the discrete crosspolytope. Our upper bound is based on a good surface-to-volume ratio of a parallelepiped spanned by a reduced basis of the interference lattice of a grid. Measurements show that our algorithm typically reduces the number of cache misses by a factor of three, relative to a compiler optimized code. We show that stencil calculations on grids whose interference lattices have a short vector feature abnormally high numbers of cache misses. We call such grids unfavorable and suggest to avoid these in computations by appropriate padding. By direct measurements on a MIPS R10000 processor we show a good correlation between abnormally high numbers of cache misses and unfavorable three-dimensional grids.