User Tools

Site Tools


Lab 8

In this lab we'll add timing code to the Mandelbrot Set generator program goatbrot.c and time with various numbers of threads.

Grab the files from the directory Beej's goatbrot program. Build the program by running make. To get an idea of what the program does, run with this command line:

./goatbrot -i 8000 -o out.ppm

This says to generate the Mandelbrot Set with 8000 iterations (which is our problem size) and output the result to out.ppm, which you can view in by double-clicking the file in File Viewer.

Modify the makefile to enable OpenMP. Add timing code around the call to mandelbrot and rebuild the program by running make.

Add the -t flag to vary the number of threads (the default is 8). Use -t 1 to get the serial program time, as in:

./goatbrot -i 8000 -o out.ppm -t 1

As always, record the average of at least 3 runs.

  1. Run the program using 1, 2, 4, 8, and 16 threads and label each result with the thread count.
  2. Graph speedup versus number of threads. Include all speedup curves on one graph unless its too crowded, in which case split into two graphs, one for 1, 2, 4 threads and another for 8 and 16.
  3. Remember you are using Python, you can compute speedup in your script.
  4. Post the writeup in HTML format on your webpage.

When finished with the graph, look at the README.TXT file and try several different combinations of the -e and -m flags to get different funky images. Drop your favorite on your website. Hmmm…does Jupyter allow you to paste in a graphics file?

cs415pdc/lab8.txt · Last modified: 2017/11/28 15:50 by scarl