Sale!

CSC 4005 Assignment 2: Mandelbrot Set Computation solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (8 votes)

1 description
Set of points in a complex plane that are quasi-stable (will increase and decrease, but not exceed some
limt) when computed by iterating the function:
when is the th iteration of the complex number and is a complex number giving
the position of the point in the complex plan. (For example, in a image of height and width ,
. You can also scale the to obtain a different output).
The initial value for is zero. The iterations continued until the magnitude of is greater than a
threshold or the maximum number of iterations have been achieved. For . The magnitude of
is defined below:
Computing the complex function is simplfied by recognizing that:
Therefore, real part is the while the imaginary part is . The next iteration values can be
produced by computing:
You need to design your own method to partition the image and assign pixels to different threads or
processes.
For visualizing the Mandelbrot Set on an image, compute for each pixel, if is quasi-stable, draw this
pixel on the display using Imgui(for windows users where template is uploaded to bb) or Xlib(for mac or
windows users where template is uploaded to
http://www.cs.nthu.edu.tw/~ychung/homework/para_programming/seq_mandelbrot_c.htm).
2 requirement
• You need to implement two versions of the tasks, which are MPI version and a Pthread version. And
hand in the codes for these two versions in two seperate code files.
• In your submit code, it should display an image with size of 800 × 800.
• Include the results in your report.
• You need to specify the command line about how to compile and run your program.
zk+1 = z + c
2
k
zk+1
(k + 1) z = a + bi c
H W
c = + × i
x− height /2
height/4
y− width /2
width/4 c
z0 z𝕜
z = a + bi k
zk
zk = a +
2 b √‾‾‾‾‾‾‾2
zk+1 = z + c
2
k
z = + 2abi + b = − + 2abi
2 a
2
i
2 a
2 b
2
a −
2 b
2 2abi
zreal = z − + = 2 +
2
real
z
2
imag creal zimag zreal zimag cimag
z𝕜 z𝕜

• You need to compare the performance of different implementation and configurations in your report.
– The number of processes or threads used in the program
– MPI vs Sequential vs Pthread
– Size of the output images (three different sizes ranging from small, medium to large)
– More if you have
• You need to include two figures describing the structure of your MPI program and Pthread program.
• The report should be in appropriate format, with a title page, introduction session to introduce the basic
problem and task, method session to describe your parallel implementation, result session to compare
performance under different configurations, and a conclusion session which concludes your experiment
results.
3 Tips
• When measuring the running time of the program, make sure only measure the computation time.
(Because Imguiʼs or xlib’s drawing are time consuming.)
• You should start your homework as soon as possible, do not try to finish it in the last two days before
the deadline.
• Debug your program on the VM that is built on the image centos. Make sure the program is OK, only
after then measure the running time of the program on the server.
• Make sure use ‘sbatchʼ command to submit your jobs onto the master machine, do not directly run your
program on the master machine.
• Try to limit your program running time within 60 seconds. If your program is running slow, try to improve
your code or reduce the imageʼs size.
4 Where and What to Turn in Your Homework
• Please turn in a zip file includes
– Report
– codes
• zip your source codes and paper in a zip file, and name it studentID.zip, then submit it on Black board.
• Late submission penalty, 5 points deduction for each 12 hours after the deadline.

CSC 4005