<?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>nklein software &#187; mpi</title>
	<atom:link href="http://nklein.com/tags/mpi/feed/" rel="self" type="application/rss+xml" />
	<link>http://nklein.com</link>
	<description>software development and consulting</description>
	<lastBuildDate>Tue, 22 May 2012 03:48:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Installing mpich2 for use with CL-MPI</title>
		<link>http://nklein.com/2009/06/installing-mpich2-for-use-with-cl-mpi/</link>
		<comments>http://nklein.com/2009/06/installing-mpich2-for-use-with-cl-mpi/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 18:48:01 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[mpi]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=503</guid>
		<description><![CDATA[Some time back, I began writing some OpenMPI wrappers for Lisp. I got everything that I needed working, but I hardly scratched the surface of what MPI-2 makes available. Recently, Alex Fukunaga started up a blog about Lisp. One of the things he has done is make CFFI bindings for mpich2. Here is an introductory [...]]]></description>
			<content:encoded><![CDATA[<p>Some time back, I began writing some OpenMPI wrappers for Lisp.  I got everything that I needed working, but I hardly scratched the surface of what MPI-2 makes available.</p>
<p>Recently, Alex Fukunaga started up <a href="http://risupu.blogspot.com/">a blog about Lisp</a>.  One of the things he has done is make CFFI bindings for <a href="http://www.mcs.anl.gov/research/projects/mpich2/">mpich2</a>.  Here is an <a href="http://risupu.blogspot.com/2009/06/parallel-mandelbrot-computation-in-lisp.html">introductory post about those bindings</a> with a link to his <a href="http://code.google.com/p/cl-mpi/">CL-MPI site</a>.</p>
<p>Today, I have been working on getting his bindings up and running under Ubuntu Linux and Mac OS X.</p>
<p><span id="more-503"></span><br />
So far, it has been a nightmare trying to get mpich2 compiled on either platform.  It compiles famously if you just run</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">% ./configure --prefix=/usr/local</pre></div>
<p>However, that doesn&#8217;t build shared libraries.  Without shared libraries, the CFFI stub library happily links against the static library and happily imports zero of the symbols.  After sifting through <strong>configure &#8211;help</strong>, I decided that I should add <strong>&#8211;enable-dynamiclibs</strong>.  Doing so yells at me that I must also specify <strong>&#8211;enable-sharedlibs=type</strong>.  So, I sifted through the help again and decided to try:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ubuntu% ./configure --prefix=/usr/local --enable-dynamiclibs --enable-sharedlibs=gcc
macosx% ./configure --prefix=/usr/local --enable-dynamiclibs --enable-sharedlibs=gcc-osx</pre></div>
<p>Both compiles then bomb out saying <strong>MPIU_CALL_MPIDI_CH3</strong> is undeclared.  Yay.</p>
<p>Searching the web on the relevant errors, I discover that I do not need to enable dynamiclibs to get shared libraries.  Wheee.  Now, mpich2 is built on both architectures.</p>
<p>I added this target into <strong>cl-mpi/mpich2-stub/Makefile</strong>:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">libmpiskeleton.dylib: mpiskeleton.o
        mpicc -dynamiclib -o libmpiskeleton.dylib -dylib mpiskeleton.o</pre></div>
<p>and changed the bottom of <strong>cl-mpi/cl-mpi-configure.lisp</strong> to this:</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span>eval-<span style="color: #b1b100;">when</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">compile-toplevel</span> <span style="color: #66cc66;">:</span><span style="color: #555;">load-toplevel</span> <span style="color: #66cc66;">:</span><span style="color: #555;">execute</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>pushnew <span style="color: #66cc66;">:</span><span style="color: #555;">mpich2</span> *features*<span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; Use MPICH2                                     </span>
  <span style="color: #66cc66;">&#40;</span>defvar *mpi-header-file* <span style="color: #ff0000;">&quot;/usr/local/include/mpi.h&quot;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">;; For MPICH2, Need to load a special stub shared object, and not the MPICH s\</span>
hared library directly                                                          
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> load-mpi-foreign-libraries <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
    #-darwin
    <span style="color: #66cc66;">&#40;</span>cffi<span style="color: #66cc66;">:</span><span style="color: #555;">use-foreign-library</span> <span style="color: #ff0000;">&quot;/usr/local/asdf-install/site/cl-mpi/mpich2-stub/<span style="color: #000099; font-weight: bold;">\</span>
libmpiskeleton.so.1.0.1&quot;</span><span style="color: #66cc66;">&#41;</span>
    #+darwin
    <span style="color: #66cc66;">&#40;</span>cffi<span style="color: #66cc66;">:</span><span style="color: #555;">use-foreign-library</span> <span style="color: #ff0000;">&quot;/usr/local/asdf-install/site/cl-mpi/mpich2-stub/<span style="color: #000099; font-weight: bold;">\</span>
libmpiskeleton.dylib&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>After sorting out some svn merge problems in mpi-test.lisp, it appears as though it all works wonderfully on MacOSX.  Most of it seems to work under Ubuntu for me, but I have to look into some error messages more closely.</p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2009/06/installing-mpich2-for-use-with-cl-mpi/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>First decent images from my new raytracer</title>
		<link>http://nklein.com/2008/09/first-decent-images-from-my-new-raytracer/</link>
		<comments>http://nklein.com/2008/09/first-decent-images-from-my-new-raytracer/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 23:13:40 +0000</pubDate>
		<dc:creator>pat</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[mpi]]></category>
		<category><![CDATA[rt]]></category>

		<guid isPermaLink="false">http://nklein.com/?p=490</guid>
		<description><![CDATA[Some time ago, I wrote an n-dimensional raytracer in C++. It does a fair number of things, none of them efficiently, most of the rigidly. There are a bunch of things that I wanted to do with it for a long time, but it&#8217;s been too slow and rigid to make any of those things [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I wrote an <a href="http://www.nklein.com/products/rt">n-dimensional raytracer</a> in C++.  It does a fair number of things, none of them efficiently, most of the rigidly.</p>
<p>There are a bunch of things that I wanted to do with it for a long time, but it&#8217;s been too slow and rigid to make any of those things fun.</p>
<p>Enter Lisp.  As soon as it made it through my skull that Lisp is actually compiled (honest-to-goodness your-CPU instructions), I wanted to rewrite the whole thing in Lisp.  I have finally gotten started on doing that.  And, I just made it to the point where I&#8217;m actually tracing rays.  Here is a stereo pair of a three-dimensional scene:</p>
<p><center></p>
<table cellpadding="2" cellspacing="0">
<tr>
<td><a href="http://nklein.com/wp-content/uploads/2009/06/lrt-l.png"><img src="http://nklein.com/wp-content/uploads/2009/06/lrt-l.png" alt="lrt-l" title="lrt-l" width="240" height="135" class="alignnone size-full wp-image-491" /></a></td>
<td><a href="http://nklein.com/wp-content/uploads/2009/06/lrt-r.png"><img src="http://nklein.com/wp-content/uploads/2009/06/lrt-r.png" alt="lrt-r" title="lrt-r" width="240" height="135" class="alignnone size-full wp-image-492" /></a></td>
</tr>
</table>
<p></center></p>
<p><span id="more-490"></span></p>
<p>It use&#8217;s <a href="http://xach.livejournal.com/">xach</a>&#8216;s ZPNG library for output, my OpenMPI library for sharing work across machines, and a thin layer that I wrote on top of Portable Threads for threading within a machine.</p>
<p>It doesn&#8217;t yet do reflections and refractions, directional lights, or most of the shapes that my old raytracer does.<br />
But, it&#8217;s already got multithreading, MPI, more meaningful camera parameters, and functional color characteristics.</p>
<p>So, here&#8217;s the source code that generated the above images. Note that the one sphere has checkboarded diffuseness and the other has gradated phong-exponent and positional coloring.</p>
<div class="codecolorer-container lisp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><pre class="lisp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> make-checkerboard-func <span style="color: #66cc66;">&#40;</span>a b<span style="color: #66cc66;">&#41;</span>
  #'<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&amp;</span>amp<span style="color: #808080; font-style: italic;">;key position)</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>sum <span style="color: #66cc66;">&#40;</span>reduce #'+
			 position
			 <span style="color: #66cc66;">:</span><span style="color: #555;">key</span> #'<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span>vv<span style="color: #66cc66;">&#41;</span>
				  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&amp;</span>lt<span style="color: #808080; font-style: italic;">; 1.0 (mod vv 2.0)) 1 0)))))</span>
	<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">evenp</span> sum<span style="color: #66cc66;">&#41;</span> a b<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> my-universe <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">universe</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">spatial-dimensions</span> <span style="color: #cc66cc;">3</span>
		<span style="color: #66cc66;">:</span><span style="color: #555;">color-dimensions</span> <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>look-at <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">18.0</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>eye-offset <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.25</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>aspect <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">16.0</span> <span style="color: #cc66cc;">9.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>field-of-view <span style="color: #cc66cc;">120.0</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>object-scale <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">3.0</span> <span style="color: #cc66cc;">3.0</span> <span style="color: #cc66cc;">3.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>x-axis <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">1.0</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>y-axis <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">1.0</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>z-axis <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>angle <span style="color: #cc66cc;">10.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-transforms</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span>* eye-offset -<span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span>
			   <span style="color: #66cc66;">:</span><span style="color: #555;">look-at</span> look-at<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">camera</span> <span style="color: #66cc66;">:</span><span style="color: #b1b100;">name</span> <span style="color: #66cc66;">:</span><span style="color: #555;">main-camera-</span><span style="color: #b1b100;">l</span>
		   <span style="color: #66cc66;">:</span><span style="color: #555;">aspect</span> aspect
		   <span style="color: #66cc66;">:</span><span style="color: #555;">field-of-view</span> field-of-view<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-transforms</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span>* eye-offset <span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span>
			   <span style="color: #66cc66;">:</span><span style="color: #555;">look-at</span> look-at<span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">camera</span> <span style="color: #66cc66;">:</span><span style="color: #b1b100;">name</span> <span style="color: #66cc66;">:</span><span style="color: #555;">main-camera-r</span>
		   <span style="color: #66cc66;">:</span><span style="color: #555;">aspect</span> aspect
		   <span style="color: #66cc66;">:</span><span style="color: #555;">field-of-view</span> field-of-view<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> -<span style="color: #cc66cc;">5.0</span> -<span style="color: #cc66cc;">2.0</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">light</span> <span style="color: #66cc66;">:</span><span style="color: #555;">color</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.7</span> <span style="color: #cc66cc;">0.7</span> <span style="color: #cc66cc;">0.7</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> -<span style="color: #cc66cc;">10.0</span> -<span style="color: #cc66cc;">5.0</span> <span style="color: #cc66cc;">8.0</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">light</span> <span style="color: #66cc66;">:</span><span style="color: #555;">color</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.7</span> <span style="color: #cc66cc;">0.7</span> <span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-transforms</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> look-at
			   <span style="color: #66cc66;">:</span><span style="color: #555;">scaling</span> object-scale
			   <span style="color: #66cc66;">:</span><span style="color: #555;">look-at</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span>
			   <span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span> -<span style="color: #cc66cc;">1.0</span><span style="color: #66cc66;">&#41;</span>
			   <span style="color: #66cc66;">:</span><span style="color: #555;">rotation</span> <span style="color: #66cc66;">&#40;</span>x-axis y-axis angle<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-transforms</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> -<span style="color: #cc66cc;">1.5</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span>
			     <span style="color: #66cc66;">:</span><span style="color: #555;">color-scaling</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.75</span> <span style="color: #cc66cc;">0.75</span> <span style="color: #cc66cc;">0.75</span><span style="color: #66cc66;">&#41;</span>
			     <span style="color: #66cc66;">:</span><span style="color: #555;">color-rotation</span> <span style="color: #66cc66;">&#40;</span>y-axis z-axis angle<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-color</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">c</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.2</span> <span style="color: #cc66cc;">0.8</span> <span style="color: #cc66cc;">0.2</span><span style="color: #66cc66;">&#41;</span>
			       <span style="color: #66cc66;">:</span><span style="color: #555;">diffuseness</span> <span style="color: #66cc66;">&#40;</span>make-checkerboard-func <span style="color: #cc66cc;">0.2</span> <span style="color: #cc66cc;">0.6</span><span style="color: #66cc66;">&#41;</span>
			       <span style="color: #66cc66;">:</span><span style="color: #555;">specularity</span> <span style="color: #cc66cc;">0.4</span><span style="color: #66cc66;">&#41;</span>
	    <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">sphere</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-transforms</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">:</span><span style="color: #555;">translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">2.0</span> <span style="color: #cc66cc;">2.0</span> <span style="color: #cc66cc;">1.5</span><span style="color: #66cc66;">&#41;</span>
			     <span style="color: #66cc66;">:</span><span style="color: #555;">scaling</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">1.5</span> <span style="color: #cc66cc;">1.5</span> <span style="color: #cc66cc;">1.5</span><span style="color: #66cc66;">&#41;</span>
			     <span style="color: #66cc66;">:</span><span style="color: #555;">color-translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.2</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-color</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">c</span> #'<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&amp;</span>amp<span style="color: #808080; font-style: italic;">;key position)</span>
				   <span style="color: #66cc66;">&#40;</span>map 'vector #'<span style="color: #b1b100;">abs</span> position<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
			       <span style="color: #66cc66;">:</span><span style="color: #555;">diffuseness</span> <span style="color: #cc66cc;">0.6</span>
			       <span style="color: #66cc66;">:</span><span style="color: #555;">specularity</span> <span style="color: #cc66cc;">0.4</span>
			       <span style="color: #66cc66;">:</span><span style="color: #555;">phong-exponent</span> #'<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&amp;</span>amp<span style="color: #808080; font-style: italic;">;key position)</span>
						   <span style="color: #66cc66;">&#40;</span>+ <span style="color: #cc66cc;">10</span>
						      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">abs</span> <span style="color: #66cc66;">&#40;</span>* <span style="color: #cc66cc;">100</span>
							     <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">aref</span> position <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>
							     <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">sphere</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-rotation</span> <span style="color: #66cc66;">&#40;</span>x-axis y-axis angle<span style="color: #66cc66;">&#41;</span>
	  <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-translation</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> -<span style="color: #cc66cc;">15.0</span> <span style="color: #cc66cc;">0.0</span> <span style="color: #cc66cc;">0.0</span><span style="color: #66cc66;">&#41;</span>
	    <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-color</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">c</span> <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">0.8</span> <span style="color: #cc66cc;">0.2</span> <span style="color: #cc66cc;">0.2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	      <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">halfspace</span> <span style="color: #66cc66;">:</span><span style="color: #b1b100;">name</span> <span style="color: #66cc66;">:</span><span style="color: #555;">hspace1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
