...
CS 181E Resource Site: Fundamentals of Parallel Programming (Fall 2012
...
Instructor:
...
Prof. Vivek Sarkar, Sprague Hall 414
...
Grutors:
...
Matt Prince
...
Co-instructor:
...
Prof. Ran Libeskind-Hadas
...
Mary Rachel Stimson
...
Habanero Research Staff:
...
Vincent Cavé, Shams Imam
...
...
...
Lectures:
...
Brockman 101 (new location effective 1/18/2012)
...
Lecture times:
...
MWF 1:00 - 1:50pm
...
Labs:
...
Ryon 102
...
Lab times:
...
)
...
...
...
...
Wednesday, 3:30 - 4:50pm (Section 2)
...
...
...
...
Thursday, 4:00 - 5:20pm (Section 1)
Introduction
The goal of COMP 322 is to introduce you to the fundamentals of parallel programming and parallel algorithms, using a pedagogical approach that exposes you to the intellectual challenges in parallel software without enmeshing you in low-level details of different parallel systems. To that end, the main pre-requisite course requirement is COMP 215 or equivalent. This course should be accessible to anyone familiar with the foundations of sequential algorithms and data structures, and with basic Java programming. COMP 221 is also recommended as a co-requisite.
The pedagogical approach will introduce you to the following foundations of parallel programming:
- Primitive constructs for task creation & termination, collective & point-to-point synchronization, task and data distribution, and data parallelism
- Abstract models of parallel computations and computation graphs
- Parallel algorithms and data structures including lists, strings, trees, graphs, matrices
- Common parallel programming patterns including task parallelism, undirected and directed synchronization, data parallelism, divide-and-conquer parallelism, map-reduce, concurrent event processing including graphical user interfaces.
Laboratory assignments will explore these topics through a simple parallel extension to the Java language called Habanero-Java (HJ), developed in the Habanero Multicore Software Research project at Rice University. The use of Java will be confined to a subset of the Java 1.4 language that should also be accessible to C programmers --- no advanced Java features (e.g., generics) will be used. An abstract performance model for HJ programs will be available to aid you in complexity analysis of parallel programs before you embark on performance evaluations on real parallel machines. We will conclude the course by introducing you to some real-world parallel programming models including the Java Concurrency Utilities, Google's MapReduce, CUDA and MPI. The foundations gained in this course will prepare you for advanced courses on Parallel Computing offered at Rice (COMP 422, COMP 522).
Since the aim of the course is for you to gain both theoretical and practical knowledge of the foundations of parallel programming, the weightage for course work will be balanced across homeworks, exams, and lab attendance.
Textbooks
There are no required textbooks for the class. You will be expected to read each lecture handout before coming to the lecture. We will also provide a number of references in the slides and handouts.
However, there are a few optional textbooks that we will draw from quite heavily. 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:
- 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
Introduction
This web site contains resources for the Fall 2012 offering of CS 181E at Harvey Mudd College. For general information on this course, please see the course Twiki page and the course syllabus.
Lecture Schedule
| Day | Date (2012) | Topic | Slides | Audio (Panopto) | Code Examples | Homework AssignedAssignmentHomework Due | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Wed | Sep 05 | Lecture 1: The What and Why of Parallel Programming |
|
| |||||||||||||||
2 | Mon | Sep 10 | Lecture 2: Async-Finish Parallel Programming and Computation Graphs |
|
| |||||||||||||||
Module 1: Deterministic Shared-Memory Parallelism | ||||||||||||||||||||
1 | Wed | Sep 05 | Lecture 1: Introduction, Async-Finish Parallel Programming, Computation Graphs | 3 | Wed | Sep 12 | Lecture 3: Computation Graphs, Abstract Performance Metrics, Parallel Array ReductionsSum | lec3lec1-slideslec3 | lec1-audio | HW1 | HW0 (due by 11:59pm on Tuesday, Sep 11th) | |||||||||
2- | Mon | Sep 17 | School Holiday |
|
|
|
|
| ||||||||||||
4 | Wed | Sep 19 | Lecture 4: Parallel Speedup, Efficiency, Amdahl's Law |
|
|
| ||||||||||||||
5 | Mon | Sep 24 | Lecture 5: Data & Control Flow with Async Tasks, Data Races | (See Lab 3) |
|
| ||||||||||||||
6 | Wed | Sep 26 | Lecture 6: Memory Models, Atomic Variables | (See Lab 3) |
|
| ||||||||||||||
7 | Mon | Oct 01 | Lecture 7: Memory Models (contd), Futures --- Tasks with Return Values |
|
| |||||||||||||||
10 | Lecture 2: Parallel Array Sum (contd), Amdahl's Law, Weak vs. Strong Scaling, Data Races and Determinism | lec2-audio |
| |||||||||||||||||
3 | Wed | Sep 12 | Lecture 3: Finish Accumulators, Futures (Tasks with Return Values | 8 | Wed | Oct 03 | Lecture 8: Futures (contd), Dataflow Programming, Data-Driven Tasks | lec8lec3-audio |
|
| HW1 (due by 11:59pm on Tuesday, Sep 18th) | |||||||||
49 | MonOct | 08Sep 17 | Lecture 9: Abstract vs. Real Performance, seq clause, forasync loops4: Parallel Programming Patterns, Seq clause, Forall Loops, Barrier Synchronization | lec9lec4-audio |
| HW2 | ||||||||||||||
105 | WedOct | 10Sep 19 | Lecture 105: Forasync ChunkingSystolic Algorithms, Parallel Prefix Sum algorithm | lec10-audioOdd-Even Sort |
|
| ||||||||||||||
11 | Mon | Oct 15 | Lecture 11: Parallel Prefix Sum (contd), Parallel Quicksort |
| HW3 (HJ Programming Assignment), SeqScoring.hj, X.txt, Y.txt, BigSeq.zip |
| ||||||||||||||
12 | Wed | Oct 17 | Lecture 12: Finish Accumulators, Forall Loops and Barrier Synchronization |
|
|
| ||||||||||||||
13 | Mon | Oct 22 | Lecture 13: Forall Loops and Barrier Synchronization (contd) |
|
|
| ||||||||||||||
14 | Wed | Oct 24 | Lecture 14: Point-to-point Synchronization and Phasers |
|
|
| ||||||||||||||
15 | Mon | Oct 29 | Lecture 15: Phaser Accumulators, Bounded Phasers |
|
|
| ||||||||||||||
HW2 (due by 11:59pm on Tuesday, Sep 25th) | ||||||||||||||||||||
6 | Mon | Sep 24 | Lecture 6: Collective and Point-to-point Synchronization with Phasers, Phased Forasync Loops, Phaser Accumulators, Loop Chunking | lec6-audio |
| 16 | Wed | Oct 31 | Lecture 16: Summary of Barriers and Phasers | lec16-audio | ||||||||||
17 | Mon | Nov 05 | Lecture 17: Task Affinity with Places | lec17-audio | Module 2: Nondeterministic Shared-Memory Parallelism | 18 | Wed | Nov 07 | Lecture 18: Task Affinity with Places (contd)
|
| ||||||||||
19 | Mon | Nov 12 | Lecture 19: Midterm Summary |
|
|
|
| |||||||||||||
- | F | Feb 24 | No Lecture (Take-home Exam 1 due by 4pm today) |
|
|
|
| HW3 | ||||||||||||
- | M-F | Feb 27 - Mar 02 | Spring Break |
|
|
|
|
| ||||||||||||
7 | Wed | Sep 26 | Lecture 7 | 20 | Wed | Nov 14 | Lecture 20: Critical sections and the Isolated statement, Atomic Variables | lec20lec7-audio |
|
| HW3 (due by 11:59pm on Thursday, Oct 4th) | |||||||||
821 | MonNov | 19Oct 01 | Lecture 21: Isolated statement (contd), Monitors, Actors |
|
| |||||||||||||||
22 | Wed | Nov 21 | Lecture 22: Actors (contd) |
|
| |||||||||||||||
23 | Mon | Mar 12 | Lecture 23: Linearizability of Concurrent Objects |
|
|
| ||||||||||||||
24 | Wed | Mar 14 | Lecture 24: Linearizability of Concurrent Objects (contd) |
|
|
| ||||||||||||||
8: Observationally Cooperative Scheduling (Guest lecturer: Prof. Melissa O'Neil) | lec8-slides |
|
|
| ||||||||||||||||
9 | Wed | Oct 03 | Lecture 9: Monitors, Actors | lec9-slides | HW4 (due by 11:59pm on Friday, Oct 12th) | |||||||||||||||
10 | Mon | Oct 08 | Lecture 10: Linearizability of Concurrent Objects, Safety and Liveness Properties, Progress Guarantees | lec10-slides | 25 | Fri | Mar 16 | Lecture 25: Safety and Liveness Properties | lec25-audio |
|
| |||||||||
26 | Mon | Mar 19 | Lecture 26: Parallel Programming Patterns |
| ||||||||||||||||
27 | Wed | Mar 21 | Lecture 27: Introduction to Java Threads |
| HW4 | |||||||||||||||
Module 3: Distributed-Memory Parallelism | - | Fri | Mar 23 | Midterm Recess
|
|
| ||||||||||||||
28 | Mon | Mar 26 | Lecture 28: Bitonic Sort (guest lecture by Prof. John Mellor-Crummey) |
|
|
|
| |||||||||||||
29 | Wed | Mar 28 | Lecture 29: Java Threads (contd), Java synchronized statement |
|
|
| ||||||||||||||
30 | Fri | Mar 30 | Lecture 30: Java synchronized statement (contd), advanced locking |
|
|
| ||||||||||||||
31 | Mon | Apr 02 | Lecture 31: Java Executors and Synchronizers |
|
|
| ||||||||||||||
32 | Wed | Apr 04 | Lecture 32: Volatile Variables and Java Memory Model |
|
|
| ||||||||||||||
11 | Wed | Oct 10 | Lecture 11: Task Affinity with Places, Message | 33 | Fri | Apr 06 | Lecture 33: Message Passing Interface (MPI)lec33 | lec11-slides | lec33lec11-audio |
|
| HW5 | HW5 (due by 11:59pm on Wednesday, Oct 17th) | |||||||
1234 | MonApr | 09Oct 15 | Lecture 3412: Message Message Passing Interface (MPI, contd)lec34 | lec12-slides | lec34lec12-audio |
|
| |||||||||||||
3513 | Wed | Apr 11 | Lecture 35: Cloud Computing, Map Reduce |
|
|
| ||||||||||||||
36 | Fri | Apr 13 | Lecture 36: Map Reduce (contd) |
|
|
| ||||||||||||||
37 | Mon | Apr 16 | Lecture 37: Speculative parallelization of isolated blocks (Guest lecture by Prof. Swarat Chaudhuri) |
|
|
|
| |||||||||||||
38 | Wed | Apr 18 | Lecture 38: Comparison of Parallel Programming Models |
|
|
| ||||||||||||||
Oct 17 | Lecture 13 | 39 | Fri | Apr 20 | Lecture 39: Course Reviewlec39 | lec13-slides |
| Exam 2 (Take-home ) | HW6 | |||||||||||
- | Fri | Apr 27 | Exam 2 due |
|
|
|
| Exam 2 |
Lab Schedule
Lab # | Date (2011) | Topic | Handouts | Code Examples | Solutions |
---|---|---|---|---|---|
1 | Jan 10, 11, 12 | DrHJ setup, Async-Finish Parallel Programming | |||
2 | Jan 17, 18, 19 | Abstract performance metrics with async & finish |
| ||
3 | Jan 23, 25, 26 | Data race detection and repair | RacyArraySum1.hj, RacyFib.hj, RacyNQueens.hj, RacyFannkuch.hj |
| |
4 | Jan 30 Feb 01, 02 | Real performance, work-sharing and work-stealing runtimes, futures |
| ||
5 | Feb 07, 08, 09 | Data-driven futures | |||
6 | Feb 14, 15, 16 | Barriers and Phasers | |||
- | Feb 21, 22, 23 | No lab (Exam 1 week) |
|
|
|
7 | Mar 06, 07, 08 | Atomic Variables and Isolated Statement | spanning_tree_atomic.hj, spanning_tree_isolated_object.hj, SortedListExampleObj.hj | ||
8 | Mar 13, 14, 15 | Actors | |||
- | Mar 20, 21, 22 | No lab (HW4 deadline, midterm recess) |
|
|
|
9 | Mar 27, 28, 29 | Java Threads | |||
10 | Apr 03, 04, 05 | Java Locks |
| ||
11 | Apr 10, 11, 12 | Message Passing Interface (MPI) | |||
12 | Apr 17, 18, 19 | Map Reduce |
|
Grading, Honor Code Policy, Processes and Procedures
Grading will be based on your performance on six homeworks (worth 50%), two exams (20% each), and lab attendance (10%).
The purpose of the homeworks is to train you to solve problems and to help deepen your understanding of concepts introduced in class. Homeworks and programming assignments are due on the dates and times specified in the course schedule. Please turn in all your homeworks using the CLEAR turn-in system. Homework is worth full credit when turned in on time. A 10% penalty per day will be levied on late homeworks, up to a maximum of 6 days. No submissions will be accepted more than 6 days after the due date.
You will be expected to follow the Honor Code in all homeworks and exams. All submitted homeworks are expected to be the result of your individual effort. You are free to discuss course material and approaches to problems with your other classmates, the teaching assistants and the professor, but you should never misrepresent someone else’s work as your own. If you use any material from external sources, you must provide proper attribution ([as shown here|http://www.dartmouth.edu/~writing/sources/]). Exams 1 and 2, which are pledged under the Honor Code, test your individual understanding and knowledge of the material. Collaboration on exams is strictly forbidden. Finally, it is also your responsibility to protect your homeworks and exams from unauthorized access.
Graded homeworks will be returned to you via email, and exams as marked-up hardcopies. If you believe we have made an error in grading your homework or exam, please bring the matter to our attention within one week.
Past Offerings of COMP 322
Accommodations for Students with Special Needs
...
Final Exam (3-hour duration, due by 5pm on Oct 19th) |