Skip to content

Commit f6372e6

Browse files
authoredNov 7, 2024··
Merge pull request #37 from aobolensk/05
2 parents 4b8218c + b47b049 commit f6372e6

8 files changed

+325
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,317 @@
1+
\documentclass{beamer}
2+
3+
% Theme choice
4+
\usetheme{Madrid}
5+
6+
% Optional packages
7+
\usepackage{graphicx} % For including images
8+
\usepackage{amsmath} % For math symbols and formulas
9+
\usepackage{hyperref} % For hyperlinks
10+
\usepackage{listings}
11+
\usepackage{xcolor}
12+
\usepackage[T1]{fontenc}
13+
14+
\lstdefinestyle{CStyle}{
15+
language=C, % Set the language to C
16+
basicstyle=\ttfamily\footnotesize\linespread{0.9}\tiny, % Set font style and size
17+
keywordstyle=\color{blue}, % Color of keywords
18+
commentstyle=\color{gray}, % Color of comments
19+
stringstyle=\color{red}, % Color of strings
20+
showstringspaces=false, % Do not mark spaces in strings
21+
breaklines=true, % Enable line breaks at appropriate places
22+
breakatwhitespace=false, % Break lines at any character, not just whitespace
23+
numbers=left, % Show line numbers on the left
24+
numberstyle=\tiny\color{gray}, % Style for line numbers
25+
tabsize=4, % Set tab width
26+
keepspaces=true, % Keep indentation spaces
27+
frame=single, % Add a border around the code
28+
aboveskip=0pt, % Reduce space above the code block
29+
belowskip=0pt, % Reduce space below the code block
30+
xleftmargin=7.5pt, % Add left padding (approx. 2.8mm or 10px)
31+
xrightmargin=15pt, % Add left padding (approx. 2.8mm or 10px)
32+
}
33+
34+
% Title, author, date, and institute (optional)
35+
\title[Parallel Programming. Parallelism theory]{Parallel Programming course. Parallelism theory}
36+
\author{Obolenskiy Arseniy, Nesterov Alexander}
37+
\institute{Nizhny Novgorod State University}
38+
39+
\date{\today} % or \date{Month Day, Year}
40+
41+
% Redefine the footline to display both the short title and the university name
42+
\setbeamertemplate{footline}{
43+
\leavevmode%
44+
\hbox{%
45+
\begin{beamercolorbox}[wd=.45\paperwidth,ht=2.5ex,dp=1ex,leftskip=1em,center]{author in head/foot}%
46+
\usebeamerfont{author in head/foot}\insertshortinstitute % Displays the university name
47+
\end{beamercolorbox}%
48+
\begin{beamercolorbox}[wd=.45\paperwidth,ht=2.5ex,dp=1ex,leftskip=1em,center]{author in head/foot}%
49+
\usebeamerfont{author in head/foot}\insertshorttitle % Displays the short title
50+
\end{beamercolorbox}%
51+
\begin{beamercolorbox}[wd=.1\paperwidth,ht=2.5ex,dp=1ex,rightskip=1em,center]{author in head/foot}%
52+
\usebeamerfont{author in head/foot}\insertframenumber{} / \inserttotalframenumber
53+
\end{beamercolorbox}}%
54+
\vskip0pt%
55+
}
56+
57+
\begin{document}
58+
59+
\begin{frame}
60+
\titlepage
61+
\end{frame}
62+
63+
\begin{frame}{Contents}
64+
\tableofcontents
65+
\end{frame}
66+
67+
\begin{frame}{Full list of tasks}
68+
\tiny
69+
\begin{itemize}
70+
\item Producer-Consumer Problem
71+
\item Readers-Writers Problem
72+
\item Dining Philosophers Problem
73+
\item Sleeping Barber Problem
74+
\item Broadcast (one-to-all communication)
75+
\item Reduce (all-to-one communication)
76+
\item Allreduce (all-to-one communication and broadcast)
77+
\item Scatter (generalized one-to-all communication)
78+
\item Gather (generalized all-to-one communication)
79+
\item Topology: Line
80+
\item Topology: Ring
81+
\item Topology: Star
82+
\item Topology: Torus Grid
83+
\item Topology: Hypercube
84+
\item Horizontal Strip Scheme
85+
\item Vertical Strip Scheme
86+
\item Horizontal Strip Scheme (only matrix A partitioned)
87+
\item Horizontal Strip Scheme for A, Vertical Strip Scheme for B
88+
\item Gaussian Method - Horizontal Strip Scheme
89+
\item Gaussian Method - Vertical Strip Scheme
90+
\item Gauss-Jordan Method
91+
\item Iterative Methods (Jacobi)
92+
\item Iterative Methods (Gauss-Seidel)
93+
\item Simple Iteration Method
94+
\item Bubble Sort (Odd-Even Transposition Sort)
95+
\item Image Smoothing
96+
\item Contrast Enhancement
97+
\end{itemize}
98+
\end{frame}
99+
100+
101+
\section{Tasks}
102+
103+
\begin{frame}{Tasks}
104+
Tasks in the course are splitted into the following subgroups:
105+
\begin{itemize}
106+
\item Classical Tasks of Parallel Programming
107+
\item Data Transfer Methods
108+
\item Topologies
109+
\item Matrix Multiplication
110+
\item Systems of Linear Algebraic Equations
111+
\item Sort
112+
\item Computer Graphics
113+
\end{itemize}
114+
\end{frame}
115+
116+
\begin{frame}{Disclaimers}
117+
\begin{itemize}
118+
\item All matrices should be stored in linear arrays (not \texttt{std::vector<std::vector<int> >})
119+
\item Performance should be meauserd on big matrices/vectors
120+
\item Functionality should be preserved for wide range of processes count
121+
\end{itemize}
122+
\end{frame}
123+
124+
\section{Classical Tasks of Parallel Programming}
125+
126+
\begin{frame}{Classical Tasks of Parallel Programming}
127+
\begin{itemize}
128+
\item Producer-Consumer Problem
129+
\item Readers-Writers Problem
130+
\item Dining Philosophers Problem
131+
\item Sleeping Barber Problem
132+
\end{itemize}
133+
Warning:
134+
There is different testing mechanism. Time is not measured for these tasks.
135+
Tasks are measured with big number of processes (16+, up to physical limit)
136+
\end{frame}
137+
138+
\begin{frame}{Producer-Consumer Problem}
139+
We have multiple processes: \textbf{several producers and several consumers}.
140+
Producer produces the data, consumer needs to read it.
141+
142+
The producer-consumer problem is a classic synchronization scenario where one or more producers generate data and place it into a buffer, and one or more consumers remove data from the buffer for processing. The challenge is to ensure that producers do not add data into a full buffer and consumers do not remove data from an empty buffer, all while maintaining data integrity and synchronization.
143+
144+
In the context of MPI we can implement the producer-consumer problem by using message passing between processes.
145+
146+
Source: \href{https://en.wikipedia.org/wiki/Producer–consumer_problem}{https://en.wikipedia.org/wiki/Producer–consumer\_problem}
147+
\end{frame}
148+
149+
\begin{frame}{Readers-Writers Problem}
150+
Some processes may read and some may write, with the constraint that no process may access the shared resource for either reading or writing while another process is in the act of writing to it.
151+
152+
A readers-writer lock is a data structure that solves one or more of the readers-writers problems.
153+
154+
Source: \href{https://en.wikipedia.org/wiki/Readers–writers_problem}{https://en.wikipedia.org/wiki/Readers–writers\_problem}
155+
\end{frame}
156+
157+
\begin{frame}{Dining Philosophers Problem}
158+
Five philosophers dine together at the same table. Each philosopher has their own plate at the table. There is a fork between each plate. The dish served is a kind of spaghetti which has to be eaten with two forks. Each philosopher can only alternately think and eat. Moreover, a philosopher can only eat their spaghetti when they have both a left and right fork. Thus two forks will only be available when their two nearest neighbors are thinking, not eating. After an individual philosopher finishes eating, they will put down both forks. The problem is how to design a regimen (a concurrent algorithm) such that any philosopher will not starve; i.e., each can forever continue to alternate between eating and thinking, assuming that no philosopher can know when others may want to eat or think (an issue of incomplete information).
159+
160+
Source: \href{https://en.wikipedia.org/wiki/Dining_philosophers_problem}{https://en.wikipedia.org/wiki/Dining\_philosophers\_problem}
161+
\end{frame}
162+
163+
\begin{frame}{Sleeping barber problem}
164+
Imagine a hypothetical barbershop with one barber, one barber chair, and a waiting room with n chairs (n may be 0) for waiting customers. The following rules apply:
165+
\begin{itemize}
166+
\item If there are no customers, the barber falls asleep in the chair
167+
\item A customer must wake the barber if he is asleep
168+
\item If a customer arrives while the barber is working, the customer leaves if all chairs are occupied and sits in an empty chair if it's available
169+
\item When the barber finishes a haircut, he inspects the waiting room to see if there are any waiting customers and falls asleep if there are none
170+
\end{itemize}
171+
172+
Source: \href{https://en.wikipedia.org/wiki/Sleeping_barber_problem}{https://en.wikipedia.org/wiki/Sleeping\_barber\_problem}
173+
\end{frame}
174+
175+
\section{Data Transfer Methods}
176+
177+
\begin{frame}{Data Transfer Methods}
178+
\begin{itemize}
179+
\item Broadcast (one-to-all communication)
180+
\item Reduce (all-to-one communication)
181+
\item Allreduce (all-to-one communication and broadcast)
182+
\item Scatter (generalized one-to-all communication)
183+
\item Gather (generalized all-to-one communication)
184+
\end{itemize}
185+
\end{frame}
186+
187+
\begin{frame}{Data Transfer Methods: details}
188+
There is no specific task for this section. You should come up with your own:
189+
\begin{itemize}
190+
\item Requirement: Put the task you have chosen in the description
191+
\item Reference implementation: original MPI function
192+
\item Tasks size should be big. Broadcast should send more that one element (vector).
193+
\end{itemize}
194+
\end{frame}
195+
196+
\section{Topologies}
197+
198+
\begin{frame}{Topologies}
199+
\begin{itemize}
200+
\item Topology: Line
201+
\item Topology: Ring
202+
\item Topology: Star
203+
\item Topology: Torus Grid
204+
\item Topology: Hypercube
205+
\end{itemize}
206+
Warning:
207+
There is different testing mechanism. Time is not measured for these tasks.
208+
Tasks are measured with big number of processes (16+, up to physical limit)
209+
210+
Data is transferred from process 0
211+
\end{frame}
212+
213+
\begin{frame}{Line topology}
214+
\begin{figure}[h]
215+
\includegraphics[width=1\textwidth]{images/line-topology.jpg}
216+
\end{figure}
217+
\end{frame}
218+
219+
\begin{frame}{Ring topology}
220+
\begin{figure}[h]
221+
\includegraphics[width=0.65\textwidth]{images/ring-topology.png}
222+
\end{figure}
223+
\end{frame}
224+
225+
\begin{frame}{Star topology}
226+
\begin{figure}[h]
227+
\includegraphics[width=0.6\textwidth]{images/star-topology.jpg}
228+
\end{figure}
229+
\end{frame}
230+
231+
\begin{frame}{Torus Grid topology}
232+
\begin{figure}[h]
233+
\includegraphics[width=0.4\textwidth]{images/torus.jpeg}
234+
\end{figure}
235+
\begin{figure}[h]
236+
\includegraphics[width=0.4\textwidth]{images/torus-topology.png}
237+
\end{figure}
238+
\end{frame}
239+
240+
\begin{frame}{Hypercube topology}
241+
\begin{figure}[h]
242+
\includegraphics[width=1\textwidth]{images/hypercube-topology.png}
243+
\end{figure}
244+
Source: \href{https://en.wikipedia.org/wiki/Hypercube_internetwork_topology}{https://en.wikipedia.org/wiki/Hypercube\_internetwork\_topology}
245+
\end{frame}
246+
247+
\section{Matrix Multiplication}
248+
249+
\begin{frame}{Matrix Multiplication}
250+
\begin{itemize}
251+
\item Horizontal Strip Scheme
252+
\item Vertical Strip Scheme
253+
\item Horizontal Strip Scheme (only matrix A partitioned)
254+
\item Horizontal Strip Scheme for A, Vertical Strip Scheme for B
255+
\end{itemize}
256+
Expected perf gain:
257+
Validate shapes (if matmul is possible for these shapes)
258+
\end{frame}
259+
260+
\section{Systems of Linear Algebraic Equations}
261+
262+
\begin{frame}{Systems of Linear Algebraic Equations}
263+
\begin{itemize}
264+
\item Gaussian Method - Horizontal Strip Scheme
265+
\item Gaussian Method - Vertical Strip Scheme
266+
\item Gauss-Jordan Method
267+
\item Iterative Methods (Jacobi)
268+
\item Iterative Methods (Gauss-Seidel)
269+
\item Simple Iteration Method
270+
\end{itemize}
271+
Generate matrix that fits conditions
272+
Validate:
273+
\begin{itemize}
274+
\item Determinant, ... (you can use boost library for validation step)
275+
\item Use data that produces only 1 solution
276+
\item For the last 3 tasks, check convergence conditions (otherwise there will be an infinite loop)
277+
\end{itemize}
278+
Iterative methods: max ~10\%, you can parallelize only inside iteration
279+
\end{frame}
280+
281+
\section{Sort}
282+
283+
\begin{frame}{Sort}
284+
\begin{itemize}
285+
\item Bubble Sort (Odd-Even Transposition Sort)
286+
\end{itemize}
287+
Notes:
288+
\begin{itemize}
289+
\item Do not use std::sort for time comparison!
290+
\item Validation of functionality is OK
291+
\end{itemize}
292+
\end{frame}
293+
294+
\section{Computer Graphics}
295+
296+
\begin{frame}{Computer Graphics}
297+
\begin{itemize}
298+
\item Image Smoothing
299+
\item Contrast Enhancement
300+
\end{itemize}
301+
Notes:
302+
\begin{itemize}
303+
\item Use RGB/BGR (color) linearized matrix
304+
\item Allowed to verify unctionality using boost
305+
\item Compare time metric with sequential implementation
306+
\end{itemize}
307+
\end{frame}
308+
309+
\begin{frame}
310+
\centering
311+
\Huge{Thank You!}
312+
\end{frame}
313+
314+
\begin{frame}{References}
315+
\end{frame}
316+
317+
\end{document}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
\beamer@sectionintoc {1}{Tasks}{4}{0}{1}
2+
\beamer@sectionintoc {2}{Classical Tasks of Parallel Programming}{6}{0}{2}
3+
\beamer@sectionintoc {3}{Data Transfer Methods}{11}{0}{3}
4+
\beamer@sectionintoc {4}{Topologies}{13}{0}{4}
5+
\beamer@sectionintoc {5}{Matrix Multiplication}{19}{0}{5}
6+
\beamer@sectionintoc {6}{Systems of Linear Algebraic Equations}{20}{0}{6}
7+
\beamer@sectionintoc {7}{Sort}{21}{0}{7}
8+
\beamer@sectionintoc {8}{Computer Graphics}{22}{0}{8}
Loading
23.5 KB
Loading
63.6 KB
Loading
91.3 KB
Loading
Loading
208 KB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.