MIME-Version: 1.0 Server: CERN/3.0 Date: Monday, 16-Dec-96 23:50:46 GMT Content-Type: text/html Content-Length: 2435 Last-Modified: Tuesday, 06-Feb-96 18:31:34 GMT
This assignment must be done in groups of two. Hand in one solution per group (printed, not manuscript).
You are, as so often, sitting on an Xterm and remotely logged into some random slow machine. You wonder how fast this turtle really is. As so often, the system files only give cryptic model numbers. So you decide to run a few experiments yourself. (The main goal of this homework is to get you familiar with taking precise measurements.)
Write a "10-line" program that measures the instruction execution rate of your processor. On SunOS use gettimeofday to take measurements.
Hints: You probably want to write a very tight loop. You probably also want to count the instructions in the loop using the compiler disassembly. You probably also want to make sure you time enough iterations to dwarf measurement overheads and few enough to avoid time-slice problems.
Run your benchmark on two different sparcstations and on one other "interesting" machine. Hand in your 10-line program, evidence that you are counting instructions correctly, and the results in MIPS. (Total one page max.)
Let's assume you want to run large simulations and therefore you are particularly interested in the memory hierarchy on the machines you found. Write a "1-page" program that allows you to determine the following cache characteristics: number of levels of cache, size of each cache, associativity of each cache, and block size of each cache.
Hints: don't write a program that prints the answers, instead, allocate a large array (use malloc) and stomp all over it in various well-crafted patterns. Time how long it takes per array access (again using many iterations). Graph the results and draw conclusions.
Run your benchmark on two different sparcstations, at least one of which should have two levels of cache. Hand in your program (one page of enscript -r2G max), the results/plots, and an explanation of the results (one page of explanations max).