Parallel Programming - FS '14

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 (e.g., GPUs) 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
  • Emerging parallel programming models (e.g., GPUs)
  • Case studies of building parallel programs starting from sequential algorithms

  • Overview

    eDoz Course Nr.
    Otmar Hilliges, Kornilios Kourtis
    Gerd Zellwegerzgerd+inf+ethz+ch, Simon Gerbersimon.gerber+inf+ethz+ch, Georgios Giannikisgiannikg+ethz+ch, Chothia Zaheerzchothia+ethz+ch, Daniela Dorneanudanielad+ethz+ch, Jana Gicevagicevaj+inf+ethz+ch, Georg Ofenbeckofgeorg+ethz+ch, Shinde Pravinpravin+inf+ethz+ch, Jascha Grübeljgruebel+ethz+ch, Simon Peyerpeyers+ethz+ch, Sebastian Wickiswicki+ethz+ch, Lukas Vogelluvogel+ethz+ch
    Mon 10-12 HG E7,
    Tue 10-12 HG G5
    Mon 16-18 CAB G 52 and CAB G 57
    Thu 13-15 CAB G 57, CHN D 48, HG E 33.5, ML F 40, ML H 43 and NO E 11
    Fri 13-15 NO E 11 and NO E 39
    Office hours
    coordinate via e-mail:
    ECTS credits
    7 credits


    Course Website for Spring 2014 online.
    Students to groups assignment is now online.
    Exercise 1 is now online.
    Exercise 2 is now online.
    Exercise 3 is now online.
    Information about mid-term exams is now available.
    Additional information about mid-term exams is now available.
    Exercise 4 is now online.
    Exercise 5 is now online.
    Exercise 6 is now online. Notice the deadline extension.
    The grades of the first mid-term are now available.
    Exercise 7 is now online. Notice the deadline extension.
    Additional information about the second mid-term exam is now available.
    Exercise 8 is now online.
    Exercise 9 is now online.
    Exercise 10 is now online.
    The grades of the second mid-term are now available.
    A correction of "OpenCL Case Studies (Annotated version)" is now online.

    Course Content

    Main text and reference book
  • Java Concurrency in Practice, 2006. Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, Doug Lea. ISBN-13: 9780321349606
  • Introduction to Java Programming, 2014. Daniel Liang. ISBN-13: 9780133813463
  • 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.
  • 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.
  • OpenCL
  • OpenCL in Action, available via the ETH Library

  • Schedule

    Wk. Date Content Slides
    1 17.02.2014
    Course Introduction
    Slides1 Slides1(annotated) Slides2
    1 18.02.2014
    Parallel Architectures
    Slides Handout
    2 24.02.2014
    Basic Concepts
    Slides Handout
    2 25.02.2014
    Parallel Models
    Slides Handout
    3 03.03.2014
    Introduction to Programming
    Slides Slides(annotated) Handout
    3 04.03.2014
    Java Basics
    Slides Slides(annotated) Handout
    4 10.03.2014
    Java Loops / Objects / Classes
    Slides Handout
    4 11.03.2014
    Slides (annotated) Handout
    5 17.03.2014
    Synchronization: Introduction to locks
    Slides Handout
    5 18.03.2014
    Synchronization: Using locks and building thread-safe classes
    Slides Handout
    6 24.03.2014
    (previous lecture continued)
    6 25.03.2014
    midterm exam, no lecture
    7 31.03.2014
    Synchronization: Beyond locks
    Slides (v0.2) Handout (v0.2)
    7 1.04.2014
    Synchronization: Advanced (and other) topics
    Slides (v0.2) Handout (v0.2)
    8 7.04.2014
    Task Parallelism
    Slides Handout
    8 8.04.2014
    Transactional Memory
    Slides Handout
    9 14.04.2014
    Designing Parallel Algorithms
    Slides (annotated) Handout
    9 15.04.2014
    GUIs MVC
    Slides Handout
    10 28.04.2014
    Concurrent message passing
    Slides Handout
    10 29.04.2014
    Data parallel programming
    Slides Handout
    11 12.05.2014
    Intro to Massively Parallel Programming
    Slides Handout (annotated)
    11 13.05.2014
    Slides Handout (annotated)
    12 20.05.2014
    Guest Talk
    Talk will be at 11:00-12:00
    12 21.05.2014
    OpenCL Memory Model
    Slides Handout (annotated)
    13 26.05.2014
    OpenCL Case Studies
    Slides Handout (annotated)
    13 27.05.2014
    Recap / Q & A Session
    Slides Handout


    The assignment of teaching assistants to rooms and time slots can be found here. The assignment of students to teaching assistants can be found here.

    Exercise Assignment Due date
    Exercise 1 Handout Bakery Simulator Slides Solution 03.03.2014
    Exercise 2 Handout Slides Solution 10.03.2014
    Exercise 3 Handout Slides Solution Solution 17.03.2014
    Exercise 4 Handout Slides Solution Solution 26.03.2014
    Exercise 5 Handout Slides Solution Solution 31.03.2014
    Exercise 6 Handout Slides Solution Solution 14.04.2014
    Exercise 7 Handout Slides Solution 28.04.2014
    Exercise 8 Handout Solution 07.05.2014
    Exercise 9 Handout Slides Solution Solution 12.05.2014
    Exercise 10 Handout [Fixed for Mac OS] Solution 21.05.2014
    Exercise 11 Handout Solution 31.05.2014

    Exams and Grading

    Class is part of Basisprüfung. There is a written, centralized exam after the end of the semester.

  • 70% of grade made-up from written exam
  • 30% of grade made-up from two Midterm exams

  • Exercise sessions are not graded, however they are considered essential!

    Midterm Exams

    There will be two midterms on the 25.03.14 and 06.05.14. The midterms are during the lecture hours and are closed book. No additional material is allowed.

    First Midterm

    The first midterm on Tuesday, 25.03.14. This will be happening in three rooms:

  • Lastnames A - D: Room: HG E 1.1
  • Lastnames E - M: Room: ML D 28
  • Lastnames N - Z: Room: HG G 5

  • Topics include everything in the lecture up to and including week 5.
    Topics from the Exercise include everything up-to and including exercise 4.

    The grades are available here.

    Second Midterm

    The second midterm on Tuesday, 06.05.14. This will be happening in three rooms:

  • Lastnames A - D: Room: HG E 1.1
  • Lastnames E - M: Room: ML D 28
  • Lastnames N - Z: Room: HG G 5

  • Topics include everything in the lecture from and including week 5, up-to and including week 10.
    Topics from the Exercise include everything from and including exercise 5, up-to and including exercise 8.
    More specifically, you should study solutions for exercises 5-7 and just have a look at assignment 8.

    The grades are available here.

    You can review the exam this Friday, 23.05.2014 from 10:00 to 14:00 in room CNB H 100.5.

    Final Exam (Basisprüfung)

    The final exam takes place on Saturday, 09.08.14 from 11:00 until 13:00 (120 minutes).
    This will be held in a single room for everyone: HIL G 41 (building map) (floor plan)

    Topics include everything covered in the lectures (see annotated slides) and all the exercise material. The only written aids allowed are 4 sides (2 A4 pages) of handwritten notes. You may not use your books, addit ional notes, or any calculator on this exam.