252-0029-00L Parallel Programming

FS 2021

T. Hoefler, B. Solenthaler

Basic Information

  • Semester: Spring 2021
  • Course Number: 252-0029-00L
  • Lecturers: T. Hoefler, B. Solenthaler
  • Edoz: Open in Course Catalogue
  • Lectures: Tue, 10:15 - 12:00 and Wed, 14:15 - 16:00. The lecture will be held on Zoom.
  • Exercises: Wed, 16:15 - 18:00 and Fri, 10:15 - 12:00. The exercise sessions will be held on Zoom.
  • Head TAs: Rafael Wampfler (first part), Timo Schneider (second part)
  • TAs: Prashanth Chandran,  Daniel Dorda,  Aurel Gruber,  Leonhard Helminger,  Lasse Lingens,  Jingwei Tang,  Robin Renggli,  Cliff Hodel,  Ricardo Heinzmann,  Jonas Maier,  Lukas Möller,  Michael Heider,  Salvatore Di Girolamo,  Konstantin Taranov,  Andrei Ivanov,  Marcin Copik,  Daniele De Sensi,  Shigang Li,  Jan Gilcher

News:

  • 05.01.21: Website online
  • 16.02.21: Moodle is online. All material is distributed over Moodle.
  • 24.02.21: First exercise published on Moodle.
  • 02.03.21: Second exercise published on Moodle.
  • 10.03.21: Third exercise published on Moodle.
  • 17.03.21: Fourth exercise published on Moodle.
  • 22.03.21: The Zoom link for the lecture at March 24 changed.
  • 30.03.21: No exercise sessions on April 2 (Good Friday).
  • 30.03.21: Exam preparation sessions will take place on Wednesday, April 14, 8:15 - 10:00 (English) and Friday, April 16, 16:15 - 18:00 (German).
  • 21.04.21: Lecture videos will now be published in a YouTube playlist.

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.

All material (lecture slides & recordings) is available on Moodle.

  DateTitleLive Stream
  Feb 23 Introduction & Course Overview Live Stream (23.2 at 10:15)
  Feb 24 Java Recap and JVM Overview Live Stream (24.2 at 14:15)
  Mar 2 Introduction to Threads and Synchronization (Part I) Live Stream (2.3 at 10:15)
  Mar 3 Introduction to Threads and Synchronization (Part II) Live Stream (3.3 at 14:15)
  Mar 9 Introduction to Threads and Synchronization (Part II) Live Stream (9.3 at 10:15)
  Mar 10 Parallel Architectures: Parallelism on the Hardware Level (Part I) Live Stream (10.3 at 14:15)
  Mar 16 Parallel Architectures: Parallelism on the Hardware Level (Part II) Live Stream (16.3 at 10:15)
  Mar 17 Basic Concepts in Parallelism Live Stream (17.3 at 14:15)
  Mar 23 Divide and Conquer, Cilk-style bounds Live Stream (23.3 at 10:15)
  Mar 24 Divide and Conquer, Cilk-style bounds Live Stream (24.3 at 14:15)
  Mar 30 ForkJoin Framework and Task Parallel Algorithms Live Stream (30.3 at 10:15)
  Mar 31 ForkJoin Framework and Task Parallel Algorithms / Shared Memory Concurrency, Locks and Data Races Live Stream (31.3 at 14:15)
  Apr 13 ForkJoin Framework and Task Parallel Algorithms / Shared Memory Concurrency, Locks and Data Races Live Stream (13.4 at 10:15)
  Apr 14 Shared Memory Concurrency, Locks and Data Races (High-level data races) / Fast Forward Live Stream (14.4 at 14:15)
  Apr 20 Data Races - Implementing locks with Atomic Registers Live Stream (20.4 at 10:15)
  Apr 21 Data Races - Implementing locks with Atomic Registers II Live Stream (21.4 at 14:15), Alternative Stream (YT) We expect a higher latency on YouTube but also a higher video quality.
  Apr 27 Beyond Locks I: Spinlocks, Deadlocks, Semaphores Live Stream (27.4 at 10:15) Alternative Stream (Twitch)
  Apr 28 Beyond Locks II: Semaphore, Barrier, Producer-/Consumer, Monitors Live Stream (28.4 at 14:15) Alternative Stream (Twitch)
  May 4 Readers/Writers Lock, Lock Granularity: Coarse Grained, Fine Grained, Optimal, and Lazy Synchronization Live Stream (4.5 at 10:15) Alternative Stream (Twitch) Today we try twitch-only, in case of a catastrophic failure we fall back to zoom.
  May 5 Lock tricks, skip lists, and without Locks I Chat-only Alternative Stream (5.5 at 14:15) Live Stream (Twitch)
  May 11 Without Locks II Chat-only Alternative Stream (11.5 at 10:15) Live Stream (Twitch)
  May 12 ABA Problem, Concurrency Theory Chat-only Alternative Stream (12.5 at 14:15) Live Stream (Twitch)
  May 18 Sequential Consistency, Consensus, Transactional Memory Chat-only Alternative Stream (18.5 at 10:15) Live Stream (Twitch)
  May 19 Consensus Hierarchy + Transactional Memory Chat-only Alternative Stream (19.5 at 14:15) Live Stream (Twitch)
  May 25 Transactional Memory + Message Passing Chat-only Alternative Stream (25.5 at 10:15) Live Stream (Twitch)
  May 26 Message Passing Chat-only Alternative Stream (26.5 at 14:15) Live Stream (Twitch)
  June 1 Consensus Proof and Reductions Chat-only Alternative Stream (1.6 at 10:15) Live Stream (Twitch)
  June 2 Parallel Sorting Chat-only Alternative Stream (2.6 at 14:15) Live Stream (Twitch)

Exercises

All material (exercise slides, recordings, exercises) is available on Moodle.

All exercises are provided online via Zoom and start in the first week of the semester. The meetings IDs are likely to change so please always refresh the website to get the latest version.

Wednesday 16:15 - 18:00

  • Groups G-01 (Salvatore Di Girolamo, English): https://ethz.zoom.us/j/66812772575
  • Groups G-02 (Cliff Hodel, German): 3242113960
  • Groups G-03 (Michael Heider, German): 2206610375
  • Groups G-04 (Ricardo Heinzmann, German): 4854892011

Friday 10:15 - 12:00

  • Groups G-05 (Cliff Hodel, German): 3242113960
  • Groups G-06 (Marcin Copik, English): https://ethz.zoom.us/my/mcopik This group is suspended due to low attendance. Please join one of the remaining groups, it will likely be reactivated in case in-person teaching happens.
  • Groups G-07 (Jonas Maier, German): 98600297551
  • Groups G-08 (Robin Renggli, German): 2480870652
  • Groups G-09 (Lukas Möller, German): 93979513593
WeekTitleDue Date
  1 Introduction 1.03.2021
  2 Introduction to Multi-threading 8.3.2021
  3 Multi-threading 15.3.2021
  4 Parallel Models 22.3.2021
  5 Divide and Conquer 29.3.2021
  6 Task Parallelism 12.4.2021
  7 Synchronization And Resource Sharing 19.4.2021

Exam Prepration Sessions

The exam preparation sessions are scheduled as follows:

  • English: Wednesday, April 14, 8:15 - 10:00
  • German: Friday, April 16, 16:15 - 18:00

The sessions are hosted by Robin Renggli. Please us the following Zoom Link: 2480870652.

All material of the exam preparation sessions will be available on Moodle.

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