Upload a pdf file containing your solutions to the problems below to Learning Suite before 11:00pm on the assigned date.
Problem 424-3:
In this problem, you will explore some of the challenges of getting
reliable performance measures for the loop-based vector code examples
discussed in the book.
Part 2. Once you have the file cpecode.tar, place it in your directory of choice. From within that directory, typing "tar xvf *" will create a new "cpecode" subdirectory with all the files required to build the getcpe executable. Typing "make" within that subdirectory should produce an executable named getcpe. It should compile correctly under Linux or Mac OS X.
Part 3. To identify key parameters, start by considering what values control the number of iterations of important loops in the code.
Part 4. You'll be populating a 4x4 grid of CPE measurements. Do all
your work on one machine, but you can use any machine you want that
this code compiles and runs on -- it need not be a spice machine. Note
that the book reports results on ints while you will be using
longs. To get each desired data point, you'll need to edit one or more
of these files: getcpe.c, vector.h, and the Makefile (to change GCC
optimization levels). After your edits, you'll recompile and run the
new version. Also, you will find combine2, combine3 and combine4 in your book
(combine1 is already in the code).
Depending on your test
platform, you may encounter problems arising from the OS dynamically
scaling the processor speed, a power-saving feature that kicks in when
the CPU is lightly loaded. You can tell if this happens because the
processor speed reported by the "getcpe" program will be a small
fraction of what you would otherwise expect. The simplest solution is
to make sure that a handful of other programs are running (actually
consuming CPU resources) while you run "getcpe" and collect the
measurements you report.
Part 5. Focus your attention on anything that you find surprising. (It would be surprising to me if you got exactly the results reported in the book.) Different processors and different versions of GCC can produce quite different results, and our method for measuring GCC is not identical to that used by the authors of our text.