LTSpice simulates for an hour, CPU only20-30% - Page 1
Forum section: electronics / projects

author: alager
author_rank: Newbie
timestamp: February 08, 2019, 05:26:51 pm
content: I'm simulating the sample circuit from Linear Tech for the LT3748. It takes a while to simulate, which is common for a switcher, I get that. However, it seems like more computing resources could be used, and I'm not sure if there is something I need to tweak in order for that to happen.I have an quad core i7 with hyperthreading, so 4 virtual cores as well (8 in total). However it seems like only 1 core is being utilized. I was under the impression that since version 4, this was multi threaded.I've attached my LTSpice settings and the CPU performance graphs. It can also be seen from the summaries, that it doesn't appear that the disk or ram are limiting anything either.Any tips on getting LTspice to utilize more cores?

author: edgaras006
author_rank: Contributor
timestamp: February 08, 2019, 05:43:18 pm
content: It looks like a single threaded operation for me. My i7-920 performs similarly with single threaded apps.

author: iMo
author_rank: Super Contributor
timestamp: February 08, 2019, 05:49:15 pm
content: The original LT3748 fixture simulates 15secs here (2.5cores active out of 4, 50% aver util of the 4 cores).

author: alager
author_rank: Newbie
timestamp: February 08, 2019, 06:21:59 pm
content: So a few things I've changed from the original:1) transformer coupling 1 => 0.9812) added flyback diode and zener to clamp ringing.3) increased sim time from 3ms to 10msI know that number 1 is pretty big, but again, I'm only using one core at near 100%. In fact, when I change the coupling back to 1, then all my cores are sitting at <40%.More testing: Not sure why I didn't try this earlier, but watching the cpu graph when I stop the simulation has all cores drop to about 6%. So I guess it is using all cores to some extent, just not 100%.Maybe it's a non issue, just wish it were faster.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 08, 2019, 08:15:09 pm
content: Starting from the LT3748's test fixture and just lowering the coupling coefficient from 1 to 0.98 is enough to make the simulation very slow compared to the original test fixture (which only takes a few seconds). This is probably due to the solver taking many more steps to converge in this case.On my Core i7-5930K (6 cores/12 threads), it uses an average of 16% CPU in both cases on average during this simulation, which is still twice what I'd get with only one thread fully utilized (so a single-thread solver). It definitely IS multithreaded, but it's not particularly efficient in optimizing the use of several threads. Efficiently multi-threading a Spice-based solver is tough, as there is necessarily many dependencies between the blocks you can run in parallel, so each thread is likely to be waiting for the result of other threads for a significant portion of its own time.You can try the "alternate" solver in options, or try a different integration method. You can also play with the tolerance parameters (set them a little higher), so the simulation time will be shorter but at the expense of accuracy. But there is definitely nothing inherently wrong with your setup explaining that. It's just the way LTSpice works. And whereas it performs better than single-threaded, it's not the best out there in terms of performance, but it's free. Cadence Spectre, for instance, is way faster, but it's very expensive. If anyone knows of a free or even not too expensive Spice-based simulator that is faster than LTSpice, I'm interested. (ngspice is definitely not faster in typical use.)

author: 3roomlab
author_rank: Frequent Contributor
timestamp: February 08, 2019, 08:56:05 pm
content: Quote from: alager on February 08, 2019, 05:26:51 pmassuming there is nothing secret, can i try your file? lets see if my PC does the same speed?edit :this filehttps://www.analog.com/media/en/simulation-models/LTspice-demo-circuits/LT8309_DC1961A_TA02.asctakes 122s on a i5-3320M underclocked 2.6Ghz @ 11watts on 2 cores (LTspice 4.2). simulation load is 100% on both cores. the simulation is working alongside about 26 other open windows/appssometimes I think, changes in component values makes the simulation inefficient, and takes years to complete.

author: alager
author_rank: Newbie
timestamp: February 09, 2019, 12:09:57 am
content: @3roomlab I ran that simulation, it takes about the same time as yours, and consumes about 65%-70% cpu across all 8 cores.

author: 3roomlab
author_rank: Frequent Contributor
timestamp: February 09, 2019, 12:40:00 am
content: .option method =gear.option TRTOL = 7.option SSTOL =1utime 116ssame as above, affinity = 1 core (taskman tweak)time 144s (power = 9w, 100% on 1 core).option method =trap.option TRTOL = 7.option SSTOL =1utime 134sedit : maybe you could see if your CPU is temperature limited as a secondary measure (heatsink crooked?)