Electronics > PCB/EDA/CAD

OrCAD Capture+PSpice: .OPTIONS and number of CPU threads

(1/3) > >>

hanakp:
Hello, in my workplace, we're using Orcad Capture to draw simulation schematics and PSpice to run them. We have rather old version 16.6 (upgrades are pricey) and I noticed it uses only 4 CPU threads during computation. That slows things down (even free LTspice can use up to 20 threads now). According to this document, the number of threads can be set via .OPTIONS THREADS command. I have two questions about it:

1. How I can actually use the .OPTION command in Capture? I've never done it before. Is it somewhere in the GUI menus? Or is there a special part like PARAM? Or do I have to manually edit the Spice file? And if so, how?

2. The document above says "Maximum 4 threads can be used for regular PSpice Licenses". But that document is for old 16.6 version. Is the limit higher in newer versions? Or do we need to buy some special (and presumably expensive) separate license to unlock more threads? I couldn't find this information anywhere.

Thanks!

hanakp:
I solved the problem, but the results were contrary to my expectations.

Short version: Orcad PSpice versions 16.6 and 17.2 are very poorly optimized for multi-CPU/multi-thread PCs and run the fastest on 1 thread only. Enabling more than 1 thread slows down transient simulations significantly.

Long version: I discussed it with a colleague from a different department who has newer PSpice 17.2. In it, the number of threads can be changed from the GUI, it's hidden in Edit Simulation Profile -> Options -> Number of Threads. It's set to 0 by default, which means PSpice employs half the threads available in the PC. In my case it was 12, beause I currently work on AMD Threadripper 2920X (12C/24T). But when I limited it to 1 thread, transient simulations suddenly run more than twice as fast!! Setting it to 2 or 8 threads doesn't make much difference, it's almost as slow as default 12. It has no effect on AC simulations, they always take the same time. According to the colleague, HSpice simulator and Intel CPUs also suffer from this problem. Apparently, Cadence haven't even touched the Spice core in the last 15 years or so - even free LTspice is light-years ahead when it comes to multi-threading.

Unfortunately, we found no way to how to set the number of threads globally in PSpice, you have to change it manually for every single new project. But the colleague created library CUSTOM.OLB which contains a special part OPT_CMD. You can place it into Capture schematic and it passes .OPTIONS to the simulator. I'm attaching it below, it should work with all .OPTIONS commands PSpice recognizes. Enter only one command per part, but theoretically you can place as many OPT_CMDs as you want. For example, the ACCT command appends CPU, memory, runtime and other statistics to the resulting .OUT file. That's how I measured the runtime.

Which brings me to another question: does anybody have the latest PSpice 22? And if so, did they improve its multithreading?

Uky:
I know that there has been comments in the world of simulations that AMD CPU's (like Threadrippers) used for simulation sometimes does the job slower that the corresponding Intel processors due to the fact that the many simulation softwares are compiled using Intel code libraries. So I got puzzled when you write that also Intel CPU exhibits the same behavior.

I also know that some softwares, like CST (3D EM-simulator) does not "like" hyperthreading (two threads per core) for some simulation setups. The software warns about it when starting a simulation and turns off the hyperthreading and instead relies only on multiple "true" cores.

If Cadence PSpice simulator can make full use of many "true" cores, I do not know. Did you disable the hyperthreading in the BIOS to see if that was a part of the problem?

hanakp:
I'm a bit wary to disable HT on my current machine, Windows sometimes doesn't take such BIOS changes well. But I'll look which PSpice version I have on my old PC, I think it has an Intel CPU.

In the meantime, I found out another odd thing: you really have to set the number of threads in Orcad/PSpice and not externally. You see, back in olden times, when HT Pentium 4 and Athlon X2 were introduced, lots of programs refused to run properly on them, particularly games. You had to force such programs to use only one CPU, which could be done by changing "Processor affinity" in Windows Task manager. There were utilites that could automate this, I'd been using Process Lasso. But that doesn't work on PSpice - when I change the affinity for SimSrvr.exe to one CPU only, the simulation still takes over 2 times as long.

Warhawk:

--- Quote from: hanakp on March 16, 2023, 12:11:58 pm ---Hello, in my workplace, we're using Orcad Capture to draw simulation schematics and PSpice to run them. We have rather old version 16.6 (upgrades are pricey) and I noticed it uses only 4 CPU threads during computation. That slows things down (even free LTspice can use up to 20 threads now). According to this document, the number of threads can be set via .OPTIONS THREADS command. I have two questions about it:

1. How I can actually use the .OPTION command in Capture? I've never done it before. Is it somewhere in the GUI menus? Or is there a special part like PARAM? Or do I have to manually edit the Spice file? And if so, how?

2. The document above says "Maximum 4 threads can be used for regular PSpice Licenses". But that document is for old 16.6 version. Is the limit higher in newer versions? Or do we need to buy some special (and presumably expensive) separate license to unlock more threads? I couldn't find this information anywhere.

Thanks!

--- End quote ---

Ahoj Kolego,

you can pass the option from Capture to pSpice netlist using @pspice: clause. See the picture attached. For some reason, this is nearly impossible to find online. People simply don't know it. I struggled with it about two months ago.

The attached capture diagram generates this netlist:

--- Code: ---* source PSPICE-LOGIC
* PSpice Text Block on SCHEMATIC1 PAGE1
.OPTION TRTOL=10
***
X_U1         N00327 N00186 N00119 0 SN74LVC1G04
V_V1         N00119 0 3.3
R_R1         0 N00327  1Meg TC=0,0
V_V2         N00186 0 
+PULSE 0 3.3 1u 100p 100p 30u 50u


--- End code ---

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod