Skip to content

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 ​

bash
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 ​

bash
# 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:

text
/opt/intel2021/oneapi/
├── compiler/latest      # DPC++/C++ compilers
├── mkl/latest           # math kernel library
├── mpi/latest           # Intel MPI
└── setvars.sh           # environment entry point

4. Load the Environment (Two Ways) ​

bash
source /opt/intel2021/oneapi/setvars.sh intel64 --force

4.2 module mode ​

bash
# 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.1

5. Verify ​

bash
which mpirun
# /opt/intel2021/oneapi/intelpython/latest/bin/mpirun

which mpicc

mpirun --version
# Intel(R) MPI Library for Linux* OS, Version 2021.x

6. First Command ​

bash
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.

bash
source /opt/intel2021/oneapi/setvars.sh intel64 --force

7.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.

AI-HPC Expert · Contact: openaihpc@gmail.com