simpy icon indicating copy to clipboard operation
simpy copied to clipboard

Support executing multiple process in parallel

Open chinnikrishna opened this issue 5 years ago • 3 comments

Hi, Is there support to execute multiple process within same environment in parallel? If there is no support can you outline what it takes to enable such a support? Thanks

chinnikrishna avatar Aug 21 '19 21:08 chinnikrishna

Hi,

Please take a look at this example: https://simpy.readthedocs.io/en/latest/examples/process_communication.html

The last part features 3 processes: one message_generator, and two message_consumer.

cristiklein avatar Aug 22 '19 08:08 cristiklein

I am sorry I was not clear. Is there someway to execute two different process on two different processors? For example use python multiprocessing and offload that process to a different core (I did follow the parallel python tutorial here https://pythonhosted.org/SimPy/Manuals/Interfacing/ParallelSimPy/SimPyPP.html but we want find module listing in our infrastructure hard) Can you suggest any alternatives based on new python multiprocessing module

chinnikrishna avatar Aug 22 '19 18:08 chinnikrishna

If you want to run the same simulation code with multiple parameters, then you can use the shell to run them in parallel:

./simulate --seed 1 &
./simulate --seed 2 &
...
wait

I never needed to parallelize "within" simulation.

Hope it helps.

On Thu, 22 Aug 2019, 20:18 ChinniKrishna Kothapalli, < [email protected]> wrote:

I am sorry I was not clear. Is there someway to execute two different process on two different processors? For example use python multiprocessing and offload that process to a different core (I did follow the parallel python tutorial here https://pythonhosted.org/SimPy/Manuals/Interfacing/ParallelSimPy/SimPyPP.html but we want find module listing in our infrastructure hard) Can you suggest any alternatives based on new python multiprocessing module

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cristiklein/simpy/issues/5?email_source=notifications&email_token=AAMVPIMSEOFSAZBWGS4V4XDQF3J6JA5CNFSM4IOOKVZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD456NZY#issuecomment-524019431, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMVPILGB274ROSYGHIB3HTQF3J6JANCNFSM4IOOKVZA .

cristiklein avatar Aug 24 '19 08:08 cristiklein