I've got a question I'm hoping someone can help me figure out. I'm trying to construct two different parallel views in an iPython notebook. The first view has the processor with ID 0, and the second has all the rest of the processors. I associate a prefix with each of the views so I can easily run different things on the different processors.
I launch a background thread that does a long calculation using the processors in the second view. While that's running in the background, I try to run a command using the first view, but it doesn't work. I get this error: ValueError: '' is not in list.
So I'm wondering if there's a way to do what I'm trying to do here, or if this is unsupported behavior. In short, I'd like to create two different views using different processors. No processors will be shared between the views. Then I'd like to be able to run a background task that uses one view, while simultaneously using the other view for unrelated tasks.
Here's a small example script that results in the error. I'm not sure how to post a notebook directly, so I've just copied and pasted the python script generated from it.
# <codecell>
from IPython import parallel
cli = parallel.Client()
# <codecell>
view1 = cli[0]
view1.block = True
view1.activate("_one")
# <codecell>
view2 = cli[1:]
view2.block = True
view2.activate("_two")
# <codecell>
%px_two import time
def backFunc():
for i in range(10):
%px_two time.sleep(5)
%px_two print "In bg thread"
# <codecell>
from IPython.lib import backgroundjobs as bg
bgJob = bg.BackgroundJobManager()
bgJob.new('backFunc()')
# <codecell>
%px_one import time
def foreFunc():
for i in range(10):
%px_one time.sleep(1)
%px_one print "In fg thread"
# <codecell>
foreFunc()
As soon as foreFunc() is run, it gives the error:
ValueError: '<IDS|MSG>' is not in list
Any thoughts? I'd appreciate any ideas anyone has.