1

Use multiple Processor for PSSE Dynamics Run

Is there an easy way via python scripting to use multiple cores on a single computer for PSSE Dynamics Run. It is taking too long to complete dynamics runs, and I suspect the default system is only using a single core. Any help will be appreciated.

ddhungana's avatar
11
ddhungana
asked 2019-08-26 13:06:01 -0500
edit flag offensive 0 remove flag close merge delete

Comments

Thank you all for your responses. This is adequate information for me to get started.

ddhungana's avatar ddhungana (2019-08-29 10:05:48 -0500) edit
add a comment see more comments

3 Answers

1

Python also has the ability to split work across multiple cores. Some sample code below on how we run multiple dynamic simulations on the same machine in parallel. Be careful on how many workers you add. The problem can become I/O with all the data from the multiple runs and running 4 in parallel will not be 400% faster than running 1. You get a diminishing rate of return the more cores you add. With this code, you can easily play around with how many cores you want to use and find the optimal number for your machine.

Sample code:

import multiprocessing
from multiprocessing import Process
from multiprocessing import Pool

workers = multiprocessing.cpu_count() - 1 # Run on N-1 cores on local machine
p = Pool(workers)
p.map(run_test, tests) # run_test is a function you call in parallel, tests is an array of data that gets passed to the function (could be case name, snapshot, fault name, etc...)

def run_test(test):
    # Run you stability run here...
bronco7TX's avatar
9
bronco7TX
answered 2019-08-29 08:11:46 -0500, updated 2019-08-29 08:14:28 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
0

Check the post "Python Parallel Dynamics Simulations", with a link to my python tool MPjobs.

jconto's avatar
2.9k
jconto
answered 2019-08-26 13:34:54 -0500
edit flag offensive 0 remove flag delete link

Comments

Hi jconto, I'm trying to do a 2D run with two cases and 1 contingency. Would you know why instead of running the simulations in parallel, it waits for the first one to finish, and then runs the second simulation. Your help would be appreciated!

Type1_bus's avatar Type1_bus (2020-09-22 00:22:03 -0500) edit

Usually the OS control what task goes to what CPU. In PSSe dynamic runs of small networks, the communication needs imposed by the OS usually are bigger or comparable with the actual running time. Parallel time gains are expected for large system or longer run times. BTW, your scenario seems a 1D.

jconto's avatar jconto (2020-09-22 10:56:29 -0500) edit

Thanks jconto! I was assuming the 1D.ini file will not let me run it if there are 2 cases (1D only allows 1 case and multiple contingencies?). Am I wrong?

Type1_bus's avatar Type1_bus (2020-09-25 12:38:01 -0500) edit

1D studies allows 1 independent variable (Xvar) in a study, like multiple contingencies, but everything else the same or multiple cases with same contingency. For multiple cases, multiple contingencies, use the 2D.ini example, where 2D studies allows for 2 independent variables (Xvar, Yvar).

jconto's avatar jconto (2020-09-25 13:10:46 -0500) edit

Thanks jconto! I'm now using multiple cases and contingencies using mp2D.ini. I'm running dynamic simulations for large networks and still noticing that the runs are happening one by one as opposed to running in parallel. Do you think I'm missing something? Your help is much appreciated!

Type1_bus's avatar Type1_bus (2020-09-26 07:47:07 -0500) edit
add a comment see more comments
0

You may know this already, but Siemens sells a "Parallel Dynamics Module," which I'm sure will fit your needs. There is a 1-month free trial available by the looks of it. I'm sure it's quite expensive after that.

I couldn't tell you if there's a good way of parallelizing a dynamics run with Python.

acd1's avatar
63
acd1
answered 2019-08-26 13:28:36 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Login/Signup to Answer