Is there a way to force ngspice to use 4 cores during simulations, currently it uses only one when I invoke it from Xschem?
m
Matthew Guthaus
12/04/2021, 6:06 PM
You need to create a .spiceinit file with this in it:
set num_threads=4
👍 2
d
Domagoj Tomić
12/04/2021, 8:25 PM
Thank you, that worked. It uses all 4 cores but the utilization is ~40% per core for the first three cores and ~90% of the 4th. This is when I set it for 4 threads (so it has improved two times roughly). It is ~40% per core for all 4 cores when I set it to 8 threads (as viewed by htop). Is that expected, why is it not utilizing 100%?
m
Matthew Guthaus
12/04/2021, 8:49 PM
Parallelizing code is hard! 🙂
The things that can be parallelized are:
1. BSIM model evalution
2. Solving the linear system between each time steep
#1 scales well if you have a lot of devices, but you will then be bottlenecked by #2.
#2 depends on how interconnected your circuit is whether it can be divided into parallel problems. I'm not sure if/how well ngpisce does this but Xyce does a really good job.
👍 1
I'm guessing the 40% is from the BSIM and then one core is used for #2
👍 1
There's also overhead to share the results in memory