COMP 464 final practice problems
Practice problems for the final
MPI (5)
M1. This works with n = 10 and hangs with n = 10000000. Why?
int other = 1 - rank;
MPI_Send(out, n, MPI_INT, other, 0, MPI_COMM_WORLD);
MPI_Recv(in, n, MPI_INT, other, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
M2. Each rank has a double x. Send x to the rank on the right and receive from the rank on the left into double y. The ring wraps. Use one MPI_Sendrecv.
M3. Do M2 with MPI_Isend, MPI_Irecv, and MPI_Waitall. Mark where other work can go. Which variables can that work not touch?
M4. Each rank has a double t. Write one call that gives every rank the largest t.
M5. Why call MPI_Barrier before the first MPI_Wtime?
OpenMP (4)
O1. Pick a schedule for each loop:
- Every iteration does the same work.
- Iteration
idoes work proportional toi. - Iteration cost is random.
O2. Fix the race with a reduction.
long count = 0;
#pragma omp parallel for
for (long i = 0; i < N; i++)
if (a[i] % 3 == 0) count++;
O3. 4 threads, schedule(static). Which thread finishes first? Last? How is the work split?
#pragma omp parallel for reduction(+:total) schedule(static)
for (long i = 0; i < N; i++)
for (long j = i; j < N; j++)
total += 1.0 / (i + j + 1);
O4. O3 with 4 threads:
-
perf stat: task-clock 16.0 s, elapsed 7.0 s -
/procuser time per thread: 7.0, 5.0, 3.0, 1.0 s
How many CPUs were busy on average? What do you change? What elapsed time do you expect after?
Performance and observability (3)
P1. Metric, log, trace, or profile?
- CPU temperature every 10 s
node 42 rebooted at 03:14- A flame graph of one program
- Every MPI message with sender, receiver, and time
P2. Same loop, same instruction count. Version A: 1.2 instructions per cycle, few cache misses. Version B: 0.3 instructions per cycle, many cache misses. Which is faster, by how much, and why?
P3. Give one question observability answers for a user, for the system, and for an admin.
Systems (4)
S1. Order fastest to slowest. Mark what is wiped at job end.
GPU HBM, home directory, archive (tape), DDR memory, parallel filesystem, node-local NVMe
S2. How long does 1 PB take at 100 Gb/s, full line rate, no overhead? Show the arithmetic.
S3. What isolates a VM? A container? Why is Docker a problem on a shared HPC system? What does Apptainer change?
S4. Name the four zones of an HPC facility. Which one touches the outside network?
Fault tolerance (6)
F1. Fault, error, or failure?
- A cosmic ray flips a bit in memory.
- The flipped bit changes a value in your array.
- The program prints the wrong answer.
Transient, intermittent, or permanent?
- A loose cable that drops packets on hot days.
- A dead DIMM.
F2. Make this restartable. Checkpoint to state.txt every 10,000,000 iterations. Load the checkpoint on start if it exists. work(i) is given.
long N = 1000000000;
double sum = 0.0;
for (long i = 0; i < N; i++)
sum += work(i);
printf("sum = %f\n", sum);
F3. In F2, why write a temporary file and rename it instead of writing state.txt directly?
F4. Give two reasons HPC uses checkpoint/restart instead of running extra copies of each job.
F5. One line each: SCR, VeloC, CRIU, ULFM, ABFT.
F6. Your Slurm job ends early. sinfo shows the node as DRAIN. What does DRAIN mean? What do you check before resubmitting?