[IPython-User] Pushing Code to Engines?
MinRK
benjaminrk@gmail....
Mon Aug 15 15:51:29 CDT 2011
To call a function on args remotely, you just use apply:
rc = Client()
dview = Client[:]
def f(a):
return a*2
# call f(5) on every engine:
dview.apply(f, 5)
# send f to all engines (as 'g', you can give it any name), so you can use
it many times:
dview['g'] = f
# now you can call it with execute:
dview.execute('b=g(10)')
-MinRK
On Mon, Aug 15, 2011 at 13:34, Darren Govoni <darren@ontrenet.com> wrote:
> Hi,
> I have a cluster and create a Client() from ip shell.
> I define a function in my shell space. Is it possible to have it pushed
> to the engines to execute? Or does all the code have to reside
> on the engines already?
>
> thanks for any tips. I'm reading all the docs, but missing these
> particulars.
>
> Darren
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20110815/1ec4bf6e/attachment.html
More information about the IPython-User
mailing list