Skip to content

Commit f97b856

Browse files
committed
Add content to 04-parallelism-theory
1 parent 04b04da commit f97b856

File tree

2 files changed

+118
-4
lines changed

2 files changed

+118
-4
lines changed

04-parallelism-theory/04-parallelism-theory.tex

+115-3
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,124 @@
6464
\tableofcontents
6565
\end{frame}
6666

67-
\section{Parallelism efficiency}
67+
\section{Parallelism efficiency metrics}
6868

69-
\begin{frame}{Parallelism metrics}
69+
\begin{frame}{Parallelism efficiency metrics}
70+
Let us introduce a number of terms used in parallel programming theory:
71+
\begin{itemize}
72+
\item \textbf{Speedup (S)}: Ratio of the execution time of the best sequential algorithm to the execution time of the parallel algorithm.
73+
\[
74+
S = \frac{T_1}{T_p}
75+
\]
76+
\item \textbf{Efficiency (E)}: Measure of how effectively the computational resources are being utilized.
77+
\[
78+
E = \frac{S}{p} = \frac{T_1}{p \times T_p}
79+
\]
80+
\item \textbf{Scalability}: Ability of a system to maintain performance when the number of processors increases.
81+
\end{itemize}
7082
\end{frame}
7183

72-
\begin{frame}{Amdahl's law}
84+
\section{Amdahl's Law}
85+
86+
\begin{frame}{Amdahl's Law}
87+
Amdahl's Law addresses the maximum improvement to an overall system when only part of the system is improved.
88+
\begin{itemize}
89+
\item Formula:
90+
\[
91+
S_{\text{max}} = \frac{1}{(1 - P) + \frac{P}{N}}
92+
\]
93+
\item Where:
94+
\begin{itemize}
95+
\item \( P \) is the proportion of the program that can be made parallel.
96+
\item \( N \) is the number of processors.
97+
\end{itemize}
98+
\item Implications:
99+
\begin{itemize}
100+
\item Diminishing returns as \( N \) increases.
101+
\item Emphasizes optimizing the sequential portion.
102+
\end{itemize}
103+
\end{itemize}
104+
\end{frame}
105+
106+
\begin{frame}{Amdahl's Law example}
107+
\begin{itemize}
108+
\item Assuming 90\% of a task can be parallelized (P = 0.9) and we have 4 processors (N = 4):
109+
\item Formula:
110+
\[
111+
S_{\text{max}} = \frac{1}{(1 - P) + \frac{P}{N}}
112+
\]
113+
\item Calculating for this particular example:
114+
\[
115+
S = \frac{1}{(1 - 0.9) + \frac{0.9}{4}} = \frac{1}{0.1 + 0.225} = \frac{1}{0.325} \approx 3.08
116+
\]
117+
\item So, even though we have 4 processors, the speedup is only about 3.08 times faster than a single processor due to the non-parallelizable portion.
118+
\end{itemize}
119+
\end{frame}
120+
121+
\begin{frame}{Amdahl's Law assumptions and limitations}
122+
Note that:
123+
\begin{itemize}
124+
\item Amdahl's Law assumes that the overhead of splitting and managing parallel tasks is (infinitely) small, which may not always be true.
125+
\item It doesn't account for other practical factors like memory access contention, communication delays between processors, or the complexity of load balancing.
126+
\end{itemize}
127+
\end{frame}
128+
129+
\section{Gustafson's Law (Gustafson-Barsis's Law)}
130+
131+
\begin{frame}{Gustafson's Law (Gustafson-Barsis's Law)}
132+
Gustafson's Law, also known as Gustafson-Barsis's Law is a principle in parallel computing that addresses the scalability of parallel systems.
133+
\begin{itemize}
134+
\item Key note: Gustafson's Law suggests that the overall speedup in a parallel system is determined not only by the fraction of the task that can be parallelized but also by the size of the problem being solved. As the problem size increases, the potential speedup from parallelism also increases.
135+
\item Formula:
136+
\[
137+
S(p) = p - \alpha(p - 1)
138+
\]
139+
\item Where:
140+
\begin{itemize}
141+
\item \( S(p) \) is the speedup with \( p \) processors.
142+
\item \( \alpha \) is the fraction of the workload that must be executed serially (i.e., non-parallelizable).
143+
\item \( p \) is the number of processors.
144+
\end{itemize}
145+
\end{itemize}
146+
\end{frame}
147+
148+
\begin{frame}{Gustafson's Law notes}
149+
Note that:
150+
\begin{itemize}
151+
\item Unlike Amdahl's Law, Gustafson's Law argues that by increasing the size of the problem, the parallel portion can dominate, allowing for more effective use of additional processors.
152+
\item Gustafson's Law is more realistic in situations where the problem size increases with the number of processors.
153+
\item As the problem size grows, the portion that can be parallelized becomes larger, thus maximizing the benefit of adding more processors.
154+
\end{itemize}
155+
\end{frame}
156+
157+
\begin{frame}{Parallelism overhead}
158+
Basically, parallelism overhead is the extra time that is required to manage parallel tasks.
159+
160+
Sources of overhead:
161+
\begin{itemize}
162+
\item Communication between processors.
163+
\item Synchronization delays.
164+
\item Data sharing and contention.
165+
\end{itemize}
166+
\end{frame}
167+
168+
\begin{frame}{Best Practices for Efficient Parallelism}
169+
\begin{itemize}
170+
\item Minimize synchronization and communication.
171+
\item Balance load among processors.
172+
\item Optimize data locality.
173+
\item Use appropriate parallel programming constructs.
174+
\end{itemize}
175+
\end{frame}
176+
177+
\begin{frame}{Flynn's Classification}
178+
\begin{itemize}
179+
\item Categorizes computer architectures based on instruction and data streams.
180+
\item SISD: Single Instruction, Single Data.
181+
\item SIMD: Single Instruction, Multiple Data.
182+
\item MISD: Multiple Instruction, Single Data.
183+
\item MIMD: Multiple Instruction, Multiple Data.
184+
\end{itemize}
73185
\end{frame}
74186

75187
\begin{frame}
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
\beamer@sectionintoc {1}{Parallelism efficiency}{3}{0}{1}
1+
\beamer@sectionintoc {1}{Parallelism efficiency metrics}{3}{0}{1}
2+
\beamer@sectionintoc {2}{Amdahl's Law}{4}{0}{2}
3+
\beamer@sectionintoc {3}{Gustafson's Law (Gustafson-Barsis's Law)}{7}{0}{3}

0 commit comments

Comments
 (0)