-
Notifications
You must be signed in to change notification settings - Fork 0
/
hpcborealis.tex
241 lines (212 loc) · 7.78 KB
/
hpcborealis.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamercolor{block body}{bg=blue!20}
\begin{frame}
\frametitle{Borealis compilation scheme}
\begin{figure}
\includegraphics[width=115mm]{image/compile}
\end{figure}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Distributed compilation}
There are several ways to distributed compilation:
\begin{itemize}
\item Compilation on the Lustre storage
\item Distribution of intermediate build tree to the processing nodes
\item Distribution of copies of the analyzed project
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Compilation on the Lustre storage}
\begin{itemize}
\item Each node access to Lustre for necessary files
\item Lustre is slow when dealing with multiple small files
\end{itemize}
\begin{figure}
\includegraphics[width=70mm]{image/compLustre}
\end{figure}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Distribution of intermediate build tree}
\begin{itemize}
\item Reduce the CPU time
\item Build may contain several related compilation/linking phases
\end{itemize}
\begin{figure}
\includegraphics[width=70mm]{image/compTree}
\end{figure}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Distribution of copies of the analyzed project}
\begin{itemize}
\item Compilation is done using standard build tools
\item We are repeating computations on every node
\item Don't increase the wall-clock time
\end{itemize}
\begin{figure}
\includegraphics[width=110mm]{image/compSource}
\end{figure}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Distributed linking}
\begin{itemize}
\item We distribute different SMT queries to different nodes/cores
\item Borealis performs analysis on an LLVM IR module
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Distributed linking}
It means there are options of how one can distribute the work:
\begin{itemize}
\item Module level
\begin{itemize}
\item[•] Same as parallel make
\item[•] Not really effective
\end{itemize}
\item Instruction level
\begin{itemize}
\item[•] Need to track dependencies between SMT calls
\item[•] Too complex
\end{itemize}
\item Function level
\begin{itemize}
\item[•] Medium efficiency
\item[•] Simple implementation
\end{itemize}
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Distributed linking}
There are two ways how one can distribute functions between several processes:
\begin{itemize}
\item Dynamic distribution
\item Static distribution
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Dynamic distribution}
\begin{itemize}
\item Master process distributes functions between several processes
\item Based on a single producer / multiple consumers scheme
\item If a process receives N functions, it also has to run auxiliary LLVM passes N times
\end{itemize}
\begin{figure}
\includegraphics[width=70mm]{image/dynDistr.png}
\end{figure}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Static distribution}
\begin{itemize}
\item Each process determines a set of function based on it's rank
\item We use the following two rank kinds:
\begin{itemize}
\item[•] global rank
\item[•] local rank
\end{itemize}
\item After some experiments we decided to use static distribution
\end{itemize}
\begin{figure}
\includegraphics[width=70mm]{image/statDistr.png}
\end{figure}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Improving static distribution}
\begin{itemize}
\item Need to balance workload
\item We reinforce method with function complexity estimation
\item Our estimation is based on the following properties:
\begin{itemize}
\item[•] Function size
\item[•] Number of memory work instructions
\end{itemize}
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{PDD}
\begin{itemize}
\item Borealis records the analysis results
\item Thereby we doesn't re-analyze already processed functions
\item Persistent Defect Data (PDD) is used for recording results
\item PDD contains:
\begin{itemize}
\item[•] Defect location
\item[•] Defect type
\item[•] SMT result
\end{itemize}
\end{itemize}
\begin{columns}
\column{0.5\textwidth}
\begin{lstlisting}[style=crs_cpp]
{
"location": {
"loc": {
"col": 2,
"line": 383
},
"filename": "rarpd.c"
},
"type": "INI-03"
}
\end{lstlisting}
\end{columns}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{PDD synchronization problem}
\begin{itemize}
\item Transfer a full PDD takes a long time
\item We synchronize a reduced PDD (rPDD)
\item rPDD is simply a list of already analyzed functions
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{rPDD synchronization}
To make the synchronization we utilize a two-staged approach:
\begin{itemize}
\item Synchronize rPDD between the processes on a single node
\item Synchronize rPDD between the nodes
\end{itemize}
\begin{figure}
\includegraphics[width=115mm]{image/pddMerge}
\end{figure}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Implementation}
\begin{itemize}
\item Borealis HPC implementation is based on OpenMPI library
\item We implemented API to work with library
\item HPC Borealis is implemented in the form of 3 LLVM passes
\end{itemize}
\begin{figure}
\includegraphics[width=100mm]{image/passes}
\end{figure}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%