Projects/jrMandel

From juliano.info

Jump to: navigation, search

jrMandel

jrMandel.png
Last version: 0.1.2
License: GPL
Languages: C++
Status: Active

jrMandel is a command-line, parallel Mandelbrot set fractal renderer. It is specially designed to render high-resolution fractal images taking advantage of parallel processing, either by using multiple threads of execution (and thus suitable to run on multi-core processors) or by using a Parallel Virtual Machine (PVM) to distribute the tasks among the nodes of a computer cluster. jrMandel can also render fractals without using any parallelism, in order to compare the efficiency between parallel and non-parallel runs.

I wrote jrMandel in order to evaluate the performance of different distributed process scheduling algorithms during my Master's graduate work. The tools currently used to generate synthetic processing load were too simple and limited, and I wanted something that better reassembled a real parallel task, and with good randomness about the scheduling needs.

jrMandel is written in C++, and it's design is completely object-oriented. The tool is modularized into fractals (currently only mandelbrot is available), generators (standalone, threaded and pvm are available) and output-writers (pgm and null are currently available). It was designed to be easy to add more fractals, generators or output writers in future versions.

Currently, the only options for output are Portable Graymap (PGM) or null output (fractal is only rendered in memory, and then discarded). The output in pgm mode is simple enough to our needs, and since it is an uncompressed and non-interlaced format, it has the advantage of directly assembling the file from the various pieces that arrive unordered from the distributed system. The result is a grayscale image, but you can use ImageMagick's convert tool to colorize and convert the result.

Contents

Examples

Normal rendering

Example Mandelbrot set fractal generated by jrMandel and colorized by convert. It is focused on (0.0,-0.7), with 1024 iterations max.

The commands used to generate the above fractal were:

~$ jrMandel -w -0.15,-0.60:0.15,-0.80 -s 640,480 jrMandel-example1.pgm
~$ convert jrMandel-example1.pgm \
           -channel r -fx 'sin(3*pi*u)' \
           -channel g -fx 'sin(5*pi*u)' \
           -channel b -fx 'sin(8*pi*u)' jrMandel-example1.png

Distributed rendering

When running in pvm mode, the program recursively divides the image and spawn tasks to render each partition according to the its complexity. So, the final result is that complex regions of the fractal are deeper distributed to different tasks, while simpler regions tend to be handled by a fewer number of tasks.

The following is an example of distributed rendering using the pvm module. The lines highlight the different partitions that were distributed to different nodes for parallel processing.

Example of distributed rendering using the pvm module. The lines highlight the different partitions that were delegated to different nodes for parallel processing. Thus, seven tasks rendered different parts of the fractal in parallel. The focus is on (0.3535,-0.648).

The commands used to generate the above fractal were:

~$ jrMandel -w 0.348,-0.644:0.359,-0.652 -s 1024,768 \
            -G pvm --show-divs --divs=2,2 jrMandel-example2.pgm
~$ convert jrMandel-example2.pgm -fx 'sin(2.5*pi*u)' \
            -resize 640x480 jrMandel-example2.png

Requirements

  • Boost 1.33.1 or higher
  • PVM 3.4.0 or higher

Download

Views