iccsa-19-vtestbed

git clone https://git.igankevich.com/iccsa-19-vtestbed.git
Log | Files | Refs

commit 457096e32269f911dd8f8d30f1aad8d487633f52
parent 3923e4b5593c42c7c003efbc9859e05b24388286
Author: Ivan Gankevich <igankevich@ya.ru>
Date:   Fri, 28 Jun 2019 19:19:55 +0300

slides

Diffstat:
Makefile | 8++++++++
gnuplot/histogram-slides.gnuplot | 43+++++++++++++++++++++++++++++++++++++++++++
gnuplot/openmp-slides.gnuplot | 27+++++++++++++++++++++++++++
graphics/aurora-real.jpg | 0
graphics/aurora-vsl.png | 0
graphics/ship-velocity-waves.png | 0
graphics/ship.png | 0
graphics/waves-velocity.png | 0
graphics/waves.png | 0
preamble.tex | 12++++++++++++
slides.tex | 399++++++++++++++++++++++++++++++++++++++++++++++++++-----------------------------
11 files changed, 343 insertions(+), 146 deletions(-)

diff --git a/Makefile b/Makefile @@ -22,6 +22,8 @@ build/$(NAME).pdf: main.tex @echo " LATEX $<" @-$(LATEXMK) $(FLAGS) -f $< +build/$(SLIDES).pdf: build/openmp-slides.eps +build/$(SLIDES).pdf: build/histogram-slides.eps build/$(SLIDES).pdf: slides.tex @echo " LATEX $<" @-$(LATEXMK) $(FLAGS) -xelatex -f $< @@ -35,6 +37,12 @@ build/openmp.svg: build/*.openmp.dat gnuplot/openmp.gnuplot gnuplot/style.gnuplo build/histogram.svg: build/*.histogram.dat gnuplot/histogram.gnuplot gnuplot/style.gnuplot ./gnuplot/histogram.gnuplot +build/openmp-slides.svg: build/*.openmp.dat gnuplot/openmp-slides.gnuplot gnuplot/style.gnuplot + ./gnuplot/openmp-slides.gnuplot + +build/histogram-slides.svg: build/*.histogram.dat gnuplot/histogram-slides.gnuplot gnuplot/style.gnuplot + ./gnuplot/histogram-slides.gnuplot + build/%.eps: build/%.svg inkscape -z --export-eps=$@ $< diff --git a/gnuplot/histogram-slides.gnuplot b/gnuplot/histogram-slides.gnuplot @@ -0,0 +1,43 @@ +#!/usr/bin/gnuplot -d + +set terminal svg size 1920/6,1080/6 dynamic round font 'Open Sans, 10' lw 0.5 +set key Left reverse outside +set key autotitle columnheader +set ylabel 'Time, ms' offset 2,0 +set xtics rotate by -45 +set ytics 0,20 + +load 'gnuplot/style.gnuplot' + +set style histogram rowstacked title +set style data histograms +set style fill solid border -1 +set boxwidth 0.75 +set xlabel offset 0,1 +set output 'build/histogram-slides.svg' +plot \ + newhistogram "Storm", \ + 'build/sphere.storm.histogram.dat' \ + using 'waves':xtic(1) ls 1, \ + '' using 'velocity' ls 2, \ + '' using 'wetted' ls 3, \ + '' using 'clamp' ls 4, \ + '' using 'pressure' ls 5, \ + '' using 'exchange' ls 6, \ + newhistogram "GPUlab", \ + 'build/sphere.gpulab1.histogram.dat' \ + using 'waves':xtic(1) ls 1 notitle, \ + '' using 'velocity' ls 2 notitle, \ + '' using 'wetted' ls 3 notitle, \ + '' using 'clamp' ls 4 notitle, \ + '' using 'pressure' ls 5 notitle, \ + '' using 'exchange' ls 6 notitle, \ + newhistogram "Capybara", \ + 'build/sphere.capybara1.histogram.dat' \ + using 'waves':xtic(1) ls 1 notitle, \ + '' using 'velocity' ls 2 notitle, \ + '' using 'wetted' ls 3 notitle, \ + '' using 'clamp' ls 4 notitle, \ + '' using 'pressure' ls 5 notitle, \ + '' using 'exchange' ls 6 notitle + diff --git a/gnuplot/openmp-slides.gnuplot b/gnuplot/openmp-slides.gnuplot @@ -0,0 +1,27 @@ +#!/usr/bin/gnuplot -d + +set terminal svg size 1920/8*0.9,2.3*1080/6*0.7 dynamic round font 'Open Sans, 10' lw 0.5 enhanced +set key right Left reverse width -2 +set xlabel 'No. of parallel threads' offset 0,1 +set ylabel 'Time, ms' offset 3,0 +set xtics offset 0,0.5 +set ytics 0,20,80 offset 0.5,0 +set xrange [0:10] +load 'gnuplot/style.gnuplot' +set output 'build/openmp-slides.svg' +set multiplot layout 2,1 +plot \ + 'build/sphere.storm.openmp.dat' with linespoints ls 1 lw 4 smooth csplines title 'Storm', \ + 'build/sphere.gpulab1.openmp.dat' with linespoints ls 2 lw 4 smooth csplines title 'GPUlab', \ + 'build/sphere.capybara1.openmp.dat' with linespoints ls 3 lw 4 smooth csplines title 'Capybara' + +set ylabel 'Speedup' offset 3,0 +set ytics 0,2 offset 0.5,0 +set yrange [0:10] +set key left Left reverse height -2 +plot \ + 'build/sphere.storm.openmp.dat' using 1:3 with linespoints ls 1 lw 4 smooth csplines title 'Storm', \ + 'build/sphere.gpulab1.openmp.dat' using 1:3 with linespoints ls 2 lw 4 smooth csplines title 'GPUlab', \ + 'build/sphere.capybara1.openmp.dat' using 1:3 with linespoints ls 3 lw 4 smooth csplines title 'Capybara', \ + x with lines lw 4 lc 'gray' dt 3 notitle + diff --git a/graphics/aurora-real.jpg b/graphics/aurora-real.jpg Binary files differ. diff --git a/graphics/aurora-vsl.png b/graphics/aurora-vsl.png Binary files differ. diff --git a/graphics/ship-velocity-waves.png b/graphics/ship-velocity-waves.png Binary files differ. diff --git a/graphics/ship.png b/graphics/ship.png Binary files differ. diff --git a/graphics/waves-velocity.png b/graphics/waves-velocity.png Binary files differ. diff --git a/graphics/waves.png b/graphics/waves.png Binary files differ. diff --git a/preamble.tex b/preamble.tex @@ -24,6 +24,18 @@ arrows={-Triangle[length=0.25cm,width=0.125cm]}, draw=spbuDarkGray ] +\tikzstyle{Dashed} = [ + very thick, + draw=spbuDarkGray2, + dashed +] +\tikzstyle{Label} = [ + align=center, + font=\scriptsize\linespread{1}\selectfont, + fill=none, + baseline, + anchor=south +] \definecolor{markRed}{HTML}{E5C6C5} diff --git a/slides.tex b/slides.tex @@ -1,4 +1,4 @@ -\documentclass[aspectratio=169]{beamer} +\documentclass[aspectratio=169,xcolor=table]{beamer} \usepackage{polyglossia} \setdefaultlanguage{english} \usetheme{SaintPetersburg} @@ -9,6 +9,9 @@ \usepackage{tikz} \usetikzlibrary{arrows.meta} \setlength{\tabcolsep}{4pt} +\definecolor{opencl}{RGB}{200,255,200} +\definecolor{openmp}{RGB}{255,255,200} + %\setbeamertemplate{footline}[frame number] @@ -55,12 +58,12 @@ A.\:Grigorev% \begin{column}{0.33\textwidth} \centering \includegraphics[height=4cm]{graphics/supercomputer.jpg} - Supercomputers are scarce. + Supercomputers have command line interface (mostly). \end{column} \begin{column}{0.33\textwidth} \centering \includegraphics[height=4cm]{graphics/gpu.jpg}\linebreak - GPUs are not. + GPUs are easy to get and powerfull. \end{column} \end{columns} \pause @@ -68,88 +71,169 @@ A.\:Grigorev% {\Large How much performance can we gain using GPUs?} \end{frame} -\begin{frame}{Velocity potential equations} - \footnotesize - \begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}% - \vspace{-\baselineskip}% - \begin{align*}% - & \nabla^2\phi = 0 - & \text{continuity equation} - \\ - & \phi_t+\frac{1}{2} |\vec{\upsilon}|^2 + g\zeta=-\frac{p}{\rho} - & \text{dynamic BC for }z=\zeta(x,y,t) - \\ - & D\zeta = \nabla \phi \cdot \vec{n} - & \text{kinematic BC for }z=\zeta(x,y,t)\\ - \end{align*}% - \vspace{-2.5\baselineskip}% - \end{beamercolorbox}% - % - \pause% - % - \spbuArrow{}% - \vspace{-0.2cm}% - % - \begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}% - \vspace{-\baselineskip}% - \begin{align*}% - & \phi_{xx} + \phi_{yy} + \phi_{zz} = 0\\ - & \zeta_t - = \underbrace{\fillrectemph{f1}{\left(\FracSqrtZetaXY{\zeta_x} - \zeta_x\right)}}_{f_1} \phi_x - + \underbrace{\fillrectemph{f2}{\left(\FracSqrtZetaXY{\zeta_y} - \zeta_y\right)}}_{f_2} \phi_y - - \underbrace{\fillrectemph{f3}{\FracSqrtZetaXY{1}}}_{f_3} \phi_z \\ - \end{align*}% - \vspace{-2.7\baselineskip}% - \end{beamercolorbox}% - % - \pause% -\vspace{-0.5\baselineskip}% -\spbuArrow{}% -\vspace{-\baselineskip}% -\begingroup% -\setlength\abovedisplayskip{1mm}% -\begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}% -Solution:\vspace{-0.5\baselineskip}% -\begin{equation*}% - \phi(x,y,z,t) - = - \mathcal{W}_2(x,y,z) - \mathrel{*} -% \frac{\zeta_t(x,y,t)}{i f_1(x,y,t) + i f_2(x,y,t) - f_3(x,y,t)} - \frac{\zeta_t(x,y,t)}{F\left(f_1, f_2, f_3\right)} -% & \mathcal{W}_1 \approx \mathcal{W}_2 -\end{equation*}% -\vspace{-0.5\baselineskip}% -\end{beamercolorbox}% -\endgroup% +\begin{frame}{Wavy surface} + \begin{columns}[T] + \begin{column}{0.49\textwidth} + \includegraphics[width=\textwidth]{graphics/waves.png} + \end{column} + \begin{column}{0.49\textwidth} + \begin{itemize} + \item Stokes waves (without vorticity). + \end{itemize} + \end{column} + \end{columns} +\end{frame} + +\begin{frame}{Velocity potential} + \begin{columns}[T] + \begin{column}{0.49\textwidth} + \includegraphics[width=\textwidth]{graphics/waves-velocity.png} + \end{column} + \begin{column}{0.49\textwidth} + \begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}% + \vspace{-\baselineskip}% + \begin{align*}% + & \nabla^2\phi = 0 + & \text{continuity equation}\\ + & \phi_t+\frac{1}{2} |\vec{\upsilon}|^2 + g\zeta=-\frac{p}{\rho} + & \text{dynamic BC}\\ + & D\zeta = \nabla \phi \cdot \vec{n} + & \text{kinematic BC}\\ + \end{align*}% + \vspace{-2.5\baselineskip}% + \end{beamercolorbox} + \spbuArrow{}% + \vspace{-0.2cm}% + \begin{beamercolorbox}[colsep*=.75ex,vmode]{block body}% + Solution:\vspace{-0.5\baselineskip}% + \begin{equation*}% + \phi(x,y,z,t) + = + \mathcal{W}(x,y,z) + \mathrel{*} + \frac{\zeta_t(x,y,t)}{F\left(f_1, f_2, f_3\right)} + \end{equation*}% + \vspace{-0.5\baselineskip}% + \end{beamercolorbox}% + \end{column} + \end{columns} \end{frame} \begin{frame}{Wave pressure} - Pressure: - \begin{equation*} - p(x,y,z,t) = -\rho\phi_t - - \rho\frac{1}{2}\left( \phi_x^2 + \phi_y^2 + \phi_z^2 \right) - - \rho g z - \end{equation*} - Pressure force: - \begin{equation*} - F(x,y,z,t) = -p S \vec{n} - \end{equation*} + \begin{columns}[T] + \begin{column}{0.49\textwidth} + \includegraphics[width=\textwidth]{graphics/ship-velocity-waves.png} + \end{column} + \begin{column}{0.49\textwidth} + Pressure: + \begin{equation*} + p(x,y,z,t) = -\rho\phi_t + - \rho\frac{1}{2}\left( \phi_x^2 + \phi_y^2 + \phi_z^2 \right) + - \rho g z + \end{equation*} + Pressure force: + \begin{equation*} + F(x,y,z,t) = -p(x,y,z,t) S \vec{n} + \end{equation*} + \end{column} + \end{columns} +\end{frame} + +\begin{frame}{Ship motions} + \begin{columns}[T] + \begin{column}{0.49\textwidth} + \includegraphics[width=\textwidth]{graphics/ship.png} + \end{column} + \begin{column}{0.49\textwidth} + \begin{equation*} + \frac{d}{dt}\left[ + \begin{array}{c} + x(t)\\ + q(t)\\ + P(t)\\ + L(t) + \end{array} + \right] = \left[ + \begin{array}{c} + v(t)\\ + \frac{1}{2}\omega(t)q(t)\\ + F(t)\\ + \tau(t) + \end{array} + \right] + \end{equation*} + \begin{equation*} + P(t) = mv(t) \qquad + L(t) = I(t)\omega(t) + \end{equation*} + \begin{equation*} + I(t) = R(q(t)) \, I_{\text{body}} \, R(q(t))^{T} + \end{equation*} + \vfill + \footnotesize + Classic reference: + \begin{itemize} + \item + David Baraff \textit{An Introduction to Physically Based Modeling: + Rigid Body Simulation}, 1997. + \end{itemize} + \end{column} + \end{columns} +\end{frame} + +\begin{frame}{Digitised three-dimensional ship hull models} + \begin{columns}[T] + \begin{column}{0.49\textwidth} + \begin{tikzpicture} + \node[anchor=north west,inner sep=0] (image) at (0,0) {% + \includegraphics[width=\textwidth]{graphics/aurora-vsl.png}}; + \node[anchor=north west,spbuWhite1,font={\large}] at (0,0) + {Aurora in Virtual testbed}; + \end{tikzpicture} + \end{column} + \begin{column}{0.49\textwidth} + \begin{tikzpicture} + \node[anchor=north west,inner sep=0] (image) at (0,0) + {\includegraphics[width=\textwidth]{graphics/aurora-real.jpg}}; + \node[anchor=north west,spbuWhite1,font={\large}] at (0,0) + {Aurora in Saint-Petersburg}; + \end{tikzpicture} + \end{column} + \end{columns} + \vfill + Ship hull database is registered in~FIPS: + \footnotesize + \begin{itemize} + \item + A.\:Bogdanov, V.\:Khramushin + \textit{Vessel: Blueprints for the + analysis of hydrostatic characteristics, stability and + propulsion of the ship}, 2015, FIPS \#2015621368 + (in Russian). + \item + V.\:Khramushin \textit{Analytic ship hull shape + construction, wave resistance + calculations, theoretical blueprint feature curve + calculations, and ship stability diagrams}, 2010, FIPS \#2010615849 + (in Russian). + \end{itemize} \end{frame} \begin{frame} - \frametitle{Main loop} + \frametitle{The anatomy of a simulation step} \centering \begin{tikzpicture}[x=2.2cm,y=-1.4cm] - \node[Block] (s1) at (0,0) {\strut{}Wavy surface}; + % nodes + \node[Block,fill=markRed] (s1) at (0,0) {\strut{}Wavy surface}; \node[Block] (s2) at (1,0) {\strut{}Autoreg. model}; \node[Block] (s3) at (2,0) {\strut{}Wave numbers}; - \node[Block] (s4) at (3,0) {\strut{}Velocity potential}; - \node[Block] (s5) at (4,0) {\strut{}Wave pressure}; - \node[Block] (s6) at (4,1) {\strut{}Wetted surface}; - \node[Block] (s7) at (3,1) {\strut{}Elevation deriv.}; - \node[Block] (s8) at (2,1) {\strut{}Pressure force}; + \node[Block,fill=markRed] (s4) at (3,0) {\strut{}Velocity potential}; + \node[Block,fill=markRed] (s5) at (4,0) {\strut{}Wave pressure}; + \node[Block,fill=markRed] (s6) at (4,1) {\strut{}Wetted surface}; + \node[Block,fill=markRed] (s7) at (3,1) {\strut{}Elevation deriv.}; + \node[Block,fill=markRed] (s8) at (2,1) {\strut{}Pressure force}; \node[Block] (s9) at (1,1) {\strut{}Ship velocities}; + % solid edges \path[Arrow] (s1) -- (s2); \path[Arrow] (s2) -- (s3); \path[Arrow] (s3) -- (s4); @@ -159,85 +243,108 @@ Solution:\vspace{-0.5\baselineskip}% \path[Arrow] (s7) -- (s8); \path[Arrow] (s8) -- (s9); \path[Arrow] (s9) -| (s1); + % labels + \node[Label,anchor=south,above=of s1] + (lblWavySurface) + {Linear models}; + \node[Label,anchor=north,above=of s4,text width=3.0cm] + (lblVelocityPotential) + {Convolution (4\(\times\)FFT), derivatives}; + \node[Label,anchor=north,above=2cm of s5,text width=3.0cm] + (lblPressure) + {Geometric transformations, derivatives}; + \node[Label,anchor=south,below=of s6,text width=4cm] + (lblGeometry) + {Geometric transformations}; + \node[Label,anchor=south,below=1.5cm of s8,text width=3cm] + (lblInterpolation) + {Linear\\interpolation}; + \node[Label,anchor=south,below=of s9,text width=4.0cm] + (lblShipMotion) + {Runge---Khutta---Fehlberg (or Euler)}; + % dashed edges + \path[Dashed] (s1.north -| lblWavySurface.south) -- (lblWavySurface.south); + \path[Dashed] (s4.north -| lblVelocityPotential.south) -- (lblVelocityPotential.south); + \path[Dashed] (s5.north -| lblPressure.south) -- (lblPressure.south); + \path[Dashed] (lblGeometry.north -| s6.south) -- (s6.south); + \path[Dashed] (lblInterpolation.north -| s8.south) -- (s8.south); + \path[Dashed] (lblShipMotion.north -| s9.south) -- (s9.south); \end{tikzpicture} \end{frame} \begin{frame} - \frametitle{3-D ship models} - \centering - \includegraphics[width=0.5\textwidth]{build/aurora.eps}\hfill - \includegraphics[width=0.5\textwidth]{build/micw.eps} - \vfill - \begin{tabular}{lrrr} - \toprule - & Aurora & MICW & Sphere \\ - \midrule - Length, m & 126.5 & 260 & 100 \\ - Beam, m & 16.8 & 32 & 100 \\ - Depth, m & 14.5 & 31 & 100 \\ - No. of panels & 29306 & 10912 & 5120 \\ - \bottomrule - \end{tabular} -\end{frame} - -\begin{frame} - \frametitle{Best median performance} - \centering - \begin{tabular}{lrrrlrrrlrrrl} - \toprule - & \multicolumn{4}{c}{Sphere} - & \multicolumn{4}{c}{Aurora} - & \multicolumn{4}{c}{MICW} \\ - \cmidrule(r){2-5} - \cmidrule(r){6-9} - \cmidrule(r){10-13} - Node & \(t\), ms & \(m\) & \(n\) & ver. - & \(t\), ms & \(m\) & \(n\) & ver. - & \(t\), ms & \(m\) & \(n\) & ver. \\ - \midrule - Storm & 16 & 64 & 1 & CL - & 14 & 72 & 1 & CL - & 29 & 34 & 1 & CL \\ - GPUlab & 10 & 104 & 1 & CL - & 9 & 112 & 1 & CL - & 18 & 55 & 1 & CL \\ - Capybara & 12 & 85 & 10 & MP - & 15 & 66 & 10 & MP - & 19 & 51 & 10 & MP \\ - \bottomrule - \end{tabular} -\end{frame} - -\begin{frame} - \frametitle{Hardware configuration} - \centering - \begin{tabular}{lllrr} - \toprule - & & & \multicolumn{2}{c}{GPU GFLOPS} \\ - \cmidrule(r){4-5} - Node & CPU & GPU & Single & Double \\ - \midrule - Storm & Intel Q9550 & Radeon R7 360 & 1613 & 101 \\ - GPUlab & AMD FX-8370 & NVIDIA GTX1060 & 4375 & 137 \\ - Capybara & Intel E5-2630 v4 & NVIDIA P5000 & 8873 & 277 \\ - \bottomrule - \end{tabular} -\end{frame} - -\begin{frame} - \frametitle{OpenMP performance} - \centering - \includegraphics{build/openmp.eps} -\end{frame} - -\begin{frame} - \frametitle{Overall performance} - \centering - \includegraphics{build/histogram.eps} + \small + \begin{columns}[T] + \begin{column}{0.56\textwidth}% + \centering% + \begin{block}{\small{}Detailed performance (sphere)\strut{}}% + \includegraphics{build/histogram-slides.eps}% + \end{block}% + \vspace{-1.5\baselineskip} + \begin{block}{\small{}Workstations\strut{}} + \centering\tiny + \begin{tabular}{lllrr} + \toprule + & & & \multicolumn{2}{c}{GPU GFLOPS} \\ + \cmidrule(r){4-5} + Workstation & CPU & GPU & Single & Double \\ + \midrule + Storm & Intel Q9550 & Radeon R7 360 & 1613 & 101 \\ + GPUlab & AMD FX-8370 & NVIDIA GTX1060 & 4375 & 137 \\ + Capybara & Intel E5-2630 v4 & NVIDIA P5000 & 8873 & 277 \\ + \bottomrule + \end{tabular} + \end{block} + \end{column}% + \begin{column}{0.40\textwidth}% + \begin{block}{\small{}Best median performance\strut{}}% + \centering% + \scriptsize% + \begin{tabular}{lrrr}% + \toprule + & \multicolumn{3}{c}{Simulation step time, ms} \\ + \cmidrule(r){2-4} + Workstation & Sphere & Aurora & MICW \\ + \midrule + Storm & \cellcolor{opencl}16 & \cellcolor{opencl}14 & \cellcolor{opencl}29 \\ + GPUlab & \cellcolor{opencl}10 & \cellcolor{opencl}9 & \cellcolor{opencl}18 \\ + Capybara & \cellcolor{openmp}12 & \cellcolor{openmp}15 & \cellcolor{openmp}19 \\ + \bottomrule + \end{tabular} + \vskip0.5\baselineskip + \begin{tabular}{cc} + \cellcolor{opencl}OpenCL & + \cellcolor{openmp}OpenMP \\ + \end{tabular} + \end{block}% + \vspace{-1.5\baselineskip} + \begin{block}{\small{}Ship hulls\strut{}} + \centering% + \scriptsize + \begin{tabular}{lrrr} + \toprule + & Aurora & MICW & Sphere \\ + \midrule + Length, m & 126.5 & 260 & 100 \\ + Beam, m & 16.8 & 32 & 100 \\ + Depth, m & 14.5 & 31 & 100 \\ + No. of panels & 29306 & 10912 & 5120 \\ + \bottomrule + \end{tabular} + \end{block} + \end{column}% + \end{columns}% \end{frame} \begin{frame} - \frametitle{Results} + \frametitle{Conclusion} + \begin{itemize} + \item Moving computations to data (and not vice versa) is beneficial + for iterative programmes. + \item Computationally efficient mathematical models (rewriting formulae + using FFT) are needed for large performance gains. + \item Can not get away without GPU-specialised algorithms (derivatives). + \end{itemize} \end{frame} \begin{frame}