GS510

Assignment 2-- Fall 2000

Due Date: Wednesday September 27, 2000

3. Let A and B be square matrices of order N defined as follows:

Generate two computer codes to calculate the product of the matrix A times the matrix B -- one code is the "standard" matrix multiply and the other arranges the code so that the inner loop has unit stride memory access. To help you get started, refer to these Fortran and C codes implementing the "standard" matrix multiply

For N-values of N = 32*k, k = 2,3,...,16, calculate a megaflop rate for each version of the matrix multiply code.

For this experiment to be meaningful, all arrays must be tightly dimensioned. You can expedite the collection of the N values and corresponding megaflop rates by doing the following:

Task 1:

Once you have recorded the megaflop rates for both versions for all the above N values, use aa graph to display the results of your numerical experiment.

Comment on how cache misses vary with N and with stride.

Turn in your two matrix multiply codes and hardcopy of your plots. On your plot, specify which matrix multiply algorithm is used and which compiler flag(s) you used.

Task 2:

Set N = 513 in your standard matrix multiply code (the one that doesn't rely on the symmetry of either of the matrices) and record six matrix multply times for the six possible nestings of the loops in the matrix multiply algorithm. Comment on the results of this experiment.