On Sat, Jan 7, 2012 at 21:37, Fernando Perez <fperez.net@gmail.com> wrote:
> Hi Olivier,
>> On Fri, Jan 6, 2012 at 9:58 PM, Olivier Grisel <olivier.grisel@ensta.org>
> wrote:
> > Very interesting thread, thanks for sharing. Let me share some of my
> > related use cases with to feed the IPython.parallel community with
> > some additional use cases you might not be aware of.
>> [...]
>> Thanks a lot for this explanation and the link. I think I must have
> missed something, because it seems to me that we already offer that:
>> In [26]: from IPython.parallel import Client
> ...: v = Client()[:]
>> In [27]: x = rand(len(v.targets))
> ...: v.scatter('x', x)
> Out[27]: <AsyncResult: scatter>
>> In [29]: v['x']
> Out[29]:
> [array([ 0.55751144]),
> array([ 0.51093798]),
> array([ 0.03574132]),
> array([ 0.31362035])]
>> In [30]: v['x_sum'] = sum(v['x'])
> ...: v['x_sum']
> Out[30]:
> [1.4178110846551577,
> 1.4178110846551577,
> 1.4178110846551577,
> 1.4178110846551577]
>>> No? That last line performs what the all_reduce operation is defined
> as: it pulls 'x' from each node, does the reduction, and sends back
> the global reduction to all nodes now named x_sum.
>> Can you clarify what I'm not understanding?
>
Fernando,
The problem is that gathering everything to the client prior to calling
reduce won't work for the cases where the whole parallel problem doesn't
fit in memory on one node, so you have to do a *parallel* reduce, which can
be implemented without requiring more than two parts of the problem on a
node at any given time.
Olivier,
Thanks for this data point, I have been thinking about what a
'zeromq-style' parallel reduce might look like. Obviously, you can
implement one with all:all addressed messages (ROUTERs everywhere), but it
would be nice to let 0MQ do more of the legwork. And the difference
between reduce and allreduce is trivial, if I understand correctly - just
publish the final reduced result.
-MinRK
>> Thanks!
>> f
>-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120107/cdf0bbb8/attachment.html