CS475 Fall 2009 - Homework 4

OpenMP Programming


Objectives

The objective of this homework is to write three OpenMP programs. The parallelizations of the first two are relatively simple, and the results should be pleasing in terms of performance/speedups. The third program is a bit more challenging.

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.

1. Jacobi Stencil computation

Parallelize the Jacobi stencil computation from the provided sequential code (see below). Please make sure that you modify the computation as follows. Make sure that the constant EPSILON is small enough (e.g., 10-6). Also make sure that the convergence test is correct, i.e., the program should stop when the maximum (over all i,j) of the absolute value of the change (i.e., the difference between curr and prev) is less than EPSILON, or if the number of iterations loop exceeds MAX_ITERATION.

Note: You must produce two executables for this program by default. See below for details

2. Row-wise knapsack

Return to the memory efficient program that fills up the knapsack in the row-wise order. Write, debug, analyze and report on an OpenMP parallelization of this program. You should use the knapsack.c provided in the previous homework for this assignment.

3. Needleman-Wunsch

The objective of is to write an OpenMP program for the well known Needleman-Wunsch algorithm for global sequence alignment. The sequential program for a simplified version of the Needleman-Wunsch algorithm is provided below.

Note that the default problem sizes are deliberately small for debugging purposes. Please make sure to change them appropriately when you gather performance data.

Provided Code

Jacobi 2D Needleman-Wunsch

Questions to discuss in your report

What/When/How to Submit:

Good luck and have fun!