Simulation and Scientific Computing - Chair for System Simulation

Simulation and Scientific Computing
(Simulation und Wissenschaftliches Rechnen - SiWiR)
Winter Term 2014/15
Prof. Dr. Christoph Pflaum, Florian Schornbaum
Chair for System Simulation
Introductory Lecture
Monday, October 6, 2014
Outline
• General Information / Organizational Matters
People (Lecturer, Tutors, HiWis)
• Structure of the Lecture/Exercises
•
• Motivation (for Scientific Computing)
• Topics
Lecture
• Content of Exercise Classes
• Tutorial
•
• Grading / Evaluation of Exercises
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
3
People
• Lecturer: Prof. Dr. Christoph Pflaum
• Tutors (for the exercise classes):
• Florian Schornbaum
• Dominik Bartuschat
• Student Tutor:
• Lorenz Hufnagel (supervision of computer exercises)
• Contact:
• [email protected]
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
4
General Information
• Schedule:
• Monday, 10:15 – 11:45, lecture, K1-119
• Tuesday, 12:15 – 13:45, computer exercise, 00.131
• Tuesday, 14:15 – 15:45, exercise, 01.151-128
• Wednesday, 14:15 – 15:45, computer exercise, 00.131
• Wednesday, 16:00 – 17:30, exercise, 01.255-128
• ( Thursday, 10:15 – 11:45, tutorial, 00.152-113 )
• No exercises in the first week – exercises start on Tuesday,
October 14, 2014!
• You have to sign up for both the lecture and the exercises on
mein campus until Friday, October 31, 2014!
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
5
Exercises / Tutorial
• You don’t have to visit the exercise classes …
• … but visiting one exercise class per week is strongly encouraged!
• Computer exercises are completely optional – If you need
assistance for the programming exercises, you can ask the tutors
for help during that time.
• For the exercises, team formation is mandatory: You have to
divide into groups of three persons.
• You have to sign up on the team formation list at our chair
until Friday, October 31, 2014!
• For the tutorial, each student must prepare a 10 minute talk. The
talks will be in December/January – Topics will be assigned in
October/November.
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
6
Organizational Matters
• You have to get an account at our chair.
• Remote access to our computers (i10cip1.informatik.uni-erlangen.de to i10cip12)
is only possible via ssh (Windows users: PuTTY & WinSCP).
• Access requires a public-private key pair:
[user@private-pc-at-home/laptop ~]$ ssh-keygen -t dsa -b 1024
Create a default key "~/.ssh/id_dsa" and copy (e.g., via mail) the public (!) key located
at "~/.ssh/id_dsa.pub" to the "~/.ssh/" directory of your account at LSS. If the directory
does not exist at your LSS account, you must create it. Then:
[user@i10cip5 ~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
• In order to login, you have to either first access a computer from
the university network, or log in via VPN:
http://www.rrze.fau.de/dienste/internet-zugang/vpn/openvpn.shtml
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
7
Outline
• General Information / Organizational Matters
People (Lecturer, Tutors, HiWis)
• Structure of the Lecture/Exercises
•
• Motivation (for Scientific Computing)
• Topics
Lecture
• Content of Exercise Classes
• Tutorial
•
• Grading / Evaluation of Exercises
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
8
Motivation (Scientific Computing)
⇒ video
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
9
Motivation (Scientific Computing)
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
10
Motivation (Scientific Computing)
• Example (3D simulation):
• Resolution (after domain discretization): 2,500 × 2,000 × 2,000
• Time steps: 1,000,000 = 106
• Floating point operations per cell/grid point: 100
• Total number of floating point operations required for the
entire simulation: 1,000,000,000,000,000,000 = 1018
• Performance of an Intel® Core™ i7-4770 Processor:
• Theoretical peak: 217.6 GFLOPS
floating point operations
per second
• Linpack with Intel MKL library: 177 GFLOPS
• 1 GFLOPS = 109 FLOPS = 1,000,000,000 FLOPS
• Assuming the simulation (~100 GiB) even fits in the main
memory of the i7-4770, it would run for at least two months.
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
11
Motivation (Scientific Computing)
• CPU frequencies cannot get higher (power, heat, …)
• Solution: Parallelism
• On-chip: superscalar processors, instruction pipelining, …
• Multiple cores per processor / multiple processors per system
• Multiple interconnected compute nodes
⇒ clusters / supercomputers
• One of the fastest supercomputers: Sequoia (IBM BlueGene/Q)
• Number of cores: 1,572,864 (6,291,456 threads)
• Linpack performance: 17.2 PFLOPS = 17.2 ∙ 1015 FLOPS
• Our example simulation would finish in ~10 minutes.
• The next generation of supercomputers targets 1 exaFLOPS
(EFLOPS) = 1018 FLOPS! (power consumption …)
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
12
Outline
• General Information / Organizational Matters
People (Lecturer, Tutors, HiWis)
• Structure of the Lecture/Exercises
•
• Motivation (for Scientific Computing)
• Topics
Lecture
• Content of Exercise Classes
• Tutorial
•
• Grading / Evaluation of Exercises
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
13
Lecture Topics
• Code optimization for performance (writing efficient code)
• Hardware-aware code optimization
• Finite differences for solving differential equations
• Solvers: direct solvers & iterative methods
• Parallelization (concepts, algorithms, standard programming
models/APIs)
• Expression templates (C++ metaprogramming technique)
• Ray tracing (not for CG but for simulations involving lasers)
• …
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
14
Exercise Topics
• Implementation of topics from the lecture
• Programming language: C++ (C++11)
• Hardware-aware code optimization:
get as much performance as possible out of one core
• On-chip parallelization using threads:
get as much performance as possible out of one CPU/chip
• System parallelization:
get as much power as possible out of a cluster/supercomputer
⇒ live demonstration
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
15
Tutorial Topics
• Talks cover various topics on performance optimization,
numerical analysis, simulation, etc.
• Some selected topics:
•
•
•
•
•
•
•
•
•
Automated empirical optimization of software (ATLAS)
uBlas and boost
Shortley–Weller discretization (for finite differences)
Preconditioners
GMRES
Domain partitioning/load balancing with METIS
Newton–Krylov methods for non-linear problems
Runge Kutta methods for ODEs
…
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
16
Outline
• General Information / Organizational Matters
People (Lecturer, Tutors, HiWis)
• Structure of the Lecture/Exercises
•
• Motivation (for Scientific Computing)
• Topics
Lecture
• Content of Exercise Classes
• Tutorial
•
• Grading / Evaluation of Exercises
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
17
Grading / Evaluation of Exercises
• Written exam:
•
•
Sometime in February 2015, 90 minutes
Covers topics of the lecture and exercises (including programming)
• “Grading” of the exercises:
•
•
•
•
•
•
Red, yellow, or green point for each exercise
4 exercises in total
To pass exercises you need at least: 3 yellow + 1 green point
red + green = 2 x yellow
With 2 red points (and without winning a performance challenge), you cannot
pass the exercises!
Performance challenges: You can win point “upgrades”
• Tutorial:
•
You must be present for all talks
Simulation and Scientific Computing (Simulation und Wissenschaftliches Rechnen - SiWiR)
Florian Schornbaum - Chair for System Simulation - 2014/15
18
THE END
QUESTIONS ?