Exercise OpenMP - Mandelbrot
mandelbrot. Understand program flow. Use
displayto show the image. Write down how long it takes.
- There is a copy of the original program as
mandelomp.c. This program does not compile at the moment.
mandelomp.c, substitute calls to
stop_timer()by calls to
omp_get_wtime(). Compile. Have you added the include file
omp.h? Use gcc 4.8 for the time beeing.
export OMP_NUM_THREADS=1and run.
mandelomp.cwith a simple
parallel for. Run with 1, 2 and 4 threads. Is the image the same?
- Modify the code in order to have a parallel section and a for worksharing construct. Is the image fine? Include a statement that tells us on how many threads we are running.
- Measure the scaling behaviour. (You
run.sh. The program
gnuplotis installed at
- Improve scaling behaviour by using
- How to further improve performance (some platforms, some compliers)?