TUNA Demos

We've seen some interesting demonstrations at the TUNA project meetings; here's some information about them for people who're interested in studying or modifying them.

Most of this software was implemented in occam-pi; to compile it, you'll need a recent version of the KRoC compiler compiled with pony support. Binaries are for IA32 PCs running Linux; you'll need the SDL and OpenGL libraries installed. If you have trouble getting the software to work, please ask Adam Sampson ( ats1@kent.ac.uk ).

Life (Adam Sampson and Damian Dimmich)

With OpenGL 3D display (./life -f 5 -c -w -x 100 -y 100 -o opengl):


With SDL 2D bitmap display (./life -f 5 -c -w -o sdlraster):


The Life demo implements John Conway's Game of Life cellular automaton, and shows off some notable features of occam-pi:

A full discussion of the strategies used by this and other process-oriented Life implementations can be found in our CPA2005 paper Lazy Cellular Automata with Communicating Processes; there's also the presentation Adam gave at CPA2005.

Download source code

Download Linux IA32 binary

Invoke the program as ./life --help to see the options available.

CDX (Fred Barnes and Adam Sampson)

cdxmandel with three workers:


The CDX library provides simple visualisation of bitmap graphics generated across a cluster of machines, and a (rather inefficient) network barrier implementation. I wouldn't suggest using CDX for new applications now that pony is stable -- see below.

The demonstration renders the Mandelbrot set, assigning a horizontal stripe to each worker. The output from the workers is coloured according to their number.

Download source code

To run the demo on a single host with three worker processes, you'll need to run all these processes at the same time (i.e. in different terminal windows):

To run across a network, you'll need to edit cdxmandel.occ to set the network hostnames of the cdxview and netbard hosts.

Clotting (Peter Welch)

This shows a couple of different approaches to a process-based model of blood clotting: one based on Steve Schneider's CSP model using multiway events, and one using occam-pi mobile channels.

Various agent-based simulations (Mark D'inverno)

Some of Mark's simulations can be found on interdisciplinary.co.uk. These use Processing, a "programming language and environment for people who want to program images, animation, and sound".

mandelbauer (Mario Schweigler and Adam Sampson)


This is one of the examples for Mario's pony project, a networked-channels framework for occam-pi, included in recent development versions of the KRoC distribution. It renders the Mandelbrot set in a distributed manner using a farming algorithm.

See the mandelbauer presentation from the TUNA meeting in May 2006, which includes process diagrams and benchmark results.

Download source code -- or just look in the pony/examples directory of the KRoC distribution. You'd probably do best to update your KRoC source tree to the latest Subversion version by doing ./build --svn-update; that'll ensure you have the very latest version of the pony code.

Download IA32 Linux binaries

To run mandelbauer, using the above binaries, with the master and one worker on the same host:

If you've built it from source, then ponyanstcpip should have been installed into KRoC's bin directory.

To run mandelbauer (and, indeed, pony programs in general) across multiple hosts, you need to make sure that the .pony.tcpip.ans file in the current directory contains a line to set the hostname of the machine running the ANS. For example:


You should then be able to start the master on one host, and slaves on as many others as you like. The -n option can be used to set node names explicitly. (See Mario's thesis for more information.)

By default, mandelbauer will operate in an interactive graphical mode. Hold down the left mouse button to zoom in, or the right mouse button to zoom out; the point under the mouse pointer will stay in the same place, so you can move around while zooming by moving the mouse while holding down a mouse button. You can press the U and D keys on the keyboard to change the iteration limit. If you're more interested in benchmarking than in pretty graphics, invoke mandelbauer with the -b option to put it in benchmark mode, and it won't do the display. There are various other options available; run ./mandelbauer --help to list them.

pony farming examples (Adam Sampson)

Since mandelbauer is rather complex, I've written basic implementations of the two approaches to farming described in the presentation which should be easier to read; these farm out a trivial job (generating lists of numbers) to a set of worker processes in the same ways mandelbauer does.

Download source code for farming_shared (View OccamDoc)

Download source code for farming_alting (View OccamDoc)

View the difference between the two programs, which shows the lines that I changed between farming_shared and farming_alting. Note that the code that generates, processes and receives jobs is the same in both (which is how it's possible for the mandelbauer program to use either approach at the cost of a bit more complexity in the framework code).

3D blood clotting (Carl Ritson)


This demonstration makes use of a number of new occam-pi features to simulate and visualise blood clotting in a large vessel, distributing the work across a cluster of machines. For more information, see the 3D Blood Clotting page.

TUNADemos (last edited 2006-11-20 17:55:03 by ats1)