Permalink
Browse files

Update README.md

  • Loading branch information...
1 parent a8c33c5 commit b3cc6480fecc2c50ab9ea08b87509f079ffb3ea8 @Mongey committed May 9, 2012
Showing with 35 additions and 2 deletions.
  1. +35 −2 README.md
View
37 README.md
@@ -1,2 +1,35 @@
-Mandelbrot-Set-SSE-OMP
-======================
+Solution to CS3014 Concurrent Systems I Lab 2 - Mandelbrot Set by Conor Mongey & Alan Cross
+
+A Mandlebrot set refers to a set of complex numbers, real and imaginary parts, that correspond to points in a plane. The set is calculated by applying a recursive formula; if the results are within a specific bound, then C is a member of the Mandlebrot set.
+
+We were provided with a template program which computes and draws the Mandlebrot set to screen, within certain bounds. The goal of the assignment was to speed up this program with techniques learned in class such as code vectorization using SSE and parallelisation using OpenMP (pthreads if preferred). Although we could modify the program for optimisation purposes, we were not allowed to change the actual computation of the Mandlebrot set used in the template program.
+
+SSE
+====
+
+We identified the member function as a key slowdown in the rendering of the current program.
+We created a new function sse_member which returns a vector containing the iterations needed to identify if the coordinate was within the mandelbrot set.
+
+We passed in 4 X coordinates at a time, allowing us to do vector operations in parallel, which allowed for quicker processing times. The sse_member returns the number of iterations that each coordinate takes to process. When we return from the sse_member we check if the iterations is equal to the MAX_ITERATIONS, if it is not then we just print that coordinate black.
+
+We attempted to add more SSE optimisations to the code (currently commented out) but found that the image produced was inaccurate:
+
+OPENMP
+====
+
+
+We chose to parallelize our program with OpenMP. Firstly we decided which section(s) of our new program could be most suitably parallelized. We knew we were going to parallelize one of the loops of the program.
+
+The main while loop of the program could not be parallelized as this loop must be done iteratively as the madlebrot set must be printed out once at a time, not each new image of the set printing on top of each other.
+
+We then cancelled out parallelization of the inner for loop which cycles through the x coordinates as this would only be speeding up a small portion of the program (each 4x4 column of a single row).
+
+We finally decided on parallelizing the outer for loop which cycles through the y coordinates. This would allow for all rows of the set to be calculated in parallel. This resulted in a speedup of around 400%.
+
+
+Timings
+=======
+SSE Only
+
+SSE + OpenMP
+

0 comments on commit b3cc648

Please sign in to comment.