Page 1 of 1

Pyneuron vs hoc

Posted: Wed Oct 19, 2011 3:54 am
by shyam_u2
I have a large network model. When i run it using pyNEURON i get a lot of memory problems. Given below is an example.

nrniv(63134) malloc: *** mmap(size=34816000) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
/Users/shyam/neuronlatest/nrn-7.2/i386/bin/nrniv: out of memory

I dont get these errors when i run in hoc. Is my observation true ? Or am i wrong.

Re: Pyneuron vs hoc

Posted: Thu Oct 20, 2011 10:29 am
by ted
What's pyNEURON, and how are you "running your model" with it?

Re: Pyneuron vs hoc

Posted: Sun Oct 23, 2011 10:17 pm
by shyam_u2
I have a model which has a set of hoc and mod files. I declare the methodology for running my model as given below.

1.Using hoc -- just run using a hoc file
2.using Python - write a python file to call all the hoc files using h object. eg h.load_file("init.hoc") and run it

When i run using method 2 i get a lot of memory errors like i described in my previous post.

Re: Pyneuron vs hoc

Posted: Mon Oct 24, 2011 5:50 pm
by hines
it is possible, though it seems unlikely, that you are so close to the memory limit with your hoc model that
wrapping it in Python puts you over the edge. Can you scale the size of your model so it is half the size
and see if you still get the memory error.

Re: Pyneuron vs hoc

Posted: Tue Oct 25, 2011 12:20 am
by shyam_u2

Thank you very much for your reply. I did scale down the size of my model to half its size. I get the same error using python wrapper but not using hoc. But if i reduce beyond this value, the model works fine using both the python wrapper and hoc.
Is there any way to get rid of this error ?


Re: Pyneuron vs hoc

Posted: Tue Oct 25, 2011 7:06 am
by hines
What kind of machine are you working on, desktop?, cluster? How much memory
per machine do you have? If I have a similar machine available and you can send
me a zip file with all the hoc,python,mod files I need to reproduce the problem, then
I can look into it. Also what version of python are you running. If you decide to
email me the code, send it to Of course i would need
instruction how to launch and some hints on how to change the model size.