Table of Contents
Memory bandwidth (1D FDTD)
Memory bandwidth can limit updates that move many array values for little arithmetic. The magnetic loop makes this balance visible:
for (size_t k = 0; k < width - 1; k++) { Hy[k] = Ch1[k] * Hy[k] + Ch2[k] * (Ez[k + 1] - Ez[k]); }
Each iteration reads the old $H_y$ value, two neighboring $E_z$ values, and two coefficients, then writes $H_y$. The electric loop has a similar pattern. Consecutive iterations can reuse electric samples and cache lines, so counting expressions is not a measurement of DRAM bytes.
When the arrays exceed cache capacity, more traffic reaches main memory. Adding threads increases combined demand until shared resources can limit throughput. The benchmark measures elapsed time; bandwidth saturation is an interpretation to investigate with counters, rather than a directly measured output.
Source: fdtd_ez_kernels.c.
