pythonic parallel context

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
Ruben Moor
Posts: 6
Joined: Tue Nov 17, 2009 9:02 am

pythonic parallel context

Post by Ruben Moor » Mon Dec 14, 2009 12:55 pm

Hello,

I am using the bulletin board style system with embedded python and was very excited when I noticed the recent changes.

Now I have found some things not yet working as I expected (disregarding mistakes I may have made):

Code: Select all

while pc.working():
    metypefilename = pc.upkpyobj()
    features = pc.upkobj()
leads to the error:
neuron/nrn/src/nrnpython/nrnpy_p2h.cpp:504: Object* pickle2po(char*): Assertion `po' failed.

I am trying to unpack the arguments, provided along with the submit call. The arguments are of the type string, list of strings, string

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

Re: pythonic parallel context

Post by hines » Tue Dec 15, 2009 10:12 am

Strings and scalars should still be unpacked with upkstr and upkscalar respectively.
features = pc.upkobj()
I assume that is a transcription typo and you really were using pc.upkpyobj()
So if the args are string, list of strings, string the sequence should be
s1 = pc.upkstr()
list = pc.upkpyobj()
s2 = pc.upkstr()
I need to add some error detection at a more reasonable level.

Ruben Moor
Posts: 6
Joined: Tue Nov 17, 2009 9:02 am

Re: pythonic parallel context

Post by Ruben Moor » Wed Dec 16, 2009 5:12 am

Hello,

unfortunately upkstr() did not work for me

Code: Select all

filename = pc.upkstr()
fails with "upkstr not enough arguments".

I worked around that with

Code: Select all

h('''strdef str1, str2
str1 = po.pc.upkstr(str1)
str2 = po.pc.upkstr(str2)
''')
filename = h.str1
features = h.str2
where I used 'submit' with a hoc-stub function as first argument and two strings as arguments.
This workaround does not work anymore once I use the pythonic version of 'submit'.

Post Reply