Parallel & Distributed Solutions (College Board AP® Computer Science Principles): Revision Note
Benefits and limitations of parallel and distributed computing
Why use parallel or distributed computing?
Parallel computing consists of a parallel portion and a sequential portion
Solutions that use parallel computing can scale more effectively than solutions that use sequential computing
Distributed computing allows problems to be solved that could not be solved on a single computer because of either the processing time or storage needs involved
Distributed computing allows much larger problems to be solved quicker than they could be solved using a single computer
Comparing parallel and distributed computing
Feature | Parallel computing | Distributed computing |
|---|---|---|
What it does | Splits a program into operations that run simultaneously on multiple processors within a system | Uses multiple devices to run a program |
Why it is used | Completes tasks faster by performing operations at the same time | Solves problems too large for a single computer's processing time or storage |
Scaling | Scales more effectively than sequential computing | Enables problems to be solved that a single computer cannot handle at all |
Efficiency limitations
What limits the efficiency of parallel computing?
When increasing the use of parallel computing in a solution, the efficiency of the solution is still limited by the sequential portion
This means that at some point, adding parallel portions will no longer meaningfully increase efficiency
Every parallel solution has tasks that must run sequentially (e.g. initializing data before processing, or combining results after processing)
The sequential portion sets a minimum time that the solution cannot go below, regardless of how many processors are added
Examiner Tips and Tricks
The AP exam may describe a scenario where adding more processors does not significantly reduce the total time. The reason is always the sequential portion.
If a question asks why doubling the number of processors does not halve the execution time, the answer relates to the sequential tasks that cannot be parallelized. Remember that distributed computing is specifically about using multiple devices, not just multiple processors within one machine.
Worked Example
A company uses a sequential computing solution that takes 200 seconds to process a large dataset. The company switches to a parallel computing solution that reduces the processing time to 60 seconds. A programmer suggests adding more processors to further reduce the time. However, 30 seconds of the solution must always run sequentially.
Which of the following best explains why adding more processors will NOT reduce the time below 30 seconds?
(A) Parallel computing cannot process large datasets
(B) Adding processors increases the sequential portion of the solution
(C) The efficiency of the solution is limited by the sequential portion, which cannot be parallelized
(D) Distributed computing must be used instead of parallel computing for further improvement
[1]
Answer:
(C) The efficiency of the solution is limited by the sequential portion, which cannot be parallelized [1 mark]
The sequential portion sets a minimum execution time that cannot be reduced by adding more processors, so the solution can never complete in less than 30 seconds.
Unlock more, it's free!
Was this revision note helpful?