为高性能计算提供高效、可扩展的消息传递解决方案
Intel® MPI Library 是由英特尔开发的高性能消息传递接口(Message Passing Interface, MPI)实现, 专为在集群和多节点系统上运行的并行应用程序设计。 它兼容 MPI-3.1 标准,并针对英特尔架构进行了深度优化,支持多种互连网络(如 InfiniBand、Omni-Path、以太网等)。
核心优势:高可移植性、卓越性能、自动调优、与 Intel oneAPI 工具链无缝集成。
以下是一个简单的 "Hello World" MPI 程序(C语言):
#include <mpi.h>
#include <stdio.h>
int main(int argc, char** argv) {
MPI_Init(&argc, &argv);
int world_rank, world_size;
MPI_Comm_rank(MPI_COMM_WORLD, &world_rank);
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
printf("Hello from rank %d of %d!\n", world_rank, world_size);
MPI_Finalize();
return 0;
}
编译与运行命令(需已安装 Intel MPI):
# 编译
mpiicc hello.c -o hello
# 运行(本地双进程)
mpirun -n 2 ./hello
Intel MPI 可通过以下方式获取:
安装后,加载环境变量:
source /opt/intel/oneapi/setvars.sh