Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Compiling code and using MPI - lecture
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SCITAS
Courses
Compiling code and using MPI
Compiling code and using MPI - lecture
Commits
654ed97a
Commit
654ed97a
authored
6 years ago
by
Ewan Roche
Browse files
Options
Downloads
Patches
Plain Diff
Font size changes
parent
496c99e7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
document.tex
+169
-39
169 additions, 39 deletions
document.tex
with
169 additions
and
39 deletions
document.tex
+
169
−
39
View file @
654ed97a
...
...
@@ -18,11 +18,27 @@
%---------------------
\begin{frame}
\begin{block}
{}
Today we will look at
\end{block}
\begin{itemize}
\item
<2-> Hardware
\item
<3-> Parallel programming
\item
<4-> Compiling and linking
\item
<5-> Running on a cluster
\end{itemize}
\end{frame}
%---------------------
\begin{frame}
\begin{block}
{}
\begin{center}
\large
Hardware
\\
is
\\
complicated
\normalsize
\end{center}
\end{block}
...
...
@@ -46,8 +62,8 @@ Pinning processes to cores
\end{block}
\begin{itemize}
\item
<
1
->
\tt
{
1
}
- task is allowed
\item
<
2
->
\tt
{
0
}
- task is excluded
\item
<
2
->
\tt
{
1
}
- task is allowed
\item
<
3
->
\tt
{
0
}
- task is excluded
\end{itemize}
\end{frame}
...
...
@@ -56,33 +72,51 @@ Pinning processes to cores
\begin{frame}
\begin{block}
{}
CPU masks
CPU masks
for a 8 core system
\begin{itemize}
\item
<
1
->
\tt
{
10000000
}
\item
<
2
->
\tt
{
01000000
}
\item
<
3
->
\tt
{
00110000
}
\item
<
4
->
\tt
{
11110000
}
\item
<
5
->
\tt
{
00001111
}
\item
<
6
->
\tt
{
11111111
}
\item
<
2
->
\tt
{
10000000
}
\item
<
3
->
\tt
{
01000000
}
\item
<
4
->
\tt
{
00110000
}
\item
<
5
->
\tt
{
11110000
}
\item
<
6
->
\tt
{
00001111
}
\item
<
7
->
\tt
{
11111111
}
\end{itemize}
\end{block}
\end{frame}
%---------------------
\begin{frame}
\begin{block}
{}
CPU masks for a 8 core system
\begin{itemize}
\item
\tt
{
10000000 = 0x80
}
\item
\tt
{
01000000 = 0x40
}
\item
\tt
{
00110000 = 0x30
}
\item
\tt
{
11110000 = 0xF0
}
\item
\tt
{
00001111 = 0xF
}
\item
\tt
{
11111111 = 0xFF
}
\end{itemize}
\end{block}
\end{frame}
SIMD = Single Instruction Multiple Data
\\
\vspace
{
5mm
}
Why processing "power" has increased while clock speeds have decreased.
%---------------------
\end{block}
\begin{frame}
\begin{block}
{}
\Large
\textbf
{
S
}
ingle
\\
\textbf
{
I
}
nstruction
\\
\textbf
{
M
}
ultiple
\\
\textbf
{
D
}
ata
\\
\normalsize
\end{block}
\end{frame}
%---------------------
...
...
@@ -118,7 +152,9 @@ Why processing "power" has increased while clock speeds have decreased.
\begin{frame}
\begin{block}
{}
\begin{center}
HPC and HPCG
\large
HPL and HPCG
\normalsize
\end{center}
\end{block}
...
...
@@ -126,20 +162,60 @@ HPC and HPCG
%---------------------
%---------------------
\begin{frame}
\begin{block}
{}
\begin{center}
SIMD
HPL can use roughly 80
\%
of the peak performance
\end{center}
\end{block}
\end{frame}
%---------------------
\begin{frame}
\begin{block}
{}
\begin{center}
HPCG can use roughly 2
\%
of the peak performance
\end{center}
\end{block}
\end{frame}
%---------------------
\begin{frame}
\begin{block}
{}
\begin{center}
HPCG is representative for lots of scientific codes
\end{center}
\end{block}
\end{frame}
%---------------------
\begin{frame}
\begin{block}
{}
\begin{center}
\large
Shared Memory
\normalsize
\end{center}
\end{block}
\end{frame}
%---------------------
\begin{frame}
\begin{block}
{}
\begin{center}
Every task sees all the data
\end{center}
\end{block}
...
...
@@ -149,12 +225,33 @@ Shared Memory
\begin{frame}
\begin{block}
{}
\begin{center}
\large
Distributed Memory
\normalsize
\end{center}
\end{block}
\end{frame}
%---------------------
\begin{frame}
\begin{block}
{}
\begin{center}
Workers have their own data and can't see data belonging to other workers
\end{center}
\end{block}
\end{frame}
%---------------------
\begin{frame}
\begin{block}
{}
\begin{center}
If they need to ask to see something they have to send a message
\end{center}
\end{block}
\end{frame}
%---------------------
...
...
@@ -335,23 +432,19 @@ The recipe
\end{block}
\end{frame}
\begin{frame}
[fragile]
\begin{frame}
\begin{block}
{}
\begin{
verbatim
}
$
module load gcc fftw
$
gcc mycode.c
\
-lfftw3
\
-L
${
FFTW
_
ROOT
}
/
lib
\
-
I
${
FFTW
_
ROOT
}
/include
\
-o mycode.x
\begin{
center
}
At runtime we need to set
\\
\vspace
{
5mm
}
{
\tt
LD
\_
LIBRARY
\_
PATH
}
\
\
\vspace
{
5mm
}
so the system knows where to find the library
\end{center}
\end{block}
\end{verbatim}
\end{block}
\end{frame}
%---------------------
\begin{frame}
\begin{block}
{}
...
...
@@ -365,18 +458,19 @@ What's linked?
%---------------------
\begin{frame}
[fragile]
\small
\begin{block}
{}
\begin{verbatim}
$
ldd
hi
$
ldd
qmsolve
linux
-
vdso.so.
1
=
>
(
0
x
00007
...
)
lib
output
.so
=
>
\
/
home
/
user
/
m
y
code
/
lib
output
.so
lib
fastqm
.so
=
>
\
/
home
/
user
/
q
mcode
/
lib
/
libfastqm
.so
libc.so.
6
=
>
/
lib
64
/
libc.so.
6
\end
{
verbatim
}
\normalsize
\end
{
block
}
\end
{
frame
}
...
...
@@ -406,6 +500,29 @@ Libraries to make your life better
\end
{
block
}
\end
{
frame
}
%---------------------
\begin
{
frame
}
[
fragile
]
\begin
{
block
}{}
\small
\begin
{
verbatim
}
$
module load gcc fftw
$
gcc mycode.c
\
-
lfftw
3
\
-
L
${
FFTW
_
ROOT
}
/lib
\
-I
${
FFTW
_
ROOT
}
/
include
\
-
o mycode.x
\end
{
verbatim
}
\normalsize
\end
{
block
}
\end
{
frame
}
%---------------------
\begin
{
frame
}
...
...
@@ -423,9 +540,9 @@ Optimising code
\begin
{
block
}{}
Do you want to optimise so that:
\begin
{
itemize
}
\item
<
2
-
> the executable is as small as possible
\item
<
3
-
> the code runs as fast as possible
\item
<
4
-
> the code has "perfect" numerical accuracy
\item
<
2
-
> the executable is as small as possible
?
\item
<
3
-
> the code runs as fast as possible
?
\item
<
4
-
> the code has "perfect" numerical accuracy
?
\end
{
itemize
}
\end
{
block
}
...
...
@@ -627,7 +744,7 @@ matest(float, float, float):
\begin
{
frame
}
\begin
{
block
}{}
\begin
{
center
}
Compilers are
be
stupid
\\
Compilers are stupid
\\
\footnotesize
\it
or at least not as intelligent as you might like
...
...
@@ -692,7 +809,7 @@ double *prod, int c)
{
for
(
int x
=
0
; x < c; x
=
x
+
8
)
{
prod
[
x
]
=
a
rray
1
[
x
]
*
a
rray
2
[
x
]
;
prod
[
x
]
=
a
1
[
x
]
*
a
2
[
x
]
;
prod
[
x
+
1
]
=
a
1
[
x
+
1
]
*
a
2
[
x
+
1
]
;
prod
[
x
+
2
]
=
a
1
[
x
+
2
]
*
a
2
[
x
+
2
]
;
prod
[
x
+
3
]
=
a
1
[
x
+
3
]
*
a
2
[
x
+
3
]
;
...
...
@@ -1087,3 +1204,16 @@ stack:
\end
{
block
}
\end
{
frame
}
\begin
{
frame
}
\begin
{
block
}{}
\end
{
block
}
\end
{
frame
}
\begin
{
frame
}
\begin
{
block
}{}
\begin
{
center
}
https:
//
scitas
-
data.epfl.ch
/
kb
\end
{
center
}
\end
{
block
}
\end
{
frame
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment