SlideShare a Scribd company logo
B Y
DR. HEMAN PATHAK
Associate Professor
Dept. of Comp. Sc., KGC - Dehradun
1
Book
PARALLEL COMPUTING
THEORY AND PRACTICE
By Michel J. Quinn
CHAPTER – 2
2
This paper is about the
designing of efficient
algorithms for real parallel
computers
Random Access Machine (RAM)
Algorithms can be measured in a machine-independent
way using the Random Access Machine (RAM) model. This
model of computation is an abstraction that allows us to
compare algorithms on the basis of performance.
 This model assumes a single processor.
 In the RAM model, instructions are executed one after
the other, with no concurrent operations.
3
4
The assumptions made in the RAM are:
 Each simple operation takes 1 time step.
 Loops and subroutines are not simple operations.
 Each memory access takes one time step, and there is no
shortage of memory.
 For any given problem the running time of an algorithms is
assumed to be the number of time steps. The space used by
an algorithm is assumed to be the number of RAM memory
cells.
Random Access Machine (RAM)
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
5
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
6
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
7
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
8
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
9
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
10
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
11
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
12
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
13
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
14
15
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
0 1
1 2
2 4
3 8
: :
p 2p
lb(x) or log2(x): Log base 2, also known as the binary
logarithm, is the logarithm to the base 2.
The binary logarithm of x is the power to which the
number 2 must be raised to obtain the value x.
log2(1) = 0 log2(2) = 1 log2(4) = 2
log2(8) = 3 log2(16) = 4 log2(32) = 5
p steps for 2p Processors
log2(p) steps for
log2(2p)=p Processors
If p is perfect power of
2 otherwise log2(p)
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
18
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
19
Sequential Algorithm
Sum = 0
for i = 0 to n-1 do
sum = sum + a[i]
endfor
Time Complexity = (n)
20
Sum of n elements
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
21
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
22
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
23
Step 1: PEs Required 𝑛/2
Step 2: PEs Numbers i = 0 to 𝑛/2 -1
Step 3: Sequential Loop
j = 0 to log 𝑛 -1
Step 4: Which PEs will participate
i mod 2j =0 and 2i+ 2j < n
Step 5: What is to be done in each step
A[2i] = A[2i] + A[2i + 2j ]
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
24
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
25
26
Prefix Sum
Sequential algorithm
for i = 1 to n-1 do
a[i] = a[i-1] + a[i]
endfor
Time Complexity = (n)
27
Prefix Sum
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
28
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
29
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
30
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
31
32
List Ranking
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
33
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
34
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
35
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
36
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
37
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
38
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
39
40
Pre-order Tree Traversal
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
41
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
42
EXAMPLE
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
43
AB
BD
DB
BE
EC
CE
EH
HE
EB
BA
AC
CF
FC
CA
1
1
0
1
1
0
1
0
0
0
1
1
0
0
EXAMPLE
No. of Vertices = 8 (n)
No. of edges = 7 (n-1)
Forward edges = 7 (n-1)
Backward edges = 7 (n-1)
Total Edges = 14 2(n-1)
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
44
EXAMPLE
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
45
EXAMPLE
(C,F)
Vertices A B C D E F G H
Positions 1 7 2 6 5 1 4 3
Prorder 1 2 7 3 4 8 5 6
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
46
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
47
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
48
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
49
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
50
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
51
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
52
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
53
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
54
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
55
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
56
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
57
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
58
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
59
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
60
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
61
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
62
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
63
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
64
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
65
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
66
Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
67
Ad

More Related Content

What's hot (20)

Amdahl`s law -Processor performance
Amdahl`s law -Processor performanceAmdahl`s law -Processor performance
Amdahl`s law -Processor performance
COMSATS Institute of Information Technology
 
Pumping lemma Theory Of Automata
Pumping lemma Theory Of AutomataPumping lemma Theory Of Automata
Pumping lemma Theory Of Automata
hafizhamza0322
 
