COMP 322: Fundamentals of Parallel Programming (Spring
...
2025)
...
Instructor: | Mackale Joyner, DH 2063 | TAs: |
|---|
Elian Ahmar, Timothy Goh, Kelly Park, Tucker Reinhardt, Mantej Singh, Minh Vu, Thanh Vu, Robert Walsh, Frederick Wang, Xincheng Wang, Yidi Wang | | Admin Assistant: | Annepha Hurlock, annepha@rice.edu, DH 3122, 713-348-5186 | | |
Piazza site: | https://piazza.com/rice/spring2021/comp322 (Piazza is the preferred medium for all course communications) | Cross-listing: | ELEC 323 |
|---|
Lecture location: |
|---|
Fully OnlineHerzstein Amp | Lecture times: | MWF 1: |
|---|
30pm 225pm locationsFully Online timesTu 130pm 2:25pm (TV, MS, TG, RW)Th 4:50pm - 5:45pm (XW, TR, KP, YW, FW)
Course Course Syllabus
A summary PDF file containing the course syllabus for the course can be found here. Much of the syllabus information is also included below in this course web site, along with some additional details that are not included in the syllabus.
...
The desired learning outcomes fall into three major areas (course modules):
1) Parallelism: functional programming, Java streams, creation and coordination of parallelism (async, finish), abstract performance metrics (work, critical paths), Amdahl's Law, weak vs. strong scaling, data races and determinism, data race avoidance (immutability, futures, accumulators, dataflow), deadlock avoidance, abstract vs. real performance (granularity, scalability), collective & point-to-point synchronization (phasers, barriers), parallel algorithms, systolic algorithms.
...
3) Locality & Distribution: memory hierarchies, locality, cache affinity, data movement, message-passing (MPI), communication overheads (bandwidth, latency), MapReduce, accelerators, GPGPUs, CUDA, OpenCL.
To achieve these learning outcomes, each class period will include time for both instructor lectures and in-class exercises based on assigned reading and videos. The lab exercises will be used to help students gain hands-on programming experience with the concepts introduced in the lectures.
To ensure that students gain a strong knowledge of parallel programming foundations, the classes and homeworks homework will place equal emphasis on both theory and practice. The programming component of the course will mostly use the Habanero-Java Library (HJ-lib) pedagogic extension to the Java language developed in the Habanero Extreme Scale Software Research project at Rice University. The course will also introduce you to real-world parallel programming models including Java Concurrency, MapReduce, MPI, OpenCL and CUDA. An important goal is that, at the end of COMP 322, you should feel comfortable programming in any parallel language for which you are familiar with the underlying sequential language (Java or C). Any parallel programming primitives that you encounter in the future should be easily recognizable based on the fundamentals studied in COMP 322.
...
- Module 1 handout (Parallelism)
- Module 2 handout handout (Concurrency)
There
...
There are also a few optional textbooks that we will draw from during the course. You are encouraged to get copies of any or all of these books. They will serve as useful references both during and after this course:
- Fork-Join Parallelism with a Data-Structures Focus (FJP) by Dan Grossman (Chapter 7 in Topics in Parallel and Distributed Computing)
- Java Concurrency in Practice by Brian Goetz with Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes and Doug Lea
- Principles of Parallel Programming by Calvin Lin and Lawrence Snyder
- The Art of Multiprocessor Programming by Maurice Herlihy and Nir Shavit
Lecture Schedule
Finally, here are some additional resources that may be helpful for you:
Lecture Schedule
Week | Day | Date (2021) | Lecture | Assigned Reading | Assigned Videos (see Canvas site for video links) | In-class Worksheets | Slides | Work Assigned | Work Due |
|---|
| | Worksheet Solutions |
|
|---|
1 | Mon | Jan |
|---|
25Topic 1.1 Lecture, Topic 1.1 Demonstration Task Creation and Termination (Async, Finish)Module 1: Section 1.1 | | | | | 27 Computation Graphs, Ideal ParallelismModule 1: Sections 1.2, 1.3 | Topic 1.2 Lecture, Topic 1.2 Demonstration, Topic 1.3 Lecture, Topic 1.3 Demonstration | worksheet2 | lec2-slides | Homework 1 | | | | | | Fri | Jan 29 | Lecture 3: Abstract Performance Metrics, Multiprocessor Scheduling | Module 1: Section 1.4 | Topic 1.4 Lecture, Topic 1.4 Demonstration | worksheet3 | lec3-slides | | | | |
2 | Mon | Feb 01 | Lecture 4: Parallel Speedup and Amdahl's Law | Module 1: Section 1.5 | Topic 1.5 Lecture, Topic 1.5 DemonstrationQuiz for Unit 1 | | | | | Wed | Feb 03 | Lecture 5: Future Tasks, Functional Parallelism ("Back to the Future")11 1 worksheet5lec5 | | | Fri | Feb 05 | Lecture 6: Finish Accumulators33 3 worksheet6lec6 | Quiz for Unit 1 | | |
|
| WS7-solution |
|
| Fri | Jan 31 | Lecture 8: Async, Finish, Computation Graphs |
|---|
3 | Mon | Feb 08 | Lecture 7: Map Reduce Section 2.4 24 24 Demonstration | 1 Demonstration, Topic 1.2 Lecture, Topic 1.2 Demonstration | worksheet8 | lec8 |
worksheet7 | lec7 Lecture 8: Data Races, Functional & Structural DeterminismWed | Feb 10 | | Lecture 9: Ideal Parallelism, Data-Driven Tasks | Module 1: Section |
25 26 25 25 26 26 Demonstration worksheet8 | lec8-slides | Homework 2 | | | 12 9: Java’s Fork/Join Library11: GUI programming, Scheduling/executing computation graphs
| Module 1: |
Sections 2.7, 2.8 27 28 Lectureworksheet9lec9Quiz for Unit | | | 4 15 10: Loop-Level Parallelism, Parallel Matrix Multiplication| 12: Abstract performance metrics, Parallel Speedup, Amdahl's Law | Module 1: |
Sections 3.1, 3.2 31 3.1 Demonstration , Topic 3.2 Lecture, Topic 3.2 Demonstration worksheet10 | lec10 | | | | Wed 17Spring "Sprinkle" Day (no class) | | | | | | | | | | Fri | Feb 19 | | No class: Spring Recess
|
|
|
|
|
|
|
|
|
| 6 | Mon | Feb 17 | Lecture 14: Data Races, Functional & Structural Determinism |
Lecture 11: Iteration Grouping (Chunking), Barrier Synchronization 33 34 33 33 34 34 worksheet11lec11 | Quiz for Unit 2 | | | 5 | Mon | Feb 22 | Lecture 12: Parallelism in Java Streams, Parallel Prefix Sums | Module 1: Section 3.7 | Topic Topic 3.7 Java Streams, Topic 3.7 Java Streams Demonstration | worksheet12 | lec12-slides | | | | |
|---|
| | Wed | Feb 24 | Lecture 13: Iterative Averaging Revisited, SPMD pattern | Module 1: Sections 3.5, 3.6 | Topic 3.5 Lecture , Topic 3.5 Demonstration , Topic 3.6 Lecture, Topic 3.6 Demonstration | worksheet13 | lec13-slides | Homework 3 (includes one intermediate checkpoint) Quiz for Unit 3 | Homework 2 | | |
| Fri | Feb 26 | Lecture 14: Data-Driven Tasks | Module 1: Sections 4.5 | Topic 4.5 Lecture Topic 4.5 Demonstration | worksheet14 | lec14-slides | | | | |
|---|
| 6 | Mon | Mar 01 | Spring "Sprinkle" Day (no class) | | | | | | | | |
| Wed | Mar 03 | Lecture 15: Point-to-point Synchronization with Phasers | Module 1: Section 4.2, 4.3 | Topic 4.2 Lecture , Topic 4.2 Demonstration, Topic 4.3 Lecture, Topic 4.3 Demonstration | worksheet15 | lec15-slides | | | | |
|---|
| Fri | Mar 05 | Lecture 16: Pipeline Parallelism, Signal Statement, Fuzzy Barriers | Module 1: Sections 4.4, 4.1 | Topic 4.4 Lecture , Topic 4.4 Demonstration, Topic 4.1 Lecture, Topic 4.1 Demonstration | worksheet16 | lec16-slides | Quiz for Unit 4 | Quiz for Unit 3 | | |
|---|
7 | Mon | Mar 08 | Lecture 17: Midterm Review | | | | lec17-slides | | | | |
|---|
| Wed | Mar 10 | Lecture 18: Abstract vs. Real Performance | | | worksheet18 | lec18-slides | | | | |
|---|
| Fri | Mar 12 | Lecture 19: Critical Sections, Isolated construct (start of Module 2) | Module 2: Sections 5.1, 5.2, 5.6, | Topic 5.1 Lecture, Topic 5.1 Demonstration, Topic 5.2 Lecture, Topic 5.2 Demonstration, Topic 5.6 Lecture, Topic 5.6 | | | 15 Parallel Spanning Tree algorithm, Atomic variables Data-Parallel Programming model. Loop-Level Parallelism, Loop Chunking | Module 1: Sections 3.1, 3.2, 3.3 | Topic 3.1 Lecture, Topic 3.1 Demonstration , Topic 3.2 Lecture, Topic 3.2 Demonstration, Topic 3.3 Lecture, Topic 3.3 |
Module 2: Sections 5.3, 5.4, 5.5 | Topic 5.3 Demonstration, Topic 5.4 Lecture, Topic 5.4 Demonstration, Topic 5.5 Lecture, Topic 5.5 Homework 3, Checkpoint-1 | | | 17 ActorsBarrier Synchronization with Phasers | Module |
2 6.1, 6.2 61 Topic 6.1 Demonstration , Topic 6.2 Lecture, Topic 6.2 | | | | 19 Actors (contd)Stencil computation. Point-to-point Synchronization with Phasers | Module |
2 63 6., 65 63 6.3 Demonstration, Topic 6. Lecture , Topic 64 65 65 | Quiz for Unit 4 | | 22 Actors (contd)Fuzzy Barriers with Phasers | Module |
2 66Topic 66 6.6 Demonstration | lec23-slides | Quiz for Unit 5 | | | | 24 Java Threads, Java synchronized statement Confinement & Monitor Pattern. Critical sections Global lock | Module 2: |
7.1, 7.2| Sections 5.1, 5.2 | Topic 5.1 Lecture, Topic 5.1 Demonstration, Topic 5.2 Lecture, Topic 5.2 Demonstration, Topic 5.6 Lecture, Topic 5.6 Demonstration | worksheet24 | lec24-slides |
|
| WS24-solution |
|
| Fri | Mar 14 | Lecture 25: Atomic variables, Synchronized statements | Module 2: Sections 5.4 |
|---|
Topic 7.1 Lecture, Topic 7.2 Lecture | | lec24-slides | | | | | | | Fri | Mar 26 | Spring "Sprinkle" Day (no class) | | | | | | | | |
10 | Mon | Mar 29 | Lecture 25: Java Threads, Java synchronized statement (contd), wait/notify | Module 2: 7.1 71 Lecture| 4 Lecture, Topic 5.4 Demonstration, Topic 7.2 |
Lecture | | | | | Wed | Mar 31 | Lecture 26: Java Threads (exercise) | | | | lec26-handout | | Homework 3 (all) | | |
|---|
| Fri | Apr 02 | Lecture 27: Java Locks | Module 2: 7.3 |
|
| WS25-solution |
|
| Mon | Mar 17 | No class: Spring Break |
| |
|
|
|
|
|
|
| Wed | Mar 19 | No class: Spring Break |
|
|
|
|
|
|
|
|
| Fri | Mar 21 | No class: Spring Break |
|
|
|
|
|
|
|
|
|---|
10 | Mon | Mar 24 | Lecture 26: Java Threads and Locks | Module 2: Sections 7.1, 7.3 | Topic 7.1 Lecture, Topic 7.3 Lecture |
|---|
lec27Quiz for Unit 6 | Quiz for Unit 5 | | |
|
| WS26-solution |
|
| Wed | Mar 26 | Lecture 27: Read-Write Locks, Soundness and progress guarantees |
|---|
11 | Mon | Apr 05 | Lecture 28: Linearizability of Concurrent Objects44 lec28 4 (includes one intermediate checkpoint
| | | Wed | Apr 07 | Lecture 29: Java Locks (exercise) | | | | lec29-handout | | | | |
|---|
| Fri | Apr 09 | Lecture 30: Safety and Liveness Properties, Java Synchronizers, Dining Philosophers Problem | Module 2: 7.5, 7.6 | Topic 7.5 Lecture, Topic 7.6 Lecture | | lec30-slides | Quiz for Unit 7 | Quiz for Unit 6 | | |
|---|
12 | Mon | Apr 12 | Lecture 31: Message Passing Interface (MPI), (start of Module 3) | | Topic 8.1 Lecture, Topic 8.2 Lecture, Topic 8.3 Lecture | | lec31-slides | | | | |
|---|
| Wed | Apr 14 | Lecture 32: Message Passing Interface (MPI, contd) | | Topic 8.4 Lecture | | lec32-slides | | | | |
|---|
| Fri | Apr 16 | Lecture 33: Message Passing Interface (MPI, contd) | | Topic 8.5 Lecture, Topic 8 Demonstration Video | | lec33-slides | | Homework 4 Checkpoint-1 | | |
|---|
13 | Mon | Apr 19 | Lecture 34: Task Affinity with Places | | | | lec34-slides | Quiz for Unit 8 | Quiz for Unit 7 | | |
|---|
| Wed | Apr 21 | Lecture 35: Eureka-style Speculative Task Parallelism | | | | lec35-slides | | | | |
|---|
| Fri | Apr 24 | Lecture 36: Algorithms based on Parallel Prefix (Scan) operations | | | | lec36-slides | | | | |
|---|
14 | Mon | Apr 26 | TBD | | | | | | | | |
|---|
| Wed | Apr 28 | Lecture 38: Course Review (Lectures 19-34 |
) | all) | | 30TBD | | | | | | Quiz for Unit 8 | | | | 25 | Lecture 39: Course Review (Lectures 19-34) |
|
|
| lec39-slides |
|
|
|
|
Lab Schedule
2021Examples | 0 | | Infrastructure Setup | lab0-handout | 26Async-Finish Parallel Programming with abstract metrics Feb 02 | Feb 09 | | Jan 27 | Functional Programming |
Futures 16Cutoff Strategy and Real World Performance | 23DDFs | lab4-handout | | 5 | Mar 02 | Loop-level Parallelism | lab5lab5intro- | Mar 09 (Midterm exam) | Mar 16Spring "Sprinkle" Day | | - | | Isolated Statement and Atomic Variables | | |
|---|
| - | | Actors | | |
|---|
| - | | Java Threads, Java Locks | | |
|---|
- | | Message Passing Interface (MPI) | | |
|---|
- | | Apache Spark | | |
|---|
- | | Eureka-style Speculative Task Parallelism | | |
|---|
- | | Java's ForkJoin Framework | | Grading, Honor Code Policy, Processes and Procedures
...
Labs must be submitted by the following Monday at 11:59pmFriday at 4pm. Labs must be checked off by a TA.
Worksheets should be completed by the deadline listed in Canvas before the start of the following class (for full credit) so that solutions to the worksheets can be discussed in the next class.
...