Page 1 of 1

Activating multithreading from python code

Posted: Thu Jul 15, 2010 4:48 am
by mattions
Dear all,

I'm trying to obtain the same effect which I can have using the ParallelComputeTool from NEURON gui through python code:

This is what I'm doing:

Code: Select all

from neuron import h
soma = h.Section(name='soma')
h.load_file('parcom.hoc')
p = h.ParallelComputeTool()
p.nthread(4)
p.multisplit(True)

I think the last call:

Code: Select all

p.multisplit(True)
returns a 0 which I make me think is not the right way..
Which is the right way?

Thanks,
Michele.

Re: Activating multithreading from python code

Posted: Thu Jul 15, 2010 8:00 pm
by hines
All hoc procedures return a 0.0 when called from Python. eg.

Code: Select all

>>> from neuron import h
>>> h('proc p() { print "hello" }')
1
>>> h.p()
hello
0.0
>>>