Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
patapon
patapon
Commits
f92a3699
Commit
f92a3699
authored
Feb 13, 2021
by
Philippe Helluy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up
parent
5c26900e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
560 additions
and
2 deletions
+560
-2
mhd/doc/review/answers.lyx
mhd/doc/review/answers.lyx
+542
-0
mhd/doc/spring_mhd_lbm.bib
mhd/doc/spring_mhd_lbm.bib
+1
-1
mhd/doc/spring_mhd_lbm.tex
mhd/doc/spring_mhd_lbm.tex
+9
-0
mhd/vortex_lbm.py
mhd/vortex_lbm.py
+8
-1
No files found.
mhd/doc/review/answers.lyx
View file @
f92a3699
...
...
@@ -411,6 +411,548 @@ I would like the authors to give a more detailed explanation of how they
\begin_inset Quotes erd
\end_inset
:
\begin_inset Newline newline
\end_inset
We enriched the computational part of the part with a more precise evaluation
of the performance of the code: memory bandwidth and computational intensity.
This analysis confirms the excellent efficiency of the implementation.
\begin_inset Formula
\[
n_{\text{GB}}=\frac{\texttt{\texttt{Nx}\ensuremath{\times\texttt{Ny}}\ensuremath{\times prec}}\times4\times m}{1024^{3}},
\]
\end_inset
where
\begin_inset Formula $prec$
\end_inset
is the number of bytes for storing one floating point number (
\begin_inset Formula $prec=4$
\end_inset
for single precision and
\begin_inset Formula $prec=8$
\end_inset
for double precision).
We then perform a given number of time iterations niter and measure the
elapsed time
\begin_inset Formula $t_{\text{elapsed}}$
\end_inset
(with a specific features of the OpenCL library).
We perform two kind of experiments.
In the first experiment, we deactivate the numerical computations and only
perform the shift operations.
The memory bandwidth of the shift algorithm is then given by
\begin_inset Formula
\[
b=\frac{2\times n_{\text{GB}}\times niter}{t_{\text{elapsed}}}.
\]
\end_inset
In the second experiment, we reactivate the computations and measure how
the bandwidth is reduced.
This allows to evaluating how the elapsed time is shared between memory
transfers and computations.
The results are given in Table xxx
\begin_inset Newline newline
\end_inset
\begin_inset Tabular
<lyxtabular version="3" rows="10" columns="5">
<features tabularvalignment="middle">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<column alignment="center" valignment="top">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
prec.
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula $b$
\end_inset
(GB/s, only shift)
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Formula $b$
\end_inset
(GB/s, full LBM)
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
max.
bandwidth (GB/s)
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
AMD
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
float32
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
AMD
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
float32
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Iris 640
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
float32
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
26.20
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
24.98
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Iris 640
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
float64
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
GTX
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
float32
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Quadro
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
float32
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
Quadro
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
float64
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
V100
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
float32
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
V100
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
float64
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text
\begin_layout Plain Layout
\end_layout
\end_inset
</cell>
</row>
</lyxtabular>
\end_inset
\end_layout
...
...
mhd/doc/spring_mhd_lbm.bib
View file @
f92a3699
...
...
@@ -1714,7 +1714,7 @@ MRREVIEWER = {Philip D. Loewen},
}
@article
{
toth2000b
,
title
=
{The
∇{\textperiodcentered} B
= 0 constraint in shock-capturing magnetohydrodynamics codes}
,
title
=
{The
$\nabla \cdot b
= 0
$
constraint in shock-capturing magnetohydrodynamics codes}
,
author
=
{T{\'o}th, G{\'a}bor}
,
journal
=
{Journal of Computational Physics}
,
volume
=
{161}
,
...
...
mhd/doc/spring_mhd_lbm.tex
View file @
f92a3699
...
...
@@ -865,6 +865,15 @@ $
\texttt
{
nvtop
}
\footnote
{
\url
{
https://github.com/Syllo/nvtop
}}
indicates
that the GPU occupation is of
$
99
\%
$
. This indicates a quasi-optimal
implementation.
In order to measure the efficiency of the implementation we perform a memory bandwidth test
on several grid sizes. One time step of the method implies the read access in the global memory
to the set of fields of the previous time step. The local computations are done in registers. Then
there is another write access to global memory for storing the data of the next time step.
The size in memory in Gigabyte of one set of fields is
$$
n
_{
\text
{
GB
}}
=
\frac
{
\texttt
{
\texttt
{
Nx
}
\ensuremath
{
\times
}
\texttt
{
Ny
}
\ensuremath
{
\times
b
}}
\times
4
\times
m
}{
1024
^{
3
}}
,
$$
where
$
b
$
is the number of bytes for storing one floating point number (
$
b
=
4
$
for single precision and
$
b
=
8
$
for double precision),
\section
{
Numerical applications to MHD
}
...
...
mhd/vortex_lbm.py
View file @
f92a3699
...
...
@@ -166,6 +166,10 @@ def solve_ocl(m=_m, n=_n, nx=_nx, ny=_ny, Lx=_Lx, Ly=_Ly, Tmax=_Tmax,
levels
=
np
.
linspace
(
_minplot
,
_maxplot
,
16
))
#fig = Figure(title=plot_title)
compute
=
False
print
(
"Compute:"
)
print
(
compute
)
print
(
"start OpenCL computations..."
)
while
t
<
Tmax
+
dt
:
...
...
@@ -199,7 +203,10 @@ def solve_ocl(m=_m, n=_n, nx=_nx, ny=_ny, Lx=_Lx, Ly=_Ly, Tmax=_Tmax,
t
+=
dt
#event = prg.time_step(queue, (nx * ny, ), None, wn_gpu, wnp1_gpu)
event
=
prg
.
time_step
(
queue
,
(
nx
*
ny
,
),
None
,
fn_gpu
,
fnp1_gpu
)
if
compute
:
event
=
prg
.
time_step
(
queue
,
(
nx
*
ny
,
),
None
,
fn_gpu
,
fnp1_gpu
)
else
:
event
=
prg
.
time_shift
(
queue
,
(
nx
*
ny
,
),
None
,
fn_gpu
,
fnp1_gpu
)
#event = prg.time_step(queue, (nx * ny, ), None, wn_gpu, wnp1_gpu, wait_for = [event])
event
.
wait
()
queue
.
finish
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment