Lecture 1 of System Programming
Lecture 1 of System Programming
• Teaching Assistants:
• Arnamoy Bhattacharyya, Seyed Jokar Jandaghi, Yu
Luo, Ishita Ray, Hao Wang
Recommended Textbook
• Exams (65%)
• Midterm (25%): TBD
• Final (40%)
• Closed book
• Homework (35%)
• 5 homeworks (varying % each)
Policies: Assignments
• Work groups
• You can work in groups of two for all labs (or individually)
• You can change groups for each assignment (if you want)
• No extensions for group changes mid-assignment
• Don’t put assignment code on Internet!
• Handins
• Electronic hand-ins only
• Follow the submit procedure (as specified in lab handout)
Policies: Cheating
• Cheating is a serious offence, will be punished harshly
• 0 grade for assignment, potential for official letter in file.
• What is cheating?
• Using someone else’s solution to finish your assignment to avoid
having to understand/learn
• Sharing code with a non-group-member
• Copying or retyping
• We do use cheater-beaters
• Automatically compares your solutions with others
How NotTo pass ECE454
• Do not come to lecture
• It’s nice out, the slides are online, and material in the
book anyway
• TRUTH: Lecture material is the basis for exams
• It is much more efficient to learn through discussion
1) Readability
2) Debugability
Productivity (choice of language, practice)
3) Reliability
4) Maintainability
5) Scalability
Performance (systems understanding)
6) Efficiency
ECE 454
Let’s be more concrete
P P P P
PentiumIV Core2 Duo Core 2 Quad
P P C C C C
P P
C C C C C C C C
C C C C C C C C
P P
P P C C C C
8-core 16-core
C C C C
P P
P C C C C
16-core
one core idle 15 cores idle!
Improving Execution Time
Single Program:
Exec.
Time
C
C C C C
C C C C
Punch line: We Must Parallelize All Software!
• Topics
• Finding the bottleneck!
• code optimization principles
• measuring time on a computer and profiling
• Understanding and using an optimizing compiler
• Assignments
• HW1: Compiler optimization and program profiling
• basic performance profiling, finding the bottleneck.
2) Memory Management and Opt.
• Topics
• Memory hierarchy
• Caches and Locality
• Virtual Memory
Note: all involve aspects of software, hardware, and OS
• Assignments
• HW2: Optimizing Memory Performance
• profiling, measurement, locality enhancements for cache performance
• HW3: Writing your own memory allocator package
• understanding dynamic memory allocation (malloc)
3) Parallelization
• Topics
• A: Parallel/multicore architectures (high-level understanding)
• Threads and threaded programming
• Synchronization and performance
• B: Parallel on multiple machines
• Big data & cloud computing
• Assignments
• HW4: Threads and Synchronization Methods
• Understanding synchronization and performance
• HW5: Parallelizing a program
• Parallelizing and optimizing a program for multicore performance
A big picture
Topic 1: code C C
Core
optimization
Cache Cache Cache Topic 3A: multi-
Topic 2: mem. core parallelization
management Memory
Memory
• HW1: 2 weeks 5%
• HW2: 2 weeks 7%
• HW3: 4 weeks 9%
• HW5: 2 weeks 7%
• 35% total
The bigger picture
• Optimization is not the ONLY goal!
1) Readability
2) Debugability
More important than performance!!!!
3) Reliability
4) Maintainability