Homework #1
This first homework will ask you to solve some problems from the textbook
and to do some work on your own related to locality and comparing perfomance.
Please keep in mind that all work
your turn in must be typed. Check the syllabus for more info.
|
Problem |
Page |
Points |
1 |
1.45 |
48 |
10 |
2 |
2.1 |
90 |
5 |
3 |
2.2 |
90 |
5 |
4 |
2.5 |
90 |
5 |
5 |
2.8 |
91 |
5 |
6 |
2.9 |
91 |
10 |
7 |
2.10 |
91 |
5 |
8 |
2.13 |
92 |
10 |
9 |
2.18 |
93 |
10 |
10 |
See #1 below |
50 |
11 |
See #2 below |
50 |
Maximum mark (100%) |
165 |
1. Using files that contain addresses issued by some CPU to execute some application(s),
draw the histogram of address distribution for each of them. On the Ox axis of the plot you will have the address number (don't start with zero,
rather with the smallest address you find in the file and go up to the maximum
address in the file). On the Oy axis you will have the number of occurences for each particular address.
Please comment based on the histogram. The names of the files are (on any of the systems
delta0 through delta8)
~virgil/cs470/varia/traces/benchmarks/tex.din
~virgil/cs470/varia/traces/benchmarks/cc1.din
The first contains the traces obtained by executing the TeX document
processor and the second one has been obtained using the cc
compiler to compile itself.
Each line in the file has two fields: the first field indicates what kind
of operation the CPU performs (read, write, etc.), and the second field
is the address; for this exercise you only need to consider the second
column in the file.
2. Write a program that multiplies two square matrices, whose elements are
randomly generated. You will have two versions of the program, one in which
matrix elements are integers and another one where they are real numbers.
You will compile and run the programs on two different systems (most likely
one of them will be some PC and the other one some workstation - delta0 through delta8).
Measure the time it takes the program to complete and then compare the performance
of the two systems. Since the matrices are randomly generated, you will
have to run the program several times, measure the running time and then
take the average. Also the running time has to be significantly large (many
seconds) to avoid measuring errors; this means you will have to work with
matrices that have at least tens of lines and columns.
Is the performance ratio the same as the clock rate ratio of the two systems?
Explain. Based on the retail price of the two systems, which one is more
cost effective? Make sure your work includes a description of the two systems
(manufacturer, CPU type, amount of memory, etc.) and of the compiler used.
|