Chapter 6 pc
Chapter 6 pcChapter 6 pc
Chapter 6 pc
Hanif Durad
 
Inference in Bayesian Networks
Inference in Bayesian NetworksInference in Bayesian Networks
Inference in Bayesian Networks
guestfee8698
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
SOMNATHMORE2
 
4 greedy methodnew
4 greedy methodnew4 greedy methodnew
4 greedy methodnew
abhinav108
 
Topological Sorting (Decrease and Conquer)
Topological Sorting (Decrease and Conquer)Topological Sorting (Decrease and Conquer)
Topological Sorting (Decrease and Conquer)
Gem WeBlog
 
Introduction to algorithms
Introduction to algorithmsIntroduction to algorithms
Introduction to algorithms
subhashchandra197
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
Dr Shashikant Athawale
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFA
Maulik Togadiya
 
Paging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantagePaging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantage
sohinibanerjee121
 
Master theorem
Master theoremMaster theorem
Master theorem
fika sweety
 
Data decomposition techniques
Data decomposition techniquesData decomposition techniques
Data decomposition techniques
Mohamed Ramadan
 
Np hard
Np hardNp hard
Np hard
jesal_joshi
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generator
sanchi29
 
Ambiguous & Unambiguous Grammar
Ambiguous & Unambiguous GrammarAmbiguous & Unambiguous Grammar
Ambiguous & Unambiguous Grammar
MdImamHasan1
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
Kuppusamy P
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
Rezwan Siam
 
Lecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithmLecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithm
Hema Kashyap
 
Dichotomy of parallel computing platforms
Dichotomy of parallel computing platformsDichotomy of parallel computing platforms
Dichotomy of parallel computing platforms
Syed Zaid Irshad
 
Pumping lemma Theory Of Automata
Pumping lemma Theory Of AutomataPumping lemma Theory Of Automata
Pumping lemma Theory Of Automata
hafizhamza0322
 
Inference in Bayesian Networks
Inference in Bayesian NetworksInference in Bayesian Networks
Inference in Bayesian Networks
guestfee8698
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
SOMNATHMORE2
 
4 greedy methodnew
4 greedy methodnew4 greedy methodnew
4 greedy methodnew
abhinav108
 
Topological Sorting (Decrease and Conquer)
Topological Sorting (Decrease and Conquer)Topological Sorting (Decrease and Conquer)
Topological Sorting (Decrease and Conquer)
Gem WeBlog
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFA
Maulik Togadiya
 
Paging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantagePaging & segmentation; advantages and disadvantage
Paging & segmentation; advantages and disadvantage
sohinibanerjee121
 
Data decomposition techniques
Data decomposition techniquesData decomposition techniques
Data decomposition techniques
Mohamed Ramadan
 
Intermediate code generator
Intermediate code generatorIntermediate code generator
Intermediate code generator
sanchi29
 
Ambiguous & Unambiguous Grammar
Ambiguous & Unambiguous GrammarAmbiguous & Unambiguous Grammar
Ambiguous & Unambiguous Grammar
MdImamHasan1
 
Intermediate code generation in Compiler Design
Intermediate code generation in Compiler DesignIntermediate code generation in Compiler Design
Intermediate code generation in Compiler Design
Kuppusamy P
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
Rezwan Siam
 
Lecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithmLecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithm
Hema Kashyap
 
Dichotomy of parallel computing platforms
Dichotomy of parallel computing platformsDichotomy of parallel computing platforms
Dichotomy of parallel computing platforms
Syed Zaid Irshad
 

Similar to Parallel Algorithms (20)

Web Traffic Time Series Forecasting
Web Traffic  Time Series ForecastingWeb Traffic  Time Series Forecasting
Web Traffic Time Series Forecasting
BillTubbs
 
GRAPHICAL STRUCTURES in our lives
GRAPHICAL STRUCTURES in our livesGRAPHICAL STRUCTURES in our lives
GRAPHICAL STRUCTURES in our lives
xryuseix
 
