252-0029-00L Parallel Programming

FS 2020

T. Hoefler, H. Lehner, M. Schwerhoff

Basic Information

  • Semester: Spring 2020
  • Course Number: 252-0029-00L
  • Lecturers: T. Hoefler, H. Lehner, M. Schwerhoff
  • Edoz: Open in Course Catalogue
  • Lectures: Tue, 10-12 HG F 7 and Wed, 13-15 HG F 7
  • Exercises: Wed, 15-17 and Fri, 10-12
  • Head TAs: Pavol Bielik (first part), Timo Schneider (second part)
  • TAs: Walo Neville,  Stöger Felix,  Lasse Meinen,  Robin Renggli,  Soel Micheletti,  Patrick Wicki,  Andreas Bergmeister,  Yishai Oltchik,  Salvatore Di Girolamo,  Andrei Ivanov,  Grzegorz Kwasniewski,  Johannes de Fine Licht,  Nikoli Dryden,  Alexandros Ziogas,  Marcin Copik,  Marc Ficher,  Velko Vechev,  Enis Ulqinaku,  Victor Cornillere

News:

  • 21.01.20: Website online
  • 10.03.20: Course forum is online in Moodle.
  • 17.03.20: Added links to the online exercises.

Overview

The purpose of this course is to introduce students to parallel programming. By the end of the course students will be able to design and implement working parallel programs in traditional (e.g., Java Threads) and emerging parallel programming models. Moreover, students will master fundamental concepts in parallelism and be able to reason about the correctness, performance, and the construction of parallel programs using different parallel programming paradigms (e.g., task parallelism, data parallelism) and mechanisms (e.g., threads, tasks, locks, communication channels). Finally, the course will examine how parallel programming methodologies can be applied in different algorithmic domains by investigating parallelization of algorithms.

Topics include:

  • Basic parallel programming concepts
  • Parallel programming using Java
  • Synchronization techniques
  • Case studies of building parallel programs starting from sequential algorithms

Course Content

Main text and reference book

  • Introduction to Java Programming, 2014. Daniel Liang. ISBN-13: 9780133813463
  • Java Concurrency in Practice, 2006. Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, Doug Lea. ISBN-13: 9780321349606
  • The Art of Multiprocessor Programming, 2011. Maurice Herlihy, Nir Shavit. Morgan Kaufmann. Also available online in the ETH network.

Related resources, text and reference books

  • Sophomoric Parallelism and Concurrency (from: spac)
  • The Little Book of Semaphores
  • Programming concurrency on the JVM, 2011. Venkat Subramaniam
  • Structured Parallel Programming: Patterns for Efficient Computation, 2012. Michael McCool, Arch Robison, James Reinders.
  • Patterns for Parallel Programming, 2004. Timothy G. Mattson, Beverly A. Sanders, Berna L. Massingill.
  • A minicourse on multithreaded programming. Charles E. Leiserson, Harald Prokop.
  • (Optional) Inside the Java Virtual Machine. 2000. Bill Venners.

Introduction to Java books (freely available)

  • How to Think Like a Computer Scientist, 2012. Allen B. Downey.
  • Introduction to Programming Using Java, 2011. David J. Eck.

  DateTitleSlides
  Feb 17 Introduction & Course Overview Slides
  Feb 18 Java Recap and JVM Overview Slides Demo Code
  Feb 25/26, Mar 3 Introduction to Threads and Synchronization Slides Demo Code Recap I Recap II
  Mar 4/10 Parallel Architectures: Parallelism on the Hardware Level Slides Demo Code Recap I Recap II
  Mar 11 Basic Concepts in Parallelism Slides
  Mar 17 Divide and Conquer, Cilk-style bounds Slides (1-28) Video Live Stream (17.3 at 10:15)
  Mar 18 Divide and Conquer, Cilk-style bounds Slides (28-50) Video Live Stream (18.3 at 13:15)
  Mar 24 ForkJoin Framework and Task Parallel Algorithms Slides (1-34) Video Live Stream (24.3 at 10:15)
  Mar 25 ForkJoin Framework and Task Parallel Algorithms / Shared Memory Concurrency, Locks and Data Races Slides (35-60) Slides (1-24) Video Live Stream (25.3 at 13:15)
  Mar 31 Shared Memory Concurrency, Locks and Data Races Slides (24-55) Video Live Stream (31.3 at 10:15)
  Apr 1 Java Streams Slides Video (password: 2pftj2) Live Stream via Zoom (1.4 at 13:15) Demo Source Code
  Apr 7 Data Races - Implementing locks with Atomic Registers Slides Video (nethz login) Live Stream (7.4. at 10:15)
  Apr 8 Data Races - Implementing locks with Atomic Registers II Slides Video (nethz login) Live Stream (8.4. at 13:15)
  Apr 21 Beyond Locks I: Spinlocks, Deadlocks, Semaphores Slides Video (nethz login) Live Stream (21.4. at 10:15)
  Apr 22 Beyond Locks II: Semaphore, Barrier, Producer-/Consumer, Monitors Slides Video (nethz login) Live Stream (22.4. at 13:15)
  Apr 28 Readers/Writers Lock, Lock Granularity: Coarse Grained, Fine Grained, Optimal, and Lazy Synchronization Slides Video (nethz login) Live Stream (28.4. at 10:15)
  Apr 29 Lock tricks, skip lists, and without Locks I Slides Video (nethz login) Live Stream (29.4. at 13:15)
  May 5 Without Locks II Slides Video (nethz login) Live Stream (05.05. at 10:15)
  May 6 ABA Problem, Concurrency Theory Slides Video (nethz login) Live Stream (06.05. at 13:15)
  May 12 Sequential Consistency, Consensus, Transactional Memory Slides Video (nethz login) Live Stream (12.05. at 10:15)
  May 13 Consensus Hierarchy + Transactional Memory Slides Video (nethz login) Live Stream (13.05. at 13:15)
  May 19 Transactional Memory + Message Passing Slides Video (nethz login) Live Stream (19.05. at 10:15)
  May 20 Message Passing Slides Video (nethz login) Live Stream (20.05. at 13:15)
  May 26 Consensus Proof and Reductions Slides Video (no login required) Live Stream (26.05. at 10:15)
  May 27 Parallel Sorting Slides Video (nethz login) Live Stream (27.05. at 13:15)

