MPI Getting Started: Installing oneAPI and Your First Parallel Environment
Abstract: Multi-node computing starts with a working MPI. This article walks the full offline installation of Intel oneAPI Base + HPC Toolkit (the standard approach for air-gapped delivery), environment loading, and verification — fully reproducible.
1. Why MPI
Within one node, OpenMP/threads are enough; across nodes you need message passing — MPI. HPL, most traditional HPC apps, and many scientific codes run on MPI.
Stack used here: Intel oneAPI (Intel MPI + MKL). Offline packages are large (Base ~3.5 GB, HPC ~1.3 GB); offline installation is the norm for internal delivery.
2. Prepare the Installers
l_BaseKit_p_2021.1.0.2659_offline.sh # Base Toolkit
l_HPCKit_p_2021.1.0.2684_offline.sh # HPC Toolkit (contains MPI)Why both packages
Base Toolkit provides compilers and MKL; HPC Toolkit provides Intel MPI. HPC without Base breaks MPI compile/link against the basic libraries.
3. Silent Installation
# Base Toolkit
sh l_BaseKit_p_2021.1.0.2659_offline.sh -a --cli
# HPC Toolkit (install into the SAME root as Base, or MPI won't find the compiler)
sh l_HPCKit_p_2021.1.0.2684_offline.sh -a --cli-a: accept agreement--cli: command-line interface (required on headless servers)- Default install root:
/opt/intel2021/oneapi
Resulting layout:
/opt/intel2021/oneapi/
├── compiler/latest # DPC++/C++ compilers
├── mkl/latest # math kernel library
├── mpi/latest # Intel MPI
└── setvars.sh # environment entry point4. Load the Environment (Two Ways)
4.1 source setvars.sh (recommended)
source /opt/intel2021/oneapi/setvars.sh intel64 --force4.2 module mode
# generate modulefiles (once)
sh /opt/intel2021/oneapi/modulefiles-setup.sh
# oneAPI modulefiles folder is here: "/opt/intel2021/oneapi/modulefiles"
# load when needed
module load mpi/2021.1.15. Verify
which mpirun
# /opt/intel2021/oneapi/intelpython/latest/bin/mpirun
which mpicc
mpirun --version
# Intel(R) MPI Library for Linux* OS, Version 2021.x6. First Command
lscpu | grep -E "^CPU\(s\)|Core|Socket|Model name"7. Common Pitfalls
7.1 mpirun: command not found
Cause: fresh shell without source setvars.sh / module load. MPI is not on PATH.
source /opt/intel2021/oneapi/setvars.sh intel64 --force7.2 Multi-node connection failures
- Confirm passwordless SSH between nodes
- hostfile: one node name/IP per line
- specify the fabric (see next article)
7.3 What --force does
setvars.sh may refuse to overwrite existing variables in non-interactive/multi-version shells; --force overrides. Keep it.
8. Next Step
With the environment ready, MPI Hello World in Practice walks compile → single-node multi-rank → multi-node.