Fulltext
FulltextFulltext
Fulltext
engnishantmittal1
 
Technical_Report_on_ML_Library
Technical_Report_on_ML_LibraryTechnical_Report_on_ML_Library
Technical_Report_on_ML_Library
Saurabh Chauhan
 
Modeling the Behavior of Threads in the PREEMPT_RT Linux Kernel Using Automata
Modeling the Behavior of Threads in the PREEMPT_RT Linux Kernel Using AutomataModeling the Behavior of Threads in the PREEMPT_RT Linux Kernel Using Automata
Modeling the Behavior of Threads in the PREEMPT_RT Linux Kernel Using Automata
Daniel Bristot de Oliveira
 
R workshop xx -- Parallel Computing with R
R workshop xx -- Parallel Computing with R R workshop xx -- Parallel Computing with R
R workshop xx -- Parallel Computing with R
Vivian S. Zhang
 
Generative AI for Reengineering Variants into Software Product Lines: An Expe...
Generative AI for Reengineering Variants into Software Product Lines: An Expe...Generative AI for Reengineering Variants into Software Product Lines: An Expe...
Generative AI for Reengineering Variants into Software Product Lines: An Expe...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
6. Implementation
6. Implementation6. Implementation
6. Implementation
bibbidy N-BObbiDY boo at NECST
 
The google MapReduce
The google MapReduceThe google MapReduce
The google MapReduce
Romain Jacotin
 
Control system Lab record
Control system Lab record Control system Lab record
Control system Lab record
Yuvraj Singh
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm Analysis
Mary Margarat
 
ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...
ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...
ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...
Databricks
 
Subtle Asynchrony by Jeff Hammond
Subtle Asynchrony by Jeff HammondSubtle Asynchrony by Jeff Hammond
Subtle Asynchrony by Jeff Hammond
Patrick Diehl
 
A Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLA Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQL
Databricks
 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Marina Kolpakova
 
Hierarchical free monads and software design in fp
Hierarchical free monads and software design in fpHierarchical free monads and software design in fp
Hierarchical free monads and software design in fp
Alexander Granin
 
Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...
NECST Lab @ Politecnico di Milano
 
Matlab anilkumar
Matlab  anilkumarMatlab  anilkumar
Matlab anilkumar
THEMASTERBLASTERSVID
 
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptxMATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
prashantkumarchinama
 
spaGO: A self-contained ML & NLP library in GO
spaGO: A self-contained ML & NLP library in GOspaGO: A self-contained ML & NLP library in GO
spaGO: A self-contained ML & NLP library in GO
Matteo Grella
 
Web Traffic Time Series Forecasting
Web Traffic  Time Series ForecastingWeb Traffic  Time Series Forecasting
Web Traffic Time Series Forecasting
BillTubbs
 
GRAPHICAL STRUCTURES in our lives
GRAPHICAL STRUCTURES in our livesGRAPHICAL STRUCTURES in our lives
GRAPHICAL STRUCTURES in our lives
xryuseix
 
Technical_Report_on_ML_Library
Technical_Report_on_ML_LibraryTechnical_Report_on_ML_Library
Technical_Report_on_ML_Library
Saurabh Chauhan
 
Modeling the Behavior of Threads in the PREEMPT_RT Linux Kernel Using Automata
Modeling the Behavior of Threads in the PREEMPT_RT Linux Kernel Using AutomataModeling the Behavior of Threads in the PREEMPT_RT Linux Kernel Using Automata
Modeling the Behavior of Threads in the PREEMPT_RT Linux Kernel Using Automata
Daniel Bristot de Oliveira
 
R workshop xx -- Parallel Computing with R
R workshop xx -- Parallel Computing with R R workshop xx -- Parallel Computing with R
R workshop xx -- Parallel Computing with R
Vivian S. Zhang
 