Exercises

All exercises are provided online via Zoom. The meetings IDs are likely to change so please always refresh the website to get the latest version.

Wednesday 15-17

  • Groups G-01 + G-03: 9443684796 (cancelled due to low attendance, please join any of the remaining sessions)
  • Groups G-02 + G-05: 400641784
  • Groups G-06 + G-07: 2480870652
  • Groups G-08 + G-09: 9159511308

Friday 10-12

  • Groups G-14 + G-18: 198017795
  • Groups G-10 + G-16: 574972436 (cancelled due to low attendence, please join any of the remaining sessions)
  • Groups G-11 + G-12: 229816108
  • Groups G-17 + G-15: 9443684796 (cancelled due to low attendence, please join any of the remaining sessions)
  • Groups G-19 + G-13: 634945700
WeekTitleDue DateAssignmentSlidesTA SessionSolution
  1 Introduction 24.02.2020 Assignment PDF Slides
  2 Introduction to Multi-threading 2.3.2020 Assignment PDF
Assignment Code
Slides Solution Code
  3 Multi-threading 9.3.2020 Assignment PDF
Assignment Code
Slides Solution Code
  4 Parallel Models 16.3.2020 Assignment PDF
Supplementary Assignment PDF
Slides Englisch, Deutsch Solution
Supplementary Solution
  5 Divide and Conquer 23.3.2020 Assignment PDF
Assignment Code
Slides Englisch, Deutsch Solution
Solution Code
  6 Task Parallelism 30.3.2020 Assignment PDF
Assignment Code
Slides Englisch, Deutsch Solution Code
  7 Synchronization and Resource Sharing 6.4.2019 Assignment PDF
Assignment Code
Supplementary Assignment PDF
Slides Englisch, Deutsch Solution, Solution Code
  8 Synchronization II 13.4.2020 Assignment PDF
Assignment Code
Slides Englisch, Deutsch Solution Solution Code
  9 Reasoning about Locks / Java Memory Model Basics 20.4.2020 Assignment PDF Slides English, Deutsch Solution
  10 Advanced synchronization mechanisms 27.4.2020 Assignment PDF Assignment Code Slides Englisch, Englisch Solution Code
 11 Advanced Synchronization Mechanisms 11.5.2020 Assignment PDF
Assignment Code
Slides Englisch, Deutsch Solution Code
 12 Linearizability 18.5.2020 Assignment PDF
Slides Englisch, Deutsch Solution
 13 Software Transactional Memory 25.5.2020 Assignment PDF
Assignment Code
Slides Englisch, Deutsch Solution
 14 MPI+Reductions 1.6.2020 Assignment PDF
Assignment Code
Slides Englisch, Deutsch Solution

Supplementary Materials

TitleSlides
Command Line Basics PDF
Terminology link Note that this list is intended as a reminder, not a replacement for the definitions given on the slides.

Exams and Grading

There is a written, centralized exam after the end of the semester. Exercise sessions are not graded.

  • 100% of grade determined by final Exam


Old Exams
2018 Summer Questions
2018 Winter Questions
2016 Summer Questions
2016 Summer Solution