<div dir="ltr">Hi Jose,<br><div><div class="gmail_extra"><br></div><div class="gmail_extra">Just wanted to share my experience with parallel:<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 22, 2014 at 6:19 PM, Jose Gomez-Dans <span dir="ltr"><<a href="mailto:jgomezdans@gmail.com" target="_blank">jgomezdans@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Aron,<div class="gmail_extra"><br><div class="gmail_quote"><span class="">On 18 December 2014 at 20:22, Aron Ahmadia <span dir="ltr"><<a href="mailto:aron@ahmadia.net" target="_blank">aron@ahmadia.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span><div class="gmail_extra">What happens if instead of partitioning the data, you create a list of work units and map those?<br></div></span><div class="gmail_extra">Something like:<br><br></div><div class="gmail_extra">def apply_the_func(i):<br></div><div class="gmail_extra">      return the_func(X[N*i):X[(i+1)*N])<br></div><div class="gmail_extra"><br><font face="monospace">Y = run_func.map ( [xrange(i), apply_the_func) for i in range(nodes)] ) </font></div></div></blockquote><div><br></div></span><div>This provides a substantial speed-up. I also tested other approaches (scatter&gather), but all in all, "pushing" X to the engines seems & using your suggestion seems to work. A question I have is what is going on behind the scenes when I push X around: do all the engines get a copy of the full X? In my case, X can be quite large, and it seems expensive to send lots and lots of data to engines that will only operate on a small fraction of the data...</div></div></div></div></blockquote><div><br><br></div><div>I've been working with up to 2 GB of data and using the push mechanism is not really feasible at that size. Also, the transmission time increases linearly (super linearly?) with more target engines. So I've tried a few solutions:<br><br></div><div>1.) If you're working on the same host and don't expect to expand that switch to multiprocessing. It's very fast in transmitting data.<br></div><div>2.) Store your data on the file system and have each engine access that. Either you have a shared file system for the remote kernels to access or you'll need to copy the data beforehand/use paramiko.<br></div><div>3.) Having a database server is quite a bit of work to invest at the beginning (especially if you don't know how) but really lends itself to this sort of task. A database server usually has a connection pool so that it can automatically handle many workers accessing it concurrently.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Thanks for your help</div><span class="HOEnZb"><font color="#888888"><div>Jose </div></font></span></div></div></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div><div class="gmail_extra">Just my thoughts/experience. Best of luck with your project,<br></div><div class="gmail_extra">Moritz<br></div></div></div>