Using paranrn as python module does not work

General issues of interest both for network and
individual cell parallelization.

Moderator: hines

Post Reply
mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

Using paranrn as python module does not work

Post by mattions »

Hi,

I'm trying to use the parallel neuron to run my simulation

If I use the binary it works. :

Code: Select all

nrniv -python -mpi mpi_ex.py

If I use neuron as python module it doesn't

Code: Select all

python mpi_exp.py
The code I'm running is the following:

Code: Select all

from mpi4py import MPI
import os
# Removing display to import neuron properly
if os.environ.has_key("DISPLAY"):
    del os.environ['DISPLAY']
from neuron import h
pc = h.ParallelContext()

s = "mpi4py thinks I am %d of %d, NEURON thinks I am %d of %d\n"
cw = MPI.COMM_WORLD
print s % (cw.rank, cw.size, pc.id(), pc.nhost())

pc.done()
Output 1:

Code: Select all

mattioni@ebi-001:sandbox(master)$ bsub -I -n 4 -a openmpi mpirun.lsf -np 4 -mca btl tcp,self nrniv -python -mpi mpi_exp.py
Job <237116> is submitted to default queue <research>.
<<Waiting for dispatch ...>>
<<Starting on ebi-152>>
numprocs=4
NEURON -- Release 7.0 (281:80827e3cd201) 2009-01-16
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

mpi4py thinks I am 0 of 4, NEURON thinks I am 0 of 4
mpi4py thinks I am 1 of 4, NEURON thinks I am 1 of 4
mpi4py thinks I am 2 of 4, NEURON thinks I am 2 of 4
mpi4py thinks I am 3 of 4, NEURON thinks I am 3 of 4
Output 2:

Code: Select all

mattioni@ebi-001:sandbox(master)$ bsub -I -n 4 -a openmpi mpirun.lsf -np 4 -mca btl tcp,self python mpi_exp.py
Job <237115> is submitted to default queue <research>.
<<Waiting for dispatch ...>>
<<Starting on ebi-108>>

NEURON -- Release 7.0 (281:80827e3cd201) 2009-01-16
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

mpi4py thinks I am 2 of 4, NEURON thinks I am 0 of 1

mpi4py thinks I am 0 of 4, NEURON thinks I am 0 of 1

mpi4py thinks I am 1 of 4, NEURON thinks I am 0 of 1

mpi4py thinks I am 3 of 4, NEURON thinks I am 0 of 1
It's worth to say that if I run the binary nrniv without the mpi switch I obtain the second output.
What am I missing here?
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Re: Using paranrn as python module does not work

Post by hines »

NEURON -- Release 7.0 (281:80827e3cd201) 2009-01-16
Try the latest alpha version
http://www.neuron.yale.edu/ftp/neuron/versions/alpha
There have been a number of changes with regard to figuring out whether or not to
add the -mpi arg when extending.
mattions
Posts: 65
Joined: Tue Jul 15, 2008 11:21 am
Location: EMBL-EBI Cambridge UK

Re: Using paranrn as python module does not work

Post by mattions »

It works with this one.
Thanks.
Post Reply