CS 377P: Programming for Performance

Assignment 5: Shared-memory parallel programming (II)

Due date: April 10th, 2026, 9:00 PM

In this assignment, you will implement a pThreads program to perform the partitioning step in Quicksort in parallel. Recall that the partitioning step can become the bottleneck if it is done sequentially, even if the two recursive calls to Quicksort are executed in parallel. Parallelizing the partitioning step is nontrivial but as discussed in class, it can be done using the filter data-parallel operator, which in turn is implemented in parallel using the scan data-parallel operator. Read the entire assignment before starting to write your programs since the different parts build on each other.


1) Sequential partitioning implementation:

           
        What to turn in: (i) y
our code, (ii) a table with execution times for different array sizes, and (iii) a log-log plot of execution times vs. array sizes.

2) Parallel  partitioning using two filters:

3) Parallel partitioning using a single filter:

            What to turn in: same as in the previous part.


4) Report:
write a short report (one page) summarizing your implementation and conclusions from your experiments.