CS475 Fall 2011 - Homework 1

OpenMP Programming


Objectives

The objective of this homework is to write four OpenMP programs, to debug and test them, and to experimentally determine the gains you get in running it in parallel on up to 8 (or possibly 16) processors on carver. The parallelizations are relatively simple, and the results should be pleasing in terms of performance/speedups.

As always, you should measure the performance of your parallelization as a function of the number of processors and the problem size, and analyze, plot and discuss your observations. For these programs, you may use the department machines for debugging and program development, but use carver for the final tests and data collection. Remember the environment/compiler options and/or commands may be different for each setup. However, it must be possible to switch back and forth simply by selecting an option to make.

1. Mandelbrot

You have already worked with this program in Lab 3, and have been able to set it op so that the program executes on carver. It returns a .pgm file for the Mandelbrot set. Using this as a starting point, develop and debug an OpenMP parallelization. Analyze this program for your report.

2. Jacobi Stencil 1D

Parallelize the Jacobi stencil computation from the provided sequential code (see below). You should make sure this runs on carver and that you are getting good speed up as the number of processors increases, but you do not need to analyze this program for the report.

3. Jacobi Stencil 2D

Extension of the previous problem, but the data is now a 2-D array that is updated using the values of four neighboring elements. Please, analyze the ruining time as a function of the number of processors and the problem size, plot and discuss your observations.

4. Matrix-vector Product

The objective of is to write an OpenMP program for the matrix-vector product. The sequential program for the Matrix-vector Product algorithm is provided below. You do not need to analyze this program for your report.

Provided Code

Jacobi 1D Jacobi 2D Mandelbrot Matrix-vector Product timer.c timer.h Makefile

Compile OpenMP Program

We are using gcc on both lab machine and carver. On the department lab machines, OpenMP is part of gcc, but you need to enable the OpenMP flag to compile, the flag for OpenMP is "fopenmp".

Questions to discuss in your report

The main question we want you to address in the report is how the performance (execution time) changes as a function o the number of processors. More specific details (e.g., input parameters and program size values to be used for the data) will be provided soon.

What/When:

How to Submit:

How to tar files:

Good luck and have fun!