1997-98 CS 284a

Homework One: Multithreaded Quicksort

Handed out: Wednesday, 15th October 1997.
Due in: Friday, 24th October 1997.

Introduction

Starting with the program provided, use the sthread_block() function to develop a correct and efficient multithreaded quicksort function. The program consists of three files: quicksort.h, quicksort.c, and main.c. Write the multithreaded quicksort function in quicksort.c. Use the main program provided to test and time your multithreaded quicksort function.

What to hand in

  1. Hand in your modified quicksort.c file.
  2. Time sequential and multithreaded quicksort of 25 million items using 1, 2, 4, 8, 16, 32, 64, 96, and 128 threads. Hand in a table giving the execution time and speedup of multithreaded quicksort over sequential quicksort for increasing number of threads. Hand in a graph showing speedup of multithreaded quicksort over sequential quicksort for increasing number of threads.
  3. Using the best number of threads for multithreaded quicksort of 25 million items, time multithreaded quicksort of 25 million items on 1, 2, 3, and 4 processors. Hand in a table giving the execution time and the speedup of multithreaded quicksort over sequential quicksort for increasing number of processors. Hand in a graph showing speedup of multithreaded quicksort over sequential quicksort for increasing number of processors.
  4. Using the best number of threads for multithreaded quicksort of 25 million items, time sequential and multithreaded quicksort of 10, 20, 30, 40, and 50 million items. Hand in a table giving the execution time and the speedup of multithreaded quicksort over sequential quicksort for increasing number of items. Hand in a graph showing speedup of multithreaded quicksort over sequential quicksort for increasing number of items.
  5. Hand in a short written performance analysis, discussing the issues that limit the speedup of multithreaded quicksort. Quantitatively estimate the overheads of thread management, load imbalance, and memory contention.

Notes

Grading

Your homework will be graded out of 20 points as follows:

You must follow the style of maintaining equivalent pragma and Sthreads versions of multithreaded functions.

Double your best speedup for sorting 25 million items.

Tables and graphs must be complete and well presented.

Your analysis must be accurate and insightful.