531/735 Programming Assignment 4 - 20032
Due Date: Monday, February 16, 2004
Purpose:
The purpose of this programming assignment is to explore the shared memory (data parallel)
programming model using openMP on the SUN 450's, SMP (Symmetric MultiProcessor)
machines.
Implement the odd-even transposition sort using OpenMP (C or C++).
A five point bonus will be awarded to the person who shows the best speedup on
4 processors in combination with the fastest time.
Another five point bonus will be given to the person who is able to sort the
most numbers and in the fastest time.
Command Line Arguments:
To make it easier both for you to debug and me to grade, let's agree on
a convention for input/output control. Order matters.
- Where will the input come from
- stdin - stdin or redirected file
- random - randomly generated
- What kind of output do we want
- IO - Input numbers and sorted output
- Sorted - Sorted list only
- TimingOnly - Timing only
- How many numbers to sort (Should be at least 2) (Used with randome only)
Output:
If Sorted or IO is selected, make sure that you
print out ALL sorted numbers in order, not just a range per
processor!
What to Submit:
Hardcopy:
- A listing of your program(s).
- A discussion of the algorithm you implemented and of the
problems that you had to solve. Include discussion of what you tried, what worked, what didn't.
- A timing study of your project including problem size
vs the number of processors used, using a version of your program that has
been compiled using guidec. This should include charts and graphs of
sorting various data set sizes (try at least 100, 1000, 10000, 100,000, and
500,000, etc.) on various numbers of processors (1 - 4). Since the metrics often used
in parallel computing are speedup and efficiency, these should also be
calculated and plotted. (Please note that traditionally, the number of
processors is plotted on the x-axis and the time/speedup/efficiency are on the
y-axis.) Be sure to discuss your results AND COMPARE YOUR RESULTS WITH WHAT YOU ACHIEVED using MPI.
NOTE: You SHOULD be able to achieve speedup!
- A comparison of programming using the openMP data parallel model versus
parallaxis, C-linda, and MPI. Discuss such items as SIMD/MIMD, shared or
distributed memory, whether topology could/needed to be specified, flexibility,
ease of programming, and whether there were issues such as deadlock, synchronization or termination to deal with.
- A comparison of your experience in executing openMP programs on a
parallel machine with your experiences with C-linda and MPI.
In addition, you should be prepared to discuss your results with the
class.
You are to electronically submit a directory called lab4dir using the command:
submit -v ncs-grd 531lab4 lab4dir
or
submit -v ncs-grd 735lab4 lab4dir
where lab4dir contains your source program(s), data files, a makefile
and a README file that provides any information that I will need in
order to execute your program. Please have your main make target produce
an executable called OE that has been compiled using guidec and
that when executed requests that the user provide
the number of numbers to sort. The numbers to be sorted may be generated
randomly, but provide the user with the option of seeing both the input
data and the sorted output - perhaps by asking if they want to see it. Your final program should base it's setup on
the contents of the OMP_NUM_THREADS environment variable, not require
recompilation to change number of processors.
The gradesheet for this assignment is available here.
Nan C. Schaller
Rochester Institute of Technology
Computer Science Department
102 Lomb Memorial Dr.
Rochester, NY 14623-5608
telephone: +1.585.475.2139
fax: +1.585.475.7100
e-mail:
ncs@cs.rit.edu
November 25, 2003