Lab 9 -- Performance Tweaks in C

11:59pm, Friday December 10th

Your job today is to examine the three different array multiplication schemes presented Friday in class and test their performance. You may work in groups.

  1. Create a program that generates three nxn arrarys and populates them with random numbers (you may use integers, floats, or doubles -- it's your choice).
  2. Create 3 functions corresponding to the three different algorithms for multiplying the matrices.
  3. Compile with gcc -pg -O0 yourProgram.c -o yourProgram
  4. Run your program and then run gprof yourProgram to deterimen how much time each of the three programs take.
  5. Graph the values of at least 8 different values of N. You may run either on the jazz or compute machines, but do not need to test both.
  6. Compile your program with the -O2 switch. Does this improve performance? Why or why not?
  7. Your (brief) write-up should include your graph, the different choices you made when writing the code, and the answer to the previous questions. You do not need to submit your code. Please email everything as a single .pdf to Matt. (If this is not possible, attach a .pdf of the graph to an email and put the text of your writeup within the text of the email.)