NetPyNE hanging with MPI

130 views
Skip to first unread message

Chris Fink

unread,
Jul 15, 2022, 2:19:44 PM7/15/22
to NetPyNE Q&A forum
I am just starting out with Netpyne (though I have used NEURON for quite some time). I just installed NetPyNE on my Windows machine, and I successfully ran tut1.py in serial (from http://www.netpyne.org/tutorial.html). However, when I ran it with MPI, it generated all the same output files and seemed to be successful, *except* for the fact that it just hung in the command window and never completed. I had to Control-C to kill the process, after which point it generated all the text about analyzing, saving output files, plotting, etc.

Any idea what I can do so that it finishes successfully? I have no problem running my NEURON code with MPI. Thank you.

‍신기성[ 대학원석·박사통합과정재학 / 뇌공학과 ]

unread,
Jul 17, 2022, 10:03:44 PM7/17/22
to NetPyNE Q&A forum
Hello, Chris Fink.

I had the same question as you. How about checking out my method?

In my case, I am writing a script that runs NetPyNe repeatedly in Python, but NetPyNe process does not close automatically. (Please see the attached image)

The file structure is as follows:
- script.py
-- my_netpyne.py

I solved this problem by inserting the following code at the end of my_netpyne.py.

from neuron import h
sim.pc.barrier()                
# wait until all nodes in here
if sim.pc.id() == 0:           # if master node,
    sim.pc.done()               # quit other nodes
    h.quit()                           # quit all process

This seems to be able to end the process without loss after NetPyNe simulation.
I hope my method will help you.

Best regards,
Kisung Shin

2022년 7월 16일 토요일 오전 3시 19분 44초 UTC+9에 Chris Fink님이 작성:
netpyne_process_not_complete.PNG

Chris Fink

unread,
Jul 18, 2022, 6:34:24 PM7/18/22
to NetPyNE Q&A forum
Thank you very much, that was helpful! After adding your lines, my program now outputs all the text about analyzing, saving output files, plotting, etc, without me having to kill the process. However, it does still hang after this point.

I am using tut1.py from http://www.netpyne.org/tutorial.html, whose original code is the following:

import HHTut
from netpyne import sim
sim.createSimulateAnalyze(netParams = HHTut.netParams, simConfig = HHTut.simConfig)


With your recommended additions, it is now:

import HHTut
from netpyne import sim
from neuron import h
sim.createSimulateAnalyze(netParams = HHTut.netParams, simConfig = HHTut.simConfig)


sim.pc.barrier()                # wait until all nodes in here
if sim.pc.id() == 0:           # if master node,
    sim.pc.done()               # quit other nodes
    h.quit()                           # quit all process


I am following the tutorial and running the code with the command mpiexec -n 4 nrniv -python -mpi tut1.py . When I do so, all the expected data files are generated, and the command window outputs a bunch of text, but the cursor still just sits there blinking without the program every properly quitting.

Untitled.jpg

Thank you for the help!

J C

unread,
Jun 6, 2023, 4:25:56 PM6/6/23
to NetPyNE Q&A forum
Hello,

can you validate which version of NetPyNE you are working on?

(dev) PS C:\WINDOWS\system32> pip list | grep -E 'netpyne|NEURON'
netpyne                       1.0.4
NEURON                        8.2.0

Right now working with NEURON on Windows causes unique problems versus running through the Windows Subsystem Linux tool.

(I currently am troubleshooting my own Windows specific NEURON which broke on an installation/update 2 weeks back)

Chris Fink

unread,
Jun 7, 2023, 8:50:47 PM6/7/23
to NetPyNE Q&A forum
I'm using version 1.0.2.1

Chris Fink

unread,
Jun 7, 2023, 8:52:04 PM6/7/23
to NetPyNE Q&A forum
But I am completely open to running this on the Windows Subsystem Linux tool. Would you prefer I do that instead?

Chris Fink

unread,
Jul 23, 2023, 6:46:16 PM7/23/23
to NetPyNE Q&A forum
Just to close the loop on this thread, I ran this with MPI on Windows Subsystem Linux, and it completely solved the problem. Thank you.
Reply all
Reply to author
Forward
0 new messages