diff --git a/nummeth-ws22/exercises/entenrennen.pdf b/nummeth-ws22/exercises/entenrennen.pdf new file mode 100644 index 0000000..48ea48b Binary files /dev/null and b/nummeth-ws22/exercises/entenrennen.pdf differ diff --git a/nummeth-ws22/exercises/uebung9.tex b/nummeth-ws22/exercises/uebung9.tex new file mode 100644 index 0000000..708882a --- /dev/null +++ b/nummeth-ws22/exercises/uebung9.tex @@ -0,0 +1,66 @@ +\documentclass[12pt,a4paper]{uebungen} +\usepackage{german} +\usepackage[utf8]{inputenc} +\usepackage{epsfig} +\usepackage[amssymb]{SIunits} +\usepackage{wrapfig} +\usepackage{graphics} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{amsmath} +\usepackage{url} +\usepackage{pgf} +\usepackage{listings} +\lstset{language=[ANSI]C++,basicstyle=\ttfamily,commentstyle=\itshape, + keywordstyle=\bfseries,extendedchars=true,backgroundcolor=\color{gray}} + +%------------------------------------------------------------------------------ +%\graphicspath{{../../../GALLERY/}} +%------------------------------------------------------------------------------ +\setlength{\topmargin}{-2.5cm} +\setlength{\textheight}{26.0cm} +\setlength{\textwidth}{17cm} +\setlength{\oddsidemargin}{-0.5cm} +\setlength{\evensidemargin}{-0.5cm} +\setlength{\parskip}{0pt} +\setlength{\parindent}{0pt} +\pagestyle{empty} +%------------------------------------------------------------------------------ +\newcommand{\vt}[1]{\vec{#1}} +\newcommand{\mt}[1]{\underline{\underline{#1}}} +\newcommand{\dt}[1]{\left\vert\underline{\underline{#1}}\right\vert} +\newcommand{\mo}{\!\!\!\!\!-1} +%------------------------------------------------------------------------------ +\def\bbbr{{\rm I\!R}} +%------------------------------------------------------------------------------ +\begin{document} +%------------------------------------------------------------------------------ +\thispagestyle{myheadings} +\begin{center} +{\bf \underline{\Large Exercises in ``Numerical Methods in Plasma Astrophysics''}}\\ +%\hfill\\ +%{\bf \large }\\ +\hfill\\ +{\bf \large Winter 2022/23 \hfill Exercise 9}\\ +\end{center} +\noindent +% +\section*{\large Exercise 9: Rubber duck race}\vspace*{-0.0cm} +% +Rubber ducks are clearly racing animals, they love surfing the wild waters of the Neckar! We will try to follow such a race through the magic of computer simulations. Let's assume the race takes place in the well-known 1D Neckar that is described by the Burgers' equation. Due to the large extent of the Neckar it is absolutely necessary to make use of MPI to solve the the numerical problem. + +Two rubber ducks are taken as test particles in this 1D flow that will be advected along with the local flow speed. + +\begin{center} + \pgfimage[width=.7\textwidth]{entenrennen} +\end{center} + +\bigskip +\textbf{a)} Use the code sample discussed in the lecture to perform multi-CPU simulations of the Burgers' equation (you are free to use the [incompressible] Navier-Stokes equation instead, but that's far more complicated\dots) + +\textbf{b)} Define a rubber duck class with position and velocity and place two instances into the simulation domain. The rubber ducks will at some point follow the flow to the next processor, in this case the rubber duck has to be transferred to the next CPU as well.\\ +Hint: In every step neighbouring CPUs should communicate the number of rubber ducks to be transferred. Then a number of \texttt{double} values (2 per rubber duck: position and velocity) are transferred. On the old CPU the rubber duck has to be destroyed and created on the new CPU. There may be more than one rubber duck per CPU. + + +\end{document} +%------------------------------------------------------------------------------ diff --git a/nummeth-ws22/literatur.bib b/nummeth-ws22/literatur.bib index 06d5df9..e700d70 100644 --- a/nummeth-ws22/literatur.bib +++ b/nummeth-ws22/literatur.bib @@ -6,6 +6,26 @@ publisher = {McGraw-Hill, New York}, year = 1981, } +@ARTICLE{kurganov-levy:2000, + author = {{Kurganov}, Alexander and {Levy}, Doron}, + title = "{A Third-Order Semidiscrete Central Scheme for Conservation Laws and Convection-Diffusion Equations}", + journal = {SIAM Journal on Scientific Computing}, + keywords = {Mathematics - Numerical Analysis, Mathematics - Analysis of PDEs, 65M10 (Primary) 65M05 (Secondary)}, + year = 2000, + month = jan, + volume = {22}, + number = {4}, + pages = {1461-1488}, + doi = {10.1137/S1064827599360236}, +archivePrefix = {arXiv}, + eprint = {math/0002133}, + primaryClass = {math.NA}, + adsurl = {https://ui.adsabs.harvard.edu/abs/2000SJSC...22.1461K}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} + + + @ARTICLE{2014CoPhC.185.1981S, author = {{Schreiner}, C. and {Spanier}, F.}, title = "{Wave-particle-interaction in kinetic plasmas}", @@ -27,7 +47,7 @@ archivePrefix = "arXiv", author = {{Ivascenko}, A. and {Lange}, S. and {Spanier}, F. and {Vainio}, R. }, title = "{Determining Pitch-angle Diffusion Coefficients from Test Particle Simulations}", - journal = {\apj}, + journal = {Astrophysical Journal}, archivePrefix = "arXiv", eprint = {1610.03240}, primaryClass = "physics.space-ph", @@ -46,7 +66,7 @@ archivePrefix = "arXiv", author = {{Lange}, S. and {Spanier}, F. and {Battarbee}, M. and {Vainio}, R. and {Laitinen}, T.}, title = "{Particle scattering in turbulent plasmas with amplified wave modes}", - journal = {\aap}, + journal = {Astronomy and Astrophysics}, archivePrefix = "arXiv", eprint = {1303.7463}, primaryClass = "astro-ph.SR", @@ -64,7 +84,7 @@ archivePrefix = "arXiv", @ARTICLE{2012ApJ...750..150W, author = {{Wisniewski}, M. and {Spanier}, F. and {Kissmann}, R.}, title = "{Diffusion of Energetic Particles in Turbulent Magnetohydrodynamic Plasmas}", - journal = {\apj}, + journal = {Astrophysical Journal}, archivePrefix = "arXiv", eprint = {1203.0933}, primaryClass = "astro-ph.HE", @@ -79,6 +99,25 @@ archivePrefix = "arXiv", adsnote = {Provided by the SAO/NASA Astrophysics Data System} } +@ARTICLE{Munoz2018, + author = {{Mu{\~n}oz}, P.~A. and {Jain}, N. and {Kilian}, P. and {B{\"u}chner}, J.}, + title = "{A new hybrid code (CHIEF) implementing the inertial electron fluid equation without approximation}", + journal = {Computer Physics Communications}, + keywords = {Plasma simulation, Hybrid methods, Particle-in-cell method, Physics - Plasma Physics, Physics - Computational Physics}, + year = 2018, + month = mar, + volume = {224}, + pages = {245-264}, + doi = {10.1016/j.cpc.2017.10.012}, +archivePrefix = {arXiv}, + eprint = {1612.03818}, + primaryClass = {physics.plasm-ph}, + adsurl = {https://ui.adsabs.harvard.edu/abs/2018CoPhC.224..245M}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} + + + @BOOK{2002cra..book.....S, author = {{Schlickeiser}, R.}, title = "{Cosmic Ray Astrophysics}", @@ -108,7 +147,7 @@ booktitle = {Cosmic ray astrophysics / Reinhard Schlickeiser, Astronomy and Astr @ARTICLE{2006ApJ...644..631F, author = {{Fisk}, L.~A. and {Gloeckler}, G. and {Zurbuchen}, T.~H.}, title = "{Acceleration of Low-Energy Ions at the Termination Shock of the Solar Wind}", - journal = {\apj}, + journal = {The Astrophysical Journal}, keywords = {Acceleration of Particles, Interplanetary Medium, Shock Waves}, year = 2006, month = jun, @@ -145,7 +184,7 @@ archivePrefix = "arXiv", {Willmott}, C. and {Told}, D. and {Loureiro}, N.~F. and {Califano}, F. and {Jenko}, F.}, title = "{Fully Kinetic versus Reduced-kinetic Modeling of Collisionless Plasma Turbulence}", - journal = {\apj}, + journal = {The Astrophysical Journal}, archivePrefix = "arXiv", eprint = {1706.02652}, primaryClass = "physics.plasm-ph", @@ -241,7 +280,7 @@ archivePrefix = "arXiv", @ARTICLE{2018ApJ...858L..19G, author = {{Grete}, P. and {O'Shea}, B.~W. and {Beckwith}, K.}, title = "{As a Matter of Force{\mdash}Systematic Biases in Idealized Turbulence Simulations}", - journal = {\apjl}, + journal = {The Astrophysical Journall}, archivePrefix = "arXiv", eprint = {1803.05481}, primaryClass = "physics.flu-dyn", @@ -276,7 +315,7 @@ archivePrefix = "arXiv", author = {{Papini}, E. and {Franci}, L. and {Landi}, S. and {Verdini}, A. and {Matteini}, L. and {Hellinger}, P.}, title = "{Can Hall Magnetohydrodynamics Explain Plasma Turbulence at Sub-ion Scales?}", - journal = {\apj}, + journal = {The Astrophysical Journal}, archivePrefix = "arXiv", eprint = {1810.02210}, primaryClass = "physics.plasm-ph", @@ -294,7 +333,7 @@ archivePrefix = "arXiv", @ARTICLE{2018ApJ...864L..21P, author = {{Parashar}, T.~N. and {Matthaeus}, W.~H. and {Shay}, M.~A.}, title = "{Dependence of Kinetic Plasma Turbulence on Plasma {$\beta$}}", - journal = {\apjl}, + journal = {The Astrophysical Journall}, archivePrefix = "arXiv", eprint = {1807.11371}, primaryClass = "physics.space-ph", @@ -309,6 +348,24 @@ archivePrefix = "arXiv", adsnote = {Provided by the SAO/NASA Astrophysics Data System} } +@ARTICLE{allanson17, + author = {{Allanson}, O. and {Troscheit}, S. and {Neukirch}, T.}, + title = "{The inverse problem for collisionless plasma equilibria}", + journal = {arXiv e-prints}, + keywords = {Physics - Plasma Physics}, + year = 2017, + month = oct, + eid = {arXiv:1710.04912}, + pages = {arXiv:1710.04912}, +archivePrefix = {arXiv}, + eprint = {1710.04912}, + primaryClass = {physics.plasm-ph}, + adsurl = {https://ui.adsabs.harvard.edu/abs/2017arXiv171004912A}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} + + + @article{Yee_1966, author = {Kane Yee}, journal = {Antennas and Propagation, IEEE Transactions on}, @@ -1645,7 +1702,7 @@ Rmanelli}, author = {{Shalaby}, M. and {Broderick}, A.~E. and {Chang}, P. and {Pfrommer}, C. and {Lamberts}, A. and {Puchwein}, E.}, title = "{Importance of Resolving the Spectral Support of Beam-plasma Instabilities in Simulations}", - journal = {\apj}, + journal = {The Astrophysical Journal}, archivePrefix = "arXiv", eprint = {1704.00014}, primaryClass = "astro-ph.HE", @@ -1676,7 +1733,7 @@ archivePrefix = "arXiv", @ARTICLE{2009ApJ...699..990B, author = {{Bret}, A.}, title = "{Weibel, Two-Stream, Filamentation, Oblique, Bell, Buneman...Which One Grows Faster?}", - journal = {\apj}, + journal = {The Astrophysical Journal}, keywords = {cosmic rays, gamma rays: bursts, instabilities, shock waves, Astrophysics - High Energy Astrophysical Phenomena, Physics - Plasma Physics}, year = "2009", month = "Jul", @@ -1707,7 +1764,7 @@ archivePrefix = {arXiv}, author = {{Burkart}, Thomas and {Elbracht}, Oliver and {Ganse}, Urs and {Spanier}, Felix}, title = "{The Influence of the Mass Ratio on the Acceleration of Particles by Filamentation Instabilities}", - journal = {\apj}, + journal = {The Astrophysical Journal}, keywords = {acceleration of particles, galaxies: jets, instabilities, methods: numerical, plasmas, Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Cosmology and Extragalactic Astrophysics}, year = "2010", month = "Sep", @@ -1743,7 +1800,7 @@ archivePrefix = {arXiv}, @ARTICLE{2016A&A...585A.132K, author = {{Kempf}, A. and {Kilian}, P. and {Spanier}, F.}, title = "{Energy loss in intergalactic pair beams: Particle-in-cell simulation}", - journal = {\aap}, + journal = {Astronomy and Astrophysics}, keywords = {plasmas, galaxies: active, galaxies: jets, quasars: general, gamma rays: general, Astrophysics - High Energy Astrophysical Phenomena, Physics - Plasma Physics}, year = "2016", month = "Jan", @@ -1778,7 +1835,7 @@ archivePrefix = {arXiv}, @ARTICLE{2014ApJ...787...49S, author = {{Sironi}, Lorenzo and {Giannios}, Dimitrios}, title = "{Relativistic Pair Beams from TeV Blazars: A Source of Reprocessed GeV Emission rather than Intergalactic Heating}", - journal = {\apj}, + journal = {The Astrophysical Journal}, keywords = {gamma rays: general, instabilities, intergalactic medium, plasmas, radiation mechanisms: non-thermal, Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Cosmology and Nongalactic Astrophysics}, year = "2014", month = "May", @@ -1796,7 +1853,7 @@ archivePrefix = {arXiv}, @ARTICLE{weibel1, author = {{Califano}, F. and {Pegoraro}, F. and {Bulanov}, S.~V.}, title = "{Spatial structure and time evolution of the Weibel instability in collisionless inhomogeneous plasmas}", - journal = {\pre}, + journal = {Phys. Rev. E}, keywords = {52.35.Qz, 52.40.Nk, 52.60.+h, 52.65.Kj, Microinstabilities, Magnetohydrodynamic and fluid equation}, year = 1997, month = jul, @@ -1943,7 +2000,7 @@ archivePrefix = {arXiv}, author = {{Sundkvist}, D. and {Retin{\`o}}, A. and {Vaivads}, A. and {Bale}, S.~D. }, title = "{Dissipation in Turbulent Plasma due to Reconnection in Thin Current Sheets}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, keywords = {Plasma turbulence, Magnetic reconnection, Laboratory studies of space- and astrophysical-plasma processes}, year = 2007, month = jul, @@ -1973,7 +2030,7 @@ archivePrefix = {arXiv}, author = {{Matteini}, L. and {Hellinger}, P. and {Landi}, S. and {Tr{\'a}vn{\'{\i}}{\v c}ek}, P.~M. and {Velli}, M.}, title = "{Ion Kinetics in the Solar Wind: Coupling Global Expansion to Local Microphysics}", - journal = {\ssr}, + journal = {Space Science Reviews}, keywords = {Solar wind, Ion kinetics, Numerical simulations}, year = 2012, month = nov, @@ -1988,7 +2045,7 @@ archivePrefix = {arXiv}, author = {{Greco}, A. and {Perri}, S. and {Servidio}, S. and {Yordanova}, E. and {Veltri}, P.}, title = "{The Complex Structure of Magnetic Field Discontinuities in the Turbulent Solar Wind}", - journal = {\apj}, + journal = {The Astrophysical Journal}, keywords = {magnetic reconnection, solar wind, turbulence, Astrophysics - Solar and Stellar Astrophysics, Physics - Space Physics}, year = "2016", month = "Jun", @@ -2165,7 +2222,7 @@ archivePrefix = "arXiv", @ARTICLE{RobertsAPJ2017, author = {{Roberts}, O.~W. and {Narita}, Y. and {Escoubet}, C.~P.}, title = "{Direct Measurement of Anisotropic and Asymmetric Wave Vector Spectrum in Ion-scale Solar Wind Turbulence}", - journal = {\apj}, + journal = {The Astrophysical Journal}, keywords = {turbulence}, year = "2017", month = "Dec", @@ -2199,7 +2256,7 @@ archivePrefix = "arXiv", {Roytershteyn}, V. and {Shay}, M. and {Wu}, P. and {Daughton}, W. and {Loring}, B. and {Chapman}, S.~C.}, title = "{Intermittent Dissipation at Kinetic Scales in Collisionless Plasma Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, keywords = {94.05.Lk, 52.50.-b, 95.30.Qd, 96.50.Ci, Turbulence, Plasma production and heating, Magnetohydrodynamics and plasmas, Solar wind plasma, sources of solar wind}, year = "2012", month = "Nov", @@ -2453,7 +2510,7 @@ archivePrefix = "arXiv", @ARTICLE{KunzPRL2014, author = {{Kunz}, M.~W. and {Schekochihin}, A.~A. and {Stone}, J.~M.}, title = "{Firehose and Mirror Instabilities in a Collisionless Shearing Plasma}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {1402.0010}, primaryClass = "astro-ph.HE", @@ -2524,7 +2581,7 @@ archivePrefix = "arXiv", @ARTICLE{Boldyrev2006, author = {{Boldyrev}, S.}, title = "{Spectrum of Magnetohydrodynamic Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, eprint = {astro-ph/0511290}, keywords = {Magnetohydrodynamics, Magnetohydrodynamics and plasmas}, year = 2006, @@ -2542,7 +2599,7 @@ archivePrefix = "arXiv", @ARTICLE{PlunkTatsuno11, author = {{Plunk}, G.~G. and {Tatsuno}, T.}, title = "{Energy Transfer and Dual Cascade in Kinetic Magnetized Plasma Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {1007.4787}, primaryClass = "physics.plasm-ph", @@ -2564,7 +2621,7 @@ archivePrefix = "arXiv", author = {{Howes}, G.~G. and {Dorland}, W. and {Cowley}, S.~C. and {Hammett}, G.~W. and {Quataert}, E. and {Schekochihin}, A.~A. and {Tatsuno}, T.}, title = "{Kinetic Simulations of Magnetized Turbulence in Astrophysical Plasmas}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {0711.4355}, keywords = {Plasma turbulence, Gyrofluid and gyrokinetic simulations, MHD waves, plasma waves turbulence}, @@ -2583,7 +2640,7 @@ archivePrefix = "arXiv", @ARTICLE{ServidioPRL2017, author = {{Servidio}, S. and {Chasapis}, A. and {Matthaeus}, W.~H. and {Perrone}, D. and {Valentini}, F. and {Parashar}, T.~N. and {Veltri}, P. and {Gershman}, D. and {Russell}, C.~T. and {Giles}, B. and {Fuselier}, S.~A. and {Phan}, T.~D. and {Burch}, J.}, title = "{Magnetospheric Multiscale Observation of Plasma Velocity-Space Cascade: Hermite Representation and Theory}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {1707.08180}, primaryClass = "physics.plasm-ph", @@ -2664,7 +2721,7 @@ archivePrefix = "arXiv", {Greco}, A. and {Servidio}, S. and {Hnat}, B. and {Chapman}, S.~C. and {Phan}, T.~D.}, title = "{Magnetic Reconnection and Intermittent Turbulence in the Solar Wind}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {1403.4590}, primaryClass = "physics.space-ph", @@ -2705,7 +2762,7 @@ archivePrefix = "arXiv", author = {{Perri}, S. and {Goldstein}, M.~L. and {Dorelli}, J.~C. and {Sahraoui}, F.}, title = "{Detection of Small-Scale Structures in the Dissipation Regime of Solar-Wind Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, keywords = {Solar wind plasma, sources of solar wind, Turbulence}, year = 2012, month = nov, @@ -3010,7 +3067,7 @@ archivePrefix = "arXiv", @ARTICLE{PezziPRL2016, author = {{Pezzi}, O. and {Valentini}, F. and {Veltri}, P.}, title = "{Collisional Relaxation of Fine Velocity Structures in Plasmas}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, year = 2016, month = apr, volume = 116, @@ -3047,7 +3104,7 @@ archivePrefix = "arXiv", author = {{Servidio}, S. and {Matthaeus}, W.~H. and {Shay}, M.~A. and {Cassak}, P.~A. and {Dmitruk}, P.}, title = "{Magnetic Reconnection in Two-Dimensional Magnetohydrodynamic Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, keywords = {Magnetic reconnection, Interplanetary magnetic fields, MHD waves, plasma waves turbulence, Magnetic reconnection}, year = 2009, month = mar, @@ -3185,7 +3242,7 @@ archivePrefix = "arXiv", author = {{Daughton}, W. and {Roytershteyn}, V. and {Albright}, B.~J. and {Karimabadi}, H. and {Yin}, L. and {Bowers}, K.~J.}, title = "{Transition from collisional to kinetic regimes in large-scale reconnection layers}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, keywords = {Magnetic reconnection}, year = 2009, month = aug, @@ -3366,7 +3423,7 @@ archivePrefix = "arXiv", author = {{Le}, A. and {Egedal}, J. and {Ohia}, O. and {Daughton}, W. and {Karimabadi}, H. and {Lukin}, V.~S.}, title = "{Regimes of the Electron Diffusion Region in Magnetic Reconnection}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, keywords = {Magnetic reconnection}, year = 2013, month = mar, @@ -3419,7 +3476,7 @@ archivePrefix = "arXiv", author = {{Gro{\v s}elj}, D. and {Mallet}, A. and {Loureiro}, N.~F. and {Jenko}, F.}, title = "{Fully Kinetic Simulation of 3D Kinetic Alfv{\'e}n Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {1710.03581}, primaryClass = "physics.plasm-ph", @@ -3610,6 +3667,7 @@ archivePrefix = "arXiv", adsurl = {http://adsabs.harvard.edu/abs/2017EGUGA..19..620C}, adsnote = {Provided by the SAO/NASA Astrophysics Data System} } + @ARTICLE{ChenBoldyrevAPJ2017, author = {{Chen}, C.~H.~K. and {Boldyrev}, S.}, title = "{Nature of Kinetic Scale Turbulence in the Earth's Magnetosheath}", @@ -3767,7 +3825,7 @@ archivePrefix = "arXiv", author = {{Alexandrova}, O. and {Chen}, C.~H.~K. and {Sorriso-Valvo}, L. and {Horbury}, T.~S. and {Bale}, S.~D.}, title = "{Solar Wind Turbulence and the Role of Ion Instabilities}", - journal = {\ssr}, + journal = {Space Science Reviews}, archivePrefix = "arXiv", eprint = {1306.5336}, primaryClass = "astro-ph.SR", @@ -4046,7 +4104,7 @@ archivePrefix = {arXiv}, @ARTICLE{HughesAPJ2017, author = {{Hughes}, R. Scott and {Gary}, S. Peter and {Wang}, Joseph}, title = "{Particle-in-cell Simulations of Electron and Ion Dissipation by Whistler Turbulence: Variations with Electron {\ensuremath{\beta}}}", - journal = {\apj}, + journal = {The Astrophysical Journal}, keywords = {solar wind, turbulence, waves}, year = "2017", month = "Jan", @@ -4412,7 +4470,7 @@ archivePrefix = {arXiv}, author = {{Arzamasskiy}, Lev and {Kunz}, Matthew W. and {Chand ran}, Benjamin D.~G. and {Quataert}, Eliot}, title = "{Hybrid-kinetic Simulations of Ion Heating in Alfv{\'e}nic Turbulence}", - journal = {\apj}, + journal = {The Astrophysical Journal}, keywords = {acceleration of particles, plasmas, solar wind, turbulence, Astrophysics - High Energy Astrophysical Phenomena, Physics - Plasma Physics, Physics - Space Physics}, year = "2019", month = "Jul", @@ -4446,6 +4504,39 @@ archivePrefix = "arXiv", adsnote = {Provided by the SAO/NASA Astrophysics Data System} } +@ARTICLE{liseikina99, + author = {{Liseikina}, T.~V. and {Califano}, F. and {Vshivkov}, V.~A. and {Pegoraro}, F. and {Bulanov}, S.~V.}, + title = "{Small-scale electron density and magnetic-field structures in the wake of an ultraintense laser pulse}", + journal = {Phys. Rev. E}, + keywords = {52.40.Nk, 52.60.+h, 52.65.Rr, 41.20.-q, Particle-in-cell method, Applied classical electromagnetism}, + year = 1999, + month = nov, + volume = {60}, + number = {5}, + pages = {5991-5997}, + doi = {10.1103/PhysRevE.60.5991}, + adsurl = {https://ui.adsabs.harvard.edu/abs/1999PhRvE..60.5991L}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} + + + +@ARTICLE{alfven:63, + author = {{Alfv{\'e}n}, H.}, + title = "{Hydromagnetics of the Magnetosphere}", + journal = {Space Science Reviews}, + year = 1963, + month = dec, + volume = {2}, + number = {6}, + pages = {862-870}, + doi = {10.1007/BF00208816}, + adsurl = {https://ui.adsabs.harvard.edu/abs/1963SSRv....2..862A}, + adsnote = {Provided by the SAO/NASA Astrophysics Data System} +} + + + @ARTICLE{MithaiwalaPOP2012, author = {{Mithaiwala}, M. and {Rudakov}, L. and {Crabtree}, C. and {Ganguli}, G. }, @@ -4687,7 +4778,7 @@ archivePrefix = "arXiv", author = {{Hatch}, D.~R. and {Jenko}, F. and {Ba{\~n}{\'o}n Navarro}, A. and {Bratanov}, V.}, title = "{Transition between Saturation Regimes of Gyrokinetic Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, keywords = {Gyrokinetics, Plasma turbulence, Gyrofluid and gyrokinetic simulations}, year = 2013, month = oct, @@ -4737,7 +4828,7 @@ archivePrefix = "arXiv", {Delzanno}, Gian Luca and {Chen}, Christopher H.~K. and {Gro{\v{s}}elj}, Daniel and {Loureiro}, Nuno F.}, title = "{Numerical Study of Inertial Kinetic-Alfv{\'e}n Turbulence}", - journal = {\apj}, + journal = {The Astrophysical Journal}, keywords = {plasmas, turbulence, waves, solar wind}, year = "2019", month = "Jan", @@ -4838,7 +4929,7 @@ archivePrefix = "arXiv", {Plunk}, G.~G. and {Barnes}, M. and {Cowley}, S.~C. and {Howes}, G.~G. }, title = "{Nonlinear Phase Mixing and Phase-Space Cascade of Entropy in Gyrokinetic Plasma Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {0811.2538}, primaryClass = "physics.plasm-ph", @@ -4859,7 +4950,7 @@ archivePrefix = "arXiv", {Carati}, D. and {Merz}, F. and {G{\"o}rler}, T. and {Jenko}, F. }, title = "{Free Energy Cascade in Gyrokinetic Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {1008.3974}, primaryClass = "physics.plasm-ph", @@ -4908,7 +4999,7 @@ archivePrefix = "arXiv", author = {{Servidio}, S. and {Valentini}, F. and {Califano}, F. and {Veltri}, P. }, title = "{Local Kinetic Effects in Two-Dimensional Plasma Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, keywords = {Plasma turbulence, Plasma simulation, Space plasma physics, Solar wind plasma, sources of solar wind}, year = 2012, month = jan, @@ -4995,7 +5086,7 @@ archivePrefix = "arXiv", author = {{Osman}, K.~T. and {Matthaeus}, W.~H. and {Hnat}, B. and {Chapman}, S.~C. }, title = "{Kinetic Signatures and Intermittent Turbulence in the Solar Wind Plasma}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {1203.6596}, primaryClass = "physics.space-ph", @@ -5033,7 +5124,7 @@ archivePrefix = "arXiv", author = {{Howes}, G.~G. and {Tenbarge}, J.~M. and {Dorland}, W. and {Quataert}, E. and {Schekochihin}, A.~A. and {Numata}, R. and {Tatsuno}, T.}, title = "{Gyrokinetic Simulations of Solar Wind Turbulence from Ion to Electron Scales}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {1104.0877}, primaryClass = "astro-ph.SR", @@ -5053,7 +5144,7 @@ archivePrefix = "arXiv", author = {{Ba{\~n}{\'o}n Navarro}, A. and {Teaca}, B. and {Told}, D. and {Groselj}, D. and {Crandall}, P. and {Jenko}, F.}, title = "{Structure of Plasma Heating in Gyrokinetic Alfv{\'e}nic Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {1607.07480}, primaryClass = "physics.plasm-ph", @@ -5107,7 +5198,7 @@ archivePrefix = "arXiv", author = {{Osman}, K.~T. and {Matthaeus}, W.~H. and {Wan}, M. and {Rappazzo}, A.~F. }, title = "{Intermittency and Local Heating in the Solar Wind}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, archivePrefix = "arXiv", eprint = {1111.6921}, primaryClass = "physics.space-ph", @@ -5142,7 +5233,7 @@ archivePrefix = "arXiv", {Karimabadi}, H. and {Parashar}, T. and {Wu}, P. and {Shay}, M. }, title = "{Intermittent Dissipation and Heating in 3D Kinetic Plasma Turbulence}", - journal = {\prl}, + journal = {Phys. Rev. Letters}, keywords = {Plasma turbulence, Space plasma physics, MHD waves, plasma waves turbulence}, year = 2015, month = may, @@ -5210,7 +5301,7 @@ archivePrefix = "arXiv", @ARTICLE{ChoVishniacAPJ2000, author = {{Cho}, Jungyeon and {Vishniac}, Ethan T.}, title = "{The Anisotropy of Magnetohydrodynamic Alfv{\'e}nic Turbulence}", - journal = {\apj}, + journal = {The Astrophysical Journal}, keywords = {ISM: General, Magnetic Fields, Magnetohydrodynamics: MHD, Turbulence, Astrophysics}, year = "2000", month = "Aug", diff --git a/nummeth-ws22/skript.tex b/nummeth-ws22/skript.tex index 5c97687..79998e5 100644 --- a/nummeth-ws22/skript.tex +++ b/nummeth-ws22/skript.tex @@ -3,6 +3,7 @@ %Individuelle Kopf- und Fußzeilen \usepackage[headsepline]{scrlayer-scrpage} \pagestyle{scrheadings} +\usepackage[T1]{fontenc} %Tabellen \usepackage{booktabs}%für horizontale Linien \usepackage{multirow} @@ -442,12 +443,12 @@ It is a peculiarity of the $\vec{E} \times \vec{B}$ -drift that negative electro \vec{v}_{E}=c \frac{\vec{E} \times \vec{B}}{B^{2}} \, . \end{equation} -\begin{SCfigure}[1][th] +\begin{figure} \centering - \caption{Cycloidal trajectory resulting from the superposition of gyro-motion and E × B-drift. The electric field is oriented along the x-axis, the magnetic field is perpendicular to the x–y plane. Note that ions (full line) and electrons (dashed line) have the same drift direction. An artificial electron mass, $m_e=0.3 m_{ion}$, was assumed here for clarity!} + \caption{Cycloidal trajectory resulting from the superposition of gyro-motion and $E\times B$-drift. The electric field is oriented along the x-axis, the magnetic field is perpendicular to the x–y plane. Note that ions (full line) and electrons (dashed line) have the same drift direction. An artificial electron mass, $m_e=0.3 m_{ion}$, was assumed here for clarity!} \includegraphics[width=0.49\textwidth, height=0.4\paperheight]{./fig_chapter1/2_drift.png} \label{fig:2-2-drift} -\end{SCfigure} +\end{figure} @@ -606,13 +607,13 @@ Before doing so we have to define a suitable normalization. In this case we choo \begin{align} \int_\mathfrak{V} \int_{\vec{v}} f(\vec r, \vec v, t) \dd^3 r \dd^3 v = N \end{align} -So $f$ describes the \emph{number density} in the volume element $\dd x \dd y \dd z \dd v_x \dd v_y \dd v_z$ and has the unit \unit{cm^{-6} s^3}. +So $f$ describes the \emph{number density} in the volume element $\dd x \dd y \dd z \dd v_x \dd v_y \dd v_z$ and has the unit \si{cm^{-6} s^3}. The average density in the volume $\mathfrak{V}$ is $\langle n\rangle =N/\mathfrak{V}$. However the particle density is usually a function of space and time. It is defined as the zero order velocity moment of the distribution function \begin{align} n(\vec r, t) = \int f(\vec r, \vec v, t) \dd^3 v \end{align} -We will define the macroscopic quuantities as velocity moments of the distribution function +We will define the macroscopic quantities as velocity moments of the distribution function \begin{align*} \int f(\vec r, \vec v, t) \dd^3 v; \quad \int \vec v f(\vec r, \vec v, t) \dd^3 v; @@ -896,7 +897,7 @@ The Sun has an open atmosphere, i.e., particles are constantly streaming out. Th \begin{center} \pgfimage[width=.7\textwidth]{fig_chapter2/ramigramm} \end{center} - \caption{Profiles of solar wind speed (dash-dotted curves), Alfv´en + \caption{Profiles of solar wind speed (dash-dotted curves), Alfv\'en speed (dashed curves), and number density (solid curves). The thick [thin] curves result from our slow [fast] solar wind model. A fit to the observational equatorial electron densities is denoted by crosses (Vainio et al., 2003).} @@ -4148,7 +4149,7 @@ In the semidiscrete limit the size of the dark-grey regions can be estimated to \begin{align} D_{i+1/2,j+1/2} = (a^+_{i+1/2,j+1/2}+a^-_{i+1/2,j+1/2}+)(b^+_{i+1/2,j+1/2}+b^-_{i+1/2,j+1/2})\dd t^2+\mathcal{O}(\dd t^3) \end{align} -where $D_{i+1/2,j+1/2}$ indicates the corresponding region in Fig. \ref{fig:ralph3.2}. Additionally, a± are the right- and left-handed maximum propagation velocities for discontinuities for the upper right corner in the x-direction respectively. In the same way b± corresponds to the signal propagation velocities in the y-direction. Like the equations describing the problem under consideration these velocities have to be specified corresponding to the problem. They are obtained from the Jacobian for each direction. The size of this region is of second order in time and can, therefore, safely be neglected in the semidiscrete limit. +where $D_{i+1/2,j+1/2}$ indicates the corresponding region in Fig. \ref{fig:ralph3.2}. Additionally, $a^\pm$ are the right- and left-handed maximum propagation velocities for discontinuities for the upper right corner in the x-direction respectively. In the same way $b^\pm$ corresponds to the signal propagation velocities in the y-direction. Like the equations describing the problem under consideration these velocities have to be specified corresponding to the problem. They are obtained from the Jacobian for each direction. The size of this region is of second order in time and can, therefore, safely be neglected in the semidiscrete limit. As compared to this the light-grey areas can be estimated to have the size \begin{align} @@ -4244,7 +4245,7 @@ become \frac{\partial\rho\mathbf{u}}{\partial t}+\nabla\cdot(\rho\mathbf{uu})+\frac{m_{e}m_{i}}{e^{2}}\nabla\cdot(\frac{1}{\rho}\mathbf{jj}) & = & -\nabla p+\mathbf{j}\times\mathbf{B}\\ \mathbf{E}+\mathbf{u}\times\mathbf{B}-\frac{m_{e}m_{i}}{e^{2}\rho}\left[\frac{\partial\mathbf{j}}{\partial t}+\nabla\cdot\left(\mathbf{uj}+\mathbf{ju}\right)\right] & = & -\frac{M}{e\rho}\nabla p_{e}+\frac{m_{i}}{e\rho}\mathbf{j}\times\mathbf{B}+\eta\mathbf{j} \end{eqnarray} -(e.g. \cite{krall83}). Here $e$ represents the elementary +(e.g. \cite{KrallandTrivelpiece1973}). Here $e$ represents the elementary charge, $\mathbf{j}$ current density, $p$ the sum of electron and ion pressure, $\mathbf{B}$ the magnetic field, $\mathbf{E}$ the electric field, $M=m_{e}+m_{i}$, and $\eta$ resistivity. The first @@ -5289,7 +5290,7 @@ simulations. This noise can be suppressed by adding an artificial hyper-resistivity to the magnetic induction equation or by numerically smoothing the Hall electric field. The latter is done in VooDoo using a 3-point smoothing algorithm -\cite{birdsalllangdon91}. +\cite{Birdsall_2005}. In addition, there is also a severe penalty in the time step when the resolution is increased. The time step is proportional to $(\Delta x)^2$ so that time step decreases by an additional @@ -5425,7 +5426,7 @@ exceeding by far the electron scales. Effects of the finite electron mass originate from electron scales. They nevertheless may play also an important role for larger scale plasma phenomena. Laboratory experiments of reconnection have revealed, e.g. that the -thickness of current sheets maybe as sthin as several electron inertial +thickness of current sheets maybe as as thin as several electron inertial lengths. A the same time the current sheet thickness can be larger than the electron gyro-radius. This allows a fluid description of the electrons. And hybrid-code simulations with a finite-mass electron fluid have shown that the electron inertia can dominate when the current sheets thin down to electron inertial @@ -5530,7 +5531,7 @@ errors. In the ion-related (PIC-)part of the code the macro-particle positions and velocities at the $N$th time step are advanced for the electric and magnetic -field values defined on a staggered, the Yee-lattice grid~\cite{Yee1966} +field values defined on a staggered, the Yee-lattice grid~\cite{Yee_1966} being known at the time step $N$. For this the fields are first interpolated from the grid to the (macro-) ions positions with a weighting given by a @@ -6081,7 +6082,7 @@ for numerical simulations In general, because of computational reasons, periodic boundary conditions are used, a constraint not suited for the Harris equilibrium. To circumvent this inconvenient, in many studies a double Harris sheet is employed, that is a simple sum of two opposite Harris equilibria so that -the magnetic field profile can now be assumed as periodic. However, the so-called {\em double-Harris sheet} is no more a kinetic equilibrium +the magnetic field profile can now be assumed as periodic. However, the so-called \emph{double-Harris sheet} is no more a kinetic equilibrium because the first of Eq.(\ref{eq:potentials}) is a non linear equation and thus not satisfied by a simple linear combination of Harris sheets. Nevertheless, the double-Harris sheet is a force balance (MHD) equilibrium and thus has been deeply used in kinetic simulations by assuming that its characteristic time to evolve is longer than the system dynamics time scale or that it rapidly relaxes to a nearby kinetic equilibrium. However, this point remains since @@ -6091,8 +6092,8 @@ instabilities in the velocity space, for example those due to the presence of lo An analytical solution for a ``double-Harris like configuration'' has been obtained by superposing two opposite currents corresponding to two counter-streaming electron populations leading to a sinusoidal magnetic equilibrium but involving temperature anisotropic distributions, see Ref. \cite{att99}. These Harris-like approaches still face with the problem of obtaining an equilibrium solution in a "blinded way", so that the final -equilibrium is in principle "unknown" at the beginning of the procedure. In other words at the end of the procedure the equilibrium solution could be far from the one to be used. To step over this problem, -a generalized method for the "inverse problem" in 1D has been developed and summarized in Ref. \cite{allanson16}. It is aimed at +equilibrium is in principle ``unknown'' at the beginning of the procedure. In other words at the end of the procedure the equilibrium solution could be far from the one to be used. To step over this problem, +a generalized method for the ``inverse problem'' in 1D has been developed and summarized in Ref. \cite{allanson16}. It is aimed at obtaining analytical Vlasov equilibrium supporting a given macroscopic current sheet, including the case of force-free equilibria. The main objective is to address the magnetic reconnection problem. In this case, still using an Hamiltonian formulation in terms of the canonical momenta $p_{\alpha} = mv_{\alpha} + qA_{\alpha} /c$ and the corresponding Hamiltonian $H = mv^2 / 2 + q \phi$ for each species, one starts by imposing the force balance between @@ -6419,6 +6420,7 @@ To give a rough idea of how Eq. \eqref{eq:lbm9} propagates the occupation number \definecolor{mylgrey}{rgb}{0.8,0.8,0.8} \definecolor{mygreen}{rgb}{0.1,0.1,0.9} \definecolor{mygray}{rgb}{0.4,0.4,0.4} +\definecolor{mymauve}{rgb}{0.6,0.45,0.45} \lstset{ language=Python, @@ -6517,11 +6519,11 @@ The initial values were chosen as $\rho = 1.0$ and $u = 0$ at time $t = 0$. hard walls drawn in black and a lid that slides to the right with a prescribed velocity, drawn in red. The lattice points all lie inside the box and the walls lie half way between boundary lattice points and (virtual) solid lattice points -outside the box. (b) Streamlines in the steady state for a domain of 300 × 300 +outside the box. (b) Streamlines in the steady state for a domain of 300 $\times$ 300 lattice points and $\omega = 1.7$, corresponding to Reynolds number 1000, given the typical velocity of the sliding lid as $u_\text{lid} = 0.1$. The figures is visualized using the streamplot function of the matplotlib6library. The lattice is resampled -into a 30 × 30 lattice before determining the streamlines.} +into a 30 $\times$ 30 lattice before determining the streamlines.} \label{fig:lbm3} \end{figure} @@ -6543,25 +6545,6 @@ We calculated the velocity field in the steady state. Fig. \ref{fig:lbm3}b shows \chapter{Parallel programming} - - - - - - - - - - - - - - - - - - - This chapter is mostly based on a tutorial for the usage of work group cluster. While the very specific details are related to a cluster no longer in existence, the general idea of parallelisation, using different HPC architectures and writing to file systems is essentially similar for other systems. @@ -6670,7 +6653,7 @@ The interesting component is the high-speed network: Mostly Infiniband, but also Almost all systems on the Top 500 list are clusters\dots \begin{center} - \pgfimage[height=0.88\textheight]{fig_chapter10/top500} + \pgfimage[width=0.88\textwidth]{fig_chapter10/top500} \end{center} @@ -6744,7 +6727,7 @@ The nodes are connected to headnode \end{itemize} \begin{center} - \pgfimage[height=0.95\textheight]{fig_chapter10/headnode} + \pgfimage[width=0.95\textwidth]{fig_chapter10/headnode} \end{center} @@ -6763,7 +6746,7 @@ Two further machines \end{center} \begin{center} - \pgfimage[height=0.95\textheight]{fig_chapter10/caracal} + \pgfimage[width=0.95\textwidth]{fig_chapter10/caracal} \end{center} And then\dots @@ -6774,12 +6757,11 @@ And then\dots \end{itemize} \begin{center} - \pgfimage[height=0.95\textheight]{fig_chapter10/cluster} + \pgfimage[width=0.95\textwidth]{fig_chapter10/cluster} \end{center} Why this configuration?\\ Value for money! -\begin{columns} \textbf{16 cores per node}\\ \begin{itemize} @@ -6818,7 +6800,7 @@ Value for money! \subsection{Independent jobs} \begin{center} - \pgfimage[height=0.85\textheight]{fig_chapter10/independent} + \pgf[width=0.85\textwidth]{fig_chapter10/independent} \end{center} Simplest parallelization: @@ -6845,7 +6827,7 @@ For systems with shared memory (i.e., CPUs share the same memory controller) \subsection{Global communication} \begin{center} - \pgfimage[height=0.85\textheight]{fig_chapter10/alltoall} + \pgfimage[width=0.85\textwidth]{fig_chapter10/alltoall} \end{center} All-to-All communication \begin{itemize} @@ -6859,7 +6841,7 @@ All-to-All communication \end{center} \begin{center} - \pgfimage[height=0.85\textheight]{fig_chapter10/diffmem2} + \pgfimage[width=0.85\textwidth]{fig_chapter10/diffmem2} \end{center} The inter-CPU communication is @@ -6885,7 +6867,7 @@ This kind of distributed computing is simple to realize and limited in applicati \subsection{Chess} \begin{center} - \pgfimage[height=0.85\textheight]{fig_chapter10/chess} + \pgfimage[width=0.85\textwidth]{fig_chapter10/chess} \end{center} Chess is an atypical problem @@ -6893,7 +6875,7 @@ Chess is an atypical problem \item Different moves are evaluated \item Each move offers different new moves \item This yields a longer tree - \item Basically a new \alert{thread} can be started for each branch + \item Basically a new thread can be started for each branch \end{itemize} Parallelization is of unknown quality - we do not know how many branches there are or if some branch ends earlier (check mate\dots)\\ Essentially easy to parallelize @@ -6910,11 +6892,11 @@ Most of the linear algebra applications have been solved in various packages - w Possible distribution of matrices on CPUs \begin{center} -\pgfimage[height=.85\textheight]{fig_chapter10/matrices} +\pgfimage[width=.85\textwidth]{fig_chapter10/matrices} \end{center} \begin{center} -\pgfimage[height=.85\textheight]{fig_chapter10/matrix2} +\pgfimage[width=.85\textwidth]{fig_chapter10/matrix2} \end{center} \begin{itemize} @@ -6943,7 +6925,7 @@ For 1D data parallelization does not help. But how about multi-D data? Here the transform can be done dimension by dimension \begin{center} - \pgfimage[height=0.9\textheight]{fig_chapter10/p3dfft} + \pgfimage[width=0.9\textwidth]{fig_chapter10/p3dfft} \end{center} \begin{itemize} @@ -6984,12 +6966,12 @@ We introduce two ghost cells on both sides\\ \pgfimage[width=\textwidth]{fig_chapter10/burgers2} For two CPUs, the simulation area is divided into two equal halves.\\ -We introduce two ghost cells \alert{for every CPU}\\ +We introduce two ghost cells for every CPU\\ \begin{enumerate} \item Update from left with $u_i^{n+1}=\dots$ \item Stop at right end of CPU - \item Copy rightmost cell to left ghost cell \alert{of the next CPU} - \item Copy leftmost cell to right ghost cell \alert{of the next CPU} + \item Copy rightmost cell to left ghost cell of the next CPU + \item Copy leftmost cell to right ghost cell of the next CPU \item Start over \end{enumerate} @@ -7065,9 +7047,6 @@ What OpenMP does not do \end{itemize} - -\begin{columns} - \column{0.65\textwidth} OpenMP is based on the \emph{fork/join} model \begin{itemize} \item An OpenMP program starts as single thread (master thread) @@ -7075,9 +7054,8 @@ What OpenMP does not do \item At the end of parallel regions threads are barrier synchronized \item Beyond the parallel region code is executed sequentially \end{itemize} - \column{0.35\textwidth} + \pgfimage[width=\textwidth]{fig_chapter10/omp1} -\end{columns} \subsection{Hello World! - OpenMP} @@ -7121,14 +7099,9 @@ Hello world \pgfimage[width=\textwidth]{fig_chapter10/omp3} - -\only<3>{ \pgfimage[width=\textwidth]{fig_chapter10/omp4} -} -\end{frame} -\begin{frame}[fragile] - \frametitle{General pragmas} + \subsection{General pragmas} C-style pragma \begin{lstlisting}[language=C] @@ -7153,11 +7126,9 @@ iam = omp_get_thread_num(); \begin{lstlisting}[language=Fortran] !$ iam = OMP_GET_THREAD_NUM() \end{lstlisting} -\end{frame} -\begin{frame}[fragile] -\frametitle{Useful OpenMP Runtime Commands} +\subsection{Useful OpenMP Runtime Commands} sets or returns the number of threads in the team \begin{lstlisting}[language=C] @@ -7179,10 +7150,8 @@ returns the number of processors on which the program can be run \begin{lstlisting}[language=C] int omp_get_num_procs(void); \end{lstlisting} -\end{frame} -\begin{frame}[fragile] -\frametitle{Useful OpenMP Runtime Commands} +\subsection{Useful OpenMP Runtime Commands} toggles the dynamic thread team size \begin{lstlisting}[language=C] int omp_in_parallel(void); @@ -7205,11 +7174,7 @@ int omp_get_nested(void); \end{lstlisting} - -\end{frame} - -\begin{frame}[fragile] -\frametitle{Parallel regions: Syntax} +\subsection{Parallel regions: Syntax} Clauses \begin{itemize} @@ -7227,31 +7192,25 @@ Clauses #pragma omp parallel [clause[[,] clause] ...] structured block \end{lstlisting} -\end{frame} -\begin{frame}[fragile] -\frametitle{Execution model} +\subsection{Execution model} \begin{itemize} \item At the start of every parallel region a team of threads is generated \item Thread 0 is the master thread \end{itemize} -\begin{columns} - \column{0.5\textwidth} + \begin{lstlisting}[language=C] #pragma omp parallel { printf("Hello World!\n"); } \end{lstlisting} - \column{0.5\textwidth} + \pgfimage[width=\textwidth]{fig_chapter10/nomp_1} -\end{columns} -\end{frame} -\begin{frame}[fragile] -\frametitle{Parallel loops} +\subsection{Parallel loops} \begin{itemize} \item Main usage of OpenMP @@ -7260,10 +7219,7 @@ structured block \item Not every loop can be parallelized \item The \verb+for+ directive is doing the job \end{itemize} -\end{frame} -\begin{frame}[fragile] -\frametitle{Parallel loops} Syntax: Clauses \begin{itemize} \item \texttt{private (list)} @@ -7276,10 +7232,6 @@ Syntax: Clauses \item \texttt{nowait} \end{itemize} -\end{frame} - -\begin{frame} -\frametitle{Parallel loops} Loops have to be in canonical form \begin{itemize} \item the number of loop runs has to be known before the start of the loop @@ -7289,10 +7241,8 @@ Loops have to be in canonical form \item no exceptions inside the loop that are catched outside \item \texttt{exit} is allowed inside the loop \end{itemize} -\end{frame} -\begin{frame}[fragile] -\frametitle{Parallel loops - examples} +\subsubsection{Parallel loops - examples} Exampe: Row sum \begin{lstlisting}[language=C] #pragma omp parallel for @@ -7311,10 +7261,8 @@ for ( j = 1; j < m - 1; j++ ) a[i][j] = ( a[i-1][j-1] + a[i-1][j] + a[i-1][j+1] ) / 3.0; } \end{lstlisting} -\end{frame} -\begin{frame}[fragile] -\frametitle{Parallel loops - collapse} +\subsubsection{Parallel loops - collapse} \begin{itemize} \item perfectly nested loops can be collapsed \item all loop variables have to be independent @@ -7323,10 +7271,7 @@ a[i][j] = ( a[i-1][j-1] + a[i-1][j] + a[i-1][j+1] ) / 3.0; \end{itemize} \verb+#pragma omp parallel for collapse(n)+\\ $n$ is the number of collapsed for loops -\end{frame} -\begin{frame}[fragile] -\frametitle{Parallel loops - collapse} \begin{lstlisting}[language=C] #pragma omp parallel for collapse(3) for(int l=0; l<10; ++l) @@ -7337,11 +7282,9 @@ foo[l][j][k] = 0; } \end{lstlisting} -\end{frame} -\begin{frame}[fragile] -\frametitle{Ordered execution} +\subsection{Ordered execution} Ordered execution with \texttt{ordered} \begin{itemize} \item The \texttt{ordered} directive will execute the following block in the original sequential order @@ -7352,10 +7295,7 @@ Ordered execution with \texttt{ordered} \begin{itemize} \item When parts of a loop have to be executed ordered the keyword has to be put in as directive and as clause \end{itemize}strukturierter Block -\end{frame} -\begin{frame}[fragile] -\frametitle{Ordered execution} \begin{lstlisting}[language=C] /* ordered as clause */ #pragma omp parallel for ordered @@ -7366,12 +7306,10 @@ a[i] = f(i); printf("a[%d] = %d", i, a[i]); } \end{lstlisting} -\end{frame} -\begin{frame}[fragile] -\frametitle{Reductions} +\subsubsection{Reductions} \begin{itemize} \item are frequently used in loop to accumulate a value in a variable via a binary operator \item write access on shared variables would have to be synchronized @@ -7387,22 +7325,18 @@ sum = 0; for ( i = 0; i < n; i++ ) sum = sum + b[i]; \end{lstlisting} -\end{frame} -\begin{frame}[fragile] -\frametitle{Reductions} Syntax \begin{lstlisting}[language=C] reduction (op: Variable [, Variable] ...) \end{lstlisting} -\begin{columns} -\column{0.55\textwidth} + \begin{itemize} \item allowed operators cf. table \item shared variable of scalar type \item private copy for every thread \end{itemize} -\column{0.45\textwidth} + \begin{tabular}{l|l} Operator & Initial value\\\hline $+$ & 0\\ @@ -7416,58 +7350,43 @@ max & min value\\ min & max value \end{tabular} -\end{columns} -\end{frame} - -\begin{frame}[fragile] -\frametitle{Data races} -\begin{columns} - \column{0.7\textwidth} +\subsubsection{Data races} \begin{lstlisting}[language=C] #pragma omp parallel for for ( i = 1; i =< 2; i++ ) a[i] = a[i] + a[i-1]; \end{lstlisting} - \column{0.3\textwidth} + Initial values \begin{lstlisting}[language=C] a[0] = 1; a[1] = 1; a[2] = 1; \end{lstlisting} -\end{columns} -\vspace{-10mm} + The result of \texttt{a[i]} depends on the position $i-1$\\ No problem for sequential execution: \texttt{a[i-1]} is calculated before \texttt{a[i]} -\begin{columns} - \column{0.7\textwidth} + \texttt{a[2]} is calculated with the new value of \texttt{a[1]} - \column{0.3\textwidth} - Initial values - \begin{lstlisting}[language=C] + +Initial values +\begin{lstlisting}[language=C] a[0] = 1; a[1] = 2; a[2] = 3; \end{lstlisting} -\end{columns} -\vspace{-10mm} + \begin{center}Problems with concurrent threads\end{center} -\begin{columns} - \column{0.7\textwidth} \texttt{a[2]} is calculated with the old value of \texttt{a[1]} - \column{0.3\textwidth} + \begin{lstlisting}[language=C] a[0] = 1; a[1] = 2; a[2] = 2; \end{lstlisting} -\end{columns} - -\end{frame} - \subsection{OpenMP - Conclusions} \begin{itemize} @@ -7481,8 +7400,7 @@ a[2] = 2; -\begin{frame} - \frametitle{MPI} +\section{MPI} MPI - the Messaging Passing Interface is \begin{itemize} \item a framework to exchange information between threads by different means @@ -7490,21 +7408,17 @@ a[2] = 2; \item supports communication via shared memory, Ethernet, Myrinet, Infiniband \item is available for C/C++, Fortran, Java \end{itemize} -\end{frame} -\begin{frame} - \frametitle{Why MPI?} +\subsection{Why MPI?} \begin{itemize} \item MPI is omnipresent \item MPI runs on any connected system from multi-core CPUs to clusters with weird interconnects \item MPI is very well standardized \end{itemize} For new projects MPI should always be favored over OpenMP! -\end{frame} -\begin{frame}[fragile] - \frametitle{MPI - Hello World} +\subsection{MPI - Hello World} \begin{lstlisting}[language=C] #include ; int main(int argc, char** argv) { @@ -7528,11 +7442,9 @@ int main(int argc, char** argv) { MPI_Finalize(); } \end{lstlisting} -\end{frame} -\begin{frame}[fragile] - \frametitle{MPI - Basic commands} +\subsection{MPI - Basic commands} \begin{lstlisting}[language=C] MPI_Init(int* argc, char*** argv) @@ -7554,11 +7466,7 @@ MPI_Finalize() \vspace{-10mm} \verb+MPI_Finalize+ is used to clean up the MPI environment. No more MPI calls can be made after this one. - -\end{frame} - -\begin{frame}[fragile] - \frametitle{MPI - Communicators} +\subsection{MPI - Communicators} MPI utilizes so called communicators. At the start \verb+MPI_COMM_WORLD+ is constructed, which consists of all processors \begin{lstlisting}[language=C] MPI_Comm_size(MPI_Comm communicator,int* size) @@ -7571,21 +7479,14 @@ MPI_Comm_rank(MPI_Comm communicator,int* rank) \vspace{-10mm} \verb+MPI_Comm_rank+ returns the rank of a process in a communicator. Each process inside of a communicator is assigned an incremental rank starting from zero. The ranks of the processes are primarily used for identification purposes when sending and receiving messages. - -\end{frame} - -\begin{frame}[fragile] - \frametitle{MPI - Communicators} For almost all purposes two communicators are relevant \begin{itemize} \item \verb+MPI_COMM_WORLD+ with all processes and no topological information \item \verb+MPI_CART_COMM+ a communicator with cartesian topology \end{itemize} For any multi-dimensional application, the Cartcomm simplifies life. -\end{frame} -\begin{frame}[fragile] - \frametitle{MPI - CartCommunicators} +\subsubsection{MPI - CartCommunicators} \begin{lstlisting}[language=C] MPI_Dims_create( nnodes, ndims, dims ) \end{lstlisting} @@ -7600,10 +7501,7 @@ Inout Parameter \begin{itemize} \item \texttt{dims} array of the size \texttt{ndims} which defines the number of processes in each dimension (array of integer)\\ Values $>0$ are used as given input, 0 will be calculated newly \end{itemize} -\end{frame} -\begin{frame}[fragile] - \frametitle{MPI - CartCommunicators} \begin{lstlisting}[language=C] int MPI_Cart_create(MPI_Comm comm_old, int ndims, const int dims[], const int periods[], int reorder, MPI_Comm *comm_cart) @@ -7622,10 +7520,7 @@ Output Parameters \begin{itemize} \item \verb+comm_cart+ communicator with new cartesian topology (handle) \end{itemize} -\end{frame} -\begin{frame}[fragile] - \frametitle{MPI - CartCommunicators} \begin{lstlisting}[language=C] int MPI_Cart_coords(MPI_Comm comm, int rank, int maxdims, int coords[]) \end{lstlisting} @@ -7645,12 +7540,9 @@ Output Parameters \item \verb+coords+ integer array (of size \verb+ndims+) containing the Cartesian coordinates of specified process (integer) \end{itemize} -\end{frame} -\begin{frame}[fragile] - \frametitle{MPI - CartCommunicators} \begin{lstlisting}[language=C] int MPI_Cart_shift(MPI_Comm comm, int direction, int disp, int *rank_source, int *rank_dest) @@ -7676,13 +7568,7 @@ Output Parameters \end{itemize} -\end{frame} - - - - -\begin{frame}[fragile] - \frametitle{MPI - Send \& Receive} +\subsection{MPI - Send \& Receive} \begin{lstlisting}[language=C] MPI_Send(void* data, int count, MPI_Datatype datatype, int destination, int tag, MPI_Comm communicator) @@ -7695,11 +7581,7 @@ Data has certain tags to identify them.\\ The receiver has to be actively expecting the data with that tag\\ Since the rank of process depends on the communicator, this \verb+communicator+ has to be given explicitly. -\end{frame} - -\begin{frame}[fragile] - \frametitle{MPI - Send \& Receive} Datatypes\\ \begin{tabular}{ll} \verb+MPI datatype+ & C equivalent\\ @@ -7717,10 +7599,8 @@ Datatypes\\ \verb+MPI_LONG_DOUBLE+ & long double\\ \verb+MPI_BYTE+ & char \end{tabular} -\end{frame} -\begin{frame}[fragile] - \frametitle{MPI Barriers} +\subsubsection{MPI Barriers} \begin{lstlisting}[language=C] int MPI_Barrier( MPI_Comm comm ) \end{lstlisting} @@ -7730,12 +7610,10 @@ Input Parameters \end{itemize} Blocks the caller until all processes in the communicator have called it; that is, the call returns at any process only after all members of the communicator have entered the call. -\end{frame} -\begin{frame}[fragile] - \frametitle{MPI - Send \& Receive} -Minimal example +\subsubsection{MPI - Send \& Receive Minimal example} + \begin{lstlisting}[language=C] // Find out rank, size int world_rank; @@ -7754,19 +7632,16 @@ if (world_rank == 0) { number); } \end{lstlisting} -\end{frame} -\begin{frame}[fragile] - \frametitle{MPI - Reduction} +\subsection{MPI - Reduction} \begin{lstlisting}[language=C] int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) \end{lstlisting} \vspace{-10mm} Reduces values on all processes to a single value -\begin{columns} - \column{0.5\textwidth} + Input Parameters \begin{itemize} \item \verb+sendbuf+ @@ -7787,7 +7662,8 @@ Output Parameters \item \verb+recvbuf+ address of receive buffer (choice, significant only at root) \end{itemize} -\column{0.5\textwidth} + +Operators \begin{tabular}{ll} \verb+MPI_LAND+ & logical \verb+AND+\\ \verb+MPI_LOR+ & logical \verb+OR+\\ @@ -7803,12 +7679,8 @@ Output Parameters \verb+MPI_MAXLOC+ & minimum and index \\ \end{tabular} -\end{columns} -\end{frame} - -\begin{frame}[fragile] -\frametitle{MPI Example: Burgers} +\subsection{MPI Example: Burgers} \begin{lstlisting}[language=C] #include #include @@ -7830,12 +7702,6 @@ const int tend=1000; const int outputstep=50; const double dx=1.; const double dt=0.1; -\end{lstlisting} -\end{frame} - -\begin{frame}[fragile] -\frametitle{MPI Example: Burgers} -\begin{lstlisting}[language=C] int main(int argc, char *argv[]) { blitz::Array un, unp; @@ -7850,12 +7716,6 @@ int periods[DIM], coords[DIM]; int neighbours[2]; MPI_Comm cartcomm; MPI_Status status; -\end{lstlisting} -\end{frame} - -\begin{frame}[fragile] -\frametitle{MPI Example: Burgers} -\begin{lstlisting}[language=C] //Initialize MPI MPI_Init(&argc,&argv); //Find out how many processes are available @@ -7878,12 +7738,6 @@ MPI_Comm_rank(cartcomm, &rank); MPI_Cart_coords(cartcomm, rank, 1, coords); //Find neighbours MPI_Cart_shift(cartcomm, 0, 1,&neighbours[LEFT],&neighbours[RIGHT]); -\end{lstlisting} -\end{frame} - -\begin{frame}[fragile] -\frametitle{MPI Example: Burgers} -\begin{lstlisting}[language=C] //This is a bit dirty, but it works. Somehow. //We divide to global coordinates of the computational //grid @@ -7905,12 +7759,6 @@ if(rank < remainder) { //this is the local set of global coordinates printf("rank= %d coords= %d localmin/max/size= %d %d %d \n",rank,coords[0], localmin, localmax, localsize); -\end{lstlisting} -\end{frame} - -\begin{frame}[fragile] -\frametitle{MPI Example: Burgers} -\begin{lstlisting}[language=C] //set the right size for all arrays //Blitz arrays can have arbitrary indices //so we don't have to introduce a different @@ -7923,12 +7771,6 @@ unp.reindexSelf(localindex); //the intialization depends on a global position! for (int i=localmin;i{ +\subsection{Structure of HDF5} \begin{center} - \pgfimage[width=0.9\textwidth]{hdf_organi} + \pgfimage[width=0.9\textwidth]{fig_chapter10/hdf_organi} \end{center} - } - \only<2>{ \begin{center} - \pgfimage[width=0.9\textwidth]{hdf_dataset} + \pgfimage[width=0.9\textwidth]{fig_chapter10/hdf_dataset} \end{center} - } -\end{frame} -\begin{frame} - \frametitle{Basic Functions} - \only<1>{ +\subsection{Basic Functions} \begin{center} - \pgfimage[width=0.9\textwidth]{hdf_basic} + \pgfimage[width=0.9\textwidth]{fig_chapter10/hdf_basic} \end{center} - } -\end{frame} -\begin{frame}[fragile] - \frametitle{Open a file} +\subsection{Open a file} \begin{lstlisting}[language=C] comm = MPI_COMM_WORLD; info = MPI_INFO_NULL; @@ -8108,10 +7897,8 @@ file_id = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id); H5Fclose(file_id); MPI_Finalize(); \end{lstlisting} -\end{frame} -\begin{frame}[fragile] - \frametitle{Create a dataset} +\subsection{Create a dataset} \begin{lstlisting}[language=C] file_id = H5Fcreate(...); @@ -8126,20 +7913,13 @@ H5Dclose(dset_id); // Close the file. H5Fclose(file_id); \end{lstlisting} -\end{frame} -\begin{frame} - \frametitle{Create a group} - \only<1>{ +\subsection{Create a group} \begin{center} - \pgfimage[width=0.9\textwidth]{hdf_group} + \pgfimage[width=0.9\textwidth]{fig_chapter10/hdf_group} \end{center} - } -\end{frame} - -\begin{frame}[fragile] - \frametitle{Create a group} +\subsection{Create a group} \begin{lstlisting}[language=C] hid_t file_id, group_id; ... @@ -8153,10 +7933,8 @@ H5P_DEFAULT, H5P_DEFAULT); status = H5Gclose (group_id); status = H5Fclose (file_id); \end{lstlisting} -\end{frame} -\begin{frame}[fragile] -\frametitle{Compiling HDF5} +\subsection{Compiling HDF5} Programs using HDF5 have to be linked with the HDF5 library\\ The library has to be compiled with parallel support \begin{lstlisting}[language=bash] @@ -8166,10 +7944,8 @@ fspanier@fsk-serval:~/tmp$ mpirun.openmpi -np 2 ./hdfexample CPU 0 of 2 CPU 1 of 2 \end{lstlisting} -\end{frame} -\begin{frame}[fragile] -\frametitle{Inside HDF5} +\subsection{Inside HDF5} \begin{lstlisting}[language=bash] fspanier@fsk-serval:~/tmp$ h5ls test.hdf5 Timestep_0 Group @@ -8206,25 +7982,17 @@ GROUP "/" { } } \end{lstlisting} -\end{frame} -\chapter{Using the local cluster} +\section{Using the local cluster} -\begin{frame} - \frametitle{Storage spaces} - \only<1>{ +\subsection{Storage spaces} \begin{description} - \item[Home] -The home directory is living on the helio machines and is mainly meant as small storage with fallback solution. Home is exported through nfs4. -\item[Scratch] -The scratch filesystem is attached to fsk-caracal and exported from there via nfs4. It is split into /scratch/small and /scratch/large. -\item[BeeGFS] -BeeGFS is a new development in the field of cluster file systems. In this case the SSDs in the nodes are connected in one filesystem. This filesystem can be used from cluster nodes and serval/caracal. -\item[3Par] -The 3Par has been purchased by the ITC department and got into our hands somehow. It is in fact optimized for database access, but can also be utilized for very fast writing. The same limitation as for the BeeGFS apply: +\item[Home] The home directory is living on the helio machines and is mainly meant as small storage with fallback solution. Home is exported through nfs4. +\item[Scratch] The scratch filesystem is attached to fsk-caracal and exported from there via nfs4. It is split into /scratch/small and /scratch/large. +\item[BeeGFS] BeeGFS is a new development in the field of cluster file systems. In this case the SSDs in the nodes are connected in one filesystem. This filesystem can be used from cluster nodes and serval/caracal. +\item[3Par] The 3Par has been purchased by the ITC department and got into our hands somehow. It is in fact optimized for database access, but can also be utilized for very fast writing. The same limitation as for the BeeGFS apply: \end{description} -} -\only<2>{ + When to use what? \begin{itemize} \item Store sources and papers $\Rightarrow$ home @@ -8232,13 +8000,9 @@ When to use what? \item Massively-parallel simulation $\Rightarrow$ BeeGFS/3Par \item Storing large simulation results $\Rightarrow$ scratch \end{itemize} -} -\end{frame} +\subsection{Network and Services} -\begin{frame} - \frametitle{Network and Services} - \only<1>{ \begin{description} \item[PUKnet connection] Only fsk-serval, fsk-caracal, and the helio machines are connected directly to the PUKnet and can, therefore, be accessed from the office PCs. Since these machines offer all tools to start and stop jobs and also export the relevant filesystems, this is sufficient. As mentioned above, fsk-serval is also open to the outside: It is reachable via ssh. @@ -8248,20 +8012,13 @@ All cluster machines are part of an internal Ethernet network. The two main reas All machines are equipped with service network ports (IPMI, IlO and similar). This allows for performing most service tasks without entering the machine room. \item[Infiniband] The compute nodes, the head node and fsk-caracal can talk to each other via the low-latency, high-bandwidth Infiniband connection. This is done automatically for NFS and for MPI jobs. - \end{description} - } - \only<2>{ - \begin{description} \item[Kerberos] the cluster is secured via Kerberos providing safe authentication and encrypted data transmission \item[LDAP] user account information is stored in an LDAP database \item[NFS] cluster file systems are available via NFS4. This requires a Kerberos authenticated connection \end{description} - } -\end{frame} -\begin{frame}[fragile] - \frametitle{Software} +\subsection{Software} Two compilers are installed: \begin{itemize} \item GCC system 4.9 (gcc, gfortran, g++) @@ -8271,30 +8028,22 @@ For MPI programs the OpenMPI compilers are installed. They use the GCC compilers The cluster features a queueing system \emph{Torque} (a PBS like system) with a Maui scheduler. -\end{frame} - - -\begin{frame}[fragile] - \frametitle{Preparatory issues} +\subsection{Preparatory issues} You should start by copying your source code to the cluster's home directory with something like \begin{lstlisting}[language=bash] scp -r /path/to/source username@fsk-serval.puk.ac.za: \end{lstlisting} -\vspace{-10mm} + Then log into fsk-serval \begin{lstlisting}[language=bash] ssh username@fsk-serval.puk.ac.za \end{lstlisting} -\vspace{-10mm} It is recommended to use the gcc/gfortran compilers, if you want to use the Intel compilers instead, you have to source the shell variables \begin{lstlisting}[language=bash] source /opt/intel/composerxe/bin/compilervars.sh \end{lstlisting} -\vspace{-10mm} (for reasons of simplicity you should put that also into your .bashrc) -\end{frame} -\begin{frame}[fragile] - \frametitle{Preparatory issues} + You will have scratch space allocated already (either under \texttt{/scratch/small} or \texttt{/scratch/large}). Should it be reasonable to use the 3Par or beegfs, you can create a directory under \texttt{/scratch/beegfs} or \texttt{/scratch/3par-beegfs} yourself.\\ Since the queueing system has to submit jobs via ssh without asking for a password every time, you need to provide a ssh key. @@ -8304,12 +8053,8 @@ Since the queueing system has to submit jobs via ssh without asking for a passwo ssh-copy-id node-1 for i in `seq 1 34`; do ssh node-$i 'echo $HOSTNAME'; done \end{lstlisting} -\vspace{-10mm} Don't set any passphrase for the ssh key and answer all questions with 'yes'\footnote{It should not be necessary to log in to every node as we do it here, but the ssh implementation is indeed very picky}. After doing so you have logged into every node of the cluster and the queueing system can submit jobs to the nodes directly. -\end{frame} -\begin{frame}[fragile] - \frametitle{Preparatory issues} Next step \begin{itemize} \item find the optimal compiler settings @@ -8319,27 +8064,20 @@ Most compilers have more or less optimal automatic settings. for gcc this \begin{lstlisting}[language=bash] gcc -march=native -O3 \end{lstlisting} -\vspace{-10mm} and for the Intel compiler \begin{lstlisting}[language=bash] icc -xHost -O3 \end{lstlisting} -\vspace{-10mm} For the brave among you one may also use \begin{lstlisting}[language=bash] gcc -Ofast icc -fast \end{lstlisting} -\vspace{-10mm} These compiler settings work also for the compilers from the same set (gcc: g++, gfortran; icc: icpc, ifort). Should for some reason your code not work with these settings, you should check your code for not so obvious coding problems. -\end{frame} - - -\begin{frame}[fragile] -\frametitle{Job files in general} +\subsection{Job files in general} Jobs on the cluster are controlled by job files. These are in general shell script with extensions to control queueing system parameters. For complete examples see below. The following PBS parameters are important \begin{itemize} @@ -8352,11 +8090,9 @@ Jobs on the cluster are controlled by job files. These are in general shell scri \item \verb+#PBS -d+ defines the directory, where the executable resides \item \verb+#PBS -w+ defines the working directory \end{itemize} -\end{frame} -\begin{frame} -\frametitle{Single CPU jobs} -\only<1>{ +\subsubsection{Single CPU jobs} + \begin{itemize} \item the cluster is designed for large scale jobs, i.e., there is a large number of price-efficient CPUs with a very good interconnect. \item The single-core performance of most modern (Core i5/i7 Haswell etc.) desktop CPUs is better! @@ -8370,11 +8106,8 @@ Typical approach: \item Write a shell script producing job files for different parameters \item Submit the resulting job files \end{itemize} -} -\end{frame} -\begin{frame}[fragile] -\frametitle{Single CPU jobs} + \begin{lstlisting}[language=bash] #!/bin/bash for i in 1 2 4 8 16; do @@ -8397,10 +8130,8 @@ echo "echo 'Run complete!'" >> $filename done done \end{lstlisting} -\end{frame} -\begin{frame}[fragile] -\frametitle{OpenMP jobs} +\subsubsection{OpenMP jobs} OpenMP jobs are typically run on one node (really!), so 'nodes' has to be 1. 'ppn' can be any value from 1 to 16. Select the 'shmem' queue. The program can be run immediately, but '\verb+OMP_NUM_TASKS+' has to be set, otherwise all cores of the node will be used. \begin{lstlisting}[language=bash] @@ -8419,10 +8150,8 @@ export OMP_NUM_TASKS=$tasks \end{lstlisting} \vspace{-10mm} The wall time is set to 30 hours in this case. It is advisable to set a time which is more realistically to avoid zombie jobs blocking the cluster more than necessary (so set something like one hour more than your expected runtime). -\end{frame} -\begin{frame}[fragile] -\frametitle{Infiniband jobs} +\subsubsection{Infiniband jobs} Infiniband jobs are in some aspects different: \begin{itemize} @@ -8450,10 +8179,8 @@ mpirun -x var1 -x var2 -hostfile $PBS_NODEFILE -np $tasks \end{lstlisting} -\end{frame} -\begin{frame}[fragile] - \frametitle{Running a job} +\subsubsection{Running a job} \begin{itemize} \item \texttt{qsub} submits the job \item \texttt{qstat} shows the jobs run by the user @@ -8469,7 +8196,6 @@ Job id Name User Time Use S Queue fspanier@fsk-serval:/scratch/large/fspanier/burgers$ qdel 1478 \end{lstlisting} -\end{frame} \subsection{More cluster info} \begin{itemize} @@ -8524,7 +8250,7 @@ Total Jobs: 1 Active Jobs: 1 Idle Jobs: 0 Blocked Jobs: 0 \bibliographystyle{natdin} -\bibliography{./literatur.bib} +\bibliography{literatur} \end{document}