In [3]:
from IPython import parallel
c=parallel.Client()
dview=c.direct_view()
dview.block=True
In [2]:
c.ids
Out[2]:
In [10]:
import numpy as np
x=np.arange(100)
dview.scatter('x',x)
In [13]:
print c[0]['x']
print c[1]['x']
print c[-1]['x']
In [14]:
dview.execute('import numpy as np; y=np.sum(x)')
ys=dview.gather('y')
total=np.sum(ys)
print total
In [ ]: