<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Parallel Processing in Python with processing</title>
	<atom:link href="http://mtrr.org/blog/?feed=rss2&#038;p=91" rel="self" type="application/rss+xml" />
	<link>http://mtrr.org/blog/?p=91</link>
	<description>Notes on physics, computers, and physics with computers.</description>
	<pubDate>Mon, 06 Sep 2010 00:24:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Paul Boddie</title>
		<link>http://mtrr.org/blog/?p=91#comment-9534</link>
		<dc:creator>Paul Boddie</dc:creator>
		<pubDate>Fri, 16 Nov 2007 16:59:01 +0000</pubDate>
		<guid isPermaLink="false">http://mtrr.org/blog/?p=91#comment-9534</guid>
		<description>I responded to Valery about the issues with pickling certain things. SQLAlchemy does some exotic things which don't help with pickling, and I suggested avoiding passing such objects between processes (or across "process boundaries", if you like). Without knowing more, I can't say whether that's an acceptable solution or not, however.</description>
		<content:encoded><![CDATA[<p>I responded to Valery about the issues with pickling certain things. SQLAlchemy does some exotic things which don&#8217;t help with pickling, and I suggested avoiding passing such objects between processes (or across &#8220;process boundaries&#8221;, if you like). Without knowing more, I can&#8217;t say whether that&#8217;s an acceptable solution or not, however.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stan</title>
		<link>http://mtrr.org/blog/?p=91#comment-9521</link>
		<dc:creator>stan</dc:creator>
		<pubDate>Sun, 04 Nov 2007 18:38:12 +0000</pubDate>
		<guid isPermaLink="false">http://mtrr.org/blog/?p=91#comment-9521</guid>
		<description>It is possible that the object doesn't pickle properly, which is how all pretty much all the parallel processing modules pass arguments from one process to the other.  Without knowing more about the details of your problem, that's a total guess.</description>
		<content:encoded><![CDATA[<p>It is possible that the object doesn&#8217;t pickle properly, which is how all pretty much all the parallel processing modules pass arguments from one process to the other.  Without knowing more about the details of your problem, that&#8217;s a total guess.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Valery</title>
		<link>http://mtrr.org/blog/?p=91#comment-9520</link>
		<dc:creator>Valery</dc:creator>
		<pubDate>Sun, 04 Nov 2007 17:45:06 +0000</pubDate>
		<guid isPermaLink="false">http://mtrr.org/blog/?p=91#comment-9520</guid>
		<description>Paul Boddie wrote really an excellent module. I am happy to use it already. 

Finally I met the situation, when my function supplied as a first argument into the pmap call returns an class instance. When I try to access the result the exception is thrown. The unlucky class is "SQLSoup" of SqlSoup extension of well-known SQLAlchemy ( http://www.sqlalchemy.org/docs/04/documentation.html#plugins_sqlsoup)

I can't reproduce situation yet in a simpler form. Maybe anyone could give me a hint? 

Valery</description>
		<content:encoded><![CDATA[<p>Paul Boddie wrote really an excellent module. I am happy to use it already. </p>
<p>Finally I met the situation, when my function supplied as a first argument into the pmap call returns an class instance. When I try to access the result the exception is thrown. The unlucky class is &#8220;SQLSoup&#8221; of SqlSoup extension of well-known SQLAlchemy ( <a href="http://www.sqlalchemy.org/docs/04/documentation.html#plugins_sqlsoup" rel="nofollow">http://www.sqlalchemy.org/docs/04/documentation.html#plugins_sqlsoup</a>)</p>
<p>I can&#8217;t reproduce situation yet in a simpler form. Maybe anyone could give me a hint? </p>
<p>Valery</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse</title>
		<link>http://mtrr.org/blog/?p=91#comment-9478</link>
		<dc:creator>Jesse</dc:creator>
		<pubDate>Wed, 10 Oct 2007 19:47:28 +0000</pubDate>
		<guid isPermaLink="false">http://mtrr.org/blog/?p=91#comment-9478</guid>
		<description>I pinged the processing module author - he's game for a PEP to be put together</description>
		<content:encoded><![CDATA[<p>I pinged the processing module author - he&#8217;s game for a PEP to be put together</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stan</title>
		<link>http://mtrr.org/blog/?p=91#comment-9477</link>
		<dc:creator>stan</dc:creator>
		<pubDate>Tue, 09 Oct 2007 19:00:04 +0000</pubDate>
		<guid isPermaLink="false">http://mtrr.org/blog/?p=91#comment-9477</guid>
		<description>I haven't posted it yet since I need to take another pass through it to make sure I didn't break anything.  Then I can send it to the processing developer to see what he thinks.</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t posted it yet since I need to take another pass through it to make sure I didn&#8217;t break anything.  Then I can send it to the processing developer to see what he thinks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peer</title>
		<link>http://mtrr.org/blog/?p=91#comment-9476</link>
		<dc:creator>Peer</dc:creator>
		<pubDate>Tue, 09 Oct 2007 06:51:58 +0000</pubDate>
		<guid isPermaLink="false">http://mtrr.org/blog/?p=91#comment-9476</guid>
		<description>So where can we find your modified processing.PipeQueue code? Did you submit it to the processing developers?</description>
		<content:encoded><![CDATA[<p>So where can we find your modified processing.PipeQueue code? Did you submit it to the processing developers?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stan</title>
		<link>http://mtrr.org/blog/?p=91#comment-9472</link>
		<dc:creator>stan</dc:creator>
		<pubDate>Mon, 08 Oct 2007 00:02:54 +0000</pubDate>
		<guid isPermaLink="false">http://mtrr.org/blog/?p=91#comment-9472</guid>
		<description>Oh, and I finally hacked processing so that processing.PipeQueue has infinite queue depth.  So on a dual core Linux system, you get the following results:

wf-1-gala.py 3.422
wf-2.py 1.049
wf-3.py 1.223
wf-4.py 1.103086
wf-5.py 0.7303121
wf-6.py 0.5413789
wf-4-processing.py 0.7166

So as you might have expected, processing is on par with the multi-process version that used pipes (wf-5) and slower than the version (wf-6) which used shared memory.</description>
		<content:encoded><![CDATA[<p>Oh, and I finally hacked processing so that processing.PipeQueue has infinite queue depth.  So on a dual core Linux system, you get the following results:</p>
<p>wf-1-gala.py 3.422<br />
wf-2.py 1.049<br />
wf-3.py 1.223<br />
wf-4.py 1.103086<br />
wf-5.py 0.7303121<br />
wf-6.py 0.5413789<br />
wf-4-processing.py 0.7166</p>
<p>So as you might have expected, processing is on par with the multi-process version that used pipes (wf-5) and slower than the version (wf-6) which used shared memory.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stan</title>
		<link>http://mtrr.org/blog/?p=91#comment-9471</link>
		<dc:creator>stan</dc:creator>
		<pubDate>Sun, 07 Oct 2007 23:58:31 +0000</pubDate>
		<guid isPermaLink="false">http://mtrr.org/blog/?p=91#comment-9471</guid>
		<description>pprocess looks pretty neat!  Definitely a different approach than trying to emulate Thread().  The common use cases seem to be very streamlined.</description>
		<content:encoded><![CDATA[<p>pprocess looks pretty neat!  Definitely a different approach than trying to emulate Thread().  The common use cases seem to be very streamlined.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Boddie</title>
		<link>http://mtrr.org/blog/?p=91#comment-9470</link>
		<dc:creator>Paul Boddie</dc:creator>
		<pubDate>Sun, 07 Oct 2007 22:50:42 +0000</pubDate>
		<guid isPermaLink="false">http://mtrr.org/blog/?p=91#comment-9470</guid>
		<description>I had to try this with the pprocess module [1], too, and I've uploaded my version here:

http://www.boddie.org.uk/python/pprocess/pwf-4.py

I've taken the liberty to divide the chunks into sizes proportional to the number of processes involved. See below for a discussion of this modification.

Running on a 2 CPU machine I get 0.95s with 1 computation process, 0.60s with 2 processes, 0.62s with 4 processes. Meanwhile, taking wf-4.py as a comparison, I get 1.07s for 1 thread, 1.01s for 2 threads, 1.00s for 4 threads. This is on a machine with decent I/O and with the disk cache presumably nicely warmed up. Thus, the threaded version doesn't really get much benefit when running with lots of threads.

If I use the default chunk size, more parallel invocations or communications are required, whether or not processes are reused or spawned anew. With the pprocess module, this has a large impact on the performance, probably because the inter-process communications could do with some optimisation.

Still, if you diff wf-4.py with pwf-4.py, you'll see that I actually remove code because of certain conveniences provided in the pprocess module, as described in the tutorial [2]

[1] http://www.python.org/pypi/pprocess
[2] http://www.boddie.org.uk/python/pprocess/tutorial.html</description>
		<content:encoded><![CDATA[<p>I had to try this with the pprocess module [1], too, and I&#8217;ve uploaded my version here:</p>
<p><a href="http://www.boddie.org.uk/python/pprocess/pwf-4.py" rel="nofollow">http://www.boddie.org.uk/python/pprocess/pwf-4.py</a></p>
<p>I&#8217;ve taken the liberty to divide the chunks into sizes proportional to the number of processes involved. See below for a discussion of this modification.</p>
<p>Running on a 2 CPU machine I get 0.95s with 1 computation process, 0.60s with 2 processes, 0.62s with 4 processes. Meanwhile, taking wf-4.py as a comparison, I get 1.07s for 1 thread, 1.01s for 2 threads, 1.00s for 4 threads. This is on a machine with decent I/O and with the disk cache presumably nicely warmed up. Thus, the threaded version doesn&#8217;t really get much benefit when running with lots of threads.</p>
<p>If I use the default chunk size, more parallel invocations or communications are required, whether or not processes are reused or spawned anew. With the pprocess module, this has a large impact on the performance, probably because the inter-process communications could do with some optimisation.</p>
<p>Still, if you diff wf-4.py with pwf-4.py, you&#8217;ll see that I actually remove code because of certain conveniences provided in the pprocess module, as described in the tutorial [2]</p>
<p>[1] <a href="http://www.python.org/pypi/pprocess" rel="nofollow">http://www.python.org/pypi/pprocess</a><br />
[2] <a href="http://www.boddie.org.uk/python/pprocess/tutorial.html" rel="nofollow">http://www.boddie.org.uk/python/pprocess/tutorial.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stan</title>
		<link>http://mtrr.org/blog/?p=91#comment-9468</link>
		<dc:creator>stan</dc:creator>
		<pubDate>Sun, 07 Oct 2007 18:07:46 +0000</pubDate>
		<guid isPermaLink="false">http://mtrr.org/blog/?p=91#comment-9468</guid>
		<description>I think starting the PEP process (well, with the author's blessing) would be a great idea.  This really does belong in the standard library alongside the threading module, so we have a simple alternative to threads when appropriate.  Certainly, when forking on a single machine, it seems perfect.

I need to play more to see how easy working with remote clients is.  The remote execution problem is harder, since there is no inter-machine fork (unless you are using some kind of single-system-image operating system).  You have to start separate processes on the other machines, worry about authentication, and all that mess.  Here the slightly more awkward approach of Parallel Python seems sensible since it works the same way for local or remote worker processes.

Too bad there is no obvious way to streamline the processing module for remote usage.  I do have this strange desire to try to use Stackless with this module to distribute tasklets automatically to worker threads...</description>
		<content:encoded><![CDATA[<p>I think starting the PEP process (well, with the author&#8217;s blessing) would be a great idea.  This really does belong in the standard library alongside the threading module, so we have a simple alternative to threads when appropriate.  Certainly, when forking on a single machine, it seems perfect.</p>
<p>I need to play more to see how easy working with remote clients is.  The remote execution problem is harder, since there is no inter-machine fork (unless you are using some kind of single-system-image operating system).  You have to start separate processes on the other machines, worry about authentication, and all that mess.  Here the slightly more awkward approach of Parallel Python seems sensible since it works the same way for local or remote worker processes.</p>
<p>Too bad there is no obvious way to streamline the processing module for remote usage.  I do have this strange desire to try to use Stackless with this module to distribute tasklets automatically to worker threads&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
