kicad2ems.mom25d.threads

mom25d.threads - the solvers' threads: the BLAS's and the compiled core's OpenMP on the
fast physical cores (fast.py's, split out: R-F3)
kicad2ems.mom25d.threads.cap_blas_threads()[source]
Once: the LU's BLAS (OpenBLAS / MKL, through threadpoolctl) on the fast
physical cores only. A BLAS LU splits each step evenly over its threads and
waits for the slowest: on an i7-13700K (8 P-cores with their hyperthreads, 8
E-cores) its 24 threads made rf_stubnotch's 1.5k-unknown LU 0.62 s against
0.047 s on 8 (a whole kicad2ems run 10.8 s against 3.3 s), as fast at 5k
unknowns. MOM25D_BLAS_THREADS (or OPENBLAS_NUM_THREADS / MKL_NUM_THREADS)
sets it instead; without threadpoolctl nothing is changed.
kicad2ems.mom25d.threads.cap_core_threads()[source]
Once in each thread: the compiled core's OpenMP (the matrix fill, the
near-field correction) on the fast physical cores only, as the BLAS. Its
schedule splits the rows over every thread, and on an i7-13700K the E-cores
and the hyperthreads held the fill back: antenna_vivaldi's (21.9k unknowns)
took 1.5-3.1 s a frequency on 24 threads, 0.87 s on 8 and 0.79 s on 16, the
whole fresh solve 8.5 s against 6.9-7.1 s. Per thread: libgomp keeps
omp_set_num_threads as the calling thread's own, so a cap set once in the
main thread left a solve in another (kicad2ems's --solver-jobs, a window's
worker) on all 24 CPUs. MOM25D_OMP_THREADS (or OMP_NUM_THREADS) sets it
instead; without threadpoolctl nothing is changed.
kicad2ems.mom25d.threads.fast_cores()[source]
The physical cores of the fastest class (a hybrid CPU's P-cores; every
core of the others) among the CPUs this process may use: emsdev's, which the
other solvers ask too (mom25d had its own rule, 0.9 of the top clock over
every CPU of the machine, affinity ignored); None where emsdev cannot
tell.