On a machine recorded as Laptop A (a quad-core laptop CPU with two populated…

PHYSICS · Multi-part · Fermi University Physics · Computational Physics · Scientific programming for physicists · High-performance and data-driven computational physics

Scientific Computing for Physicists, Ch Arrays in memory: layout, cost and the data structures of physical problems

Problem

On a machine recorded as Laptop A (a quad-core laptop CPU with two populated DDR4-3200 channels, commit and lockfile as usual), you measure the memory-bandwidth triad np.add(b, c, out=a), one operation with no temporary, on three float64 arrays of N=5×107N = 5\times10^{7} elements each, following twenty measured repeats after warm-up: the median time is 45 ms45\,\mathrm{ms} (interquartile range 2 ms2\,\mathrm{ms}). ((a)) State the bytes the triad must move and estimate the sustained bandwidth βmem\beta_{\rm mem} of Laptop A. ((b)) Using this βmem\beta_{\rm mem}, estimate the lower bound on the time for one step of the explicit two-dimensional diffusion stencil on a 4000×40004000\times4000 grid, assuming perfect cache reuse (one read and one write per grid point). ((c)) The same machine executes one such stencil step with a measured median time of 52 ms52\,\mathrm{ms} (twenty repeats). Give the ratio of the measured time to the lower bound, to one significant figure, and say what the ratio shows.

Browse the problem library