Submit your work work on the Blackboard before midnight the day the homework is due.
Failure to do so will result in late penalties, see
the syllabus for grading detail.
1.
Using trace files, i.e. 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 occurrences
for each particular address.
Comment based on the histograms. The files to use are:
The first file contains the trace obtained by executing Spice, the general-purpose, open source
analog electronic circuit simulator, and the second one comes from the CC compiler compiling 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.
HINT: your work will be significantly easier if you use standard UNIX utilities such as
awk and sort and a graphing application such as gnuplot.
2.
Write a program that multiplies two rectangular matrices - please no 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 (double).
You will compile and run the programs on two different systems -- most likely
one of them will be your own desktop/laptop and the other one a computer in the lab,
or otherwise on one of the UNIX computers IIT makes available to its students.
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 hundreds 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, operating system, etc.) and of the
compiler used.
Attach the source code and the tables with your time measurements for your work.