Pthreads
Due: 5:00am, Friday, September 27, 2024
Get the Assignment Code
Login to your university Unix account and copy the assignment code to a location under your home directory:
cp -r /export/home/public/schwesin/cpsc328/assignments/project2 <LOCATION>
where <LOCATION>
is a directory of your choosing.
Description
The starter code contains an implementation of quicksort. The goal of this assignment is to create a parallel version of quicksort that uses pthreads. Your program will take several command line arguments; one of those is the number of threads to use. During the execution of your quicksort, if there are still threads available when the array is partitioned, then spawn a thread to sort each partition, otherwise call the non-parallel quicksort function on the partition.
Specifications
The name of the compiled program must be
p2
.The input to the program must be in the form of command line arguments as follows:
-h
(by itself with no other arguments) print the usage instructions-t <integer>
(required) number of threads to use-n <integer>
(required) size of the array to sort-s <integer>
(required) seed for the random number generator
The Makefile must be appropriately updated base on your implementation.
Turning in the Assignment
To turn in the assignment, execute the submit script by running the command
make submit
from within the project2
directory.
Grading Criteria
- Consistent coding style
- Modular design
- Correct implementation of the specification