parkipy.ewald.PerfModel¶
- class parkipy.ewald.PerfModel(
- p2p_time,
- p2g_time,
- fft_time,
- cnv_time,
- ifft_time,
- g2p_time,
- kernel,
- N_out,
- N_in,
- N_grid,
- d_out,
- d_in,
- fft_dim,
- ifft_dim,
- fft_shape,
- cell_size,
- window_P,
- dtype,
- execution_space,
Performance model for an Ewald summation run.
Stores per-stage wall-clock times and computes floating-point operation (FLOP) and memory operation (MOP) count estimates for each stage of the Ewald algorithm: P2P, P2G, FFT, CNV, IFFT, and G2P.
An instance is returned as the second element of the kernel output when
options.return_walltime == True.FLOP counts are device-aware: hardware-specific instruction costs are looked up from an internal table for known GPUs (currently the A100 and GH200). For unrecognised devices all instruction costs default to 1 and a
UserWarningis raised.- Parameters:
p2p_time (dict) – Wall-clock time dict for the P2P (near-field) stage.
p2g_time (dict) – Wall-clock time dict for the P2G (particle-to-grid spreading) stage.
fft_time (dict) – Wall-clock time dict for the forward FFT stage.
cnv_time (dict) – Wall-clock time dict for the convolution (CNV) stage.
ifft_time (dict) – Wall-clock time dict for the inverse FFT stage.
g2p_time (dict) – Wall-clock time dict for the G2P (grid-to-particle interpolation) stage.
kernel (str) – Name of the Ewald kernel (e.g.
'stokes_sl','stokes_comb','laplace'). Used to select the correct FLOP cost model.N_out (int) – Number of target particles.
N_in (int) – Number of source particles.
N_grid (int) – Number of far-field grid points.
d_out (int) – Output dimension (number of components per target).
d_in (int) – Total input dimension, counting source positions, densities, and (where applicable) normal vectors.
fft_dim (int) – Number of components transformed in the forward FFT.
ifft_dim (int) – Number of components transformed in the inverse FFT.
fft_shape (array_like) – Shape of the (upsampled) FFT grid.
cell_size (int) – Near-field cell size used by the P2P stage.
window_P (int) – Window function support size in grid subintervals.
dtype (numpy.dtype) – Floating-point dtype of the input arrays. Used to compute memory operation counts (
itemsizebytes per real element,2 * itemsizeper complex element).execution_space (pykokkos.ExecutionSpace) – Kokkos execution space. Used to determine whether to query the GPU device name for hardware-specific FLOP constants.
Notes
Throughput (FLOP/s) and bandwidth (bytes/s) for each stage can be read from the
__repr__output, or computed directly asperf.flop_<stage> / perf.time_<stage>['tot'].