Activating multithreading from python code

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

Activating multithreading from python code

Post by mattions » Thu Jul 15, 2010 4:48 am

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.

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

Re: Activating multithreading from python code

Post by hines » Thu Jul 15, 2010 8:00 pm

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
>>> 

Post Reply