252-0029-00L Parallel Programming

FS 2019

Torsten Hoefler and Martin Vechev

Basic Information

  • Semester: Spring 2019
  • Course Number: 252-0029-00L
  • Lecturers: Martin Vechev, Torsten Hoefler
  • Edoz: Open in Course Catalogue
  • Lectures: Tue 10-12, ML D 28 (Video Projection in ML E 12); Wed 13-15, HG F 7 (Video Projection in HG F 5)
  • Exercises: Wed 15-17 or Fri 10-12
  • Head TAs: Pavol Bielik (first part), Timo Schneider (second part)
  • TAs: Johannes de Fine Licht, Marcin Copik, Shigang Li, Yishai Oltchik, Konstantin Taranov, Salvatore Di Girolamo, Samuel Steffen, Marc Fisher, Alexandra Bugariu, Guilherme Miguel Teixeira Rito

News:

  • 13.2.2019: Please select your preferred exercise group. Based on your preferences we will publish the group assignment on 19.2.
  • 19.2.2019: Group assignment is online. As the space in each room is limited, please attend your assigned exercise group.
    If you are not in the list please contact Pavol Bielik
  • 26.2.2019: Added supplementary material with Command Line Basics

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.

Presentation Schedule

  DateTitleSlides
  Feb 19 Introduction & Course Overview Slides
  Feb 20 Java Recap and JVM Overview Slides
  Feb 26/27 Introduction to Threads and Synchronization Slides
  Mar 5 Introduction to Threads and Synchronization Slides
  Mar 6/12/13 Parallel Architectures Slides
  Mar 19 Basic Concepts in Parallelism Slides
  Mar 20 Parallel Programming Models: Task and Data Parallelism Slides
  Mar 26/27 ForkJoin Framework and Task Parallel Algorithms Slides
  Apr 2 Shared Memory Concurrency, Locks and Data Races Slides
  Apr 9 Data Races, Solving Mutual Exclusion with Atomic Registers Slides
  Apr 10 Solving Mutual Exclusion for many processes, Hardware Primitives for mutual exclusion Slides
  Apr 16 Spinlocks, Deadlocks, Semaphores Slides
  Apr 17 Beyond Locks II: Semaphore, Barrier, Producer-Consumer, Monitors Slides
  Apr 30 Readers/Writers Lock, Lock Granularity: Coarse Grained, Fine Grained, Optimal, and Lazy Synchronization Slides
  May 7 Lock Tricks, Skip Lists, and Without Locks I Slides
  May 8 Without Locks II Slides
  May 14 Concurrency Theory Slides
  May 15 Transactional Memory Slides
  May 21 Transactional Memory and Message Passing Slides
  May 22 Message Passing II Slides
  May 28 Message Passing, Parallel Algorithms Slides
  May 29 Parallel Algorithms II Slides

Exercises

Students should bring their laptops to the exercise sessions as most of the exercises involve programming.

WeekTitleDue DateAssignmentSlidesSolution
  1 Introduction - Assignment PDF
  2 Introduction to Multi-threading 3.3.2019 Assignment PDF
Assignment Code
Slides PDF Solution Code
  3 Multi-threading 10.3.2019 Assignment PDF
Assignment Code
Slides PDF Solution Code
  4 Parallel Models 17.3.2019 Assignment PDF
Assignment Code
Slides PDF Solution Code
  5 Divide and Conquer 24.3.2019 Assignment PDF
Assignment Code
Slides PDF Solution Code
  6 Task Parallelism 30.3.2019 Assignment PDF
Assignment Code
Slides PDF Solution Code
  7 Synchronization and Resource Sharing 7.4.2019 Assignment PDF
Assignment Code
Slides PDF Solution Code
  8 Synchronization II 14.4.2019 Assignment PDF
Assignment Code
Slides PDF Solution Code
  9 Beyond Locks 28.4.2019 Assignment PDF
Assignment Code
Slides PDF Solution Code
 10 Advanced Synchronization Mechanisms 13.5.2019 Assignment PDF
Assignment Code
Slides PDF Solution Code
 11 Advanced Synchronization Mechanisms 20.5.2019 Assignment PDF
Assignment Code
Slides PDF Solution Code
 12 Consensus 20.5.2019 Assignment PDF
No code
Slides PDF Solution Code

Supplementary Materials

TitleSlides
Command Line Basics PDF

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