Environment, docs and exam problems for High Performance Computing System class in UCAS (180086081201P3004H).
See questions directory for problems and full code solutions.
To setup reproducible OpenMPI environment, we use devcontainers. Read on for instructions.
- Docker
- VS Code Dev Containers
No sudo needed if current user can run Docker.
Open this repository in VS Code, then run:
Dev Containers: Reopen in ContainerTerminal > Run Build Task(Ctrl+Shift+B)Terminal > Run Task... > MPI: run hello
Expected output has one line per MPI process:
process 0 of 4 is running
process 1 of 4 is running
process 2 of 4 is running
process 3 of 4 is running
Line order may vary.
To build and run:
mkdir -p build
mpicc -O2 -Wall -Wextra -std=c11 examples/hello.c -o build/hello
HWLOC_COMPONENTS=-gl mpirun --oversubscribe -np 4 build/helloHWLOC_COMPONENTS=-gl avoids a harmless No protocol specified message from hwloc's GL/X11 device probe inside the dev container.
- Open MPI doc
- MPI Tutorial (cloned as submodule at
./mpitutorial/)
- Tutorial list
- Intro
- Install MPICH2
- Hello world -
MPI_Init,MPI_Comm_size,MPI_Comm_rank,MPI_Finalize - Send/receive -
MPI_Send,MPI_Recv, tags, ring, ping-pong - Probe/status - dynamic receive size,
MPI_Probe,MPI_Status - Random walk - point-to-point app, domain decomposition, deadlock notes
- Broadcast/collectives intro -
MPI_Bcast,MPI_Barrier - Scatter/gather/allgather -
MPI_Scatter,MPI_Gather,MPI_Allgather - Parallel rank - collective-based rank computation
- Reduce/allreduce -
MPI_Reduce,MPI_Allreduce, average, stddev - Groups/communicators - groups, custom communicators,
MPI_Comm_split