EECS 675: Multicore and GPU Programming
Spring 2020: Exam 1 Review
Administrative
- Date: Friday, February 28, 2020
- Time/Room: regular class time and room
- Once you start the exam, you will not be excused from the room for
any reason unless you turn in your exam.
Once it is turned in, you cannot come back
and continue working on it.
- The exam will be closed book and closed notes.
- No calculators, cell phones, head phones, or electronic devices of any sort
will be allowed. No such devices should be out in the open.
- Sit as far apart in the room as possible.
Exam Coverage
- Chapters 1, 2, 3-3.7, and 5-5.10 of the book.
- Posted web material: Items 1-3.e of In-Class Materials.
- All lecture notes from when the items above were covered in class.
Exam Style
Questions usually consist of short-answer items (a few sentences to a paragraph), or questions that involve reading or writing code. For the latter, I do not expect you to memorize APIs.
If a question involves specific APIs, I will give you the
necessary prototypes. But given such a prototype, you are expected to know everything relevant to the question
about how the function operates and the
significance of its parameters. I will not remind you of that during the exam. Moreover, I usually try to
make exams a bit more conceptual. For example, while questions certainly may involve writing some small
segments of code, it is more
common that I would ask questions about how you would
design certain algorithms, data structures, and other design-level issues given properties of the platform
and/or API than it is that I would ask you to write code to do some operation, particularly if a non-trivial amount
of code would be required.
IMPORTANT
We will take time in class to review, including addressing items in this review guide, but there
is preparation required on your part. Read this guide, review the book, your lecture notes and the web site,
and come prepared to ask questions. The review will be most effective if you do not just pose questions
verbatim from this guide.
Topic Review
- Introduction (Chapter 1)
- Do not focus on learning vendor-specific hardware architectures. The key concepts
for this first exam include basic architectural differences such as:
- The significance of Figure 1.2 and the terminology shown there.
- The significance of "many cores, small caches" versus "fewer cores, large caches".
- Performance metrics (speedup, efficiency, Amdahl's Law, Gustafson-Barsis viewpoint).
- Design of parallel programs (Chapter 2)
- Understand the PCAM design methodology. Be able to describe the process or any of its steps.
- Understand the basic decomposition patterns we reviewed in class.
- Shared memory parallel programming using threads (Chapter 3-3.7)
- Understand the basic thread memory model (shared code, heap, and global; private runtime stack).
- Do not try to memorize any of the thread APIs. For any exam questions that might depend on them you
will (i) use only the C++ std thread-related classes, and (ii) be given relevant portions
of the API for reference. However, given the API specifications, you will be expected to know
the various classes, method parameters, and return codes. No information other that the APIs
themselves will be provided.
- Understand how to use both binary and counting semaphores. Be able to define what they are and demonstrate an
understanding of how they are used.
- Understand the benefits of using unique_locks. For example, what all do they guarantee?
What is their relationship to mutexes?
- Understand condition_variables. Be able to recognize when a situation might call for the use
of a condition_variable. Know the difference between a thread executing a lock on a mutex
and a thread executing a wait on a condition_variable. Know how threads are released from
condition_variable queues.
- Monitors
- Understand what monitors are, what their general properties are, and why they are useful.
- Understand that a monitor is a design pattern, not an actual primitive.
- Know how to design and build a monitor, including how and why unique_lock instances are used.
- Understanding the advantages of accessing a shared resource via a monitor versus via a semaphore.
- Know the relevant terminology, including deadlock, race condition, starvation, and fairness.
- Distributed memory parallel programming using MPI/OpenMPI (Chapter 5-5.10)
- Understand the basics of MPI and its implementation in OpenMPI including:
- The concept of a "communication world" and the "rank" of processes within that world.
- MPI programs can run entirely on one machine, or (more in keeping with its design) on multiple
machines of possibly heterogeneous types.
- As with C++ threads, do not try to memorize the API. For any exam questions that might require you to
read and/or write code, relevant APIs will be provided. As with C++, however, no information other
than the API function calls will be given.
- Point-to-point message passing:
- Know all the various versions of "send" and "receive" we studied. Know how the processes in a
communication world are expected to use them.
- Understand and be able to recognize blocking versus non-blocking (immediate) sends and receives.
- For blocking, know the difference between globally and locally blocking.
- For immediate, know how to reliably determine whether it is safe to reuse/delete a buffer (sender) or
use a buffer (receiver).
- Be able to articulate the situations under which blocking or immediate is the better choice
for either sender or receiver (remembering the decision is made independently for the two).