High Performance Computing Blatt 6

Ähnliche Dokumente
VGM. VGM information. HAMBURG SÜD VGM WEB PORTAL USER GUIDE June 2016

VGM. VGM information. HAMBURG SÜD VGM WEB PORTAL - USER GUIDE June 2016

Copyright by Hildegard Heilmann IAG Diese Unterlagen stelle ich den SchülerInnen des V. Bachilleratos des IAG zur Verfügung.

Aufgabe 1 (12 Punkte)

Geometrie und Bedeutung: Kap 5

CNC ZUR STEUERUNG VON WERKZEUGMASCHINEN (GERMAN EDITION) BY TIM ROHR

PONS DIE DREI??? FRAGEZEICHEN, ARCTIC ADVENTURE: ENGLISCH LERNEN MIT JUSTUS, PETER UND BOB

DAS ZUFRIEDENE GEHIRN: FREI VON DEPRESSIONEN, TRAUMATA, ADHS, SUCHT UND ANGST. MIT DER BRAIN-STATE-TECHNOLOGIE DAS LEBEN AUSBALANCIEREN (GE

Statistics, Data Analysis, and Simulation SS 2015

Titelmasterformat Object Generator durch Klicken bearbeiten

WAS IST DER KOMPARATIV: = The comparative

Teil 2.2: Lernen formaler Sprachen: Hypothesenräume

SELF-STUDY DIARY (or Lerntagebuch) GER102

Rätsel 1: Buchstabensalat klassisch, 5 5, A C (10 Punkte) Puzzle 1: Standard As Easy As, 5 5, A C (10 points)

Unterspezifikation in der Semantik Hole Semantics

LEBEN OHNE REUE: 52 IMPULSE, DIE UNS DARAN ERINNERN, WAS WIRKLICH WICHTIG IST (GERMAN EDITION) BY BRONNIE WARE

HUMANGENETIK IN DER WELT VON HEUTE: 12 SALZBURGER VORLESUNGEN (GERMAN EDITION) BY FRIEDRICH VOGEL

Algorithms & Datastructures Midterm Test 1

J RG IMMENDORFF STANDORT F R KRITIK MALEREI UND INSPIRATION ERSCHEINT ZUR AUSSTELLUNG IM MUSEUM LU

ReadMe zur Installation der BRICKware for Windows, Version ReadMe on Installing BRICKware for Windows, Version 6.1.2

Allgemeine Mechanik Musterlösung 11.

ZWISCHEN TRADITION UND REBELLION - FRAUENBILDER IM AKTUELLEN BOLLYWOODFILM (GERMAN EDITION) BY CHRISTINE STöCKEL

KURZANLEITUNG. Firmware-Upgrade: Wie geht das eigentlich?

How to access licensed products from providers who are already operating productively in. General Information Shibboleth login...

Einsatz einer Dokumentenverwaltungslösung zur Optimierung der unternehmensübergreifenden Kommunikation

Patentrelevante Aspekte der GPLv2/LGPLv2

ZWISCHEN TRADITION UND REBELLION - FRAUENBILDER IM AKTUELLEN BOLLYWOODFILM (GERMAN EDITION) BY CHRISTINE STöCKEL

EINFACH REINE HAUT: DAS BUCH GEGEN PICKEL, AKNE UND UNREINE HAUT (EINFACH... 1) (GERMAN EDITION) BY MOIN YAMINA

Titelbild1 ANSYS. Customer Portal LogIn

aus Doktorarbeiten Anna Lena Birkmeyer Oktober 2016

Exercise (Part XI) Anastasia Mochalova, Lehrstuhl für ABWL und Wirtschaftsinformatik, Kath. Universität Eichstätt-Ingolstadt 1

EVANGELISCHES GESANGBUCH: AUSGABE FUR DIE EVANGELISCH-LUTHERISCHE LANDESKIRCHE SACHSEN. BLAU (GERMAN EDITION) FROM EVANGELISCHE VERLAGSAN

Algorithms for graph visualization

Notice: All mentioned inventors have to sign the Report of Invention (see page 3)!!!

Level 2 German, 2015

p^db=`oj===pìééçêíáåñçêã~íáçå=

USB Treiber updaten unter Windows 7/Vista

After sales product list After Sales Geräteliste

STRATEGISCHES BETEILIGUNGSCONTROLLING BEI KOMMUNALEN UNTERNEHMEN DER FFENTLICHE ZWECK ALS RICHTSCHNUR FR EIN ZIELGERICHTETE

Ingenics Project Portal

TomTom WEBFLEET Tachograph

p^db=`oj===pìééçêíáåñçêã~íáçå=

HiOPC Hirschmann Netzmanagement. Anforderungsformular für eine Lizenz. Order form for a license

Parameter-Updatesoftware PF-12 Plus

LiLi. physik multimedial. Links to e-learning content for physics, a database of distributed sources

Brandbook. How to use our logo, our icon and the QR-Codes Wie verwendet Sie unser Logo, Icon und die QR-Codes. Version 1.0.1

Name: Klasse: Standardisierte kompetenzorientierte schriftliche Reifeprüfung AHS. 18. September Englisch. Schreiben

ZWISCHEN TRADITION UND REBELLION - FRAUENBILDER IM AKTUELLEN BOLLYWOODFILM (GERMAN EDITION) BY CHRISTINE STöCKEL

Hydrosystemanalyse: Finite-Elemente-Methode (FEM)

Angewandte Umweltsystemanalyse: Finite-Elemente-Methode (FEM) #3

Prediction Market, 28th July 2012 Information and Instructions. Prognosemärkte Lehrstuhl für Betriebswirtschaftslehre insbes.

ETHISCHES ARGUMENTIEREN IN DER SCHULE: GESELLSCHAFTLICHE, PSYCHOLOGISCHE UND PHILOSOPHISCHE GRUNDLAGEN UND DIDAKTISCHE ANSTZE (GERMAN

ZWISCHEN TRADITION UND REBELLION - FRAUENBILDER IM AKTUELLEN BOLLYWOODFILM (GERMAN EDITION) BY CHRISTINE STöCKEL

Exercise (Part II) Anastasia Mochalova, Lehrstuhl für ABWL und Wirtschaftsinformatik, Kath. Universität Eichstätt-Ingolstadt 1

Abteilung Internationales CampusCenter

Level 1 German, 2012

How-To-Do. Hardware Configuration of the CC03 via SIMATIC Manager from Siemens

Harry gefangen in der Zeit Begleitmaterialien

TIn 1: Feedback Laboratories. Lecture 4 Data transfer. Question: What is the IP? Institut für Embedded Systems. Institut für Embedded Systems

Fakultät III Univ.-Prof. Dr. Jan Franke-Viebach

Level 1 German, 2014

NEWSLETTER. FileDirector Version 2.5 Novelties. Filing system designer. Filing system in WinClient

LEBEN OHNE REUE: 52 IMPULSE, DIE UNS DARAN ERINNERN, WAS WIRKLICH WICHTIG IST (GERMAN EDITION) BY BRONNIE WARE

Instruktionen Mozilla Thunderbird Seite 1

eurex rundschreiben 094/10

ONLINE LICENCE GENERATOR

Harry gefangen in der Zeit Begleitmaterialien

Top Tipp. Ref DE. Verwenden externer Dateiinhalte in Disclaimern. (sowie: Verwenden von Images in RTF Disclaimern)

Level 2 German, 2013

How to use the large-capacity computer Lilli? IMPORTANT: Access only on JKU Campus!! Using Windows:

Infrastructure as a Service (IaaS) Solutions for Online Game Service Provision

SCHNELLES DENKEN, LANGSAMES DENKEN (GERMAN EDITION) BY DANIEL KAHNEMAN

Musterlösung 3. D-MATH Algebra I HS 2015 Prof. Richard Pink. Faktorielle Ringe, Grösster gemeinsamer Teiler, Ideale, Faktorringe

ELBA2 ILIAS TOOLS AS SINGLE APPLICATIONS

(Prüfungs-)Aufgaben zum Thema Scheduling

ZWISCHEN TRADITION UND REBELLION - FRAUENBILDER IM AKTUELLEN BOLLYWOODFILM (GERMAN EDITION) BY CHRISTINE STöCKEL

RS232-Verbindung, RXU10 Herstellen einer RS232-Verbindung zwischen PC und Messgerät oder Modem und Messgerät

WAHRE LIEBE LäSST FREI!: WIE FRAU UND MANN ZU SICH SELBST UND ZUEINANDER FINDEN (GERMAN EDITION) BY ROBERT BETZ

Correspondence between initialisation table and Common Criteria Evaluation

Selbstlernmodul bearbeitet von: begonnen: Inhaltsverzeichnis:

HIR Method & Tools for Fit Gap analysis

DIE NEUORGANISATION IM BEREICH DES SGB II AUSWIRKUNGEN AUF DIE ZUSAMMENARBEIT VON BUND LNDERN UND KOMMUNEN

Creating OpenSocial Gadgets. Bastian Hofmann

"What's in the news? - or: why Angela Merkel is not significant

Efficient Design Space Exploration for Embedded Systems

Grade 12: Qualifikationsphase. My Abitur

Exercise (Part VIII) Anastasia Mochalova, Lehrstuhl für ABWL und Wirtschaftsinformatik, Kath. Universität Eichstätt-Ingolstadt 1

Inequality Utilitarian and Capabilities Perspectives (and what they may imply for public health)

Praktikum Entwicklung Mediensysteme (für Master)

When you use any of these prepositions, you need to put the noun or pronoun following them into the accusative case. For example:

PRO SCAN WASSERANALYSE PER SMARTPHONE WATER ANALYSIS BY SMARTPHONE ANALYSE DE L EAU PAR SMARTPHONE

Operations Research für Logistik

Offenes Lernen 1: Pflichtaufgaben You have to do all of these tasks. Du musst alle diese Aufgaben machen.

Informeller Brief Schreiben

CABLE TESTER. Manual DN-14003

Open Source. Legal Dos, Don ts and Maybes. openlaws Open Source Workshop 26 June 2015, Federal Chancellery Vienna

1. General information Login Home Current applications... 3

Level 1 German, 2016

Symbio system requirements. Version 5.1

How-To-Do. Hardware Configuration of the CPU 317NET with external CPs on the SPEED Bus by SIMATIC Manager from Siemens

Transkript:

Dr Andreas Borchert Institut für Numerische Mathematik Prof Dr Stefan Funken Universität Ulm Prof Dr Karsten Urban Sommersemester 23 Markus Bantle, Kristina Steih High Performance Computing Blatt 6 (Präsenzübung 3 Juni 23) Diskussion Finite Elemente: Was ist die schwache Formulierung einer PDE und wie wird sie hergeleitet? Was ist mit schwacher/starker Lösung gemeint? Was ist die Idee des Ritz-Galerkin-Verfahrens? Wie kommt man von der unendlich-dimensionalen schwachen Formulierung auf ein numerisch lösbares Problem? Wie sieht die Hutbasis aus? Malen Sie ein D-Gitter und die zugehörigen Basisfunktionen Was für ein Gleichungssystem muss dann numerisch gelöst werden? Was sind die Unbekannten? Zur Behandlung von nicht-homogenen Dirichlet-Randbedingungen, also einem Problem A(u) = f auf Ω, u = g auf Γ D, mit g und linearem Operator A, führt man normalerweise eine Homogenisierung durch: Wir lösen das Problem für ũ = u g, also A(ũ) = f auf Ω, ũ = auf Γ D Wie verändert sich dadurch das zu lösende Gleichungssystem? Wie kann man aus ũ die gewünschte Lösung u wieder rekonstruieren? Vorbereitung Aufgabe : Lesen Sie die Aufgabenstellung und die Hinweise durch (!!) Schauen Sie sich die einzelnen Klassen an und versuchen Sie, zu verstehen, was wofür zuständig ist (also warum die Aufteilung so ist, wie sie ist) Notieren Sie Ihre Fragen, die sich dabei ergeben! Vorbereitung Aufgabe 2: Lesen Sie das beschriebene Vorgehen durch (!!) Welche Längen haben jeweils die lokalen Vektoren? Wie kann das kleine Tridiagonalsystem (Schritt 5) auf jedem Prozessor assembliert werden? Welche Datenstrukturen braucht man dafür?

Aufgabe : FEM D (seriell) Solve the D Poisson problem u xx = f(x) on Ω = (, ), u() = g, u() = g using linear Lagrangian Finite Elements (the hat basis ) On the homepage, you find files for the following classes: EllipticFEMD: Contains the finite element structures, ie the D mesh, the solution vector, information about the Dirichlet boundaries etc Also has a reference to a class that provides the PDE which we want to solve PDED: The (abstract) class for a PDE problem which we want to solve This is nothing but an interface, specifying what a PDE problem class should look like There can never be an object of this class, but we can derive different classes for different PDEs from this one The abstract function assemble_on_element has to be implemented in each of these derived classes, so that it is guaranteed that this function always exists PoissonD: One example of a concrete PDE problem This class provides the assembly of the Laplace operator on a given finite element (here in D specified by the interval boundaries x i, x i+ ) In requires function pointers describing the parameters of the PDE: f for the right hand side and g for the Dirichlet boundaries (with g() = g, g() = g ) Moreover, you find a file test_femdcpp that uses the above classes to set up a Poisson problem and solve this PDE Implement the missing function implementations: PoissonD::assemble_on_element(): Computes the contributions to A and F for one single element (ie, b (k), see hints below) These entries can be computed by hand (see lecture notes) EllipticFEMD::assemble(): Loops over all elements of the mesh, calls the function assemble_on_element() for each element and adds the results into the correct positions of the stiffness matrix A and the right hand side vector F Also handles the modifications of both F and the solution vector solution for (non-homogeneous) Dirichlet boundary conditions Solve the problem for f(x) =, g = g =, as well as for f(x) =, g(x) = 2 x (with solution u(x) = 2 x2 ) Plot your solutions u Hints: Element-wise assembly: Each entry A i,j, i, j =,, N, in the stiffness matrix A h can be decomposed into the contributions on the individual elements (intervals in D): A i,j = ψ i (x) ψ j (x)dx = k= xk+ x k ψ i (x) ψ j (x)dx =: k= i,j 2

As i,j only for i, j {k, k + }, we have to assemble on each interval only the 2 2-matrix := A(k) k,k k+,k k,k+ k+,k+, which can be done by hand (cf lecture) Therefore, we can assemble A h by once looping over all intervals, calculating the individual contributions and adding them to the corresponding entries in the global stiffness matrix A h Assembly of right-hand side: As for the stiffness matrix, we perform an element-wise assembly for each entry: (f, ψ i ) = f(x)ψ i (x)dx = k= xk+ x k f(x)ψ i (x)dx =: k= b (k) i, i =,, N We use the trapezoidal rule to approximate the integrals: b (k) i = f(x k)ψ i (x k )+f(x k+ )ψ i (x k+ ) 2 (x k+ x k ) Again, on each interval, we only have to compute the vector b (k) := ( b (k) k, T k+) b(k), which is easily done using the nodal structure of our basis Dirichlet boundary conditions: In order to homogenize the problem, we choose a function g S h as g = g ψ + g ψ N+ Then g() = g, g() = g The homogeneous equation system Lw = f Lg then reads in the discrete space u j a(ψ j, ψ i ) = (f, ψ i ) [g a(ψ, ψ i ) g a(ψ N+, ψ i )], i =,, N, j= and u h := N i=j u j ψ j + g is a solution of the original boundary value problem Note that most additional terms g a(ψ, ψ i ), g a(ψ N+, ψ i ) on the right hand side are zero Which ones are not? Data structures I (Mesh): The linear system itself is only solved for the unknown coefficients u j, j =,, N (the so-called degrees of freedom) However, we want a solution representation for all mesh points {x,, x N+ }, including the boundary The easiest solution (which avoids unnecessary copy operations or separate structures for inner and boundary values) is to just assemble a system of size (N + ) (N + ) and fill the rows and columns corresponding to Dirichlet boundary points with zeros For our cg-solver, this causes no problem at all Note, however, that one usually sets the diagonal entries A i,i = in the Dirichlet rows/columns, so that the matrix has full rank This is important for some solvers and most preconditioners Data structures II (Matrix and Vector classes): In the material, you ll find a folder LinearAlgebra containing matrix and vector classes which we ll be using for the rest of the semester Inside this folder, call make once to generate the library linalg to which we can then link our programs Compilation: This code is still completely serial, so we don t need MPI But we have to link against the library LinAlg, so that the compilation command looks as follows: g++ -Wall -o test_femd test_femdcpp ellipticfemdcpp poissondcpp -L/LinearAlgebra -llinalg 3

Aufgabe 2: FEM D (parallel) Für das Problem aus Aufgabe wollen wir jetzt den parallelen Löser aus der Vorlesung implementieren Diese Methode löst im Wesentlichen das Gleichungssystem Ax = F mit A = a () b () c () a () b () c () n a () n b () n c () a () b () c () n a () n b () n c (2) a (2) b (2) c (2) n 2 2 a (2) n 2 2 b (2) n 2 2 c (2) n 2 a (2) n 2 durch eine Faktorisierung A = LU = LVW Zur einfacheren Darstellung ist hier alles für n procs = 3 Prozesse dargestellt Diese Matrizen haben die folgende Form (und Notation): l () l () n l () L = l () n l (2) l (2) n 2 U = d () u () d () u () d () n u () n f () d () u () f () n d () n u () n f (2) d (2) u (2) d (2) n 2 2 u (2) n 2 2 f (2) n 2 d (2) n 2 4

V = u () d () u () n 3 d () n 2 u () n d () u () d () u () n 3 d () n 2 u () n 3 d (2) u (2) d (2) u () n 2 3 d () n 2 2 W = d () g () d () () g n 2 d () n g () n f () d () g () d() n 2 g () n 2 f () n d () n g (2) n 2 f (2) d (2) g (2) d (2) n 2 2 g (2) n 2 2 f (2) n 2 d (2) n 2 Das Vorgehen ist nun wie folgt: Assembliere Matrix A und rechte Seite F in Prozess und verschicke die entsprechenden Zeilen an alle anderen Prozesse Berechne A = LU, also die lokalen Vektoren l (k), d (k), u (k) und f (k) für alle Prozesse k =,, n procs Hierfür ist keine Kommunikation erforderlich Duch einfachen Koeffizienten-Vergleich erhält man die Rekursionsformeln u = b, d = a, f = c for i =,, n k do l i = c i d i, u i = b i, d i = a i u i l i, f i = f i l i end for 5

2 Berechne U = VW, also die lokalen Vektoren f (k), g (k) für k =,, n procs und die (k) Einträge d n k für k < n procs Dabei können zunächst alle Einträge von f (k) und alle bis auf den letzten Eintrag von g (k) ohne Kommunikation berechnet werden: f nk = f nk, f nk 2 = f nk 2, g nk 2 = u nk for i = n k 3,, do f i = f i u i fi+ d i+, g i = u ig i+ d i+ end for Um die letzte Zeile in die richtige Form zu bringen (also u (k) n k zu eliminieren), muss allerdings kommuniziert werden: if k > then Schicke d und f an Prozess k Empfange u recv von Prozess k Berechne g nk = g d u recv end if if k < n procs then Schicke u nk an Prozess k + Empfange d recv und f recv von Prozess k + Berechne d nk = d nk frecv d recv u nk end if 3 Löse Ly = F durch Vorwärtseinsetzen, hierfür ist keine Kommunikation notwendig 4 Löse Vz = y durch Rückwärtseinsetzen Ohne Kommunikation kann man dabei z (k) n k 2,, z (k) berechnen Für die Berechnung von z (k) n k muss noch mit dem nachfolgenden Prozess k + kommuniziert werden, um z (k+) zu erhalten 5 Löse Wx = z Dazu muss erst das kleine Tridiagonal-System d () n g () n f () n d () n g (2) n 2 f (2) n 2 d (2) n 2 x = z () n z () n z (2) n 2 auf jedem Prozessor assembliert und gelöst werden Zum Lösen steht der Solver void solvetridiag(vector &ldiag, Vector &diag, Vector &udiag, Vector &x, Vector &b); zur Verfügung Danach können die restlichen Einträge von x durch Rückwärts-Substitutionen lokal auf jedem Prozess berechnet werden (Achtung: Hier muss man zwischen Prozess und den anderen Prozessen unterscheiden) 6 Zum Schluss müssen noch die lokalen Lösungen an Prozess zurückgesendet werden, der sie zusammensetzt und dann auch zb in eine Datei ausgibt Aufgabe: Ergänzen Sie die fehlenden Code-Teile in der Funktion EllipticFEMD::solve_parallel(), um den obigen Algorithmus zu implementieren Kompiliert wird mit dem folgenden Befehl: openmpic++ -Wall -o test_femd_parallel test_femd_parallelcpp ellipticfemdcpp poissondcpp -L/LinearAlgebra -llinalg 6