Upgrading from a single processor to a n-way associated multi-processor should increase the computing power by N times. Is that true?
Suppose there are five friends who want to paint a house with five rooms. If the sizes of All rooms are the same, you can designate one for each person, as long as the five people paint at the same speed, the equivalent of a person who completes the paint is 5 times faster. If the size of each room is different, the problem will be much more complicated. For example, if one room is twice the speed of other rooms, the five people cannot get a 5-fold acceleration rate when working at the same time, because the completion time of the entire task depends on the room with the longest paint time.
Amdahl's law is like this: the improvement of the computer performance obtained after optimization measures are adopted for a part of the computer system depends on the proportion of the execution time in the whole execution time. In other words, the performance improvement of a part of optimization (parallel) is limited by the part that must be executed in serial mode.
The acceleration ratio of work is defined as the ratio of the time when a processor completes a job to the time when n processors are used concurrently to complete the job. P is the part that can be executed in parallel in the job. For the sake of simplicity, assume that it takes 1 unit of time for a single processor to complete the entire job. If n processors are used to concurrently execute the parallel part of the job, P/N is required, the serial part must be 1-P. Therefore, the working hours after parallelization are as follows:
1-P + P/N
According to the definition of the acceleration ratio
S = 1/(1-P + P/N)
Let's look back at the example of painting a room. Assume that each small room is 1 unit and the only large room is 2 units. Each room is painted with one person (processor), which means that five of the six units can be painted in parallel,
That is, P = 5/6/1-p = 1/6, S = 1/(1-P + P/N) = 1/(1/6 + 1/6) = 3. It can be seen that if one room is twice the size of other rooms, the acceleration ratio of the five people painting the room at the same time is only three times that of one person painting.
If 10 people paint 10 rooms respectively, and one room is twice the other room, the situation will be worse, S = 1/(1/11 + 1/11) = 5.5, it can be seen that the tiny imbalance only allowed 10 people to paint the house to get a 5.5-fold acceleration ratio, almost half of the expected value.