Getting Started

Download CS365_Lab11.zip on the cluster and unzip it. Change directory to the CS365_Lab11 directory.

Make sure that the directory /usr/local/bin is on your execution path. To check, run the command

which java

If you see the output

/usr/local/bin/java

then your path is configured correctly. If you see different input, execute the following command:

export PATH=/usr/local/bin:$PATH

The compile the program, run the command

ant

To run the Benchmark program, run either

ant benchmark_seq

ant benchmark_par

depending if you want sequential or parallel execution.

Note: you can (and should) compile and run your program on one of the compute nodes. For example,

ssh hitchhiker02

would allow you to run programs on the second cluster node (which is the first compute node). Pick one of hitchhiker02 through hitchhiker08.

Your Task

Modify the QuickSortTask class so that it implements a parallel quicksort algorithm. The compute method should do the following:

One other detail you will need to think about is what threshold value to use to determine when sequential sorting is used. The initial version of the code hard-codes the threshold at 10,000 elements. You can experiment with other values. Hint: could you compute a reasonable value using the number of array elements and number of available CPU cores?

Benchmarking

Collect benchmark data for both the sequential and parallel versions of the program. For each datapoint, calculate the speedup, which is the sequential execution time divided by the parallel execution time. What kind of speedups do you observe?