CIS-4230/5230 Homework #3 (Barriers and Thread Pools)

Due: Friday, March 6, 2020

Modify the "simple" parallel version of the Gaussian elimination program in two different ways. First, use barriers to remove the excessive amount of thread creation/destruction that goes on in the program. Second, use a thread pool to do the same thing. You should have two totally independent files; do not try to mix these two versions together! You can start with either your solution to Homework #2 as a base, or you can use my solution that I distributed earlier.

Note that my Spica library contains a ThreadPool module in C that you can use.

Next, evaluate the performance of the various versions. There are four versions to consider: the serial version (which you should use as your baseline), the "simple" parallel version you created in Homework #2 (or the one I provided), and the barriers version and the thread pool version. As before, measure their performance on a range of problem sizes from n=1000 to n=2000, computing the speed up relative to the serial version in each case.

The normal expectation is that using barriers or thread pools will reduce the thread management overhead and give improved results. However, this would only be true if the thread management overhead is a significant factor in holding back the simple parallel version. What results do you see? Which works better: barriers or thread pools?


Submit the two different version of linear_equations.c (barriers and thread pools), along with a document that shows your findings. Pack all of the files into a zip archive and submit that archive to Canvas.