Ask Your Question
0

MPjobs tool for PSSe runs in Parallel

asked Sep 25 '0

jconto gravatar image

updated Jun 29 '1

I have written a python code, named MPjobs, that allow running as many instances of PSSe as CPU’s in a pc, in other words, runs PSSe in parallel at the process level. It uses pool.apply_async and a dictionary to pass the arguments. This tool is suitable for repetitive studies where the changing variable is known, like during benchmarking models, sensitivity runs or dynamic fault simulations.

[Updated 20210629] You can download the MPjobs tool with a demo set compatible with PSSe v.33, v.34 and v.35 (and python 2.7, v.3.7, v.3.8) from [copy the link into your browser if it does not work by clicking on it]:

At JContogoogledrive, enter the folder "MPjobs PSSe in Parallel" and then select “MPjobsjconto_xxxxx.zip”. An icon on the top-center screen will perform the download.

As it is, MPjobs can be used to parallelize runs from ‘almost’ any application that can run from a DOS window with an input file or line arguments.

Follow the instruction in the read.me file and in the wiki doc to run the demos included.

Comments

Any chance you can give us a live virtual demo of MPjobs and Channels some day?

Type1_bus gravatar imageType1_bus (Sep 26 '0)

Awesome...

mbong gravatar imagembong (Nov 9 '0)

Very cool, thanks for sharing. I may borrow some these concepts and incorporate them into my own tools.

likethevegetable gravatar imagelikethevegetable (Jul 15 '1)

Very nice tool for bulk system simulation

Yunzhi Cheng gravatar imageYunzhi Cheng (Jul 31 '1)

Hi jconto, I notice that for large batches of contingencies the tool starts skipping contingencies or gets stuck (MPAA mode). Is there a way to avoid this? The runs get processed but don’t get started. I’ve included a delay of 20 seconds.

Type1_bus gravatar imageType1_bus (Nov 3 '1)

1 answer

Sort by » oldest newest most voted
0

answered Jul 6 '4

powerengineer gravatar image

updated Jul 11 '4

Hi Jose, I am trying to use the MPjobs tool to run parallel simulations. I downloaded the latest version, followed the instructions to change the PSSE path, and tried to run 1D or 2D scenarios, but I'm getting this error.

I'm using the command mpjobs35 inis\cmld_3d

I get the error: Traceback (most recent call last): File "C:\Users\jsm20\Documents\code\Python\mpjobs.py", line 58, in <module> AttributeError: module 'JCtools' has no attribute 'pyver'

```````````````````````````````````````````

Update after trying the the latest version:

Now, I can see the compiled python file in MPjobs folders (mpjobs_p39x64.pyc), but I still can't run MPjobs. I am using PSSE 35.6 with python 3.9.12.

I tried both methods of using INI file to run simulation with mpjobs35 (it doesn't do anything) and mpjobs35 inis\mpjobs. Whe mtype in ini file is MPP, it gives an error When mtype in ini file is MPAA, it runs the code and loops through 8 scenarios, but it doesn't actually load the psspy to run the situation, so no logs or out files are generated.

running with mtype=MPAA

D:\SimulationCoding\CoSim\PSSE\parallelpsse\MPjobsParallellatest\MPjobsjconto_20240704>mpjobs35 inis\mpjobs inis\mpjobs.ini

```````````````````````````````````````````

                   MPjobs                  v.20230809
       python parallel processing engine

Copyright - Jos‚ Conto, Jan. 2015 - All rights reserved

```````````````````````````````````````````

processing MPAA run 1, P1faultsSB1b152 inis\mpjobs.ini 0 processing MPAA run 2, P1faultsSB1b153 0 processing MPAA run 3, P1faultsSB2b154 0 processing MPAA run 4, P1faultsSB2b205 0 processing MPAA run 5, P1faultsSB3b201 0 processing MPAA run 6, P1faultsSB3b204 0 processing MPAA run 7, P1faultsSB3b205 0 processing MPAA run 8, P1faultsSB4b202 0

--- mpjobs [MPAA] finished in 8.11 seconds ---

```````````````````````````````````````````

Here running with mtype = MPP

D:\SimulationCoding\CoSim\PSSE\parallelpsse\MPjobsParallellatest\MPjobsjconto_20240704>mpjobs35 inis\mpjobs inis\mpjobs.ini

```````````````````````````````````````````

                   MPjobs                  v.20230809
       python parallel processing engine

Copyright - Jos‚ Conto, Jan. 2015 - All rights reserved

```````````````````````````````````````````

Processing MPP group 0

Processing MPP group 1 inis\mpjobs.ini inis\mpjobs.ini 0 Process Process-1: Traceback (most recent call last): File "C:\Users\msarwar\AppData\Local\Programs\Python\Python39\lib\multiprocessing\process.py", line 315, in bootstrap self.run() File "C:\Users\msarwar\AppData\Local\Programs\Python\Python39\lib\multiprocessing\process.py", line 108, in run self.target(self._args, *self.kwargs) File "C:\Users\jsm20\Documents\code\Python\mpjobs.py", line 116, in runmpp File "<string>", line 30, in <module> File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'psse35' Traceback (most recent call last): File "C:\Users\jsm20\Documents\code\Python\mpjobs.py", line 284, in <module> File "C:\Users\jsm20\Documents\code\Python\mpjobs.py", line 221, in main File "C:\Users\msarwar\AppData\Local\Programs\Python\Python39\lib\multiprocessing\queues.py", line 103, in get res = self.recvbytes() File "C:\Users\msarwar\AppData\Local\Programs\Python\Python39\lib\multiprocessing\connection.py ... (more)

link

Comments

Thanks for trying MPjobs. I have updated the files and clean some of the scripts for python 3.9 (all dev was done in python 2.7!) Please download it again, tested and let me know your experience with it.

jconto gravatar imagejconto (Jul 11 '4)

Hi Jose, Thank you for updating the files. Now, I can see the compiled python file in MPjobs folders (mpjobs_p39x64.pyc), but I still can't run MPjobs. I am using PSSE 35.6 with python 3.9.12. I've updated my original comment as comments have limited length. Thanks..

powerengineer gravatar imagepowerengineer (Jul 11 '4)

In error messages:"ModuleNotFoundError: No module named 'psse35' " Q0: full or student version? Q1: did you open a DOS window using the link provided (__dos3539)? Q2: show PSSe35.exe path Q3: Open a DOS window and enter "set", show value for "psspypath", "path" content, is psse path on it?

jconto gravatar imagejconto (Jul 12 '4)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: Sep 25 '0

Seen: 1,105 times

Last updated: Jul 11 '24