iccsa-19-vtestbed

Virtual Testbed: Ship Motion Simulation for Personal Workstations
git clone https://git.igankevich.com/iccsa-19-vtestbed.git
Log | Files | Refs

slides.tex (11937B)


      1 \documentclass[aspectratio=169,xcolor=table]{beamer}
      2 \usepackage{polyglossia}
      3 \setdefaultlanguage{english}
      4 \usetheme{SaintPetersburg}
      5 
      6 \usepackage{textcomp}
      7 \usepackage{booktabs}
      8 \usepackage{multicol}
      9 \usepackage{pgfgantt}
     10 \usepackage{tikz}
     11 \usetikzlibrary{arrows.meta}
     12 \setlength{\tabcolsep}{4pt}
     13 \definecolor{opencl}{RGB}{200,255,200}
     14 \definecolor{openmp}{RGB}{255,255,200}
     15 
     16 
     17 %\setbeamertemplate{footline}[frame number]
     18 
     19 \input{preamble}
     20 
     21 \title{Virtual testbed: Ship motion simulation for personal workstations}
     22 \author{%
     23 A.\:Degtyarev \and
     24 V.\:Khramushin \and
     25 I.\:Gankevich \and
     26 I.\:Petriakov \and
     27 A.\:Gavrikov \and
     28 A.\:Grigorev%
     29 }
     30 \date{July 2019}
     31 
     32 \begin{document}
     33 
     34 \frame{\maketitle}
     35 
     36 \begin{frame}{Virtual testbed project}
     37 	Global goal: Decision support system that analyses data from ships in
     38 	sea, models the environment and predicts (and prevents) dangerous situations.
     39 	\vskip\baselineskip
     40 	Current goal: Accelerate the programme using graphical accelerators.
     41 	\vskip\baselineskip
     42 	Key features:
     43 	\begin{itemize}
     44 		\item Real-time visualisation. Without it we can not validate physics.
     45 		\item Realistic marine objects. We load ships from digital blueprints.
     46 		\item Wave reflection from ship hull (work-in-progress).
     47 	\end{itemize}
     48 \end{frame}
     49 
     50 \begin{frame}
     51 	\frametitle{Motivation}
     52 	\centering
     53 	\begin{columns}[T]
     54 		\begin{column}{0.33\textwidth}
     55 			\centering
     56 			\includegraphics[height=4cm]{graphics/model-basin.jpg}
     57 			Model basins are scarce.
     58 		\end{column}
     59 		\begin{column}{0.33\textwidth}
     60 			\centering
     61 			\includegraphics[height=4cm]{graphics/supercomputer.jpg}
     62 			Supercomputers have command line interface (mostly).
     63 		\end{column}
     64 		\begin{column}{0.33\textwidth}
     65 			\centering
     66 			\includegraphics[height=4cm]{graphics/gpu.jpg}\linebreak
     67 			GPUs are easy to get and powerfull.
     68 		\end{column}
     69 	\end{columns}
     70 \end{frame}
     71 
     72 \begin{frame}{Wavy surface}
     73 	\begin{columns}[T]
     74 		\begin{column}{0.49\textwidth}
     75 			\includegraphics[width=\textwidth]{graphics/waves.png}
     76 		\end{column}
     77 		\begin{column}{0.49\textwidth}
     78 			Third-order Stokes wave elevation:
     79 			\begin{equation*}
     80 				\zeta = A \left(
     81 					\cos\theta +
     82 					\frac{1}{2}s\cos2\theta +
     83 					\frac{3}{8}s^2\cos3\theta
     84 				\right)
     85 			\end{equation*}
     86 			\begin{equation*}
     87 				s = A |\vec{k}| \qquad
     88 				\theta = \vec{k} \cdot \vec{x} - \omega t
     89 			\end{equation*}
     90 			\footnotesize
     91 			\begin{itemize}
     92 				\item Embarassingly parallel.
     93 				\item Will be replaced in the future with Gerstner wave
     94 					for computing wave reflections.
     95 			\end{itemize}
     96 		\end{column}
     97 	\end{columns}
     98 \end{frame}
     99 
    100 \begin{frame}{Fluid motions}
    101 	\begin{columns}[T]
    102 		\begin{column}{0.49\textwidth}
    103 			\includegraphics[width=\textwidth]{graphics/waves-velocity.png}
    104 		\end{column}
    105 		\begin{column}{0.49\textwidth}
    106 			Equations of motion:
    107 			\begin{equation*}%
    108 				\begin{cases}
    109 				\nabla^2\phi = 0 \\
    110 			    \phi_t+\frac{1}{2} |\vec{\upsilon}|^2 + g\zeta=-\frac{p}{\rho} \\
    111 			    D\zeta = \nabla \phi \cdot \vec{n}
    112 				\end{cases}
    113 			\end{equation*}%
    114 			Solution in convolution form:
    115 			\begin{equation*}%
    116 				\phi(x,y,z,t)
    117 				=
    118 				\mathcal{W}(x,y,z)
    119 				\mathrel{*}
    120 				\frac{\zeta_t(x,y,t)}{F\left(f_1, f_2, f_3\right)}
    121 			\end{equation*}%
    122 			\footnotesize
    123 			\begin{itemize}
    124 				\item Describe conservation of mass and momentum for fluid.
    125 				\item Convolution theorem is used for fast computation.
    126 			\end{itemize}
    127 		\end{column}
    128 	\end{columns}
    129 \end{frame}
    130 
    131 \begin{frame}{Wave pressure}
    132 	\begin{columns}[T]
    133 		\begin{column}{0.49\textwidth}
    134 			\includegraphics[width=\textwidth]{graphics/ship-velocity-waves.png}
    135 		\end{column}
    136 		\begin{column}{0.49\textwidth}
    137 			For each ship hull panel:
    138 			\begin{equation*}
    139 				\begin{aligned}
    140 					F &= \overbrace{
    141 						\rho\left(
    142 							\phi_t +
    143 							\frac{1}{2}\left( \phi_x^2 + \phi_y^2 + \phi_z^2 \right)
    144 						\right)
    145 						S \vec{n}}^{\text{Froude---Krylov force}} \\
    146 					  & + \underbrace{\rho g z S \vec{n}}_{\text{Archimedes' force}}
    147 				\end{aligned}
    148 			\end{equation*}
    149 			\centering
    150 			\includegraphics{build/roll.eps}
    151 		\end{column}
    152 	\end{columns}
    153 \end{frame}
    154 
    155 \begin{frame}{Ship motions}
    156 	\begin{columns}[T]
    157 		\begin{column}{0.49\textwidth}
    158 			\includegraphics[width=\textwidth]{graphics/ship.png}
    159 		\end{column}
    160 		\begin{column}{0.49\textwidth}
    161 			Equations of motion (Newton's second law):
    162 			\begin{equation*}
    163 				\frac{d}{dt}\left[
    164 				\begin{array}{c}
    165 					\vec{x}(t)\\
    166 					q(t)\\
    167 					\vec{P}(t)\\
    168 					\vec{L}(t)
    169 				\end{array}
    170 				\right] = \left[
    171 				\begin{array}{c}
    172 					\vec{v}(t)\\
    173 					\frac{1}{2}\vec\omega(t)q(t)\\
    174 					\vec{F}(t)\\
    175 					\vec\tau(t)
    176 				\end{array}
    177 				\right] \quad
    178 			\end{equation*}
    179 			\begin{equation*}
    180 				\begin{aligned}
    181 					& \vec{P}(t) = m\vec{v}(t) \qquad \vec{L}(t) = I(t)\vec\omega(t) \\
    182 					& I(t) = R(q(t)) \, I_{\text{body}} \, R(q(t))^{T}
    183 				\end{aligned}
    184 			\end{equation*}
    185 			\footnotesize
    186 			\begin{itemize}
    187 				\item Describe conservation of linear and angular momentum
    188 					 for a ship.
    189 				\item Approachable reference: David Baraff \textit{An
    190 					Introduction to Physically Based Modeling: Rigid Body
    191 					Simulation}, 1997.
    192 			\end{itemize}
    193 		\end{column}
    194 	\end{columns}
    195 \end{frame}
    196 
    197 \begin{frame}{Digitised three-dimensional ship hull models}
    198 	\begin{columns}[T]
    199 		\begin{column}{0.49\textwidth}
    200 			\begin{tikzpicture}
    201 				\node[anchor=north west,inner sep=0] (image) at (0,0) {%
    202 					\includegraphics[width=\textwidth]{graphics/aurora-vsl.png}};
    203 				\node[anchor=north west,spbuWhite1,font={\large}] at (0,0)
    204 					{Aurora in Virtual testbed};
    205 			\end{tikzpicture}
    206 		\end{column}
    207 		\begin{column}{0.49\textwidth}
    208 			\begin{tikzpicture}
    209 				\node[anchor=north west,inner sep=0] (image) at (0,0)
    210 					{\includegraphics[width=\textwidth]{graphics/aurora-real.jpg}};
    211 				\node[anchor=north west,spbuWhite1,font={\large}] at (0,0)
    212 					{Aurora in Saint-Petersburg};
    213 			\end{tikzpicture}
    214 		\end{column}
    215 	\end{columns}
    216 	\vfill
    217 	Ship hull database is registered in~FIPS:
    218 	\footnotesize
    219 	\begin{itemize}
    220 		\item
    221 			A.\:Bogdanov, V.\:Khramushin
    222 			\textit{Vessel: Blueprints for the
    223 			analysis of hydrostatic characteristics, stability and
    224 			propulsion of the ship}, 2015, FIPS \#2015621368
    225 			(in Russian).
    226 		\item
    227 			V.\:Khramushin \textit{Analytic ship hull shape
    228 			construction, wave resistance
    229 			calculations, theoretical blueprint feature curve
    230 			calculations, and ship stability diagrams}, 2010, FIPS \#2010615849
    231 			(in Russian).
    232 	\end{itemize}
    233 \end{frame}
    234 
    235 \begin{frame}
    236 	\frametitle{The anatomy of a simulation step}
    237 	\centering
    238 	\begin{tikzpicture}[x=2.2cm,y=-1.4cm]
    239 		% nodes
    240 		\node[Block,fill=markRed] (s1) at (0,0) {\strut{}Wavy surface};
    241 		\node[Block] (s2) at (1,0) {\strut{}Autoreg. model};
    242 		\node[Block] (s3) at (2,0) {\strut{}Wave numbers};
    243 		\node[Block,fill=markRed] (s4) at (3,0) {\strut{}Velocity potential};
    244 		\node[Block,fill=markRed] (s5) at (4,0) {\strut{}Wave pressure};
    245 		\node[Block,fill=markRed] (s6) at (4,1) {\strut{}Wetted surface};
    246 		\node[Block,fill=markRed] (s7) at (3,1) {\strut{}Elevation deriv.};
    247 		\node[Block,fill=markRed] (s8) at (2,1) {\strut{}Pressure force};
    248 		\node[Block] (s9) at (1,1) {\strut{}Ship velocities};
    249 		% solid edges
    250 		\path[Arrow] (s1) -- (s2);
    251 		\path[Arrow] (s2) -- (s3);
    252 		\path[Arrow] (s3) -- (s4);
    253 		\path[Arrow] (s4) -- (s5);
    254 		\path[Arrow] (s5.east) -- ++(0.2,0) |- (s6.east);
    255 		\path[Arrow] (s6) -- (s7);
    256 		\path[Arrow] (s7) -- (s8);
    257 		\path[Arrow] (s8) -- (s9);
    258 		\path[Arrow] (s9) -| (s1);
    259 		% labels
    260 		\node[Label,anchor=south,above=of s1]
    261 			(lblWavySurface)
    262 			{Linear models};
    263 		\node[Label,anchor=north,above=of s4,text width=3.0cm]
    264 			(lblVelocityPotential)
    265 			{Convolution (4\(\times\)FFT), derivatives};
    266 		\node[Label,anchor=north,above=2cm of s5,text width=3.0cm]
    267 			(lblPressure)
    268 			{Geometric transformations, derivatives};
    269 		\node[Label,anchor=south,below=1.5cm of s6,text width=3cm]
    270 			(lblGeometry)
    271 			{Geometric\\transformations};
    272 		\node[Label,anchor=south,below=of s7,text width=3cm]
    273 			(lblDerivatives)
    274 			{Micikevicius 3D finite differences};
    275 		\node[Label,anchor=south,below=1.5cm of s8,text width=3cm]
    276 			(lblInterpolation)
    277 			{Linear\\interpolation};
    278 		\node[Label,anchor=south,below=of s9,text width=4.0cm]
    279 			(lblShipMotion)
    280 			{Runge---Khutta---Fehlberg (or Euler)};
    281 		% dashed edges
    282 		\path[Dashed] (s1.north -| lblWavySurface.south) -- (lblWavySurface.south);
    283 		\path[Dashed] (s4.north -| lblVelocityPotential.south) -- (lblVelocityPotential.south);
    284 		\path[Dashed] (s5.north -| lblPressure.south) -- (lblPressure.south);
    285 		\path[Dashed] (lblGeometry.north -| s6.south) -- (s6.south);
    286 		\path[Dashed] (lblDerivatives.north -| s7.south) -- (s7.south);
    287 		\path[Dashed] (lblInterpolation.north -| s8.south) -- (s8.south);
    288 		\path[Dashed] (lblShipMotion.north -| s9.south) -- (s9.south);
    289 	\end{tikzpicture}
    290 \end{frame}
    291 
    292 \begin{frame}
    293 	\small
    294 	\begin{columns}[T]
    295 		\begin{column}{0.56\textwidth}%
    296 			\centering%
    297 			\begin{block}{\small{}Detailed performance (sphere)\strut{}}%
    298 				\includegraphics{build/histogram-slides.eps}%
    299 			\end{block}%
    300 			\vspace{-1.5\baselineskip}
    301 			\begin{block}{\small{}Workstations\strut{}}
    302 				\centering\tiny
    303 				\begin{tabular}{lllrr}
    304 					\toprule
    305 					     &     &     & \multicolumn{2}{c}{GPU GFLOPS} \\
    306 					\cmidrule(r){4-5}
    307 					Workstation     & CPU              & GPU            & Single & Double \\
    308 					\midrule
    309 					Storm    & Intel Q9550      & Radeon R7 360  & 1613   & 101 \\
    310 					GPUlab   & AMD FX-8370      & NVIDIA GTX1060 & 4375   & 137 \\
    311 					Capybara & Intel E5-2630 v4 & NVIDIA P5000   & 8873   & 277 \\
    312 					\bottomrule
    313 				\end{tabular}
    314 			\end{block}
    315 		\end{column}%
    316 		\begin{column}{0.40\textwidth}%
    317 			\begin{block}{\small{}Best median performance\strut{}}%
    318 			\centering%
    319 			\scriptsize%
    320 			\begin{tabular}{lrrr}%
    321 				\toprule
    322 				& \multicolumn{3}{c}{Simulation step time, ms} \\
    323 				\cmidrule(r){2-4}
    324 				Workstation & Sphere & Aurora & MICW \\
    325 				\midrule
    326 				Storm    & \cellcolor{opencl}16 & \cellcolor{opencl}14 & \cellcolor{opencl}29 \\
    327 				GPUlab   & \cellcolor{opencl}10 & \cellcolor{opencl}9  & \cellcolor{opencl}18 \\
    328 				Capybara & \cellcolor{openmp}12 & \cellcolor{openmp}15 & \cellcolor{openmp}19 \\
    329 				\bottomrule
    330 			\end{tabular}
    331 			\vskip0.5\baselineskip
    332 			\begin{tabular}{cc}
    333 				\cellcolor{opencl}OpenCL & 
    334 				\cellcolor{openmp}OpenMP \\
    335 			\end{tabular}
    336 			\end{block}%
    337 			\vspace{-1.5\baselineskip}
    338 			\begin{block}{\small{}Ship hulls\strut{}}
    339 				\centering%
    340 				\scriptsize
    341 				\begin{tabular}{lrrr}
    342 					\toprule
    343 								  & Aurora & MICW  & Sphere \\
    344 					\midrule
    345 					Length, m     & 126.5  &   260 &  100   \\
    346 					Beam, m       &  16.8  &    32 &  100   \\
    347 					Depth, m      &  14.5  &    31 &  100   \\
    348 					No. of panels & 29306  & 10912 & 5120   \\
    349 					\bottomrule
    350 				\end{tabular}
    351 			\end{block}
    352 		\end{column}%
    353 	\end{columns}%
    354 \end{frame}
    355 
    356 \begin{frame}
    357 	\frametitle{Conclusion}
    358 	\begin{itemize}
    359 		\item Moving computations to data (and not vice versa) is beneficial
    360 			for iterative programmes.
    361 		\item Computationally efficient mathematical models (rewriting formulae
    362 			using FFT) are needed for large performance gains.
    363 		\item Can not get away without GPU-specialised algorithms (derivatives).
    364 	\end{itemize}
    365 \end{frame}
    366 
    367 \begin{frame}
    368     \centering
    369     \Large
    370     \vspace{1.5\baselineskip}
    371     Thank you for attention! 
    372 \end{frame}
    373 
    374 \begin{frame}
    375 	\tiny\vfill
    376 	Copyright \textcopyright{} 2019 Ivan Gankevich
    377 	\texttt{\href{mailto:i.gankevich@spbu.ru}{i.gankevich@spbu.ru}}. \\
    378 	\vskip\baselineskip
    379 	Aurora Cruiser under CC BY-SA 4.0 by Vitaly V. Kuzmin, \url{http://vitalykuzmin.net/}. \\
    380 	Metacentric height under CC BY-SA 2.5 by Life of Riley, \url{https://commons.wikimedia.org/wiki/File:MetacentricHeight.svg}.\\
    381 	\vskip\baselineskip
    382 	This work is licensed under a \alert{Creative Commons Attribution-ShareAlike 4.0
    383 	International License}. The copy of the license is available at
    384 	\url{https://creativecommons.org/licenses/by-sa/4.0/}.
    385 \end{frame}
    386 
    387 \end{document}