Control system Lab record
Control system Lab record Control system Lab record
Control system Lab record
Yuvraj Singh
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm Analysis
Mary Margarat
 
ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...
ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...
ADMM-Based Scalable Machine Learning on Apache Spark with Sauptik Dhar and Mo...
Databricks
 
Subtle Asynchrony by Jeff Hammond
Subtle Asynchrony by Jeff HammondSubtle Asynchrony by Jeff Hammond
Subtle Asynchrony by Jeff Hammond
Patrick Diehl
 
A Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQLA Deep Dive into Query Execution Engine of Spark SQL
A Deep Dive into Query Execution Engine of Spark SQL
Databricks
 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Marina Kolpakova
 
Hierarchical free monads and software design in fp
Hierarchical free monads and software design in fpHierarchical free monads and software design in fp
Hierarchical free monads and software design in fp
Alexander Granin
 
Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...Pretzel: optimized Machine Learning framework for low-latency and high throug...
Pretzel: optimized Machine Learning framework for low-latency and high throug...
NECST Lab @ Politecnico di Milano
 
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptxMATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
MATLAB Workshop yugjjnhhasfhlhhlllhl.pptx
prashantkumarchinama
 
spaGO: A self-contained ML & NLP library in GO
spaGO: A self-contained ML & NLP library in GOspaGO: A self-contained ML & NLP library in GO
spaGO: A self-contained ML & NLP library in GO
Matteo Grella
 
Ad

More from Heman Pathak (15)

Interconnection Network
Interconnection NetworkInterconnection Network
Interconnection Network
Heman Pathak
 
Central processing unit
Central processing unitCentral processing unit
Central processing unit
Heman Pathak
 
Registers and counters
Registers and countersRegisters and counters
Registers and counters
Heman Pathak
 
Sequential Circuit
Sequential CircuitSequential Circuit
Sequential Circuit
Heman Pathak
 
Combinational logic 2
Combinational logic 2Combinational logic 2
Combinational logic 2
Heman Pathak
 
Combinational logic 1
Combinational logic 1Combinational logic 1
Combinational logic 1
Heman Pathak
 
Simplification of Boolean Function
Simplification of Boolean FunctionSimplification of Boolean Function
Simplification of Boolean Function
Heman Pathak
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
Heman Pathak
 
Chapter 7: Matrix Multiplication
Chapter 7: Matrix MultiplicationChapter 7: Matrix Multiplication
Chapter 7: Matrix Multiplication
Heman Pathak
 
Elementary Parallel Algorithms
Elementary Parallel AlgorithmsElementary Parallel Algorithms
Elementary Parallel Algorithms
Heman Pathak
 
Chapter 5: Mapping and Scheduling
Chapter  5: Mapping and SchedulingChapter  5: Mapping and Scheduling
Chapter 5: Mapping and Scheduling
Heman Pathak
 
Cost optimal algorithm
Cost optimal algorithmCost optimal algorithm
Cost optimal algorithm
Heman Pathak
 
Chapter 4: Parallel Programming Languages
Chapter 4: Parallel Programming LanguagesChapter 4: Parallel Programming Languages
Chapter 4: Parallel Programming Languages
Heman Pathak
 
Parallel Algorithm for Graph Coloring
Parallel Algorithm for Graph Coloring Parallel Algorithm for Graph Coloring
Parallel Algorithm for Graph Coloring
Heman Pathak
 
Chapter 1 - introduction - parallel computing
Chapter  1 - introduction - parallel computingChapter  1 - introduction - parallel computing
Chapter 1 - introduction - parallel computing
Heman Pathak
 
Interconnection Network
Interconnection NetworkInterconnection Network
Interconnection Network
Heman Pathak
 
Central processing unit
Central processing unitCentral processing unit
Central processing unit
Heman Pathak
 
Registers and counters
Registers and countersRegisters and counters
Registers and counters
Heman Pathak
 
Sequential Circuit
Sequential CircuitSequential Circuit
Sequential Circuit
Heman Pathak
 
