Table of Contents
Benchmarking (1D FDTD)
Benchmarking measures the time needed to advance a fixed simulation. FDTD OpenMP's benchmark uses a Gaussian source and a 20-cell PML at each end, comparing serial execution with OpenMP thread counts from one up to the selected maximum.
make bench runs the sizes, step count, and repetitions configured by BENCH_SIZES, BENCH_NSTEPS, and BENCH_REPEAT in the Makefile. It writes results to results/benchmark.csv and generates performance plots. A smaller measurement can be run directly after make build:
$ dist/bin/benchmark \ --width=10000 \ --time-steps=500 \ --max-threads=4 \ --repeat=5 \ benchmark.csv
Before measuring each configuration, the program repeatedly runs the simulation for at least 0.1 seconds. Each timed run starts with reset fields and time; the reset itself is outside the timer. Timing uses omp_get_wtime().
The CSV records acceleration mode, thread count, grid width, steps, repetition index, and elapsed seconds. The plotting script uses medians across repetitions. Keep the build and simulation parameters consistent when comparing speedup between configurations.
