# How do I calculate response time of a multiple core cpu when given certain information?

On my homework the question asks:

A program executes serially in 200 seconds. If it is parallelized, 7 seconds of overhead are required for synchronization, locking, and communication. Compute the execution time, ideal speedup (if there were no overhead required), actual speedup, and the percentage of the ideal speedup that is obtained for 1, 2, 4, 8, 16, 32, 64, and 128 processors.

How do I calculate the answer to this? It is not something that has been covered in class yet and the homework is due before the next time the class meets.

My guess is that I divide 200 seconds by the number of cores and then add 7 * # cores to get the total response time. I don't think it is that simple.

Edit:
Amdahl's law says: T(n) = T(1)[B + 1/n(1-B)] where B is the percentage of the algorithm that is not parallelized and n is the number of cores. If I assume that the 7 seconds mentioned is the part of the algorithm that is not parallelized, I can get the percentage by saying:

      7sec * n
B  =  --------
200sec


Then I plug the value for B into Amdahl's equation. Coencidentally, this gives me the same answers as I got before when I did my own formula:

 200
---  +  [7 * (n - 1)]
n


After doing a little bit of algebra, I discovered that my formula is a simplified version of Amdahl's formula. Of course all of this assumes I am correct when I read the question as if the 7 seconds are the part of the algorithm that is not parallelized.

Thanks for looking,

Zach

• Take a look at the Amdahl's law Jan 23 '15 at 20:41
• I did look at amdahl's law and I am not sure how to use it. The part I am not sure about is the part that is not parallelized. The question does not say what percentage of the algorithm is not parallelized. Jan 23 '15 at 20:49
• I would say that @MahdiDolati is right : the 7 seconds are to be counted only once. The sequential run takes 200s, two processes would take 107s, hence the speed up is 200/107=1.86 : not too far from the optimal situation (2). With 100 processes, the wall clock time would be 2+7=9s and the speed up would be 200/9=22.2, which is not very close to the ideal speed up (100). Jan 23 '15 at 20:55
• There is a problem in your approach. B is a fraction number and should be less than 1. But, say, n equals to 30 or more, then your formula for B will be greater than 1. Jan 25 '15 at 5:52