#+<span style="color: #66cc66;">:</span><span style="color: #555;">openmpi</span>
<span style="color: #66cc66;">&#40;</span>mpi<span style="color: #66cc66;">:</span><span style="color: #555;">init</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">with-workers</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
   <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>uu <span style="color: #66cc66;">&#40;</span>my-universe<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	 <span style="color: #66cc66;">&#40;</span>dpd <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">v</span> <span style="color: #cc66cc;">2.0</span> <span style="color: #cc66cc;">2.0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
     <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">render-png</span> <span style="color: #66cc66;">:</span><span style="color: #555;">dots-per-degree</span> dpd
		    <span style="color: #66cc66;">:</span><span style="color: #555;">universe</span> uu
		    <span style="color: #66cc66;">:</span><span style="color: #555;">filename</span> #P<span style="color: #ff0000;">&quot;output-l.png&quot;</span>
		    <span style="color: #66cc66;">:</span><span style="color: #555;">camera-</span><span style="color: #b1b100;">name</span> <span style="color: #66cc66;">:</span><span style="color: #555;">main-camera-</span><span style="color: #b1b100;">l</span><span style="color: #66cc66;">&#41;</span>
     <span style="color: #66cc66;">&#40;</span>rt<span style="color: #66cc66;">:</span><span style="color: #555;">render-png</span> <span style="color: #66cc66;">:</span><span style="color: #555;">dots-per-degree</span> dpd
		    <span style="color: #66cc66;">:</span><span style="color: #555;">universe</span> uu
		    <span style="color: #66cc66;">:</span><span style="color: #555;">filename</span> #P<span style="color: #ff0000;">&quot;output-r.png&quot;</span>
		    <span style="color: #66cc66;">:</span><span style="color: #555;">camera-</span><span style="color: #b1b100;">name</span> <span style="color: #66cc66;">:</span><span style="color: #555;">main-camera-r</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
#+<span style="color: #66cc66;">:</span><span style="color: #555;">openmpi</span>
<span style="color: #66cc66;">&#40;</span>mpi<span style="color: #66cc66;">:</span><span style="color: #555;">finalize</span><span style="color: #66cc66;">&#41;</span></pre></div>
<p>And, here are the same images swapped for those of you who prefer cross-eyed stereo pairs:</p>
<p><center></p>
<table cellpadding="2" cellspacing="0">
<tr>
<td><a href="http://nklein.com/wp-content/uploads/2009/06/lrt-r.png"><img src="http://nklein.com/wp-content/uploads/2009/06/lrt-r.png" alt="lrt-r" title="lrt-r" width="240" height="135" class="alignnone size-full wp-image-492" /></a></td>
<td><a href="http://nklein.com/wp-content/uploads/2009/06/lrt-l.png"><img src="http://nklein.com/wp-content/uploads/2009/06/lrt-l.png" alt="lrt-l" title="lrt-l" width="240" height="135" class="alignnone size-full wp-image-491" /></a></td>
</tr>
</table>
<p></center></p>
]]></content:encoded>
			<wfw:commentRss>http://nklein.com/2008/09/first-decent-images-from-my-new-raytracer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

