OpenMPI (mpirun) Keyboard Shortcuts

Complete OpenMPI (mpirun) keyboard shortcuts and commands reference — 12 shortcuts across 2 categories. Quick reference cheat sheet for Windows & Mac.

mpirun is Open MPI's launcher, and its flags decide where processes land and how they are pinned, which for a GPU or HPC job matters as much as the code. The table lists the launch and environment options an operator actually types; the notes explain mapping versus binding, which is the distinction most tutorials blur.

Launching (6)

ShortcutActionDescription
mpirun -n 4 ./progRun N processesLaunch 4 copies of the program across the allocated resources.
--hostfile hosts.txtHost fileSpecify a file listing hosts and slot counts to run on.
-H host1,host2Host listComma-delimited list of hosts to launch processes on directly.
-N 4Processes per nodeLaunch 4 processes on each allocated node (synonym: --npernode).
--map-by nodeMapping policyDistribute processes round-robin across nodes instead of filling one node first.
--bind-to coreCPU bindingBind each process to a specific CPU core for consistent performance.

Environment & Debugging (6)

ShortcutActionDescription
-x VARExport env variableExport an environment variable from the launching shell to every process.
--mca key valueSet MCA parameterPass a Modular Component Architecture parameter to tune Open MPI's behavior.
--allow-run-as-rootAllow rootPermit mpirun to launch as the root user; discouraged outside containers.
--display-mapShow process mapPrint the mapped location of every process before launch, useful for debugging placement.
--oversubscribeOversubscribeAllow launching more processes than available CPU slots.
-VVersionPrint the Open MPI version and exit.
📜 Source: Open MPI documentation — mpirun(1). Options from the Open MPI 5 mpirun manual page. Checked 2026-09-06. How we verify ›
📄 View Printable Cheat Sheet — Download as PDF or print · 🧩 Combine with other tools

Frequently Asked Questions

What are the most useful OpenMPI (mpirun) keyboard shortcuts?

The most essential OpenMPI (mpirun) shortcuts are: mpirun -n 4 ./prog (Run N processes), --hostfile hosts.txt (Host file), -H host1,host2 (Host list).

How do I use OpenMPI (mpirun) commands?

These are command-line commands — type them in your terminal or console. Combine them with shell history search (Ctrl + R) and aliases to work even faster.

What is the OpenMPI (mpirun) shortcut for run n processes?

The OpenMPI (mpirun) shortcut for run n processes is mpirun -n 4 ./prog. Launch 4 copies of the program across the allocated resources.

Can I combine OpenMPI (mpirun) shortcuts with other tools?

Yes — use My Stack to combine OpenMPI (mpirun) shortcuts with any other platform on this site into one printable reference, which is useful if your daily workflow spans several tools.

Related Shortcut Pages

NCCL Tests OSU Micro-Benchmarks Intel MPI Benchmarks (IMB) HPL (Linpack) Slurm torchrun Mellanox / InfiniBand NVIDIA DCGM nvidia-smi (GPU)

Search 18,500+ shortcuts across 268 platforms

Explore All Platforms Practice Shortcuts
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.

Where processes run

mpirun -n 4 ./prog starts four ranks on the local host or the hosts Open MPI knows about. --hostfile hosts.txt names the hosts (with a slots= count per line) and -H host1,host2 lists them inline; -N 4 puts exactly four ranks on each node. Under Slurm none of this is needed — mpirun reads the allocation from the environment, and srun can launch directly.

Mapping and binding

Mapping decides the order ranks are assigned to resources and binding decides what each rank is pinned to. --map-by node distributes ranks round-robin across nodes (rank 0 on node A, rank 1 on node B…) rather than filling one node first, which balances memory bandwidth; --map-by ppr:1:numa is the usual form for one GPU per NUMA domain. --bind-to core locks every rank onto its own core, preventing the OS from migrating it, and is the single flag most likely to raise a benchmark score. --display-map prints the resulting layout before the program starts, and should be checked once per new cluster. --oversubscribe allows more ranks than slots, for testing on a laptop.

Environment and MCA

-x VAR exports an environment variable to every rank (-x LD_LIBRARY_PATH -x NCCL_DEBUG=INFO), which is how library paths and debugging flags reach remote hosts. --mca key value sets an Open MPI internal parameter — btl_tcp_if_include eth0 to choose a network, pml ucx to select the transport — and ompi_info --param all all lists them. --allow-run-as-root is required inside containers running as root; -V prints the version.

🤖 Ask AI about OpenMPI (mpirun) shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok