CS 475/575 -- Spring Quarter 2022
Test #1 Review
This page was last updated: April 17, 2022
Test #1 will be taken using the Canvas Quiz mechanism.
It will consist of 40 multiple choice questions
to be done in 60 minutes.
It will be Open Notes.
"Open Notes" is not the same as "I don't need to study for it"!
You will run out of time if you have to lookup in the notes every one of the questions.
Test date and time range:
Test #1 will open in Week #5 on Wednesday, April 27 at 2:00 PM PDT.
It will close on Sunday, May 1, at 11:59 PM PDT (one minute before midnight).
Once you start, you have 60 minutes to finish or until Sunday 11:59 PM, whichever comes first.
Canvas will not let you go beyond Sunday 11:59 PM, even if you have time remaining.
Canvas is very unforgiving about this. Don't push it.
Also Canvas does not let you pause and come back later.
The test is worth 100 points.
It gets added into your running score, just like everything else does.
It is open notes.
It is Closed Friends.
You are responsible for
- what is in the handouts
- what was said in the videos/class/Live Lectures (the contents of which are all pretty much the same)
- what you have done in the projects that have come due before the test opens
Clearly I cannot enforce the Closed Friends.
I am counting on your honesty.
I would refer you to the
Code of Student Conduct.
Also, you should know that, while there is a lot of good information on the Internet,
there is a lot of bad information on the Internet too, or good information explained in a different way.
This test has been written with respect to our class notes.
Complaints about a missed test answer because "that's not what somethingsomething.com said" will be ignored.
The test can potentially cover any of the following topics:
Project Notes noteset: drawing the performance graphs correctly, turning in the projects correctly.
Three reasons to study parallel programming.
- Make existing problems compute faster
- Make larger problems compute in the same time
- Programming convenience
Kinds of Parallelism:
Instruction Level Parallelism,
Thread Level Parallelism,
Data Level Parallelism.
Von Neumann architecture:
memory, control unit, arithmetic logic unit, accumulator.
What is a thread?
Thread State: program counter, stack pointer, registers.
Individual threads' stacks.
Multicore without multithreading.
Multithreading without multicore.
Speedup: Sn = T1/Tn = Pn/P1
Speedup Efficiency = Sn/n
Amdahl's Law to compute S, given Fp and n
Inverse Amdahl's law to compute Fp, given S and n
Using the parallel fraction to compute the maximum speedup possible no matter how many cores you add
What it is
What it gets you
What it doesn't get you
#pragma omp parallel ...
The parts of the architecture that are shared among threads (heap, executable, globals)
The parts of the architecture that aren't shared among threads (stack, stack pointer, program counter, registers)
What's stored on the stack (local variables, function call arguments, function call return addresses)
OpenMP requirements for for-loops
Problems with interloop dependencies
Declaring shared vs. private variables
default(none), and why it is recommended
Declaring a variable inside the for-loop automatically makes it private
Setting the scheduling (static vs. dynamic)
Setting the chunksize ("dealing cards")
Reduction: why it is necessary to do something different instead of just adding into a shared variable
Reduction, Atomic, Critical: what they are, which is fastest and why
Keeping internal state: what that means, and why not to do it
Synchronization: mutexes, barriers, atomic, critical
Sections: what they are, asking for them, the fact that the number of sections is static
Tasks: what they are, asking for them, balanced assignment to threads, the fact that the number of tasks is dynamic
L1, L2, L3
Each core has its own L1 and L2 cache
Cache hits and misses
Coherence: spatial, temporal
Cache lines: what they are, how large they are (64 bytes = 16 floats = 8 doubles)
N-way set associative
[ you don't have to be able to replicate the computation showing what cache line
a particular memory location will end up in ]
Array-of-structures vs. Structure-of-arrays
Linked list cache strategy
Modified, Exclusive, Shared, Invalid (MESI) cache states
False sharing: what it is, why it happens, two ways of fixing it
- Functional Decomposition:
Done for convenience, not for performance
The 3 barriers: why does each one need to be there?
Why does there need to be a Watcher thread?
- Data Decomposition:
[ You don't need to understand the heat transfer differential equation (whew)! ]
You do need to understand what is happening after that equation becomes linearized
Know what the DoAllWork( ) function is doing
Single Instruction Multiple Data (SIMD):
SSE instructions and how they work
Why use them
Various ways of asking for SIMD:
Assembly language, A[:] (CEAN), OpenMP (#pragma omp simd), Intel intrinsics
Combining SIMD with multicore -- what happened in the example in the notes
What it is, why do it
"Prefetch Distance" (PD)
[ You will not be asked what the prefetching code looks like for different compilers ]
No GPU material will be on the test.
Project 0: Simple OpenMP Experiment
Project 1: OpenMP: Monte Carlo Simulation
Project 2: OpenMP: Numeric Integration
Because Project 3 (Functional Decomposition) won't have been due yet, there will be no questions about it
Hint #1: You won't have to write any code.
Hint #2: I might give you code and ask what it does.
Hint #3: I might give you code and ask what is wrong with it and how to fix it.
Hint #4: Any arithmetic on the test will be things that you can do in your head,
but you can have a calculator handy if you want.