Published online by Cambridge University Press: 06 January 2017
STEPS OF DESIGNING
As we stated in Section 3.1, a parallel algorithm is composed of a number of algorithm components. These components are intended to solve the subproblems into which the original problem has been divided. Normally, the components cooperate with each other using intermediate results of computation as well as synchronize their action. The desired output of the parallel algorithm is a composition of results computed by the algorithm components. Since the subproblems are solved by the components of a parallel program called tasks, we will use the terms subproblem and task interchangeably.
The process of designing a parallel algorithm consists of four steps:
□ decomposition of a computational problem into tasks that can be executed simultaneously, and development of sequential algorithms for individual tasks;
□ analysis of computation granularity;
□ minimizing the cost of the parallel algorithm;
□ assigning tasks to processors executing the parallel algorithm.
The following sections characterize these activities in more detail. In addition, we present some general methods for designing parallel algorithms, such as the method of data parallelism, the method of functional parallelism, the method of task pool, the method of master and slaves, and the method of pipelining. These methods differ from each other with respect to ways of exploiting potential parallelism in the computation that solve the problem, as well as with respect to the ways of assigning processors the tasks to be executed.
PROBLEM DECOMPOSITION
4.2.1 Types of Decomposition
Dividing a computational problem into tasks, called decomposition or partitioning, can be done in several ways. We will discuss them on examples
Example 4.1 Evaluation of test results
Let us examine a problem of evaluation of multiple-choice test results. Suppose that the test results are written on n sheets, where on each sheet there are m questions with marked answers.
To save this book to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.