CMPT 370 Spring 2007
Lab2 (30 pts): Parallel Programming in OpenMP
In this lab, you will design and implement a parallel program of
your own choosing, to run on carmel.
- Choose a task that is computationally intensive, not I/O intensive or
network intensive. E.g., computing pi via Monte Carlo, not encrypting a large
file.
- You should use an OpenMP parallel construct of some sort (duh!), such as
#pragma omp parallel or #pragma omp for.
- Your lab write-up should show a table of
timing results using 1, 2, 4, and 8 threads,
and different numbers of iterations.
Ideally, we'd see a speedup with more threads, but if your code is right, you
won't lose marks if the speedup isn't dramatic.
Suggested project ideas
- Some suggestions to help you brainstorm:
- A numerical integration problem like the pi.c example shown in class
would be sufficient (choose your own different problem, though).
- Something cooler might be to compute
the Mandelbrot fractal. Some
sample serial code is available to help you
get started (it has an optional X-windows interface; you could try porting it
to FLTK or some other GUI).
- Be creative; have fun!
Lab write-up
- Follow the template lab write-up
to document your program. Name your write-up:
your_name_lab2_writeup.doc (or .txt, etc.)
Put it in the same project directory as your code so that it will be
included in the tarball.
Electronic turn-in
- Put everything (C++ code, header files, executable, lab
write-up) into a tarball/ZIP and upload it to eCourses under "Lab2":
your_name_lab2.tar.gz