<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Yet Another [À Compléter] &#187; Mono</title>
	<atom:link href="http://blog.neteril.org/category/mono/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.neteril.org</link>
	<description>Random thoughts of Jérémie Laval</description>
	<lastBuildDate>Mon, 19 Jul 2010 17:12:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Being a coding monkey (again)</title>
		<link>http://blog.neteril.org/2010/07/19/being-a-coding-monkey-again/</link>
		<comments>http://blog.neteril.org/2010/07/19/being-a-coding-monkey-again/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 17:12:12 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Mono]]></category>

		<guid isPermaLink="false">http://blog.neteril.org/?p=971</guid>
		<description><![CDATA[<p align="center"><a href="http://www.flickr.com/photos/sentrawoods/3658290263/"><img src="http://blog.neteril.org/wp-content/uploads/2010/07/monkey_face.jpg" alt="Monkey Face by Sentrawoods" title="Monkey Face" width="400" height="305" class="aligncenter size-full wp-image-973" /></a><br /><em>Monkey Face</em></p>
<p>Following the informal one-month internship I did last summer, I will be back at <a href="http://www.novell.com">Novell</a> in lovely Dublin offices this time for a full-blown seven months session starting in August.</p>
<p>As you can expect, my main area of work will be ParallelFx and other 4.0 goodness but I hope to do some <a href="http://blog.neteril.org/2010/06/18/tying-mono-and-opencl/">other interesting work</a> on the side.</p>
<p>I very much look forward to this new opportunity of working full time on the ever awesome Mono and with its talented hacker team.</p>
<p>See you around a (Guinness) pint!</p>
]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://www.flickr.com/photos/sentrawoods/3658290263/"><img src="http://blog.neteril.org/wp-content/uploads/2010/07/monkey_face.jpg" alt="Monkey Face by Sentrawoods" title="Monkey Face" width="400" height="305" class="aligncenter size-full wp-image-973" /></a><br /><em>Monkey Face</em></p>
<p>Following the informal one-month internship I did last summer, I will be back at <a href="http://www.novell.com">Novell</a> in lovely Dublin offices this time for a full-blown seven months session starting in August.</p>
<p>As you can expect, my main area of work will be ParallelFx and other 4.0 goodness but I hope to do some <a href="http://blog.neteril.org/2010/06/18/tying-mono-and-opencl/">other interesting work</a> on the side.</p>
<p>I very much look forward to this new opportunity of working full time on the ever awesome Mono and with its talented hacker team.</p>
<p>See you around a (Guinness) pint!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2010/07/19/being-a-coding-monkey-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tying Mono and OpenCL</title>
		<link>http://blog.neteril.org/2010/06/18/tying-mono-and-opencl/</link>
		<comments>http://blog.neteril.org/2010/06/18/tying-mono-and-opencl/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 17:09:01 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.neteril.org/?p=939</guid>
		<description><![CDATA[<p align="center"><a href="http://www.flickr.com/photos/un_owen/166787202/"><img src="http://blog.neteril.org/wp-content/uploads/2010/06/tortoise_hare.jpg" alt="tortoise_hare" title="tortoise_hare" width="507" height="380" class="aligncenter size-full wp-image-953" /></a></p>
<p>One of the cool buzzword these days beside parallel computing is GPGPU as in General Purpose GPU.</p>
<p>The base idea of GPGPU is to allow a programmer to tape in the parallel processing capacities of a GPU to do something different than pixel crushing (even though it mostly boils down to that very application most of time). </p>
<p>GPGPU isn&#8217;t new and for a long time vendors have provided their own rather low-level toolkit to program arbitrarily a GPU. As often, someone stepped up one day and proposed a unified API on top of all the vendor specificities. In our case, that API is a standard defined by the <a href="http://www.khronos.org/">Khronos group</a> (think OpenGL) and is named <a href="http://www.khronos.org/opencl/">OpenCL</a>.</p>
<p>OpenCL defines both a high-level C API to manipulate GPU (plus other friends) and a C-like intermediate language that is compiled and ultimately run on the device. It&#8217;s actually the same model as shader programming.</p>
<p>In the pursuit of <a href="http://www.mono-project.com">Mono</a> world-domination and following the implementation of PLinq that strived to be an easy way for programmer to access the multicore architecture of our processors via Linq, I hereby introduce <em>GLinq</em> (unoriginal acronym for GPU Linq) which this time use your graphic card to execute Linq queries via OpenCL. </p>
<p>GLinq is still much in its infancy and currently only support the Linq&#8217;s Select operator but I hope to be able to implement several other operators (at least the classic Where-Aggregate combo). The end goal is also to provide a new set of operator to allow OpenGL code to access the results of the computation without doing a roundtrip between CPU and GPU.</p>
<p>As I said previously, GLinq has the same design goal as PLinq which was to provide a totally new execution model for programmer in the most transparent way possible and with little modification to existing code. In our case, this prerequisite is rather tricky since you are juggling between two totally different worlds.</p>
<p>GLinq tries to provide that seamless experience with two features. The first one is the use of expression trees and C# compiler lambda magic to automatically capture the sense of a C# expression and rewrite it to OpenCL intermediate language. The second one is an automatic mapping of C# types and methods (e.g. Math class functions) to corresponding OpenCL symbols without however sacrificing OpenCL specificities which are also exposed through a C# API (not complete). </p>
<p>Of course, the GLinq API is still a transcription of standard Linq so you use it in the same way via the GpuEnumerable class. At the moment, the only input support are Range and Repeat but that will easily be changed to support any kind of IEnumerable.</p>
<p>Below is an example of the kind of query you can already execute:</p>
<pre class="brush: csharp;">

var query = GpuEnumerable.Range (-20, 50)
			 .Select ((i) =&gt; i * -2 + 3)
			 .Select ((i) =&gt; Math.Abs (i))
			 .Select ((i) =&gt; ExtraMath.Ldexp ((float)i, 2f))
			 .Select ((i) =&gt; (int)i);

foreach (var i in query)
	Console.Write (&quot;{0}, &quot;, i.ToString ());
</pre>
<p>From what you can see, there are a lot of select operators here. It comes from the fact that the compiler is only able to convert a pure expression lambda to its corresponding expression tree. You can circumvent this limitation by building yourself the expression tree or by using any compiler/interpreter that outputs expression trees (e.g. IronPython, IronRuby, Bechamel).</p>
<p>On a final note, there is an acknowledged bug in at least NVidia implementation of OpenCL which makes Mono doesn&#8217;t play nice with it. This is due to the fact that (most) OpenCL implementations use LLVM for code generation/optimization which in turns mess with Mono internal working.</p>
<p>This problem is going to be fixed in the next NVidia driver iteration but as a work-around you can apply <a href="http://monobin.com/__md461851">this simple patch</a> to mono. I put <del datetime="2010-06-18T18:01:11+00:00">SIGWINCH</del>SIGXFSZ there because it looks cool and seems generally unused but any other should do the trick.</p>
<p>Code in its proof-of-concept form is living here: <a href="http://git.neteril.org/glinq/">http://git.neteril.org/glinq/</a></p>
]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://www.flickr.com/photos/un_owen/166787202/"><img src="http://blog.neteril.org/wp-content/uploads/2010/06/tortoise_hare.jpg" alt="tortoise_hare" title="tortoise_hare" width="507" height="380" class="aligncenter size-full wp-image-953" /></a></p>
<p>One of the cool buzzword these days beside parallel computing is GPGPU as in General Purpose GPU.</p>
<p>The base idea of GPGPU is to allow a programmer to tape in the parallel processing capacities of a GPU to do something different than pixel crushing (even though it mostly boils down to that very application most of time). </p>
<p>GPGPU isn&#8217;t new and for a long time vendors have provided their own rather low-level toolkit to program arbitrarily a GPU. As often, someone stepped up one day and proposed a unified API on top of all the vendor specificities. In our case, that API is a standard defined by the <a href="http://www.khronos.org/">Khronos group</a> (think OpenGL) and is named <a href="http://www.khronos.org/opencl/">OpenCL</a>.</p>
<p>OpenCL defines both a high-level C API to manipulate GPU (plus other friends) and a C-like intermediate language that is compiled and ultimately run on the device. It&#8217;s actually the same model as shader programming.</p>
<p>In the pursuit of <a href="http://www.mono-project.com">Mono</a> world-domination and following the implementation of PLinq that strived to be an easy way for programmer to access the multicore architecture of our processors via Linq, I hereby introduce <em>GLinq</em> (unoriginal acronym for GPU Linq) which this time use your graphic card to execute Linq queries via OpenCL. </p>
<p>GLinq is still much in its infancy and currently only support the Linq&#8217;s Select operator but I hope to be able to implement several other operators (at least the classic Where-Aggregate combo). The end goal is also to provide a new set of operator to allow OpenGL code to access the results of the computation without doing a roundtrip between CPU and GPU.</p>
<p>As I said previously, GLinq has the same design goal as PLinq which was to provide a totally new execution model for programmer in the most transparent way possible and with little modification to existing code. In our case, this prerequisite is rather tricky since you are juggling between two totally different worlds.</p>
<p>GLinq tries to provide that seamless experience with two features. The first one is the use of expression trees and C# compiler lambda magic to automatically capture the sense of a C# expression and rewrite it to OpenCL intermediate language. The second one is an automatic mapping of C# types and methods (e.g. Math class functions) to corresponding OpenCL symbols without however sacrificing OpenCL specificities which are also exposed through a C# API (not complete). </p>
<p>Of course, the GLinq API is still a transcription of standard Linq so you use it in the same way via the GpuEnumerable class. At the moment, the only input support are Range and Repeat but that will easily be changed to support any kind of IEnumerable.</p>
<p>Below is an example of the kind of query you can already execute:</p>
<pre class="brush: csharp;">

var query = GpuEnumerable.Range (-20, 50)
			 .Select ((i) =&gt; i * -2 + 3)
			 .Select ((i) =&gt; Math.Abs (i))
			 .Select ((i) =&gt; ExtraMath.Ldexp ((float)i, 2f))
			 .Select ((i) =&gt; (int)i);

foreach (var i in query)
	Console.Write (&quot;{0}, &quot;, i.ToString ());
</pre>
<p>From what you can see, there are a lot of select operators here. It comes from the fact that the compiler is only able to convert a pure expression lambda to its corresponding expression tree. You can circumvent this limitation by building yourself the expression tree or by using any compiler/interpreter that outputs expression trees (e.g. IronPython, IronRuby, Bechamel).</p>
<p>On a final note, there is an acknowledged bug in at least NVidia implementation of OpenCL which makes Mono doesn&#8217;t play nice with it. This is due to the fact that (most) OpenCL implementations use LLVM for code generation/optimization which in turns mess with Mono internal working.</p>
<p>This problem is going to be fixed in the next NVidia driver iteration but as a work-around you can apply <a href="http://monobin.com/__md461851">this simple patch</a> to mono. I put <del datetime="2010-06-18T18:01:11+00:00">SIGWINCH</del>SIGXFSZ there because it looks cool and seems generally unused but any other should do the trick.</p>
<p>Code in its proof-of-concept form is living here: <a href="http://git.neteril.org/glinq/">http://git.neteril.org/glinq/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2010/06/18/tying-mono-and-opencl/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PLinq is in</title>
		<link>http://blog.neteril.org/2010/04/17/plinq-is-in/</link>
		<comments>http://blog.neteril.org/2010/04/17/plinq-is-in/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 22:42:56 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.neteril.org/?p=889</guid>
		<description><![CDATA[<p align="center"><div id="attachment_890" class="wp-caption aligncenter" style="width: 517px"><a href="http://www.flickr.com/photos/ecstaticist/3055718118/"><img src="http://blog.neteril.org/wp-content/uploads/2010/04/header_plinq.jpg" alt="The Delta by ecstaticist under CC by-nc-sa" title="The Delta by ecstaticist under CC by-nc-sa" width="507" height="306" class="size-full wp-image-890" /></a><p class="wp-caption-text">It's all about splitting work</p></div></p>
<p>At long last, <a href="http://msdn.microsoft.com/en-us/library/dd460688(VS.100).aspx">PLinq</a> has finally <a href="http://twitter.com/migueldeicaza/status/12241543855">found its way into Mono trunk</a> as what can be considered a preview release. The code has seen a major rewrite compared to the initial implementation done during earlier Google Summer of Code which lacked flexibility and correctness.</p>
<p>Public API is complete except some operator still not implemented. In addition and as implied by the preview title, the current code hasn&#8217;t been tested against all possible flavor of query so it might or might not work for you (i.e. deadlock). If that&#8217;s the case, don&#8217;t hesitate to fill a bug report with a query reproducing the problem. The more query I have, the more robust we can shape future release.</p>
<p>By the way, these <a href="http://blog.neteril.org/2009/08/16/how-to-get-the-max-out-of-your-plinq-query/">PLinq performance tips</a> still hold true.</p>
]]></description>
			<content:encoded><![CDATA[<p align="center"><div id="attachment_890" class="wp-caption aligncenter" style="width: 517px"><a href="http://www.flickr.com/photos/ecstaticist/3055718118/"><img src="http://blog.neteril.org/wp-content/uploads/2010/04/header_plinq.jpg" alt="The Delta by ecstaticist under CC by-nc-sa" title="The Delta by ecstaticist under CC by-nc-sa" width="507" height="306" class="size-full wp-image-890" /></a><p class="wp-caption-text">It's all about splitting work</p></div></p>
<p>At long last, <a href="http://msdn.microsoft.com/en-us/library/dd460688(VS.100).aspx">PLinq</a> has finally <a href="http://twitter.com/migueldeicaza/status/12241543855">found its way into Mono trunk</a> as what can be considered a preview release. The code has seen a major rewrite compared to the initial implementation done during earlier Google Summer of Code which lacked flexibility and correctness.</p>
<p>Public API is complete except some operator still not implemented. In addition and as implied by the preview title, the current code hasn&#8217;t been tested against all possible flavor of query so it might or might not work for you (i.e. deadlock). If that&#8217;s the case, don&#8217;t hesitate to fill a bug report with a query reproducing the problem. The more query I have, the more robust we can shape future release.</p>
<p>By the way, these <a href="http://blog.neteril.org/2009/08/16/how-to-get-the-max-out-of-your-plinq-query/">PLinq performance tips</a> still hold true.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2010/04/17/plinq-is-in/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mono @ OpenJam.ie</title>
		<link>http://blog.neteril.org/2010/03/22/mono-openjam-ie/</link>
		<comments>http://blog.neteril.org/2010/03/22/mono-openjam-ie/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 14:56:20 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.neteril.org/?p=868</guid>
		<description><![CDATA[<p align="center" style="text-align: center; padding-top: 0.5em; padding-bottom: 0.5em; margin-bottom: 1em;"><img src="http://blog.neteril.org/wp-content/uploads/2010/03/ubuntu07-ie_logo.png" alt="ubuntu07-ie_logo" title="ubuntu07-ie_logo" width="346" height="90" /> <img src="http://blog.neteril.org/wp-content/uploads/2010/03/mono-ireland.png" alt="mono-ireland" title="mono-ireland" width="100" height="120" ></p>
<p>The <a href="http://ubuntu-ie.org/">Ubuntu-ie</a> folks are running a slightly tuned Ubuntu Global Jam here in Dublin on Saturday 27th March where basically everyone is welcome to drop by and <del>slack</del>work on any project he wants.</p>
<p>The event has been dubbed <a href="http://openevents.ie/doku.php?id=openjam">OpenJam</a> and every Mono  hacker/enthusiast/bystander is most welcome to register on the Mono Corner of the <a href="http://openevents.ie/doku.php?id=openjam-signup">Signup page</a>.</p>
<p>More informations and day program is available on <a href="http://www.lczajkowski.com/2010/03/22/openjam-the-irish-ubuntu-global-jam/">Laura&#8217;s blog</a>.</p>
]]></description>
			<content:encoded><![CDATA[<p align="center" style="text-align: center; padding-top: 0.5em; padding-bottom: 0.5em; margin-bottom: 1em;"><img src="http://blog.neteril.org/wp-content/uploads/2010/03/ubuntu07-ie_logo.png" alt="ubuntu07-ie_logo" title="ubuntu07-ie_logo" width="346" height="90" /> <img src="http://blog.neteril.org/wp-content/uploads/2010/03/mono-ireland.png" alt="mono-ireland" title="mono-ireland" width="100" height="120" ></p>
<p>The <a href="http://ubuntu-ie.org/">Ubuntu-ie</a> folks are running a slightly tuned Ubuntu Global Jam here in Dublin on Saturday 27th March where basically everyone is welcome to drop by and <del>slack</del>work on any project he wants.</p>
<p>The event has been dubbed <a href="http://openevents.ie/doku.php?id=openjam">OpenJam</a> and every Mono  hacker/enthusiast/bystander is most welcome to register on the Mono Corner of the <a href="http://openevents.ie/doku.php?id=openjam-signup">Signup page</a>.</p>
<p>More informations and day program is available on <a href="http://www.lczajkowski.com/2010/03/22/openjam-the-irish-ubuntu-global-jam/">Laura&#8217;s blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2010/03/22/mono-openjam-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FOSDEM wrap up</title>
		<link>http://blog.neteril.org/2010/03/13/fosdem-wrap-up/</link>
		<comments>http://blog.neteril.org/2010/03/13/fosdem-wrap-up/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 02:28:02 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.neteril.org/?p=856</guid>
		<description><![CDATA[<p align="center"><a href="http://fosdem.org"><img src="http://blog.neteril.org/wp-content/uploads/2010/03/logofosdem2.jpg" alt="logofosdem2" title="logofosdem2" width="582" height="103" class="aligncenter size-full wp-image-859" /></a></p>
<p>This is kinda late but better than never.</p>
<p>This 10th edition of <a href="http://fosdem.org/">FOSDEM</a> was a blast again. Got to see back good friends and meet new people.</p>
<p>This year was a bit special too because we happened to have a <a href="http://fosdem.org/2010/schedule/devrooms/mono">dedicated room</a> for <a href="http://www.mono-project.com">Mono</a> thanks to the work of <a href="http://weblog.savanne.be/">Ruben </a> and <a href="http://blog.reblochon.org/">Stéphane</a>.</p>
<p>It was even more special for me since I also gave a talk about ParallelFx, your favorite parallel toolkit under Mono. Thanks to the work of <a href="http://andrius.six.lt/">Andrius</a>, we have a complete and high quality video coverage of the day and Ruben has actually nicely summed up all the different links to each presentation <a href="http://weblog.savanne.be/193-mono-fosdem-2010-slides-videos">on his blog</a>.</p>
<p>All talks were great and you have no excuse for not watching all of them. On a personal side and related to ParallelFx, I recommend <a href="http://monotorrent.blogspot.com/">Alan</a> talk on MonoTorrent (especially the part on threading) and Stéphane talk about <a href="http://tirania.org/blog/archive/2008/Nov-03.html">Mono.Simd</a>. I also really enjoyed <a href="http://jimpurbrick.com/">Jim Purbrick</a> talk on Second Life.</p>
<p>See you next year!</p>
<p align="center"><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/mADspHeopJ0&#038;hl=fr_FR&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/mADspHeopJ0&#038;hl=fr_FR&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://fosdem.org"><img src="http://blog.neteril.org/wp-content/uploads/2010/03/logofosdem2.jpg" alt="logofosdem2" title="logofosdem2" width="582" height="103" class="aligncenter size-full wp-image-859" /></a></p>
<p>This is kinda late but better than never.</p>
<p>This 10th edition of <a href="http://fosdem.org/">FOSDEM</a> was a blast again. Got to see back good friends and meet new people.</p>
<p>This year was a bit special too because we happened to have a <a href="http://fosdem.org/2010/schedule/devrooms/mono">dedicated room</a> for <a href="http://www.mono-project.com">Mono</a> thanks to the work of <a href="http://weblog.savanne.be/">Ruben </a> and <a href="http://blog.reblochon.org/">Stéphane</a>.</p>
<p>It was even more special for me since I also gave a talk about ParallelFx, your favorite parallel toolkit under Mono. Thanks to the work of <a href="http://andrius.six.lt/">Andrius</a>, we have a complete and high quality video coverage of the day and Ruben has actually nicely summed up all the different links to each presentation <a href="http://weblog.savanne.be/193-mono-fosdem-2010-slides-videos">on his blog</a>.</p>
<p>All talks were great and you have no excuse for not watching all of them. On a personal side and related to ParallelFx, I recommend <a href="http://monotorrent.blogspot.com/">Alan</a> talk on MonoTorrent (especially the part on threading) and Stéphane talk about <a href="http://tirania.org/blog/archive/2008/Nov-03.html">Mono.Simd</a>. I also really enjoyed <a href="http://jimpurbrick.com/">Jim Purbrick</a> talk on Second Life.</p>
<p>See you next year!</p>
<p align="center"><object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/mADspHeopJ0&#038;hl=fr_FR&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/mADspHeopJ0&#038;hl=fr_FR&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2010/03/13/fosdem-wrap-up/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Working on Mono with git-svn</title>
		<link>http://blog.neteril.org/2010/03/02/working-on-mono-with-git-svn/</link>
		<comments>http://blog.neteril.org/2010/03/02/working-on-mono-with-git-svn/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 00:23:17 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.neteril.org/?p=804</guid>
		<description><![CDATA[<p align="center"><img class="size-medium wp-image-807 " title="469147755_bfa4e757de_b" src="http://blog.neteril.org/wp-content/uploads/2010/03/469147755_bfa4e757de_b.jpg" alt="CC by-nd by W. T. L." width="450" height="300" /><br /><span style="text-align: center">CC by-nd by <a href="http://www.flickr.com/people/wtlphotos/">W. T. L.</a></span></p>
<p>I won&#8217;t go here in depth on how to use git, the official hub has already <a href="http://git-scm.com/documentation">tutorials</a> to get you started. I&#8217;m more interested here in the workflow you can apply and the tools you can use when working on Mono with git-svn (although it can be mostly used in a general way too).</p>
<p>Note: this post is heavily based on the <a href="http://www.mono-project.com/Accessibility:_GitSVN:_Workflow">materials</a> written by the accessibility team.</p>
<p>Note²: Prior of everything, your should first read <a href="http://mono-project.com/GitSVN">this guide</a> which explains how to setup your git-svn local copy using an existing git mirror. At this point, I expect that you have successfully completed that step.</p>
<h2>Mirroring your work</h2>
<p>The workflow I will describe here is rather destructive as you are going to end up merging some bits of git history when sending your commit to Subversion. As such, I strongly advise that you have another git mirror of your work somewhere to act as a backup with all your history.</p>
<p>You could either go public with your own <a href="http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way">server</a>/<a href="http://repo.or.cz/">repo.or.cz</a>/<a href="http://github.com/">github</a>/<a href="http://gitorious.org/">gitorious</a>/whatever or simply use a local copy situated e.g. on another drive.</p>
<p>In any case, this repository is not really meant for public consumption (i.e. people directly working on your git tree) as it&#8217;s going to be quite unstable with frequent history breaks.</p>
<p>When you are decided on where you want to host your mirror, add a remote to its location with the <code>git remote</code> command :</p>
<blockquote>
<pre>git remote add name foo@yourdomain.org:mcs.git</pre>
</blockquote>
<p>When you want to update your remote copy, just issue git push with the remote name and mirror option :</p>
<blockquote>
<pre>git push --mirror name</pre>
</blockquote>
<h2>Synchronizing with trunk</h2>
<p>The first thing to know is actually how to pull Subversion revisions back into your local repository. As with any command that have to deal with Subversion, the common prefix to use is <code>git svn</code>. This action must be done on the master branch so if you are on another one, switch back to master before doing anything else with <code>git checkout</code>.</p>
<p>Here, the command we are interested in is <code>git svn rebase</code>. This command will actually fetch the revisions from trunk, convert them to git commits and replay your local changes (if any) on top of them :</p>
<blockquote>
<pre>git svn rebase</pre>
</blockquote>
<h2>Making changes</h2>
<p>The equivalent of trunk in git is the master branch. This branch should remain clean of any change and should only be used when you are ready to commit your work to Subversion.</p>
<p>In git, branches are everywhere and are the most straightforward way to organize your changes hierarchically. As such, anything you plan to do should be separated in its own branch with a name like feature-xyz. You can also have feature branch that depends on another feature branch, I will talk about these one later and especially how to merge them back.</p>
<p>The command :</p>
<blockquote>
<pre>git checkout -b feature-xyz</pre>
</blockquote>
<p>Will switch you to a new branch where you can happily do your stuff.</p>
<p>What works well here is to follow the scheme : code a piece → commit → test → fix → commit. It will especially helps when you have to crawl back through your history at a later point with, for instance,<code> git bissect</code>.</p>
<p>Notice that commit message style at this point don&#8217;t matter, use the style that suit you the best because you are the only one who will read them.</p>
<p>During the lifetime of your development branch, it&#8217;s likely that some change introduced in Subversion will conflict with what you have done. As such, it&#8217;s always a good idea to frequently sync your local copy with Subversion (see above) and then rebase your development branches on top of master.</p>
<p>The <code>git rebase</code> command exactly serves that purpose and allows to rewrite partially or totally the history of a branch. In practise, this is as simple as issuing from the development branch :</p>
<blockquote>
<pre style="font: normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">git rebase master</pre>
</blockquote>
<p>As you see, git rebase is powerful tool but it&#8217;s also a destructive one in the sense that it rewrite your history. Rewriting history is the sort of thing that make git crazy when you are trying to pull from a repository modified that way. This is why your git backup should be considered unstable and why you have to always use a mirror or a force option with <code>git push</code>.</p>
<h2>Merging work and sending it to Subversion</h2>
<p>Let&#8217;s say your are happy with what you did, now you would like to send all that stuff to Subversion. Normally, your branch should be filled with small commits with message mainly consisting of &laquo;&nbsp;Ooops&nbsp;&raquo;, &laquo;&nbsp;Added part foo&nbsp;&raquo;  or &laquo;&nbsp;Debugging&nbsp;&raquo; which you definitely don&#8217;t want to see in the Subversion commit.</p>
<p>That&#8217;s why we are going to do a clean summary of the change you made, update the ChangeLogs accordingly and then use a pretty automagically generated log message for the Subversion commit.</p>
<p>First of all, switch back to master branch. Then issue the following command :</p>
<blockquote>
<pre>git merge --squash feature-xyz</pre>
</blockquote>
<p>What this do is that it takes the most recent version of the branch tree, generate a diff and then apply it to your master tree without committing. If you check with git status, you will see that these change are notified as &laquo;&nbsp;Going to be committed&nbsp;&raquo;.</p>
<p>That&#8217;s when we use our first tool : <a href="http://neteril.org/~jeremie/clng.py">clng.py</a>.</p>
<p>I suggest making an alias to it or putting it in a <em>PATH</em> directory to be able to invoke it directly from the command line.</p>
<p>As you can notice, the script expects some environment variable to be set. <em>EDITOR</em> tells which editor you want to use to edit ChangeLog (e.g. emacs), <em>CHANGE_LOG_NAME</em> contains the name that should be used in the ChangeLog (e.g. John Doe) and, finally, <em>CHANGE_LOG_EMAIL_ADDRESS</em> contains an email address that will be put in the ChangeLog next to your name (e.g. john.doe@foobar.com).</p>
<p>When you have set up those environment variable properly, then from the root of the repository (i.e. where the .git directory is), just call the script with no parameter which will prompt you to edit the ChangeLog corresponding to the files you have changed. That time, use a meaningful entry.</p>
<p>When all ChangeLog have been edited, you still have the option to fine tune them (if you made a typo for instance). When you are finished, call the following command to validate the ChangeLogs :</p>
<blockquote>
<pre>git add -u</pre>
</blockquote>
<p>Here now comes the second script, <a href="http://neteril.org/~jeremie/clm.py">clm.py</a>, that will gather and pretty print what you added to each ChangeLog. It uses the same environment variables than previously. </p>
<p>Then, simply type <code>git commit</code> and copy&amp;paste the commit message given by the script.</p>
<p>The two last steps are, first, to run again <code>git svn rebase</code> to make sure that no change got in between while we were doing the merge and, finally, launch the dcommit command to issue your commit to Subversion :</p>
<blockquote>
<pre>git svn dcommit</pre>
</blockquote>
<h2>Damn, I stumbled upon a bug</h2>
<p>It&#8217;s quite usual that during development time, you will notice several bugs in the code that is already on Subversion. Of course you would like to commit the fix right away because it&#8217;s an easy enough one. Only problem is that you are, most of time, stuck in the middle of something else with several changes in your working tree that haven&#8217;t been committed yet !</p>
<p>Enter <code>git stash</code>. This command will create a temporary branch were all your current changes are committed and then clean your working tree. That way you can painlessly switch back to your bug fixing branch, make some commits to solve the problem, and then push the fix to trunk with the same procedure as described above.</p>
<p>Now, it would be nice if what you were doing before take advantage of that fix (maybe it&#8217;s even a prerequisite). Good news is that you can use the same trick as in the sync section with <code>git rebase</code> to make your branch starts from the commit you just created.</p>
<h2>Working with a Subversion branch</h2>
<p>When you commit a fix, you probably want it to also live in the current stable branch of your software (Mono in our case). That require two things. First, you have to tell git-svn where the branch live and, second, you have to backport the fix.</p>
<p>Normally when you clone the repository in the guide above, you also get all the remote branches with it. If that&#8217;s the case then all is good and you can work from that point. If you don&#8217;t have the remote branch you are interested in, two options. Either you use <code>git fetch</code> to retrieve all the missing symbols (can take a good deal of time) or you directly put in the config the path of the branch you are interested in. Here is for instance the section to setup your Mono 2.6 branch :</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1735px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">[svn-remote "mono-2.6"]</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1735px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">url = svn+ssh://jlaval@mono-cvs.ximian.com/source</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1735px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">
<p>fetch = branches/mono-2-6/mcs:refs/remotes/git-svn/mono-2-6</p></div>
<blockquote>
<pre>[svn-remote "mono-2.6"]
  url = svn+ssh://foo@mono-cvs.ximian.com/source
  fetch = branches/mono-2-6/mcs:refs/remotes/git-svn/mono-2-6

[branch "mono-2.6"]
  remote = .
  merge = refs/remotes/git-svn/mono-2-6</pre>
</blockquote>
<p>The only step remaining is to duplicate the change you made to trunk to this maintenance branch which can be easily achieved with the <code>git cherry-pick</code> command. After the (eventual) conflicts are resolved, just issue <code>git svn dcommit</code> to validate this change.</p>
<h2>Merging branch of branch</h2>
<p>Sometimes, it happens that you are developing two things at the same time and that one of it is based on the second which translate by the fact that one of the branch depends on the other branch.</p>
<p>In that case, you are certainly going to end up committing the first branch first, continue a bit polishing the second one and ultimately commit it too. Problem is that, when the first branch get committed, the second one should in turn follows trunk/master happening.</p>
<p>Fortunately, <code>git rebase</code> comes again to the rescue with the onto switch. Simply merge and commit the first branch as described in the section above and then, from the second development branch, issue :</p>
<blockquote>
<pre>git rebase --onto master</pre>
</blockquote>
<p>It will move your second branch to depend on master which should happen flawlessly since the first changes are now mainline.</p>
<h2>Conclusion</h2>
<p>This post is of course far from exhaustive and if you have any more tip, share it in the comments.</p>
]]></description>
			<content:encoded><![CDATA[<p align="center"><img class="size-medium wp-image-807 " title="469147755_bfa4e757de_b" src="http://blog.neteril.org/wp-content/uploads/2010/03/469147755_bfa4e757de_b.jpg" alt="CC by-nd by W. T. L." width="450" height="300" /><br /><span style="text-align: center">CC by-nd by <a href="http://www.flickr.com/people/wtlphotos/">W. T. L.</a></span></p>
<p>I won&#8217;t go here in depth on how to use git, the official hub has already <a href="http://git-scm.com/documentation">tutorials</a> to get you started. I&#8217;m more interested here in the workflow you can apply and the tools you can use when working on Mono with git-svn (although it can be mostly used in a general way too).</p>
<p>Note: this post is heavily based on the <a href="http://www.mono-project.com/Accessibility:_GitSVN:_Workflow">materials</a> written by the accessibility team.</p>
<p>Note²: Prior of everything, your should first read <a href="http://mono-project.com/GitSVN">this guide</a> which explains how to setup your git-svn local copy using an existing git mirror. At this point, I expect that you have successfully completed that step.</p>
<h2>Mirroring your work</h2>
<p>The workflow I will describe here is rather destructive as you are going to end up merging some bits of git history when sending your commit to Subversion. As such, I strongly advise that you have another git mirror of your work somewhere to act as a backup with all your history.</p>
<p>You could either go public with your own <a href="http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way">server</a>/<a href="http://repo.or.cz/">repo.or.cz</a>/<a href="http://github.com/">github</a>/<a href="http://gitorious.org/">gitorious</a>/whatever or simply use a local copy situated e.g. on another drive.</p>
<p>In any case, this repository is not really meant for public consumption (i.e. people directly working on your git tree) as it&#8217;s going to be quite unstable with frequent history breaks.</p>
<p>When you are decided on where you want to host your mirror, add a remote to its location with the <code>git remote</code> command :</p>
<blockquote>
<pre>git remote add name foo@yourdomain.org:mcs.git</pre>
</blockquote>
<p>When you want to update your remote copy, just issue git push with the remote name and mirror option :</p>
<blockquote>
<pre>git push --mirror name</pre>
</blockquote>
<h2>Synchronizing with trunk</h2>
<p>The first thing to know is actually how to pull Subversion revisions back into your local repository. As with any command that have to deal with Subversion, the common prefix to use is <code>git svn</code>. This action must be done on the master branch so if you are on another one, switch back to master before doing anything else with <code>git checkout</code>.</p>
<p>Here, the command we are interested in is <code>git svn rebase</code>. This command will actually fetch the revisions from trunk, convert them to git commits and replay your local changes (if any) on top of them :</p>
<blockquote>
<pre>git svn rebase</pre>
</blockquote>
<h2>Making changes</h2>
<p>The equivalent of trunk in git is the master branch. This branch should remain clean of any change and should only be used when you are ready to commit your work to Subversion.</p>
<p>In git, branches are everywhere and are the most straightforward way to organize your changes hierarchically. As such, anything you plan to do should be separated in its own branch with a name like feature-xyz. You can also have feature branch that depends on another feature branch, I will talk about these one later and especially how to merge them back.</p>
<p>The command :</p>
<blockquote>
<pre>git checkout -b feature-xyz</pre>
</blockquote>
<p>Will switch you to a new branch where you can happily do your stuff.</p>
<p>What works well here is to follow the scheme : code a piece → commit → test → fix → commit. It will especially helps when you have to crawl back through your history at a later point with, for instance,<code> git bissect</code>.</p>
<p>Notice that commit message style at this point don&#8217;t matter, use the style that suit you the best because you are the only one who will read them.</p>
<p>During the lifetime of your development branch, it&#8217;s likely that some change introduced in Subversion will conflict with what you have done. As such, it&#8217;s always a good idea to frequently sync your local copy with Subversion (see above) and then rebase your development branches on top of master.</p>
<p>The <code>git rebase</code> command exactly serves that purpose and allows to rewrite partially or totally the history of a branch. In practise, this is as simple as issuing from the development branch :</p>
<blockquote>
<pre style="font: normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">git rebase master</pre>
</blockquote>
<p>As you see, git rebase is powerful tool but it&#8217;s also a destructive one in the sense that it rewrite your history. Rewriting history is the sort of thing that make git crazy when you are trying to pull from a repository modified that way. This is why your git backup should be considered unstable and why you have to always use a mirror or a force option with <code>git push</code>.</p>
<h2>Merging work and sending it to Subversion</h2>
<p>Let&#8217;s say your are happy with what you did, now you would like to send all that stuff to Subversion. Normally, your branch should be filled with small commits with message mainly consisting of &laquo;&nbsp;Ooops&nbsp;&raquo;, &laquo;&nbsp;Added part foo&nbsp;&raquo;  or &laquo;&nbsp;Debugging&nbsp;&raquo; which you definitely don&#8217;t want to see in the Subversion commit.</p>
<p>That&#8217;s why we are going to do a clean summary of the change you made, update the ChangeLogs accordingly and then use a pretty automagically generated log message for the Subversion commit.</p>
<p>First of all, switch back to master branch. Then issue the following command :</p>
<blockquote>
<pre>git merge --squash feature-xyz</pre>
</blockquote>
<p>What this do is that it takes the most recent version of the branch tree, generate a diff and then apply it to your master tree without committing. If you check with git status, you will see that these change are notified as &laquo;&nbsp;Going to be committed&nbsp;&raquo;.</p>
<p>That&#8217;s when we use our first tool : <a href="http://neteril.org/~jeremie/clng.py">clng.py</a>.</p>
<p>I suggest making an alias to it or putting it in a <em>PATH</em> directory to be able to invoke it directly from the command line.</p>
<p>As you can notice, the script expects some environment variable to be set. <em>EDITOR</em> tells which editor you want to use to edit ChangeLog (e.g. emacs), <em>CHANGE_LOG_NAME</em> contains the name that should be used in the ChangeLog (e.g. John Doe) and, finally, <em>CHANGE_LOG_EMAIL_ADDRESS</em> contains an email address that will be put in the ChangeLog next to your name (e.g. john.doe@foobar.com).</p>
<p>When you have set up those environment variable properly, then from the root of the repository (i.e. where the .git directory is), just call the script with no parameter which will prompt you to edit the ChangeLog corresponding to the files you have changed. That time, use a meaningful entry.</p>
<p>When all ChangeLog have been edited, you still have the option to fine tune them (if you made a typo for instance). When you are finished, call the following command to validate the ChangeLogs :</p>
<blockquote>
<pre>git add -u</pre>
</blockquote>
<p>Here now comes the second script, <a href="http://neteril.org/~jeremie/clm.py">clm.py</a>, that will gather and pretty print what you added to each ChangeLog. It uses the same environment variables than previously. </p>
<p>Then, simply type <code>git commit</code> and copy&amp;paste the commit message given by the script.</p>
<p>The two last steps are, first, to run again <code>git svn rebase</code> to make sure that no change got in between while we were doing the merge and, finally, launch the dcommit command to issue your commit to Subversion :</p>
<blockquote>
<pre>git svn dcommit</pre>
</blockquote>
<h2>Damn, I stumbled upon a bug</h2>
<p>It&#8217;s quite usual that during development time, you will notice several bugs in the code that is already on Subversion. Of course you would like to commit the fix right away because it&#8217;s an easy enough one. Only problem is that you are, most of time, stuck in the middle of something else with several changes in your working tree that haven&#8217;t been committed yet !</p>
<p>Enter <code>git stash</code>. This command will create a temporary branch were all your current changes are committed and then clean your working tree. That way you can painlessly switch back to your bug fixing branch, make some commits to solve the problem, and then push the fix to trunk with the same procedure as described above.</p>
<p>Now, it would be nice if what you were doing before take advantage of that fix (maybe it&#8217;s even a prerequisite). Good news is that you can use the same trick as in the sync section with <code>git rebase</code> to make your branch starts from the commit you just created.</p>
<h2>Working with a Subversion branch</h2>
<p>When you commit a fix, you probably want it to also live in the current stable branch of your software (Mono in our case). That require two things. First, you have to tell git-svn where the branch live and, second, you have to backport the fix.</p>
<p>Normally when you clone the repository in the guide above, you also get all the remote branches with it. If that&#8217;s the case then all is good and you can work from that point. If you don&#8217;t have the remote branch you are interested in, two options. Either you use <code>git fetch</code> to retrieve all the missing symbols (can take a good deal of time) or you directly put in the config the path of the branch you are interested in. Here is for instance the section to setup your Mono 2.6 branch :</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1735px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">[svn-remote "mono-2.6"]</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1735px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">url = svn+ssh://jlaval@mono-cvs.ximian.com/source</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1735px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">
<p>fetch = branches/mono-2-6/mcs:refs/remotes/git-svn/mono-2-6</p></div>
<blockquote>
<pre>[svn-remote "mono-2.6"]
  url = svn+ssh://foo@mono-cvs.ximian.com/source
  fetch = branches/mono-2-6/mcs:refs/remotes/git-svn/mono-2-6

[branch "mono-2.6"]
  remote = .
  merge = refs/remotes/git-svn/mono-2-6</pre>
</blockquote>
<p>The only step remaining is to duplicate the change you made to trunk to this maintenance branch which can be easily achieved with the <code>git cherry-pick</code> command. After the (eventual) conflicts are resolved, just issue <code>git svn dcommit</code> to validate this change.</p>
<h2>Merging branch of branch</h2>
<p>Sometimes, it happens that you are developing two things at the same time and that one of it is based on the second which translate by the fact that one of the branch depends on the other branch.</p>
<p>In that case, you are certainly going to end up committing the first branch first, continue a bit polishing the second one and ultimately commit it too. Problem is that, when the first branch get committed, the second one should in turn follows trunk/master happening.</p>
<p>Fortunately, <code>git rebase</code> comes again to the rescue with the onto switch. Simply merge and commit the first branch as described in the section above and then, from the second development branch, issue :</p>
<blockquote>
<pre>git rebase --onto master</pre>
</blockquote>
<p>It will move your second branch to depend on master which should happen flawlessly since the first changes are now mainline.</p>
<h2>Conclusion</h2>
<p>This post is of course far from exhaustive and if you have any more tip, share it in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2010/03/02/working-on-mono-with-git-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A FOSDEM talk primer</title>
		<link>http://blog.neteril.org/2010/01/21/a-fosdem-talk-primer/</link>
		<comments>http://blog.neteril.org/2010/01/21/a-fosdem-talk-primer/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 18:18:04 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Google Summer of Code 2009]]></category>
		<category><![CDATA[Mono]]></category>

		<guid isPermaLink="false">http://blog.neteril.org/?p=776</guid>
		<description><![CDATA[<p>(Shamelessly inspired from <a href="http://blog.reblochon.org/">Stéphane</a>)</p>
<p>Since image processing is both trendy and a good candidate for parallel optimizations, I took the time to implement a little program that compute a part of the <a href="http://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot set</a> (a well known fractal) in a fancy way :</p>
<p style="text-align: center; margin: 1em;"><img class="aligncenter size-medium wp-image-777" title="Lolipop" src="http://blog.neteril.org/wp-content/uploads/2010/01/lolipop-300x300.png" alt="Lolipop" width="300" height="300" /></p>
<p>Now for the facts &amp; numbers :</p>
<blockquote><p>
Sequential generation : <strong>26.5s</strong><br />
Parallel generation : <strong>13.7s</strong><br />
Effective speedup : <strong>2 times faster</strong> (dual core computer)<br />
# changes between sequential and parallel : <strong>3 lines</strong></p></blockquote>
<p>Oh, and this was done using the ParallelFx bundled with Mono 2.6 that you can already use today in your applications.</p>
<p>More informations and tips on Sunday 7th @ FOSDEM in Mono room. Don&#8217;t miss it !</p>
<p>PS: Also, don&#8217;t forget <a href="http://hackerspace.be/Mono_hack-a-day">Mono Hackaday</a> on Monday February 8th.</p>
]]></description>
			<content:encoded><![CDATA[<p>(Shamelessly inspired from <a href="http://blog.reblochon.org/">Stéphane</a>)</p>
<p>Since image processing is both trendy and a good candidate for parallel optimizations, I took the time to implement a little program that compute a part of the <a href="http://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot set</a> (a well known fractal) in a fancy way :</p>
<p style="text-align: center; margin: 1em;"><img class="aligncenter size-medium wp-image-777" title="Lolipop" src="http://blog.neteril.org/wp-content/uploads/2010/01/lolipop-300x300.png" alt="Lolipop" width="300" height="300" /></p>
<p>Now for the facts &amp; numbers :</p>
<blockquote><p>
Sequential generation : <strong>26.5s</strong><br />
Parallel generation : <strong>13.7s</strong><br />
Effective speedup : <strong>2 times faster</strong> (dual core computer)<br />
# changes between sequential and parallel : <strong>3 lines</strong></p></blockquote>
<p>Oh, and this was done using the ParallelFx bundled with Mono 2.6 that you can already use today in your applications.</p>
<p>More informations and tips on Sunday 7th @ FOSDEM in Mono room. Don&#8217;t miss it !</p>
<p>PS: Also, don&#8217;t forget <a href="http://hackerspace.be/Mono_hack-a-day">Mono Hackaday</a> on Monday February 8th.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2010/01/21/a-fosdem-talk-primer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mono happening @ FOSDEM</title>
		<link>http://blog.neteril.org/2009/12/11/mono-happening-fosdem/</link>
		<comments>http://blog.neteril.org/2009/12/11/mono-happening-fosdem/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 12:08:52 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.neteril.org/?p=744</guid>
		<description><![CDATA[<h2>Mono room</h2>
<p><img src="http://blog.neteril.org/wp-content/uploads/2009/12/fosdem_brain.png" alt="fosdem_brain" title="fosdem_brain" width="318" height="252" class="aligncenter size-full wp-image-768" /></p>
<p>So if you weren&#8217;t aware of it yet, Mono is going to have <a href="http://weblog.savanne.be/186-fosdem-2010-mono-developer-room-cfp">its own dedicated room</a> at <acronym title="Free and Open Source Software Developers' European Meeting">FOSDEM</acronym>. In order to spread Mono awesomeness, submit talks <a href="http://tinyurl.com/fosdem-2010-mono">here</a> before the 20th. You can even decide yourself how much time you are going to use so don&#8217;t hesitate to speak about a cool software you are working on, a nice hack you have done or a how-to on a library for instance.</p>
<h2>Mono Hackaday</h2>
<p><img src="http://blog.neteril.org/wp-content/uploads/2009/12/banner.png" alt="banner" title="banner" width="256" height="256" class="aligncenter size-full wp-image-754" /></p>
<p>As a side event, there will also be a Mono Hackaday the day after FOSDEM, i.e. Monday 8th, at <a href="http://hackerspace.be/">Hacker Space Brussels (HSB)</a> with all the vital hacker facilities (location details <a href="http://hackerspace.be/Location">here</a>). Everyone is welcome to drop by from 10am to 19pm. There is no precise goal for the hackaday, it&#8217;s just enjoying your normal and random hacking with other Mono fellows.</p>
<h2>Conclusion</h2>
<p>Anyway, in all case :</p>
<p align="center"><a href="http://www.fosdem.org"><img src="http://blog.neteril.org/wp-content/uploads/2009/12/going-to.jpg" alt="FOSDEM, the Free and Open Source Software Developers&#039; European Meeting" title="going-to" width="150" height="89" class="size-full wp-image-746" /></a></p>
<p>See you there (and bring your Rupert too) !</p>
]]></description>
			<content:encoded><![CDATA[<h2>Mono room</h2>
<p><img src="http://blog.neteril.org/wp-content/uploads/2009/12/fosdem_brain.png" alt="fosdem_brain" title="fosdem_brain" width="318" height="252" class="aligncenter size-full wp-image-768" /></p>
<p>So if you weren&#8217;t aware of it yet, Mono is going to have <a href="http://weblog.savanne.be/186-fosdem-2010-mono-developer-room-cfp">its own dedicated room</a> at <acronym title="Free and Open Source Software Developers' European Meeting">FOSDEM</acronym>. In order to spread Mono awesomeness, submit talks <a href="http://tinyurl.com/fosdem-2010-mono">here</a> before the 20th. You can even decide yourself how much time you are going to use so don&#8217;t hesitate to speak about a cool software you are working on, a nice hack you have done or a how-to on a library for instance.</p>
<h2>Mono Hackaday</h2>
<p><img src="http://blog.neteril.org/wp-content/uploads/2009/12/banner.png" alt="banner" title="banner" width="256" height="256" class="aligncenter size-full wp-image-754" /></p>
<p>As a side event, there will also be a Mono Hackaday the day after FOSDEM, i.e. Monday 8th, at <a href="http://hackerspace.be/">Hacker Space Brussels (HSB)</a> with all the vital hacker facilities (location details <a href="http://hackerspace.be/Location">here</a>). Everyone is welcome to drop by from 10am to 19pm. There is no precise goal for the hackaday, it&#8217;s just enjoying your normal and random hacking with other Mono fellows.</p>
<h2>Conclusion</h2>
<p>Anyway, in all case :</p>
<p align="center"><a href="http://www.fosdem.org"><img src="http://blog.neteril.org/wp-content/uploads/2009/12/going-to.jpg" alt="FOSDEM, the Free and Open Source Software Developers&#039; European Meeting" title="going-to" width="150" height="89" class="size-full wp-image-746" /></a></p>
<p>See you there (and bring your Rupert too) !</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2009/12/11/mono-happening-fosdem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wicd support patch for Banshee</title>
		<link>http://blog.neteril.org/2009/10/06/wicd-support-patch-for-banshee/</link>
		<comments>http://blog.neteril.org/2009/10/06/wicd-support-patch-for-banshee/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 21:25:38 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.neteril.org/?p=700</guid>
		<description><![CDATA[<p>Shameless plug to tell I&#8217;m alive <img src='http://blog.neteril.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  .</p>
<p>If you are using <a href="http://wicd.sourceforge.net/">Wicd</a> and usually stare at Banshee trying to download cover art or post to last.fm while you are disconnected, <a href="http://neteril.org/mono/wicd-support.patch">the following patch</a> add just the support to fix this.</p>
<p>Here is the associated <a href="https://bugzilla.gnome.org/show_bug.cgi?id=596918">bug report</a> to get the patch integrated.</p>
<p>In other news, school restarted with its bunch of new responsibilities, limiting significantly free hacking time.</p>
]]></description>
			<content:encoded><![CDATA[<p>Shameless plug to tell I&#8217;m alive <img src='http://blog.neteril.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  .</p>
<p>If you are using <a href="http://wicd.sourceforge.net/">Wicd</a> and usually stare at Banshee trying to download cover art or post to last.fm while you are disconnected, <a href="http://neteril.org/mono/wicd-support.patch">the following patch</a> add just the support to fix this.</p>
<p>Here is the associated <a href="https://bugzilla.gnome.org/show_bug.cgi?id=596918">bug report</a> to get the patch integrated.</p>
<p>In other news, school restarted with its bunch of new responsibilities, limiting significantly free hacking time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2009/10/06/wicd-support-patch-for-banshee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get the max out of your PLinq query</title>
		<link>http://blog.neteril.org/2009/08/16/how-to-get-the-max-out-of-your-plinq-query/</link>
		<comments>http://blog.neteril.org/2009/08/16/how-to-get-the-max-out-of-your-plinq-query/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 17:34:15 +0000</pubDate>
		<dc:creator>Jérémie Laval</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Google Summer of Code 2009]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.neteril.org/?p=685</guid>
		<description><![CDATA[<p>Here are some tips you should follow if you want to get the maximum performance out of a Linq query parallelized with PLinq (at least with upcoming Mono version) :</p>
<ul>
<li>
<p>Use an indexed data structure as your source like an array, a list or anything which implements the generic IList&lt;T&gt; interface.</p>
<p>You can also use <a href="http://msdn.microsoft.com/en-us/library/dd268181%28VS.100%29.aspx">ParallelEnumerable.Repeat</a> and <a href="http://msdn.microsoft.com/en-us/library/system.linq.parallelenumerable.range%28VS.100%29.aspx">ParallelEnumerable.Range</a> as input. Notice the &#8216;Parallel&#8217; word in front as it&#8217;s not the same as Enumerable.(Range|Repeat)</p>
</li>
<li>
<p>Never use an ordering operator like OrderBy and never assume that the query should be ordered.</p>
<p>The overloads of some operator that provide an index integer are also to avoid.</p>
</li>
<li>
<p>As a general rule, try to stick to the general scheme of <a href="http://msdn.microsoft.com/en-us/library/dd383966%28VS.100%29.aspx">Select</a>-<a href="http://msdn.microsoft.com/en-us/library/dd384150%28VS.100%29.aspx">Where</a>-<a href="http://msdn.microsoft.com/en-us/library/dd383667%28VS.100%29.aspx">Aggregate</a> with any number of Select and Where (like the famous <a href="http://en.wikipedia.org/wiki/MapReduce">MapReduce</a>).</p>
<p>The syntactic sugar operators based on Aggregate like Min, Max, Average, etc&#8230; can also be used.</p>
</li>
<li>
<p>If you can manage it in your code, use the <a href="http://msdn.microsoft.com/en-us/library/dd383744%28VS.100%29.aspx">ForAll</a> method with an action delegate instead of iterating over the query with <code>foreach</code></p>
</li>
<li>
<p>Of course, forbid any synchronization (locks, semaphore, &#8230;) inside the operator selectors/predicates. The purest your lambdas are, the better.</p>
</li>
<li>
<p>The functions used with operators should be predictive and stable i.e. not depend on something uncertain time-wise like a network call and should yield approximately the same execution time with each input.</p>
<p>Sure, this is not always possible but if it is, it does prevent the engine from having to repeatedly balance the query execution itself.</p>
</li>
</ul>
<p>The <a href="http://msdn.microsoft.com/en-us/library/dd460688%28VS.100%29.aspx">PLinq MSDN page</a> contains some additional tricks and explanations if you are interested.</p>
]]></description>
			<content:encoded><![CDATA[<p>Here are some tips you should follow if you want to get the maximum performance out of a Linq query parallelized with PLinq (at least with upcoming Mono version) :</p>
<ul>
<li>
<p>Use an indexed data structure as your source like an array, a list or anything which implements the generic IList&lt;T&gt; interface.</p>
<p>You can also use <a href="http://msdn.microsoft.com/en-us/library/dd268181%28VS.100%29.aspx">ParallelEnumerable.Repeat</a> and <a href="http://msdn.microsoft.com/en-us/library/system.linq.parallelenumerable.range%28VS.100%29.aspx">ParallelEnumerable.Range</a> as input. Notice the &#8216;Parallel&#8217; word in front as it&#8217;s not the same as Enumerable.(Range|Repeat)</p>
</li>
<li>
<p>Never use an ordering operator like OrderBy and never assume that the query should be ordered.</p>
<p>The overloads of some operator that provide an index integer are also to avoid.</p>
</li>
<li>
<p>As a general rule, try to stick to the general scheme of <a href="http://msdn.microsoft.com/en-us/library/dd383966%28VS.100%29.aspx">Select</a>-<a href="http://msdn.microsoft.com/en-us/library/dd384150%28VS.100%29.aspx">Where</a>-<a href="http://msdn.microsoft.com/en-us/library/dd383667%28VS.100%29.aspx">Aggregate</a> with any number of Select and Where (like the famous <a href="http://en.wikipedia.org/wiki/MapReduce">MapReduce</a>).</p>
<p>The syntactic sugar operators based on Aggregate like Min, Max, Average, etc&#8230; can also be used.</p>
</li>
<li>
<p>If you can manage it in your code, use the <a href="http://msdn.microsoft.com/en-us/library/dd383744%28VS.100%29.aspx">ForAll</a> method with an action delegate instead of iterating over the query with <code>foreach</code></p>
</li>
<li>
<p>Of course, forbid any synchronization (locks, semaphore, &#8230;) inside the operator selectors/predicates. The purest your lambdas are, the better.</p>
</li>
<li>
<p>The functions used with operators should be predictive and stable i.e. not depend on something uncertain time-wise like a network call and should yield approximately the same execution time with each input.</p>
<p>Sure, this is not always possible but if it is, it does prevent the engine from having to repeatedly balance the query execution itself.</p>
</li>
</ul>
<p>The <a href="http://msdn.microsoft.com/en-us/library/dd460688%28VS.100%29.aspx">PLinq MSDN page</a> contains some additional tricks and explanations if you are interested.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.neteril.org/2009/08/16/how-to-get-the-max-out-of-your-plinq-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
