Segmentation violation NEURON 7.3 with mpi

nevo

Segmentation violation NEURON 7.3 with mpi

Post by nevo » Wed Jul 24, 2013 3:11 pm

Hi,

I wrote a hoc file to stimulate an axon extracellular with the play method. I am using ParallelContext in order to stimulate many axons.
On my old Linux machine with NEURON 7.1 the stimulation works fine. Now I am trying to start the stimulation on a Mac OS X Version 10.7.5 with NEURON 7.3.
The test0.hoc from the parallel examples folder works fine.

If I type:

Code: Select all

mpirun -n 4 nrniv -mpi main.hoc
I get the error: "NEURONMainMenu: a template can not be redefined" and "Segmentation violation"

If I type:

Code: Select all

mpirun -n 4 nrngui -mpi main.hoc
I get the error: "Segmentation violation"

Can anybody help me?
Thanks

ted
Site Admin
Posts: 5298
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Segmentation violation NEURON 7.3 with mpi

Post by ted » Thu Jul 25, 2013 9:09 am

And what happens if you try plain old
nrngui main.hoc
?

nevo

Re: Segmentation violation NEURON 7.3 with mpi

Post by nevo » Thu Jul 25, 2013 9:22 am

Hi Ted,

Neuron starts with the stimulation (I can see that in a ses. file).
After the stimulation of the first axon I get again "Segmentation violation" error.

Thanks

ted
Site Admin
Posts: 5298
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Segmentation violation NEURON 7.3 with mpi

Post by ted » Thu Jul 25, 2013 9:02 pm

So your program doesn't execute in serial mode, i.e. on a single processor without MPI. Do you have an implementation that will run on a single processor without MPI?

nevo

Re: Segmentation violation NEURON 7.3 with mpi

Post by nevo » Fri Jul 26, 2013 5:14 am

Yes, I have an implementation without mpi that runs, if I put "load_file("stdrun.hoc")" in the first line of the program and execute it with "nrniv main_no_pc.hoc".
If I type: "nrngui main_no_pc.hoc" I get again the segmentation violation error.

ted
Site Admin
Posts: 5298
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Segmentation violation NEURON 7.3 with mpi

Post by ted » Fri Jul 26, 2013 11:27 am

OK, this I have to see in order to figure out what's going on. Could you zip up whatever .hoc, .mod, and .ses files that are necessary to reproduce the problem (no i686 or i86 subdirectories, no *.o or *.c or *.dll files) and email them to
ted dot carnevale at yale dot edu
?

ted
Site Admin
Posts: 5298
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Segmentation violation NEURON 7.3 with mpi

Post by ted » Fri Jul 26, 2013 5:45 pm

With NEURON 7.3 (840:c597ab253106) 2013-03-31 under CentOS 6.4 (RHEL 6.4 without the brand name), serial execution of main.hoc runs to completion without error and generate a file called result_5V.dat that contains the same result regardless of whether it is launched by
nrniv main.hoc
or
nrngui main.hoc
Parallel execution also runs to completion without error, but generates a result_5V.dat that has the same two lines as the serially-generated file, but the sequence of the lines is backwards i.e. the first line of the serially-generated output is the second line of the parallel-generated file, and the second line of the serially-generated file is the first line of the paralllel-generated file.

What is the first line that NEURON prints to its terminal when it starts?

Also, please save this code

Code: Select all

objref pc
pc = new ParallelContext()
{printf("I am %d of %d\n", pc.id, pc.nhost)}
{pc.runworker()}
{pc.done()}
quit()
to a file called test.hoc, run it with this command line
mpirun -n 4 nrniv -mpi test0.hoc
and tell me what you get.

nevo

Re: Segmentation violation NEURON 7.3 with mpi

Post by nevo » Sat Jul 27, 2013 6:39 am

I get the same result. My simulation runs under Ubuntu NEUORN 7.1 and fails under Mac OS X with NEURON 7.3.

The first line NEURON prints is:
NEURON -- Release 7.3 (901:c736db45853d) c736db45853d

I get the following when I run your code with:
mpirun -n 4 nrniv -mpi test.hoc

Code: Select all

numprocs=4
NEURON -- Release 7.3 (901:c736db45853d) c736db45853d
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2013
See http://www.neuron.yale.edu/neuron/credits

Additional mechanisms from files
 AXNODE.mod
I am 3 of 4
I am 0 of 4
I am 2 of 4
I am 1 of 4

ted
Site Admin
Posts: 5298
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Segmentation violation NEURON 7.3 with mpi

Post by ted » Sat Jul 27, 2013 10:17 pm

nevo wrote:I get the same result.
Just to make sure I understand--under OS X,
mpirun -n 4 nrniv -mpi test.hoc
produces this output?

Code: Select all

I am 3 of 4
I am 0 of 4
I am 2 of 4
I am 1 of 4

nevo

Re: Segmentation violation NEURON 7.3 with mpi

Post by nevo » Sun Jul 28, 2013 7:12 am

yes, you understand correctly. I get this output under OS X.

hines
Site Admin
Posts: 1507
Joined: Wed May 18, 2005 3:32 pm

Re: Segmentation violation NEURON 7.3 with mpi

Post by hines » Mon Jul 29, 2013 8:43 am

I get the error: "NEURONMainMenu: a template can not be redefined" and "Segmentation violation"
There error is that stdrun.hoc is being loaded twice.
Are you using an xopen anywhere in your code that opens stdrun.hoc and could be executed after previously opening nrngui.hoc or stdgui.hoc. If so
you can probably fix the problem by replacing with load_file. Note that nrngui.hoc opens stdgui.hoc which opens stdrun.hoc

nevo

Re: Segmentation violation NEURON 7.3 with mpi

Post by nevo » Mon Jul 29, 2013 12:33 pm

I now understand the error "a template can not be redefined".
But I still get the error "Segmentation Violation"

Thanks for your help

hines
Site Admin
Posts: 1507
Joined: Wed May 18, 2005 3:32 pm

Re: Segmentation violation NEURON 7.3 with mpi

Post by hines » Mon Jul 29, 2013 1:39 pm

in this case, the sementation violation is a consequence of the template error. Get rid of the template error and see if the segmentation violaton goes away as well.

ted
Site Admin
Posts: 5298
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Segmentation violation NEURON 7.3 with mpi

Post by ted » Mon Jul 29, 2013 3:22 pm

hines wrote:
I get the error: "NEURONMainMenu: a template can not be redefined" and "Segmentation violation"
There error is that stdrun.hoc is being loaded twice.
Are you using an xopen anywhere in your code that opens stdrun.hoc
There isn't any.

Code: Select all

$ grep xopen *
main.hoc:hide = xopen("tools_vta.hoc")
main.hoc:hide = xopen("MRGaxon.hoc")
main.hoc:	xopen("init_record.hoc")
main.hoc:	//xopen("axon.ses")
main_no_pc.hoc:hide = xopen("tools_vta.hoc")
main_no_pc.hoc:hide = xopen("MRGaxon.hoc")
main_no_pc.hoc:	xopen("init_record.hoc")
main_no_pc.hoc:	xopen("axon.ses")
And no templates are defined

Code: Select all

$ grep template *
$

nevo

Re: Segmentation violation NEURON 7.3 with mpi

Post by nevo » Mon Jul 29, 2013 3:30 pm

The simulation works now :-)

I had to put the variable declaration for "veclist" outside the function "is_spike()" in which the play method is executed.

I still dont understand, why my code works in Linux but not in OS X.

Thanks for your help.

Post Reply