CSCI 3366 (Parallel and Distributed Processing), Fall 2017:
Homework 4

Credit:
20 points.

Reading

Be sure you have read, or at least skimmed, chapters 1 through 5 of the textbook.

Honor Code Statement

Please include with each part of the assignment the Honor Code pledge or just the word ``pledged'', plus one or more of the following about collaboration and help (as many as apply).1Text in italics is explanatory or something for you to fill in. For written assignments, it should go right after your name and the assignment number; for programming assignments, it should go in comments at the start of your program(s).

Overview

Your main mission for this assignment is write a parallel version of the well-known sorting algorithm quicksort, in Java. (If you don't remember the details of quicksort, the Wikipedia articleeems reasonable. The algorithm I want you to implement is the one that sorts in place. I also like the discussion here)

Details

Sequential program

(5 points)

To help you get started, I wrote a starter program to test and time the sort:

Comments in the code explain the command-line parameters. You will need to fill in the body of the sort method. Feel free to find code on the Web or in a textbook (though you should try to understand the code you use even if you don't write it yourself), and/or to add additional methods. (If you've never personally written an implementation of the quicksort algorithm, this would be a good opportunity to do so; it's something everyone who uses this algorithm should probably do at some point!)

Parallel program

(10 points)

The next steps is to write a parallel version of your program that allows you to specify the number of threads with an additional command-line argument. Of course(?), the program should print the number of threads along with timing results. You can use the mergesort example from the ``sample programs'' page as a model; it's a reasonable choice for a first implementation. Note however that, unlike mergesort, quicksort doesn't necessarily split the array into two pieces of roughly equal size, so you may not get very good performance for this approach. Still, it's a good first try and for this assignment will be good enough for full credit. I'll give extra credit (up to 5 points) if you do something more sophisticated. Hints coming soon?

Performance of parallel program

(5 points)

Once you have working parallel code, experiment with input values until you get a problem size/configuration big enough to make it reasonable to hope for good speedups with multiple UEs. (Given how quicksort works, once you find a problem size that seems big enough, you may find it interesting to try out more than one seed.) Then time your parallel program for at least two inputs (combination of problem size and seed) and different numbers of UEs and plot the results, as in Homeworks 2 and 3.

What to turn in and how

Turn in the following:

Submit your program source code by sending mail to bmassing@cs.trinity.edu. Send program source as attachments. You can turn in your plots and input data as hardcopy or by e-mail; I have a slight preference for e-mail and a definite preference for something easily readable on one of our Linux machines -- so, PDF or PNG or the like (in the past I think some students have sent me Excel spreadsheets, which -- I'd rather you didn't). Please use a subject line that mentions the course number and the assignment (e.g., ``csci 3366 homework 4'').



Footnotes

... apply).1
Credit where credit is due: I based the wording of this list on a posting to a SIGCSE mailing list. SIGCSE is the ACM's Special Interest Group on CS Education.


Berna Massingill
2017-11-09