info
Your assignment is to add to roundrobin.m the Matlab commands
needed to
- Find the average time for each unique message size.
- Plot the average times in 2D, with x-axis having the
message size and the y-axis is time (in seconds).
- 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.
-
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:
- Be sure to label all of the plots thoroughly.
- Give a legend box for your plots.
- Choose a graph scaling
(plot, semilogx, semilogy, loglog) that best illustrates the
data.
- Document what you've done by inserting comments into the
file roundrobin.m. Most importantly, be sure to put your name
somewhere near the top of the file so I'll know to whom it belongs.
- If you plot some data, and then want to add more data to the
graph, you need to use the "hold" command. The existing 3D plot
does this, and you can use Matlab's help function to get more
info about hold.
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: