Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /web/htdocs/old-index.html
ViewVC logotype

View of /web/htdocs/old-index.html

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1474 - (download) (as text) (annotate)
Sun Aug 28 19:00:14 2011 UTC (10 years, 9 months ago) by jhr
File size: 8581 byte(s)
  prototype of new Diderot website
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <title>Diderot project home page</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="keywords" content="domain-specific language, image analysis and visualization, parallelism" />
  <meta name="generator" content="BBEdit 9.5">
  <link rel="stylesheet" href="./diderot.css" type="text/css">

<div class="logo"><img src="images/logo2-504x216.png" alt="The Diderot Project" width="504" height="216"></div>

The Diderot project is an effort to design and implement a <i>Parallel
Domain-specific Language</i> (PDSL) for image analysis and visualization.
We are particularly interested in a class of algorithms that are programmed
in terms of <em>continuous</em> scalar, vector, and tensor fields that
are reconstructed from the image data.
Our goals are to provide a high-level mathematical programming model for
these algorithms, while also providing high-performance implementations
on a variety of parallel hardware platforms.

  <li><a href="http://cs.uchicago.edu/~glk/">Gordon Kindlmann</a></li>
  <li><a href="http://cs.uchicago.edu/~jhr/">John Reppy</a></li>
  <li><a href="http://www.cs.uchicago.edu/people/lamonts">Lamont Samuels</a></li>
  <li><a href="http://www.cs.uchicago.edu/people/nseltzer">Nicholas Seltzer</a></li>

<h3>Language overview</h3>
The following is an overview of our current preliminary design for Diderot.
We are building a compiler for this design and expect that the design will
evolve as we get experience with the implementation.
Also, the design is conservative, in that it does not provide all of the features that
we plan to provide (<i>e.g.</i>, interactions between strands).

The main type of computational value in Diderot is a <em>tensor</em>, which includes
reals (0-order tensors), vectors, and matrices.
In addition, Diderot provides booleans, integers, and strings.
Diderot also has three <em>abstract</em> types:
    <dd>are used to represent the data being analyzed, as well as other array data, such as transfer
    <dd>are separable convolution kernels</dd>
    <dd>are an abstraction of functions from 1D, 2D, or 3D space to some tensor type.
    A field is defined by convolving an image with a kernel.

<h4>Program structure</h4>
<p>A Diderot program is organized into three logical sections:</p>
  <li>Global declarations define global values, such as fields, as well as the inputs to the program.</li>
  <li>Strand definitions define the computational agents that implement the program</li>
  <li>Initialization defines the initial set of strands and their structure</li>

A <em>strand</em> represents a mostly autonomous computation with local state, which includes
its <em>position</em> in world space.
A strand definition consists of declared state variables and methods.
All strands must have an <em>update</em> method and may optionally have a <em>stabilize</em>
Note that we used use the term <em>actor</em> for the computational entities, but that led to some
confusion with actor-languages, so we have changed the name to strand.

<h4>Execution model</h4>
<p>The Diderot execution model is <em>bulk synchronous</em>.
At each iteration, the update methods of all active strands are invoked, resulting in a new

<h4>An example: A simple volume renderer in Diderot</h4>
The following code is a simple diffuse-only volume rendering with head-light
written in Diderot.
It uses an opacity function that varies linearly between two values.
This example illustrates the use of probing both a field and its gradient.
<p class="warning">
This example uses Unicode characters for convolution (code point <tt>\u229B</tt>)
and differentiation (code point <tt>\u2207</tt>).
If your browser has trouble with displaying these characters, an
ASCII-only version can be found <a href="vr-lite-ascii.html">here</a>.

<div align="center">
<div align="left" class="code-display"><span class="code-type">input</span> <span class="code-type">string</span> dataFile;    <span class="code-comment">// name of dataset</span>
<span class="code-type">input</span> <span class="code-type">real</span> stepSz = 0.1;  <span class="code-comment">// size of steps</span>
<span class="code-type">input</span> <span class="code-type">vec3</span> eye;           <span class="code-comment">// location of eye point</span>
<span class="code-type">input</span> <span class="code-type">vec3</span> orig;          <span class="code-comment">// location of pixel (0,0)</span>
<span class="code-type">input</span> <span class="code-type">vec3</span> cVec;          <span class="code-comment">// vector between pixels horizontally</span>
<span class="code-type">input</span> <span class="code-type">vec3</span> rVec;          <span class="code-comment">// vector between pixels vertically</span>
<span class="code-type">input</span> <span class="code-type">real</span> valOpacMin;    <span class="code-comment">// highest value with opacity 0.0</span>
<span class="code-type">input</span> <span class="code-type">real</span> valOpacMax;    <span class="code-comment">// lowest value with opacity 1.0 </span>

<span class="code-type">image(3)[]</span> img = load (dataFile);
<span class="code-type">field#1(3)[]</span> F = img ⊛ bspln3;

<span class="code-kw">strand</span> RayCast (<span class="code-type">int</span> row, <span class="code-type">int</span> col)
    <span class="code-type">vec3</span> pos = orig + <span class="code-type">real</span>(row)*rVec + <span class="code-type">real</span>(col)*cVec;
    <span class="code-type">vec3</span> dir = (pos - eye)/|pos - eye|;
    <span class="code-type">real</span> t = 0.0;
    <span class="code-type">real</span> transp = 1.0;
    <span class="code-type">real</span> gray = 0.0;
    <span class="code-type">output</span> <span class="code-type">vec4</span>	rgba = [0.0, 0.0, 0.0, 0.0];

    <span class="code-kw">update</span> {
        pos = pos + stepSz*dir;
        <span class="code-kw">if</span> (inside (pos,F)) {
            <span class="code-type">real</span> val = F(pos);
            <span class="code-type">vec3</span> grad = ∇F(pos);
            <span class="code-type">vec3</span> norm = -grad / |grad|;
            <span class="code-kw">if</span> (val > valOpacMin) {  <span class="code-comment">// we have some opacity </span>
                <span class="code-type">real</span> opac =
			1.0 <span class="code-kw">if</span> (val > valOpacMax)
			<span class="code-kw">else</span> (val - valOpacMin)/(valOpacMax - valOpacMin);
                gray = gray + transp*opac*max(0.0, dot(-dir,norm));
                transp = transp*(1.0 - opac);
        <span class="code-kw">if</span> (transp < 0.01) {  <span class="code-comment">// early ray termination</span>
            transp = 0.0;
            <span class="code-kw">stabilize</span>;
        <span class="code-kw">if</span> (t > 40.0) {
            <span class="code-kw">stabilize</span>;
        t = t + stepSz;

     <span class="code-kw">stabilize</span> {
        rgba = [gray, gray, gray, 1.0-transp];


<span class="code-kw">initially</span> [ RayCast(r, c) | r in 0..199, c in 0..199 ];

We have a prototype language design that can handle simple examples, such as volume
rendering, and a compiler that currently generates C99 code with GCC vector extensions.
Our runtime supports both single processor and multiprocessor execution.
We are working on an OpenCL backend and plan to also support CUDA.

<h3>Further information</h3>
We have not published any papers on Diderot yet, but here are some unpublished documents that provide
additional details about the project.
  <li><a href="papers/msrc-talk-20100906.pdf"><em>Diderot: A parallel domain-specific language for image analysis</em></a>, talk
  given at Microsoft Research --- Cambridge, September 6, 2010.

We thank <a href="http://research.nvidia.com/content/academic-partnership-program">NVIDIA</a>
for hardware and financial support.

<hr />
Last modified: May 17, 2011.
<hr />


ViewVC Help
Powered by ViewVC 1.0.0