CSCI 3907: Seminar: Performance-Aware Programming

CSCI 3907: Seminar: Performance-Aware Programming


General Information

Professor:  Simon D. Levy

Textbook:  There is no official textbook for this course. Exams and assignments will be based on course lectures. Books from which I have drawn in designing this course include:

Objectives

This course equips student to write programs for performance-critical environments like robotics and high-frequency trading, in which issues of memory access and execution speed are crucial. Topics include:

    • writing nontrivial programs in a performant language like C++
    • avoiding mutation, inheritance, and other tradtiional object-oriented techniques that can make programs unsafe and difficult to debug
    • using powerful tools like gprof and PAPI to assess the performance of such programs.
    • using Field-Programmable Gate Array (FPGA) hardware to implement performance-critical computations

Classroom work will consist of lecture and discussion. Written work will consist of five programming assignments, two in-class hourly exams, and a comprehensive take-home final exam.

Grading

Because this course is a seminar, I expect you to show up for every lecture and participate. Participation -- measured as showing up and contributing to the discussion -- will count for 15% of your grade. Missing three or more meetings without a pre-arranged absence (sports commitment, job interview, etc.) or genuine emergency will result in a participation grade of zero.

The written work for the course (85% of your grade) will consist of

    • Five programming assignments (45% of the grade)
    • Two hourly exams (20% of the grade)
    • A final exam(20% of the grade)

Programming assignments should be submitted to the private repository I have set up for you on github, using a separate folder for each assignment. Your repository name is https://github/com/simondlevy/<username>, where <username> is your W&L network user name (for example, jsmith26). Each assignment is due 11:59 PM on the date indicated in the schedule below. You will receive no credit for work submitted any other way (for example, by email, or in a repository created by you), and I will take off 10% per day for lateness. If you are unhappy with your grade on an assignment, you must get back to me within a week for a review. I will ignore any such requests sent after this brief period.

The grading scale for your course grade will be 93-100 A; 90-92 A-; 87-89 B+; 83-86 B; 80-82 B-; 77-79 C+; 73-76 C; 70-72 C-; 67-69 D+; 63-66 D; 60-62 D-; below 60

AI Policy

Each assignment will specify the degree to which you can use AI tools.

Accommodations

Washington and Lee University makes reasonable academic accommodations for qualified students with disabilities. All undergraduate accommodations must be approved through the Office of the Dean of the College. Students requesting accommodations for this course should present an official accommodation letter within the first two weeks of the (fall or winter) term and schedule a meeting outside of class time to discuss accommodations. It is the student’s responsibility to present this paperwork in a timely fashion and to follow up about accommodation arrangements. Accommodations for test-taking should be arranged with the professor at least a week before the date of the test or exam.


Final Exam Policy

The final exam for this course will be given during the final exam week. The exam will be distributed electronically for you to complete in no more than three hours. You can return the exam to me via github.

Academic Integrity

The hourly exams and the final exam should be written individually and pledged.

Although you may discuss programming problems among yourselves, your programs should be your own work, unless otherwise specified (as when you are told to do pair programming). You MAY use code from the PowerPoint slides or from the textbook for the course. Otherwise, you may NOT use the work of your classmates, former students, friends, or anyone else in writing your programs. By “use” I mean turning in the work of others as your own, or even casting your eyes upon the work of others with a view to incorporating their solutions into your own. Deliberate concealment of sources constitutes plagiarism and will result in a failing grade for the course and, if necessary, a report to the EC. Deliberately providing solutions to other students, either verbally or in writing, via hardcopy or electronic transmission, will also count as plagiarism and subject to the same penalties. In particular, you may not share your work until the deadline to hand in material has passed. Please familiarize yourself with W&L’s policy on plagiarism.


Tentative Schedule

        Monday         Wednesday         Friday
31 Aug
Week 0
Course intro

Toolchain setup
7 Sep
Week 1
From Java to C++

What about Rust?

C++ always wins
A simple object-oriented library for geometric shapes.

Debugging with printf
14 Sep
Week 2
C++: memory management with new and delete

Detecting memory issues with Valgrind

Using compiler warnings for safety
[W]e almost never use objects and never use inheritance

Header-only style

Avoiding explicit memory management: copy elision
Avoding mutability with const and constexpr

Simplifying declarations with auto

Supporting different implementations via header files
21 Sep
Week 3


Compiler macros: #define
#pragma once


Due: Assignment #1
Timing with the time command

Simple run-time profiling with gprof on Linux or sample on OS X
Namespaces
28 Sep
Week 4
Compilers Will Win:
Speeding up execution with optimizaion flags
Review for exam First in-class exam
5 Oct
Week 5
Discuss exam

Due:  Assignment #2
The Standard Template Library: Containers, iterators, algorithms Reading Day; No Class
12 Oct
Week 6
STL STL STL
19 Oct
Week 7
Coding style Coding style Stepping up our game: Mechanical Sympathy

Function-call overhead

Due: Assignment #3
26 Oct
Week 8
Memory hierarchy and caching Review for exam Second in-class exam
3 Nov
Week 9
Discuss exam PAPI setup

PAPI overview
FPGA: Intro
10 Nov
Week 10
FPGA: A peek under the hood (HDL and toolchains) FPGA: Look-Up-Tables (LUTs)

Due:  Assignment #4
FPGA: Flip-Flops
17 Nov
Week 11
FPGA: Simulation and testebenches FPGA: (Finite) State Machines FPGA: I(nput)/O(utput)
30 Nov
Week 12
FPGA: Work on projects FPGA: Work on projects Review for final exam

Glossary

Due: Assignment #5 (FPGA group project)