[IPython-dev] load_balanced_view

Satrajit Ghosh satra@mit....
Mon Apr 23 15:07:05 CDT 2012


thanks min,

def task_one(b):
>     "store b in global a, for some reason"
>     global a
>     a = b
>
> def task_two(c):
>     "product of a and c, must be run following task_one"
>     return c*a
>
> rc = parallel.Client()
>
> view = rc.load_balanced_view()
>
> # submit task_one anywhere
> ar_one = view.apply_async(task_one, 5)
>
> # submit task_two to the same engine as task_one (even though we don't
> know where that is, yet)
> with view.temp_flags(follow=ar_one):
>     ar_two = view.apply_async(task_two, 10)
>

this is exactly what i needed. thanks for this.


>  We call these Graph Dependencies, and you can read a bit more about them in
> the docs<http://ipython.org/ipython-doc/dev/parallel/parallel_task.html#graph-dependencies>
> .
>

just read them and they are plenty clear.

cheers,

satra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20120423/3f0427d4/attachment.html 


More information about the IPython-dev mailing list