HPC / CFD Deep Question Bank¶
All exam-style questions with answers, organised by chapter and difficulty. Use as an active drill: cover the answer, write your own, then check.
Chapter 1 — Course Introduction & HPC Overview¶
Beginner¶
- What does HPC stand for? High-Performance Computing.
- Name two supercomputers. El Capitan, Frontier, JUWELS, Aurora.
- OS on every Top500 cluster? Linux.
- What is a "core"? One processing unit (ALU + registers) inside a CPU.
- Top500 ranks by which benchmark? LINPACK (HPL) in FLOPS.
Intermediate¶
- Define FLOPS and convert 1 PFLOPS to FLOPS. Floating-point operations per second; 1 PFLOPS = \(10^{15}\) FLOPS.
- Node vs core? Node = whole computer; core = one processing unit inside its CPU.
- State three reasons Linux dominates HPC. Open-source kernel, scriptable shells, modular distributions, POSIX portability.
- Difference between simulation and experiment in CFD? Experiments give limited but ground-truth data; simulations give all variables but need validation.
- Role of the interconnect in a cluster? Fast inter-node communication for MPI; latency limits strong scaling.
Hard¶
- LES of 5e8 cells × 5e4 steps × 200 ops → total FLOPS? \(5 \times 10^{15}\).
- Why do more cores not always help? Amdahl's law: serial fraction limits speed-up to 1/f.
- Why are GPUs becoming dominant? Higher FLOPS/W, dense vector compute.
- What limits strong scaling? Communication latency vs computation; sub-domain shrinks while messages stay.
- Power as Top500 metric? Cooling cost ∝ power; targets push GFLOPS/W.
Very Hard¶
- Algebra of Amdahl plateau. S(N) = 1/(f + (1-f)/N) → 1/f as N → ∞.
- 5% serial → max speed-up. 1/0.05 = 20×.
- Communication ∝ √N, compute ∝ N — when does communication dominate? When √N × c_comm ≳ N × c_compute, i.e. small per-node work.
Deep Integration¶
- Trace a CFD job from edit to plot. Vim → Git → SSH → SLURM → MPI → rsync → gnuplot.
- Why is "scriptability" of Linux more important than "free"? Reproducibility & automation.
Coding/Command¶
- One-liner to print core count.
nproc. - Time a program.
time ./a.out.
Debugging¶
- Why does parallel program produce different result each run? Race conditions; non-deterministic FP reduction order.
- Speed-up decreases beyond 16 cores on a laptop? Hyperthreads share ALUs; cache contention.
Long Written¶
- Discuss IFAS HPC research and sustainable aviation in 250 words. (See Ch. 1 §9.3.)
Chapter 2 — Unix / Linux Basics¶
Beginner¶
- Who released the Linux kernel? Linus Torvalds, 1991.
- What does GNU stand for? GNU is Not Unix.
- Licence of Linux kernel? GPLv2.
- Two Unix-derived OSes. macOS, Solaris.
- Tux? Linux's penguin mascot.
Intermediate¶
- Why was Unix portable? Rewritten in C in 1973.
- Who maintains POSIX? IEEE.
- Role of
init? First user-space process; starts services. - Why clusters use RHEL/Rocky? Long support, ISV certification.
- Why is
bashthe "Bourne-Again Shell"? Successor to Stephen Bourne'ssh.
Hard¶
- Two POSIX features. Function API (e.g.
fork); shell utilities (grep). - Why
Linux ≠ Unixlegally? Linux is Unix-like; not derived from AT&T code. - What is
glibc? GNU C library; user-side POSIX implementation. - Why does
lswork on macOS? Both POSIX-compliant; both shipls. - Monolithic vs micro-kernel? Linux: drivers in kernel space; Mach: drivers in user space.
Very Hard¶
- How does syscall change privilege (x86_64)?
syscallinstr → MSR-defined entry → kernel mode. - "Everything is a file" — why useful? Generic syscalls work on devices, sockets, pipes.
- Linux vs Hurd? Hurd never finished; GNU userland uses Linux kernel.
Deep Integration¶
- How does Unix philosophy map to Ch. 7? Pipes compose grep/awk/sed.
- Why is POSIX still relevant in 2026? Containers, WSL, embedded depend on it.
Coding/Command¶
- Print kernel version.
uname -r. - Print current shell.
echo $SHELL.
Debugging¶
ls: command not founddespite/bin/lsexists. PATH cleared.- System still boots old kernel after update. GRUB default not updated.
Long Written¶
- Discuss why HPC chooses Linux over BSD/Windows in 250 words. (Ch. 1 §4.4 + Ch. 2 §4.7.)
Chapter 3 — Linux Commands & File Permissions¶
Beginner¶
- Numeric for
rw-r--r--. 644. - Symbolic for 700.
rwx------. - Count words in file.
wc -w f. - Copy directory.
cp -r src dst. - Symbol for home.
~.
Intermediate¶
- Numeric for
rwsr-xr-x. 4755. - Numeric for
rwxrwxrwt. 1777. - Why
chmod 644cannot run a script. No execute bit. cpvsmvon same FS.mvjust renames inode;cpduplicates data.ls -ld /tmpoutput.drwxrwxrwt root root ....
Hard¶
umask 027onmkdir. 0777 - 027 = 0750.- List only files.
ls -lp \| grep -v '/$'orfind . -maxdepth 1 -type f. - Hard link, delete one name. Other still works; ref-count > 0.
cp -r dir1 dir2if dir2 missing. dir2 created as copy of dir1.- Why
rm -ion cluster. Adds confirmation; prevents catastrophic deletes.
Very Hard¶
-rwsrwsr-Tnumeric. 7766 (setuid+setgid+sticky+no other-x).umaskdiffers login vs non-login — why? Different rc files.rm -rf $undef_var/danger. Empty var →rm -rf /.
Deep Integration¶
- Why is
chmod -R 777bad on a shared cluster? Anyone can edit; reproducibility lost; security risk. - Why does SLURM need setuid? Helper bins elevate briefly to enforce policy.
Coding/Command¶
- Recursive group-write.
chmod -R g+w data/. - Count
.cpp.find . -type f -name "*.cpp" \| wc -l.
Debugging¶
Permission deniedrunning script.chmod +x.ls > log; ls /missing > log— what's in log? Only stderr appears; merge with2>&1.
Long Written¶
- Discuss permissions on multi-user HPC in 200 words. (Ch. 3 §9.3.)
Chapter 4 — bashrc, SSH, Remote Workflows¶
Beginner¶
- Default SSH port. 22.
- File listing your authorized public keys.
~/.ssh/authorized_keys. - One-shot file copy command.
scp. - Incremental sync command.
rsync. &at end of command. Run in background.
Intermediate¶
- Why ed25519 over RSA? Smaller, faster, modern.
- Permission for
~/.ssh/id_ed25519. 600. - Where do aliases go for persistence?
~/.bashrc. sourcevs run.sourcemodifies current shell.2>&1plain English. Send stderr where stdout points.
Hard¶
ssh -L 8888:cn01:8888 user@gw. Local-port forward localhost:8888 ↔ gateway tunnel ↔ cn01:8888.- Why does
tmuxsurvive disconnection? Server process owns the pty. - Mode 777 on
~/.ssh. SSH refuses keys for safety. ~/.ssh/known_hosts. Stores trusted server fingerprints; detects MITM.rsync src/ dst/vsrsync src dst/. Trailing slash = contents only.
Very Hard¶
- Why TOFU weakness for SSH host keys? First-contact MITM possible; mitigate via SSHFP DNS or CA.
- Agent forwarding (
ssh -A) trade-off. Convenience vs forwarding-host compromise. - Why
scpblocks butrsyncresumes? scp has no chunking/state; rsync rebuilds via checksums.
Deep Integration¶
- Map SSH ops to CFD workflow. ssh login → tmux → rsync push → sbatch → tmux detach → rsync pull.
- Why disable password auth on cluster? Stops brute-force; key-based audit-friendly.
Coding/Command¶
- Mirror with delete.
rsync -avzP --delete ~/work/ cluster:~/work/. - Bash function tunneling Jupyter.
jup(){ ssh -L 8888:$1:8888 cluster; }.
Debugging¶
Permission denied (publickey)despite key. Wrong perms / key not in agent / not in authorized_keys.scp: not foundon cluster. OpenSSH ≥9 disabled scp; usescp -Oor rsync/sftp.
Long Written¶
- Daily CFD workflow with SSH/rsync/tmux/SLURM in 250 words.
Chapter 5 — Vim & Command-Line Editing¶
Beginner¶
- Save and quit.
:wq(orZZ). - Discard.
:q!. - Copy line.
yy. - Delete 5 lines.
5dd. - Undo.
u.
Intermediate¶
ci". Change inside quotes.>aP. Indent a paragraph.- Replace foo→bar lines 5–10.
:5,10s/foo/bar/g. - Search backwards.
?Re. - Open Makefile in vsplit.
:vsp Makefile.
Hard¶
- Whole-word replace.
:%s/\<Re\>/Reynolds/g. - Repeat last
:s.&. - Yank function body. Cursor in body,
ya{. - Append
;to every line.:%s/$/;/. - Comment out lines 5–20.
:5,20s/^/\/\//.
Very Hard¶
- Edit on 200 buffers.
:bufdo %s/foo/bar/ge \| update. - Sort selected lines numerically. Select
V,:'<,'>!sort -n. - Reformat paragraph to 80 cols.
gq(withset textwidth=80).
Deep Integration¶
- Batch-edit 50 SLURM scripts.
vim *.sbatch; :argdo %s/--time=2/--time=4/ge \| update. - Why Vim over VS Code on HPC? Works over SSH; pre-installed; low memory.
Coding/Command¶
- Macro to wrap line in
if(true){…}.qa I if(true) { <Esc>A } <Esc>qthen@a. <F5>mapping to compile + run C++. See Ch. 5 §6.4.
Debugging¶
:s/foo/bar/gonly 1 match. Need%::%s/foo/bar/g.:wread-only.:w!or:w !sudo tee %.
Long Written¶
- Discuss Vim grammar's productivity in 250 words.
Chapter 6 — Regex & Globbing¶
Beginner¶
*.txtin shell. All files ending.txt.^abcregex. Lines startingabc.- Glob for one char.
?. - POSIX class for digits.
[[:digit:]]. - Regex for word + space.
[[:alpha:]]+.
Intermediate¶
- List
.h .cppin dir-1+dir-2.ls {dir-1,dir-2}/*.{h,cpp}. - Loose IPv4 regex.
([0-9]{1,3}\.){3}[0-9]{1,3}. - Replace tabs with 4 spaces (sed).
sed 's/\t/ /g'. - Whole-word
Re.\<Re\>(BRE/ERE) or\bRe\b(PCRE). - Glob hidden files.
.[!.]*.
Hard¶
- No-
foo-no-barlines (PCRE).^(?!.*(foo|bar)).*$. - Phone with optional country code.
(\+[0-9]+ )?[0-9]{3}-[0-9]{3}-[0-9]{4}. - Negate glob.
extglob!(pattern). - Replace SciNot by 0.0.
sed -E 's/[0-9]*\.[0-9]+[eE][+-]?[0-9]+/0.0/g'. - Date YYYY-MM-DD regex.
[0-9]{4}-[0-9]{2}-[0-9]{2}.
Very Hard¶
ls *.txtfaster thanfind . -name "*.txt". Glob expanded once via readdir; find recurses.- Strict IPv4 regex.
((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|...). - Negate glob.
shopt -s extglob; ls !(tmp*).
Deep Integration¶
- Pipeline to print files matching regex.
grep -lE 'PATTERN' *.log. - Why regex101.com first? Test before destructive
sed -i.
Coding/Command¶
- Find today's logs and grep ERROR.
find . -mtime -1 -type f -name '*.log' -exec grep -l ERROR {} +. - Vim whole-word replace all open buffers.
:bufdo %s/\<oldName\>/newName/ge \| update.
Debugging¶
grep "(foo|bar)" fno match. BRE: parens literal; use-E.ls *.[ch]empty. No matching files;shopt -s nullglob.
Long Written¶
- Regex+glob in HPC log analysis pipeline (250 words).
Chapter 7 — Linux Text Tools¶
Beginner¶
- All
.txtin~.find ~ -type f -name "*.txt". - Count lines with ERROR.
grep -c ERROR log. - Replace first foo→bar per line.
sed 's/foo/bar/' f. - Print 2nd CSV field.
awk -F, '{print $2}' f. - Diff two files.
diff a b.
Intermediate¶
- Files >100 MB.
find . -size +100M. - Replace all foo→bar in place.
sed -i 's/foo/bar/g' f. - Sum column 3.
awk '{s+=$3} END{print s}' f. - First match per file.
grep -m1 PAT *.log. - Unique departments.
awk -F, 'NR>1{print $3}' f \| sort -u.
Hard¶
- CSV with quoted commas — parsing?
awk -v FPAT='([^,]+)|("[^"]+")'. - Median of column.
awk '{a[NR]=$1} END{n=asort(a); ...}'. - Replace IPs with
[redacted].sed -E 's/[0-9]{1,3}(\.[0-9]{1,3}){3}/[redacted]/g'. - 5 longest lines.
awk '{print length, $0}' f \| sort -nr \| head -5. - Diff huge files: just summary.
diff -q a b.
Very Hard¶
- awk pivot by dept & gender.
awk -F, 'NR>1{c[$3,$5]++} END{for(k in c) print k,c[k]}'. - sed conditional.
sed -E '/^Re/s/=[0-9]+/=5000/'. - find avoiding
node_modules.find . -name node_modules -prune -o -type f -print.
Deep Integration¶
- Find
coutnot followed byendlin.cpp.grep -rEn 'cout[^;]*;[^l]*' --include='*.cpp' .. - Top-10 directories by size.
du -sk * \| sort -nr \| head -10.
Coding/Command¶
- awk: NR>1 && salary>50000.
awk -F, 'NR>1 && $4>50000 {print $1,$2,$3}' f. - sed swap Last_First → First_Last.
sed -E 's/([A-Za-z]+)_([A-Za-z]+)/\2_\1/'.
Debugging¶
- awk prints empty for CSV. Need
-F,. sed 's/(foo|bar)/X/g'literal. Need-E.
Long Written¶
- sed vs awk discussion in 250 words.
Chapter 8 — Shell Scripting¶
Beginner¶
- Make script executable.
chmod +x s.sh. - Print first arg.
echo $1. - Number of args.
$#. - Exit success.
exit 0. - Array length.
${#A[@]}.
Intermediate¶
- Test file exists.
[ -f f ]. - Loop
*.cpp.for f in *.cpp; do ...; done. - Read input.
read -p "?: " ans. - Subshell.
( cd dir; ls ). - Capture cmd output.
x=$(cmd).
Hard¶
cd dir; cmdvs(cd dir; cmd). Subshell scope.- Replace
.txtwith.bak.for f in *.txt; do mv -- "$f" "${f%.txt}.bak"; done. - getopts with combined flags. See Ch.8 §4.12.
- Predict
(( 0 )). Exit status 1. - Source vs run.
. file.shruns in current shell.
Very Hard¶
for f in $(ls)worse thanfor f in *. Word splitting on filenames with spaces.set -epitfalls in pipes. Needpipefailfor middle-of-pipe errors.- Memoization in bash. Associative arrays.
Deep Integration¶
- Combine awk + bash for failed cases.
awk '/FAIL/{print $1}' results \| xargs -n1 ./rerun.sh. - Trap to clean tmp on Ctrl-C.
trap 'rm -f "$tmp"' EXIT INT TERM.
Coding/Command¶
- Sum file sizes in dir.
du -sb "$1" \| cut -f1. - Squares 1..10.
for i in {1..10}; do echo $((i*i)); done.
Debugging¶
if [ $x = "yes" ]fails empty. Quote:[ "$x" = "yes" ].for f in *.cpp; do ...with no matches.shopt -s nullglobor guard.
Long Written¶
- Walk through extended
backup-data.shin 250 words.
Chapter 9 — Gnuplot¶
Beginner¶
- Plot sin(x).
plot sin(x). - Add title.
set title "..."; replot. - Save PNG.
set terminal png; set output 'x.png'; replot. - Plot col 1 vs 3.
using 1:3. - Legend top-right.
set key right top.
Intermediate¶
- Log y axis.
set logscale y. - Two curves on one plot.
plot 'a' u 1:2, 'b' u 1:2. - Red dashed thick.
lt 2 lw 3 lc rgb "red" dt 2. - Error bars.
using 1:2:3 with yerrorbars. - 2×2 multiplot.
set multiplot layout 2,2 ....
Hard¶
- Fit
a*exp(-b*x).f(x)=a*exp(-b*x); fit f(x) 'd' via a,b. - Twin y-axis.
set y2tics; plot ... axes x1y2. - Histogram.
smooth frequency with boxes. - Conditional colour.
lc variablebased on column. - 3-D surface.
splot 'mesh' u 1:2:3 with pm3d.
Very Hard¶
- awk → gnuplot in one script. See Ch. 9 §6.8.
- Animate frames into GIF. Bash loop +
convert -delay. - LaTeX-ready labels.
set terminal cairolatex eps.
Deep Integration¶
- Auto-plot every case. §7 + 6.7.
- gnuplot vs Excel for HPC. Reproducible, scriptable, terminal output.
Coding/Command¶
- Plot column 1 in ms.
plot 'd' using ($1*1000):2 with lines. - Horizontal line at 1e-6.
set arrow from graph 0,first 1e-6 to graph 1,first 1e-6 nohead lt 0.
Debugging¶
- Plot CSV nothing.
set datafile separator ",". - PNG empty. Forgot
replotafterset terminal png.
Long Written¶
- gnuplot as HPC postprocessor in 250 words.
Chapter 10 — Git¶
Beginner¶
- Init.
git init. - Stage.
git add file. - Commit.
git commit -m "msg". - Log.
git log. - Clone.
git clone url.
Intermediate¶
- Create+switch branch.
git switch -c x. - Merge x into main.
git checkout main; git merge x. - Delete branch.
git branch -d x. - Add remote.
git remote add origin url. - First push.
git push -u origin main.
Hard¶
- Undo last commit, keep staged.
git reset --soft HEAD~1. - Squash 3 commits.
git rebase -i HEAD~3thenslower two. - Restore deleted file.
git restore -- file. - Cherry-pick commit.
git cherry-pick <hash>. - Log of file.
git log -- solver.cpp.
Very Hard¶
- FF vs 3-way merge. FF linear; 3-way merge commit with two parents.
- Recover deleted branch.
git reflog→git branch x <hash>. git bisect. Binary search through history for bad commit.
Deep Integration¶
- Tag + reproducibility on cluster.
git tag v1.0-paper; git push --tags. - Why rebase shared branch is bad. Rewrites history; teammates' fetches break.
Coding/Command¶
- Stage all
.cppand commit.git add '*.cpp'; git commit -m "...". - Show README changes last 5 commits.
git log -p -5 README.md.
Debugging¶
Updates were rejected.git pull --rebasethenpush.- PAT 401. Token expired or missing scope.
Long Written¶
- GitFlow vs GitHub Flow for HPC team in 250 words.
Chapter 11 — C++ Basics¶
Beginner¶
- Compile hello.
g++ hello.cpp -o hello. - Print "hi".
std::cout << "hi" << std::endl;. - Declare int.
int a=5;. - Address of a.
&a. - Pointer to a.
int *p=&a;.
Intermediate¶
- Loop length 5.
for(int i=0;i<5;++i) .... - Pass by reference.
void f(int& a). - Class with public method. See Complex.
- Init list.
T():a(0){}. using namespace stdbad in headers. Name pollution.
Hard¶
- Why call-by-value doesn't modify caller? Copy.
int *p; *p=5;. Uninitialised pointer.deletevsdelete[]. Single object vs array.- Why
endlslow. Flushes buffer. - Returning class by value. Uses copy/move.
Very Hard¶
- Why
const Field&? Avoid expensive copies. - Stack vs heap. Auto vs
new/delete; lifetime. - Forgot
;after class. Cascading errors.
Deep Integration¶
- Pointer arithmetic ↔ SIMD vectorisation. Contiguous memory, stride 1.
- RAII vs
new/delete. Constructor acquires, destructor releases — exception-safe.
Coding/Command¶
- swap by reference.
void swap(int&a,int&b){int t=a;a=b;b=t;}. - Add
operator+to Complex. See Ch. 11 §9.7.
Debugging¶
puninit when reading.p=&afirst.c.x=5private. Use accessor or make public.
Long Written¶
- Why HPC kernels avoid copying — by-ref vs ptr (250 words).
Chapter 12 — Build Process¶
Beginner¶
- Default executable name.
a.out. - Include path flag.
-I path. - Library path.
-L path. - Link math.
-lm. make cleantypically. Remove generated.
Intermediate¶
- Compile single to .o.
g++ -c file.cpp. - Link two .o.
g++ a.o b.o -o prog. - Build static lib.
ar rcs libx.a a.o b.o. - Build shared lib.
g++ -shared -fPIC -o libx.so a.cpp b.cpp. - List symbols.
nm libx.a.
Hard¶
- Why
-fPICfor shared. PIC: relative addressing for variable load addresses. - Why
makerebuilds only changed. Timestamp comparison. LD_LIBRARY_PATH. Runtime lib search dirs.-Lvs-l. Path vs library name.rpath. Embedded run-time lib paths.
Very Hard¶
lddshowsnot found. Missing .so in search paths.- Find heavy header.
g++ -H -c …. make -j$(nproc)faster. Parallel build.
Deep Integration¶
- Header guards + templates + inline. Templates/inline must be in headers; guards prevent dup non-inline non-template defs.
- CMake adoption in CFD. Portability + dependencies + tests + install.
Coding/Command¶
- Makefile rule for Complex.h-aware .cpp→.o. See Ch.12 §6.6.
- CMakeLists for same project. See harder version.
Debugging¶
Makefile:5: missing separator. Use TAB.undefined reference to add(int,int). Forgot to compile/linkadd.cpp.
Long Written¶
- Make vs CMake for 100-file CFD project (250 words).
Chapter 13 — Debugging¶
Beginner¶
- Debug compile flag.
-g. - Start gdb.
gdb ./prog. - Set breakpoint.
break 10. - Run.
run. - Print var.
print x.
Intermediate¶
- Step into vs over.
step/next. - Print 5-element array.
p *arr@5. - Run to function end.
finish. - Show stack.
backtrace. - Detect leaks.
valgrind --leak-check=full.
Hard¶
<optimized out>. Compiled with-O2+.- Pause when i==100.
watch i; cond N i==100. - Inspect register.
info registers; p $rax. - Set var from gdb.
set var x = 5. - Attach to process.
gdb -p <pid>.
Very Hard¶
- Reverse-debug.
record full; reverse-step. - Debug optimized build.
-O2 -g -fno-omit-frame-pointer. - Debug MPI rank.
mpirun gdbor attach to PID.
Deep Integration¶
- Sanitizer in CI. Build with ASan; fail on errors.
- Why leaks bad in CFD jobs. OOM; growing per iteration.
Coding/Command¶
- One-liner with ASan.
g++ -O1 -g -fsanitize=address prog.cpp && ./a.out. - gdb finding debug03 NULL deref. See Ch.13 §6.3.
Debugging¶
- No core file.
ulimit -c unlimited. - valgrind "uninitialised value". Use
--track-origins=yes.
Long Written¶
- gdb on debug05 step-by-step (250 words).
Chapter 14 — Parallelization¶
Beginner¶
- OpenMP for? Shared-memory.
- MPI for? Distributed-memory.
- MPI compile.
mpic++ -O2 a.cpp -o a. - Run with 4 ranks.
mpirun -n 4 ./a. - Default communicator.
MPI_COMM_WORLD.
Intermediate¶
- Amdahl.
S=1/(f+(1-f)/N). - rank vs size. ID vs total.
- Why
reduction? Avoid race. - Datatype double.
MPI_DOUBLE. - Tag. Message label for matching.
Hard¶
- Send/Recv size mismatch. Error or hang.
- Blocking vs non-blocking. Returns when safe vs immediately + Wait.
MPI_Allreduce. Reduce + broadcast.- Why halo cells? Avoid per-cell communication.
schedule(dynamic)better when? Variable iteration cost.
Very Hard¶
- Why more ranks slow down beyond a point? Strong-scaling: communication > compute.
- Avoid load imbalance. ParMETIS partitioning by cost.
MPI_Sendrecvvs separate. Atomic exchange; deadlock-free for pairwise.
Deep Integration¶
- MPI + OpenMP + GPU. MPI between, OpenMP within node, OpenACC/CUDA on GPU.
- Why GPU CFD still needs MPI. Multi-GPU multi-node.
Coding/Command¶
- OpenMP doubles array.
- Broadcast int.
MPI_Bcast(&x,1,MPI_INT,0,MPI_COMM_WORLD);.
Debugging¶
- Hang on 2 ranks. Both Recv first; reorder or
Sendrecv. - Race wrong sum. Add
reduction(+:sum).
Long Written¶
- Why hybrid MPI+OpenMP dominates CFD (250 words).
Chapter 15 — HPC Cluster¶
Beginner¶
- Where jobs run. Compute nodes.
- List software.
module avail. - Submit job.
sbatch script.sh. - See queue.
squeue. - Cancel job.
scancel ID.
Intermediate¶
- Reserve interactively.
srun --pty --nodes=1 bash. - Heavy I/O location.
$WORK. - OpenMP threads from SLURM.
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK. - Job 99 details.
scontrol show job 99. - Module file-search.
module spider <name>.
Hard¶
- Job dependencies.
sbatch --dependency=afterok:<id>. ntasksvscpus-per-task. MPI ranks vs OpenMP threads.- Pin processes to cores.
--cpu-bind=cores/OMP_PROC_BIND=true. - Why
module purgefirst. Reproducible environment. sinfoshows what. Partition names + limits.
Very Hard¶
sbatchovernohup. Scheduler accounting + isolation + restart.- Lustre stripes. File split across OSTs for parallel I/O.
- Why checkpoint long jobs. Walltime kill recovery.
Deep Integration¶
- Git + module + SLURM. Ch.15 §7.
- Why record
module list. Reproducibility.
Coding/Command¶
srunfor 4 ranks 1 hour gpu partition.srun --pty --partition=gpu --nodes=1 --ntasks=4 --gres=gpu:1 --time=1:00:00 bash.- Wait until own jobs end.
until [ -z "$(squeue -h -u $USER)" ]; do sleep 60; done.
Debugging¶
- "Permission denied" running job.
chmod +xor wrong path. - Pending forever. Too many nodes/walltime.
Long Written¶
sallocinteractive vssbatchbatch (250 words).
Mixed-Topic Integration Questions¶
- Edit→commit→push→build→submit→post-process pipeline. Combine Vim + Git + ssh + Makefile/CMake + sbatch + awk + gnuplot. Reference each chapter.
- Why does
rsync -avzmatter forgit cloneon a cluster? Not directly; butrsyncfor big result transfer +gitfor code. - Predict residuals time series for a CFD case based on the script in Ch.7 §7. Apply pipeline mentally.
- Why does compile + sanitizer + valgrind matter together? Sanitizers fast pass, valgrind deep audit; the build step decides.
- How many cores total in a SBATCH
nodes=4 ntasks-per-node=2 cpus-per-task=8? 64.
End of question bank.