HPC MPI
Treat MPI as a three-layer surface: implementation choice, build or wrapper semantics, and launcher behavior inside the target scheduler.
Start
- Read
references/mpi-implementation-matrix.mdbefore choosing or repairing an MPI stack. - Read
references/launcher-semantics.mdwhen deciding betweensrun,mpirun,mpiexec, Hydra, or a site wrapper. - Read
references/wrapper-compilers-and-build.mdwhen compiling withmpiccormpicxxormpifort, linking dependencies, or mixing MPI and non-MPI toolchains. - Read
references/rank-thread-binding-matrix.mdwhen selecting MPI rank counts, OpenMP threads, affinity, or NUMA placement. - Read
references/pmi-pmix-and-environment-propagation.mdwhen PMI or PMIx integration, environment forwarding, or batch-shell drift is in doubt. - Read
references/scheduler-integration-playbook.mdwhen launching under Slurm, PBS, or LSF. - Read
references/runtime-debugging-and-observability.mdwhen ranks hang, crash, oversubscribe, or report inconsistent environment state. - Read
references/error-pattern-dictionary.mdwhen an MPI build or runtime failure needs a fast pattern match.
Work sequence
- Identify the active MPI family first:
- Open MPI
- MPICH or Hydra-derived stack
- Intel MPI
- MVAPICH2
- site-specific wrapper around one of those families
- Keep compiler wrappers and runtime launcher from the same stack.
- Decide whether the scheduler should launch ranks directly or whether the MPI launcher should do it.
- Make rank count, CPUs per rank,
OMP_NUM_THREADS, and binding policy mutually consistent. - Reproduce failures on the smallest rank count that still shows the issue before scaling back out.
Guardrails
- Do not mix
mpiccfrom one MPI stack withmpirunfrom another. - Do not assume
mpirunandsrunare interchangeable on a managed cluster. - Do not tune binding or transport variables before confirming the rank geometry is coherent.
- Do not debug collectives or hangs at production scale first when a two-rank or four-rank reproduction is possible.
Additional References
Load these on demand:
references/mpi-implementation-matrix.mdfor family selection and compatibility boundariesreferences/launcher-semantics.mdfor launcher-specific expectations and scheduler handoffreferences/wrapper-compilers-and-build.mdfor compiler-wrapper usage and link hygienereferences/rank-thread-binding-matrix.mdfor affinity and hybrid MPI plus OpenMP choicesreferences/pmi-pmix-and-environment-propagation.mdfor scheduler handoff, PMI or PMIx expectations, and batch-shell environment propagationreferences/scheduler-integration-playbook.mdfor Slurm or PBS or LSF integration detailreferences/runtime-debugging-and-observability.mdfor hang triage, rank-local logging, and environment inspectionreferences/error-pattern-dictionary.mdfor common MPI failure signatures
Reusable Templates
Use assets/templates/ when a concrete starting point is faster than rebuilding the MPI workflow from scratch, especially:
mpi_hello_world.cmpi_compile_example.shmpi_hello_slurm.shmpi_hybrid_slurm.sh
Outputs
Summarize:
- active MPI family or the ambiguity that still needs to be resolved
- compile and launcher path chosen
- rank or thread or binding geometry
- scheduler integration assumptions
- the exact build or runtime failure class if the workflow is being repaired
Scan to join WeChat group