252-0029-00L Parallel Programming

FS 2023

T. Hoefler, B. Solenthaler

Basic Information

  • Semester: Spring 2023
  • 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. HG F 7 with live streaming to HG F 5.
  • Exercises: Wed, 16:15 - 18:00 and Fri, 10:15 - 12:00.
  • Head TAs: Rafael Wampfler (first part), Timo Schneider (second part)
  • TAs: Lingchen Yang,  Daniel Dorda,  Aurel Gruber,  Lasse Lingens,  Philine Witzig,  Till Schnabel,  Nikola Kovacevic,  Alexandru Calotoiu,  Marcin Copik,  Marcin Chrapek,  Siyuan Shen,  Andrei Ivanov,  Langwen Huang 

News:

  • 16.02.23: Website online
  • 21.02.23: No lecture
  • 02.04.23: The exam preparation session will take place on Monday, April 3, 12:15 - 14:00 in HG F 7.
  • 02.04.23: No exercise session on April 7.
  • 03.04.23: Exercise groups G-01 and G-15 canceled.

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 is available on Moodle.

  DateTitle
  Feb 22 Introduction & Course Overview
  Feb 28 Java Recap and JVM Overview
  Mar 1 Introduction to Threads and Synchronization (Part I)
  Mar 7 Introduction to Threads and Synchronization (Part II)
  Mar 8 Introduction to Threads and Synchronization (Part II)
  Mar 14 Parallel Architectures: Parallelism on the Hardware Level (Part I)
  Mar 15 Parallel Architectures: Parallelism on the Hardware Level (Part II)
  Mar 21 Basic Concepts in Parallelism
  Mar 22 Divide and Conquer, Cilk-style bounds
  Mar 28 Divide and Conquer, Cilk-style bounds
  Mar 29 ForkJoin Framework and Task Parallel Algorithms
  Apr 4 ForkJoin Framework and Task Parallel Algorithms / Shared Memory Concurrency, Locks and Data Races
  Apr 5 Shared Memory Concurrency, Locks and Data Races (High-level data races) / Fast Forward
  Apr 18 Data Races - Implementing locks with Atomic Registers
  Apr 19 Data Races - Implementing locks with Atomic Registers II
  Apr 25 Beyond Locks I: Spinlocks, Deadlocks, Semaphores
  Apr 26 Beyond Locks II: Semaphore, Barrier, Producer-/Consumer, Monitors
  May 2 Readers/Writers Lock, Lock Granularity: Coarse Grained, Fine Grained, Optimal, and Lazy Synchronization
  May 3 Lock tricks, skip lists, and without Locks I
  May 9 Without Locks II
  May 10 ABA Problem, Concurrency Theory
  May 16 Sequential Consistency, Consensus, Transactional Memory
  May 17 Consensus Hierarchy + Transactional Memory
  May 23 Transactional Memory + Message Passing
  May 24 Message Passing
  May 30 Consensus Proof and Reductions
  May 31 Parallel Sorting

Exercises

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

All exercises start in the first week of the semester.

Wednesday 16:15 - 18:00

  • Group G-01 (Lingchen Yang, English): ETZ E 8
  • Group G-02 first half: (Lasse Lingens, German) / second half: (Andrei Ivanov, English): ETZ F 91
  • Group G-03 first half: (Philine Witzig, German) / second half: (Langwen Huang, English): CHN D 48
  • Group G-04 first half: (Nikola Kovacevic, German) / second half: (Marcin Copik, English): CHN E 42
  • Group G-06 (Sascha Kehrli, German): ETZ H 91
  • Group G-07 (Benjamin Gruzman, German): LFW C 11
  • Group G-08 (Andreas Ellison, German): ETZ K 91
  • Group G-09 (Constantin Pinkl, German): ML J 34.3
  • Group G-10 (Elia Trachsel, German): LFW C 1

Friday 10:15 - 12:00

  • Group G-05 first half: (Lasse Lingens, German) / second half: (Marcin Chrapek, English): CAB D 78
  • Group G-11 first half: (Philine Witzig, German) / second half: (Siyuan Shen - Anrei Ivanov covers first week, English): merged with Group G-05, please go to CAB D 78
  • Group G-12 first half: (Nikola Kovacevic, German) / second half (Timo Schneider - Marcin Copik covers first week, German): ML J 34.1
  • Group G-13 (Sascha Kehrli, German): NO D 11
  • Group G-14 (Benjamin Gruzman, German): CHN D 42
  • Group G-15 (Lingchen Yang, English): LFW C 1
  • Group G-16 (Cliff Hodel, German): ML H 34.3
  • Group G-17 (Andreas Ellison, German): CLA E 4
  • Group G-18 (Constantin Pinkl, German): IFW C 31
  • Group G-19 (Elia Trachsel, German): NO E 11

Exercises

WeekTitleDue Date
  1 Introduction 27.02.2023
  2 Introduction to Multi-threading 06.03.2023
  3 Multi-threading 13.03.2023
  4 Parallel Models 20.3.2023
  5 Divide and Conquer 27.3.2023
  6 Task Parallelism 10.4.2023
  7 Synchronization And Resource Sharing 18.4.2022

Exam Prepration Session

The exam preparation session is scheduled at:

  • Monday, April 3, 12:15 - 14:00, HG F 7

The session is hosted by Elia Trachsel and will be in German.

All material of the exam preparation session 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