OrCAD Capture+PSpice: .OPTIONS and number of CPU threads - Page 1
Forum section: electronics / general

author: hanakp
author_rank: Regular Contributor
timestamp: March 16, 2023, 12:11:58 pm
content: 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 tothis 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!

author: hanakp
author_rank: Regular Contributor
timestamp: March 29, 2023, 12:34:27 pm
content: 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?

author: Uky
author_rank: Regular Contributor
timestamp: March 30, 2023, 02:40:55 pm
content: 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?

author: hanakp
author_rank: Regular Contributor
timestamp: March 31, 2023, 09:58:10 am
content: 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 usingProcess 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.

author: Warhawk
author_rank: Frequent Contributor
timestamp: March 31, 2023, 03:18:49 pm
content: Quote from: hanakp on March 16, 2023, 12:11:58 pmAhoj 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 SN74LVC1G04V_V1 N00119 0 3.3R_R1 0 N00327 1Meg TC=0,0V_V2 N00186 0+PULSE 0 3.3 1u 100p 100p 30u 50u

author: hanakp
author_rank: Regular Contributor
timestamp: April 20, 2023, 11:00:57 am
content: @Warhawk: thanks, it really works! Much more practical than the special library part!In the meantime, I found my old Intel PC, but of course I transferred PSpice license to the new PC, so I can't get past the splash screen. The joys of some commercial software... So I tried disabling multithreading in BIOS on my current Threadripper machine as @Uky suggested, but nothing changed - enabling more than 1 thread causes transient simulations take over 2 times as long to complete.

author: Warhawk
author_rank: Frequent Contributor
timestamp: April 20, 2023, 07:23:02 pm
content: Can you try "set afinity" option in the task manager? I run windows 11. It looks different.

author: Uky
author_rank: Regular Contributor
timestamp: April 20, 2023, 08:22:36 pm
content: I attended a Cadence seminar the other day and asked about the behavior of pSPice.Another gentleman in the audience had the exact same experience with some simulationsbut not with other.The answer we were given was that:When doing simulations with a large number of nodes, multicores are computing different parts of the schematic.Simulation tasks using a small number of nodes does not benefit at all from multicores.(When I have had problems with a locked splash-screens, there is often a dialog box hidden behind itwaiting for a response in order to close and letting the software invocation proceed.I have fixed that by using Alt-Tab until the dialog box appears and a response could be entered be it clicking OK or whatever...)

author: hanakp
author_rank: Regular Contributor
timestamp: April 21, 2023, 09:27:38 am
content: @Warhawk: as I wrote earlier, changing the affinity in W10 has no effect. You really need to configure the threads from within Orcad/PSpice.@Uky: Thanks for the info, but... it doesn't explain why PSpice runsslowerfor low node numbers (my test schematic had only 108 of them). Did they mention what's considered "large number of nodes"? Thousands? More?

author: Warhawk
author_rank: Frequent Contributor
timestamp: April 21, 2023, 09:48:16 am
content: QuoteI am sorry, I overlooked it

author: Uky
author_rank: Regular Contributor
timestamp: April 21, 2023, 12:34:34 pm
content: ... It was a seminar about upcoming releases, the benefits and adaptation to PLM-systems etc.pSpice was mentioned as a method for advanced analysis (the license that I do not have) of thermaland other issues. During Q&A the multi-core problem came up but no details were given.I myself do most of my simulations in the frequency domain so I felt that I wasnot qualified to ask detailed questions regarding pSpice...I suggest rising the question in the Cadence User forum. No need to have a maintenance contract.Registering is free.

author: alager
author_rank: Newbie
timestamp: January 31, 2024, 11:13:40 pm
content: @Warhawk I'm a newb on options in Orcad. Do you just use the "Place Text" and put in@pspice: .OPTIONS THREADS=1In LTSpice, there are two input options, one for text and one for .options, that's why I ask.

author: Warhawk
author_rank: Frequent Contributor
timestamp: February 05, 2024, 08:17:02 pm
content: Hi, yes, this is just text. You can try to put there some rubbish after @pspice: to check if this results in error when running the simulation.