Combinational logic 2
Combinational logic 2Combinational logic 2
Combinational logic 2
Heman Pathak
 
Combinational logic 1
Combinational logic 1Combinational logic 1
Combinational logic 1
Heman Pathak
 
Simplification of Boolean Function
Simplification of Boolean FunctionSimplification of Boolean Function
Simplification of Boolean Function
Heman Pathak
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
Heman Pathak
 
Chapter 7: Matrix Multiplication
Chapter 7: Matrix MultiplicationChapter 7: Matrix Multiplication
Chapter 7: Matrix Multiplication
Heman Pathak
 
Elementary Parallel Algorithms
Elementary Parallel AlgorithmsElementary Parallel Algorithms
Elementary Parallel Algorithms
Heman Pathak
 
Chapter 5: Mapping and Scheduling
Chapter  5: Mapping and SchedulingChapter  5: Mapping and Scheduling
Chapter 5: Mapping and Scheduling
Heman Pathak
 
Cost optimal algorithm
Cost optimal algorithmCost optimal algorithm
Cost optimal algorithm
Heman Pathak
 
Chapter 4: Parallel Programming Languages
Chapter 4: Parallel Programming LanguagesChapter 4: Parallel Programming Languages
Chapter 4: Parallel Programming Languages
Heman Pathak
 
Parallel Algorithm for Graph Coloring
Parallel Algorithm for Graph Coloring Parallel Algorithm for Graph Coloring
Parallel Algorithm for Graph Coloring
Heman Pathak
 
Chapter 1 - introduction - parallel computing
Chapter  1 - introduction - parallel computingChapter  1 - introduction - parallel computing
Chapter 1 - introduction - parallel computing
Heman Pathak
 
Ad

Recently uploaded (20)

Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic AlgorithmDesign Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Design Optimization of Reinforced Concrete Waffle Slab Using Genetic Algorithm
Journal of Soft Computing in Civil Engineering
 
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
AI Publications
 
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia
 
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Modelling of Concrete Compressive Strength Admixed with GGBFS Using Gene Expr...
Journal of Soft Computing in Civil Engineering
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
PawachMetharattanara
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdfDavid Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
introduction technology technology tec.pptx
introduction technology technology tec.pptxintroduction technology technology tec.pptx
introduction technology technology tec.pptx
Iftikhar70
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Journal of Soft Computing in Civil Engineering
 
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
Guru Nanak Technical Institutions
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
Empowering Electric Vehicle Charging Infrastructure with Renewable Energy Int...
AI Publications
 
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia - Excels In Optimizing Software Applications
Jacob Murphy Australia
 
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
6th International Conference on Big Data, Machine Learning and IoT (BMLI 2025)
ijflsjournal087
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
01.คุณลักษณะเฉพาะของอุปกรณ์_pagenumber.pdf
PawachMetharattanara
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdfDavid Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry
 
2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt2.3 Genetically Modified Organisms (1).ppt
2.3 Genetically Modified Organisms (1).ppt
rakshaiya16
 
Applications of Centroid in Structural Engineering
Applications of Centroid in Structural EngineeringApplications of Centroid in Structural Engineering
Applications of Centroid in Structural Engineering
suvrojyotihalder2006
 
introduction technology technology tec.pptx
introduction technology technology tec.pptxintroduction technology technology tec.pptx
introduction technology technology tec.pptx
Iftikhar70
 
Evonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdfEvonik Overview Visiomer Specialty Methacrylates.pdf
Evonik Overview Visiomer Specialty Methacrylates.pdf
szhang13
 
Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025Transport modelling at SBB, presentation at EPFL in 2025
Transport modelling at SBB, presentation at EPFL in 2025
Antonin Danalet
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 

