Null Program

Christopher Wellons
mosquitopsu@gmail.com
Public GPG Key

Chris Wellons


Post Index - see a list of all of the entries.


RSS Logo RSS Feed




Hacker Logo

I am a computer engineer working at the Johns Hopkins University Applied Physics Laboratory. I love computers and free software.

Most of the topics you will find here are about hobby computing and programming with free software (and a few exceptions).

E-mail me: mosquitopsu@gmail.com


My Git Repositories


Projects:
- Brainfuck Compiler
- PNG Archiver
- BINI Tools
- Parallel Mandelbrot Generator


Archives:
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
June 2008
July 2008
August 2008
September 2008
December 2008
January 2009


This site is powered by blosxom and DreamHost.

01 Oct 2007

Mandelbrot Set on a Cluster

This the the second part of my post about clusters. Finally, here are some more pretty pictures and video to look at! It is an extremely parallel Mandelbrot set generator written in C.

This image was generated by my program on a cluster at my university, and my favorite image generated so far. It is part of the sequence in the videos below.

Mandelbrot set zoom

The reason I built my own cluster was to run this program. The generator forks off an arbitrary number of jobs (defined by a config file) to generate a single fractal, or a fractal zoom sequence. The cluster then automatically moves these jobs around to different nodes, making the fractal generation fast.

I wrote it with two goals in mind. I wanted it to be parallel so that it could easily take advantage of a cluster. I also wanted it to not use any external libraries. This is because a cluster is often a shared resource. Programs and libraries may only be available if installed by an administrator, meaning that extra libraries like libpng may not be available. For inter-process communication the generator uses simple pipes. So all you need here is a POSIX interface to the operating system, rather than some MPI implementation.

I used Andy Owen's handy bitmap library for writing out the bitmaps. I don't know how I could have done without it!

The only thing you need in order to run the fractal generator is a C compiler and a POSIX interface (GNU/Linux, *BSD, and other Unix-like systems). Extra capabilities are available if gzip is installed.

The generator is actually geared towards creating zoom sequences. Here are some I have put on YouTube. To view these videos with free software, see my post on YouTube with Free Software.

YouTube: Mandelbrot set zoom 3 w/ music
YouTube: Mandelbrot set zoom 2 (boring)
YouTube: Mandelbrot set zoom (boring)

For some much better quality video and in a free codec, here are two videos hosted right here. These are both the first video from above (without the music).

mandel-zoom.ogg - 27M, Ogg Theora (free codec)
mandel-zoom.avi - 40M, Xvid (free software, but patent-encumbered codec)

I use GNU Xaos to find good locations in the set for zoom sequences. It lets you zoom in real-time. Once I find a good spot, I tell my generator to render some nice images as a zoom sequence to it. Sometime I hope to write in an algorithm for auto-zooming. This way the generator could create zoom sequences automatically for hours on end. Xaos already has this capability for its real-time zooming.

An interesting thing I discovered: for these fractals at least, the gzipped bitmaps are (barely) smaller than the equivalent PNG versions. For the image above, the PNG version (produced by ImageMagick defaults) is 11586185 bytes. The gzipped bitmap version is 11586074 bytes. Plus, gzipping is faster. On my laptop, BMP to PNG (ImageMagick's convert) took 13.678s. Gzipping (default options) took 5.167s. I am as surprised as you are.

The project page with source code and documentation can be found at projects/mandel.

[] permanent link


Don't stop here! This isn't everything. Check out the archives (on the left) for more posts. Or just have a look at the index.