Parallel and Distributed lec 9
Parallel and Distributed lec 9
Computing
COMP3139
Contents
• Granularity
• Fine-grained parallelism
• Coarse-grained parallelism
• Medium-grained parallelism
• Examples
GRANULARITY (PARALLEL COMPUTING)
3
GRANULARITY (PARALLEL COMPUTING)
• If Tcomp is the computation time and Tcomm denotes the communication time, then the
granularity G of a task can be calculated as:
G = T comp /T comm
• Granularity is usually measured in terms of the number of instruction which
are executed in a particular task.
• Execution time of a program, combining the computation time and communication time.
4
CATEGORIES
FINE-GRAINED PARALLELISM
5
FINE-GRAINED PARALLELISM
6
FINE-GRAINED PARALLELISM
7
FINE-GRAINED PARALLELISM (EXAMPLE)
• Assume there are 100 processors that are responsible for processing
the 10*10 image. Ignoring the communication overhead, the 100
processors can process the 10*10 image in 1 clock cycle. Each
processor is working on 1 pixel of the image and then communicates
the output to other processors. This is an example of fine-grained
parallelism.
8
FINE-GRAINED PARALLELISM (PSEUDOCODE FOR 100 PROCESSORS)
9
COARSE-GRAINED PARALLELISM
10
COARSE-GRAINED PARALLELISM (EXAMPLE)
11
COARSE-GRAINED PARALLELISM (PSEUDOCODE FOR
25 PROCESSORS)
12
MEDIUM-GRAINED PARALLELISM
13
MEDIUM-GRAINED PARALLELISM
(EXAMPLE)
• Consider that there are 25 processors processing the 10*10 image. The
processing of the image will now take 4 clock cycles. This is an example
of medium-grained parallelism.
14
MEDIUM-GRAINED PARALLELISM
(PSEUDOCODE FOR 2 PROCESSORS)
15
THANK YOU