Exercise E9:
- Implement the parallel program mandelbrot. As starting point you can use the serial version. It has to be compiled
together with pic.c, for example by typing
> gcc smandelbrot.c pic.c -o smandelbrot
The required definitions are contained in pic.h which has to be copied to the
same place as pic.c and smandelbrot.c.
You can run the serial program smandelbrot with
> smandelbrot 1000 figureout.pnm
where the picture figureout.pnm is calculated. The first argument determines the size (number of pixels in horizontal direction). Note that
1000x1000 color pixels require about 3MB of memory! So do not take arguments
bigger that 5000 as first argument - it may use up your disk space.
- Test your parallel program with various picture sizes and number of processors.
- Determine the speedup of your parallel code compared to the serial version.
- In order to go to really large pictures sizes, remove the pnm_write
command and do not allocate space for the final picture. For timing this is good
enough - you automatically avoid any i/o delay.
- Implement a version of the program with static work distribution
(every porcessor gets a fixed group of lines to calculate as in exercise E8).
Compare the performance with the case of dynamic load distribution.
Back