Anybody here for computational geometry?
CSS 503A--Systems Programming
Turnkey course: largely following Professor Fukuda's notes
Fast-paced: will be firing a lot of new concepts fired at you
Classes:
Office hours:
Grading:
README
file
BUILD
and, if nontrivial, RUN
scripts
Source code
Sample data & expected output
other stuff as required: reports, diagrams, graphs
NO screen shots
grep
screen shotsUnless otherwise indicated:
cin
)cout
)cerr
)use .cc
or .cpp
file extension for source files
.cc
, but your choice for your sourceInstructor's C++ pet peeves
#include
.cc
/.cpp
files
.h
, for #include
files, or if you must include
template implementations separately, -impl.h
or .inc
Your instructor generally hates arbitrary and petty things, but these points matter in your instructor's humble opinion.
Any specifically requested results (e.g. performance measurements)
Brief thoughts about the assignment
Anything else you want to tell me
May be a paragraph or two
Fit and finish: your assignment is incomplete if I don't know how to build or run it, or if I have to type a long command line (with lots of flags) to compile your program.
May simply encapsulate the same g++
command you type at the
prompt, or be more elaborate (call make
, check for success, run
unit tests, ...)
Does not have to be your own work if used with permission and properly cited
C++
CodingCompile with -Wall
(maximum warnings), -Werror
(warnings treated
as errors), and -pedantic
(strict ISO compliance) flags
Check return codes from system calls
Good resource management
Readable style
Most of you are new to Linux. Not going to waste valuable class time going over basic user-level stuff. You are expected to develop your working knowledge on your own time.
impromptu tutorials during office hours on request
plenty of resources available on the interwebs
You guys have been around, so I shouldn't have to read you the riot act on cheating.
Office hours are generous and I want you to succeed
You are learning skills vital to your future career (whether in academia or industry). If you cheat, you are cheating yourself
Don't panic! I am here to help you.
(I try to say something about this in every class I teach)
Engineering (in general) in a single word: tradeoffs
(TODO: insert triangle diagram)
Double win: sometimes you get a solution that is "better" without sacrificing other aspect(s)
numpy
(compiled library embedded in interpreted language)Double jeopardy: sometimes there are constraints you cannot trade off
Software engineering in a word: abstraction
Why? Because we don't have the mental capacity to build & maintain large-scale (software) systems
Solution: build system in layers af abstraction
Cost (tradeoff) of abstractions: less-efficient use of machine resources
Abstractions may result in net increase in complexity, but partition the complexity so you don't have to deal with it all at once
Most of the time, we live in a world where programmer time is more valuable than machine resources
Often enough, it does matter
Example of dramatic difference: sum two matrices in different languages by row and column
Language | Sum by Rows (ms) | Sum by Columns (ms) |
---|---|---|
C++ | 0.4 | 10.8 (2.5x) |
Java 1 | 4 (10x) | 154 (385x) |
Java 2 | 3.6 | 138 |
Python 1 | 170.9 | 237.1 (~600x) |
Python 2 | 258 | 332 (> 800x) |
TODO: insert code
In this class, we're going to explore a world where performance (usually) matters
Why study this?
interestingly, performance seems to matter most on the largest (datacenter-scale) and smallest (embedded/real-time) machines
What's an operating system?
history: how we got to where we are today
system architecture
Earliest days of computing (before my time): batch systems
Personal anecdote (~ early 2000s): Uncle Zavie cleaning up personal papers, found a flowchart he did for a program on a 1960s-era computer (beautiful calligraphy!)
Batch systems
Functions common to all programs stored in "libraries" (think physical file cabinets containg programs on punch cards)
I/O operations are much slower than CPU operations --> inefficient use of expensive (dollarwise) resources
Solution: run several jobs/tasks processes concurrently
Coming soon: architecture that makes concurrent computing possible
Fast-forward to present time: these problems are basically solved
Hardware Abstraction Layer ("virtual" machine)
Goal:
processes
Linux: kernel (core of operating system)
Linux Distro (Distribution) aka GNU/Linux:
Shell (Bash): not operating system
Similarly for Windows
TODO: layered diagram
"system services" (e.g. print server) reside in userland
applications