matthuszagh / pyems

High-level python interface to OpenEMS with automatic mesh generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Limit threads in simulation

dom11990 opened this issue · comments

Is it possible to limit the number of threads through your interface? The python openems interface has this functionality in the simulation "run" call. Without it, my simulation runs painfully slow. Generally, oems recommends running on two threads anyway so perhaps it would be useful to set this as the default?

http://www.openems.de/forum/viewtopic.php?f=3&t=137

I added this in 625dddb. You can specify threads with the threads argument to Simulation.run. It uses the exact same values as OpenEMS, so if you want 2 threads you can pass threads=2. I've left 0 as the default to match the openems api for the time being, but I may change that to 2 in the future. Thanks for posting that forum topic, btw. I hadn't seen that before.

It's a very simple change so I haven't actually tested it yet. Let me know if you run into any issues.

Closing. Feel free to reopen if that didn't work for you.