Project 2, CSCI A321/A521

Download the zipped tar file roundrobin.tar.gz to the computer where you run Matlab. The individual files contained in it are

  • roundrobin.m
  • model_results
  • test_results
  • info

    Your assignment is to add to roundrobin.m the Matlab commands needed to

    1. Find the average time for each unique message size.
    2. Plot the average times in 2D, with x-axis having the message size and the y-axis is time (in seconds).
    3. Using the two parameters t_lat and t_bw that the linear least squares solver yields, superimpose the line
          t(n) = t_lat + n*t_bw 
              
      on the graph using a different color line than the blue which the data points have. Since it is linear, you just need to compute two points on the line to get the whole line.
    4. Create a third graph that plots the linear least-squares line, along with the data in test_results. This is to see how predictive the model is. The data in the file test_results may have multiple timings for a single message size n, so plot all of them as data markers, without a line connecting consecutive data points.

    Some generic points I've covered in class:

    The reason for viewing the graphs is to determine if the linear model is good or not, a common scientific problem. If possible I'll update the data files with some more modern data, but you can proceed with the data sets in model_results and test_results - it won't have an effect on what you need to do with the roundrobin.m file.

    Estimated time

    : If after two hours you don't have a clue of what to do, see me. Four hours is an overgenerous allocation of time, so see me if you get stuck anywhere. Also, notice that you can write the plotting commands even before you find the averages, by just using one data point per message size. So if you're stuck on the averaging, skip ahead to the plotting.

    My solution to this assignment involves adding 14 lines of code excluding comments, so it probably will take at most 30 lines from you unless you decide to do more than the simple requirements above. It's unlikely anyone will write code as compressed as mine, and that's OK. Clarity is more important than conciseness. There's more than one way to skin a cat, but for the cat one way of skinning is probably more than he wants.

    Extras

    : Not part of this assignment, and not required at all, anyone who wants to go further could use error bars to indicate the range of reliability for each of the averaged times. It should not be a surprise to find the command is errorbar(). Also, for variety you might add a fourth plot, a histogram that compares the values that the linear model gives to the data in model_results.

    Hand-in:

    Email to a321@cs.indiana.edu your modified file roundrobin.m. I will not need the data files, since those should be unchanged.


    Page history:
  • First written: 02-Feb-2009 12:48:28 PM
  • Modified 02-Feb-2009 10:06:09 PM, to have the mailto link.
  • Modified 03-Feb-2009 01:05:46 PM, to add the errorbar and histogram parts.