Parallel Algorithms

  • 1. B Y DR. HEMAN PATHAK Associate Professor Dept. of Comp. Sc., KGC - Dehradun 1 Book PARALLEL COMPUTING THEORY AND PRACTICE By Michel J. Quinn CHAPTER – 2
  • 2. 2 This paper is about the designing of efficient algorithms for real parallel computers
  • 3. Random Access Machine (RAM) Algorithms can be measured in a machine-independent way using the Random Access Machine (RAM) model. This model of computation is an abstraction that allows us to compare algorithms on the basis of performance.  This model assumes a single processor.  In the RAM model, instructions are executed one after the other, with no concurrent operations. 3
  • 4. 4 The assumptions made in the RAM are:  Each simple operation takes 1 time step.  Loops and subroutines are not simple operations.  Each memory access takes one time step, and there is no shortage of memory.  For any given problem the running time of an algorithms is assumed to be the number of time steps. The space used by an algorithm is assumed to be the number of RAM memory cells. Random Access Machine (RAM)
  • 5. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 5
  • 6. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 6
  • 7. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 7
  • 8. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 8
  • 9. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 9
  • 10. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 10
  • 11. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 11
  • 12. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 12
  • 13. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 13
  • 14. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 14
  • 15. 15
  • 16. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 0 1 1 2 2 4 3 8 : : p 2p lb(x) or log2(x): Log base 2, also known as the binary logarithm, is the logarithm to the base 2. The binary logarithm of x is the power to which the number 2 must be raised to obtain the value x. log2(1) = 0 log2(2) = 1 log2(4) = 2 log2(8) = 3 log2(16) = 4 log2(32) = 5 p steps for 2p Processors log2(p) steps for log2(2p)=p Processors If p is perfect power of 2 otherwise log2(p)
  • 17. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm
  • 18. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 18
  • 19. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 19
  • 20. Sequential Algorithm Sum = 0 for i = 0 to n-1 do sum = sum + a[i] endfor Time Complexity = (n) 20 Sum of n elements
  • 21. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 21
  • 22. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 22
  • 23. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 23 Step 1: PEs Required 𝑛/2 Step 2: PEs Numbers i = 0 to 𝑛/2 -1 Step 3: Sequential Loop j = 0 to log 𝑛 -1 Step 4: Which PEs will participate i mod 2j =0 and 2i+ 2j < n Step 5: What is to be done in each step A[2i] = A[2i] + A[2i + 2j ]
  • 24. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 24
  • 25. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 25
  • 27. Sequential algorithm for i = 1 to n-1 do a[i] = a[i-1] + a[i] endfor Time Complexity = (n) 27 Prefix Sum
  • 28. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 28
  • 29. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 29
  • 30. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 30
  • 31. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 31
  • 33. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 33
  • 34. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 34
  • 35. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 35
  • 36. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 36
  • 37. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 37
  • 38. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 38
  • 39. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 39
  • 41. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 41
  • 42. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 42 EXAMPLE
  • 43. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 43 AB BD DB BE EC CE EH HE EB BA AC CF FC CA 1 1 0 1 1 0 1 0 0 0 1 1 0 0 EXAMPLE No. of Vertices = 8 (n) No. of edges = 7 (n-1) Forward edges = 7 (n-1) Backward edges = 7 (n-1) Total Edges = 14 2(n-1)
  • 44. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 44 EXAMPLE
  • 45. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 45 EXAMPLE (C,F) Vertices A B C D E F G H Positions 1 7 2 6 5 1 4 3 Prorder 1 2 7 3 4 8 5 6
  • 46. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 46
  • 47. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 47
  • 48. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 48
  • 49. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 49
  • 50. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 50
  • 51. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 51
  • 52. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 52
  • 53. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 53
  • 54. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 54
  • 55. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 55
  • 56. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 56
  • 57. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 57
  • 58. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 58
  • 59. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 59
  • 60. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 60
  • 61. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 61
  • 62. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 62
  • 63. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 63
  • 64. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 64
  • 65. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 65
  • 66. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 66
  • 67. Slides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htmSlides & Diagrams from: http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/PAlgo/index.htm 67
  翻译: