[CSC 435] Exercise 1.2
Andrew J. Pounds
pounds_aj at mercer.edu
Thu Jan 25 13:10:12 EST 2007
The authors wording makes this problem a little different than I have
seen it presented before -- but here is how I would
proceed using their methods...
Since they only want the volume of data accessed for the denominator --
and since those data refer to three matrices, the total volume of data
should be 3 * N^2 (3 NxN matrices)
As far as the floting point calculations there are N^3 procedures of the
form
C += A * B
not counting the store, that's 2 floating point operations per procedure
-- or 2N^3 operations. So the ration should be (2*N^3)/(3*N^2) -- or
simply (2/3)*N
My problem with this is that it makes the ratio P_wm size dependent.
Typically one will count all of the memory ACCESSES -- in this case
there are two memory references and one store (3 operations) and these
are done N^3 times. This makes the P_wm ratio a constant (2/3). Then
anything you can do to increase the number in the numerator (because
those are things that happen in the processor) or decrease the number in
the denominator (because that typically causes the processor to wait)
will speed up your code.
> Dr. Pounds,
>
> I need help on 1.3. This answer is part of 1.2. I have the same
> answer as you, thank goodness.
>
> In 1.3, I am having trouble finding the ration p_wm of number of
> floating point operation to number of data values that have been
> obtained from memory in the square matrix product 1.8.1. It is hard
> to follow the method used in the example for this function.
>
>
>>
--
Andrew J. Pounds, Ph.D. (pounds at theochem.mercer.edu)
Associate Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
More information about the csc435
mailing list