---
title: 产品介绍
description: "MPI（Message Passing Interface）是一种支持多语言编程的并行计算通信应用接口规范，它定义了一组函数和语法规则，使得多个进程可以在不同的计算机节点上协同工作，并共同完成一个任务。MPI有多种实现，例如Open MPI、Intel MPI、MPICH等。"
url: https://www.hikunpeng.com/document/detail/zh/hpchistory/hpckit/develop2400/userg_huaweimpi_0003.html
sourcePath: /source/zh/hpchistory/hpckit/develop2400/userg_huaweimpi_0003.html
indexId: 22c92b776af8c9f7e359510b8d3237614878486f1875b0c2e28f9eae23607d6666
---
# 产品介绍

#### 概念介绍

MPI（Message Passing Interface）是一种支持多语言编程的并行计算通信应用接口规范，它定义了一组函数和语法规则，使得多个进程可以在不同的计算机节点上协同工作，并共同完成一个任务。MPI有多种实现，例如Open MPI、Intel MPI、MPICH等。

Hyper MPI（简称HMPI）是在Open MPI的基础上，结合Open UCX（Unified Communication X）框架的点对点通信操作，开发出专为集合通信优化的UCG（Unified Communication Group）框架，该框架中实现了多种集合操作加速算法。Hyper MPI具有高性能、大规模性、可移植性等特点，支持制造、气象和基因测序等场景解决方案，致力于构建以鲲鹏服务器为坚实硬件基础的高性能计算生态。


#### 价值

MPI支持点对点通信和集合通信，可以实现多种通信模式，例如广播、散射、聚集等。其中，仅MPI 3.1标准中定义的集合通信函数就高达30多种。在众多集合通信操作函数中，Allreduce、Bcast、Barrier、Alltoallv、Allgatherv、Gatherv和Scatterv的调用频率较高。

Hyper MPI在集合通信模式中，不管是大包数据，还是小包数据，它的通信性能相较于其它MPI的实现，具有以下优势：

- 高性能优化
  Hyper MPI针对Allreduce、Bcast、Barrier、Alltoallv、Allgatherv、Gatherv和Scatterv集合通信函数实现基于拓扑感知的算法优化（包括非阻塞接口）。Hyper MPI相较于开源Open MPI，集合通信性能有较高提升。

- 构筑自由生态
  Hyper MPI开源发布，专为以鲲鹏芯片为核心构建的服务器与大规模集群量身打造。鲲鹏服务器凭借单节点核数众多、指令集设计精简、能耗效率卓越以及极具竞争力的价格优势，与Hyper MPI相辅相成，共同构筑起一个高效、经济的高性能计算生态。


#### 功能

- Hyper MPI支持MPI 3.1标准，主要优化的集合通信操作如  表1
所示。
  Hyper MPI集合通信算法支持最大发送数据包长度为232字节。

**表1 集合通信操作说明**

| 集合操作名称 | 函数简介 | 阻塞接口函数原型 | 非阻塞接口函数原型 |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Allreduce | Allreduce是MPI组规约函数。 作用：将各个独立进程中的send buffer进行数学（例如加法、乘法）或逻辑（例如与、或）运算，然后将结果同步到通信域内所有进程的receive buffer中。 | 1 int MPI\_Allreduce(void \*sendbuf, void \*recvbuf, int count, MPI\_Datatype datatype, MPI\_Op op, MPI\_Comm comm) | 1 | int MPI\_Allreduce(void \*sendbuf, void \*recvbuf, int count, MPI\_Datatype datatype, MPI\_Op op, MPI\_Comm comm) | 1 int MPI\_Iallreduce(const void \*sendbuf, void \*recvbuf, int count, MPI\_Datatype datatype, MPI\_Op op, MPI\_Comm comm, MPI\_Request \*request) | 1 | int MPI\_Iallreduce(const void \*sendbuf, void \*recvbuf, int count, MPI\_Datatype datatype, MPI\_Op op, MPI\_Comm comm, MPI\_Request \*request) |
| 1 | int MPI\_Allreduce(void \*sendbuf, void \*recvbuf, int count, MPI\_Datatype datatype, MPI\_Op op, MPI\_Comm comm) |  |  |  |  |  |  |
| 1 | int MPI\_Iallreduce(const void \*sendbuf, void \*recvbuf, int count, MPI\_Datatype datatype, MPI\_Op op, MPI\_Comm comm, MPI\_Request \*request) |  |  |  |  |  |  |
| Bcast | Bcast是MPI广播操作函数。 作用：root进程将buffer中的信息发送给通信域内其余进程，使得所有进程获取相同的信息。 | 1 int MPI\_Bcast(void \*buffer, int count, MPI\_Datatype datatype, int root, MPI\_Comm comm) | 1 | int MPI\_Bcast(void \*buffer, int count, MPI\_Datatype datatype, int root, MPI\_Comm comm) | 1 int MPI\_Ibcast(void \*buffer, int count, MPI\_Datatype datatype, int root, MPI\_Comm comm, MPI\_Request \*request) | 1 | int MPI\_Ibcast(void \*buffer, int count, MPI\_Datatype datatype, int root, MPI\_Comm comm, MPI\_Request \*request) |
| 1 | int MPI\_Bcast(void \*buffer, int count, MPI\_Datatype datatype, int root, MPI\_Comm comm) |  |  |  |  |  |  |
| 1 | int MPI\_Ibcast(void \*buffer, int count, MPI\_Datatype datatype, int root, MPI\_Comm comm, MPI\_Request \*request) |  |  |  |  |  |  |
| Barrier | Barrier是MPI同步函数。 作用：该通信域中全部进程进行同步操作，即保证进程调用函数后具有良好的同步性。 | 1 int MPI\_Barrier(MPI\_Comm comm) | 1 | int MPI\_Barrier(MPI\_Comm comm) | 1 int MPI\_Ibarrier(MPI\_Comm comm, MPI\_Request \*request) | 1 | int MPI\_Ibarrier(MPI\_Comm comm, MPI\_Request \*request) |
| 1 | int MPI\_Barrier(MPI\_Comm comm) |  |  |  |  |  |  |
| 1 | int MPI\_Ibarrier(MPI\_Comm comm, MPI\_Request \*request) |  |  |  |  |  |  |
| Alltoallv | Alltoallv是MPI多对多通信函数。 作用：该通信域中全部进程进行点对点通信操作，发送数据至其他进程，并从其他进程接收数据，且通信中每个进程发送和接收的长度可变。 | 1 int MPI\_Alltoallv(const void \*sendbuf, const int sendcounts[], const int sdispls[], MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int rdispls[], MPI\_Datatype recvtype, MPI\_Comm comm) | 1 | int MPI\_Alltoallv(const void \*sendbuf, const int sendcounts[], const int sdispls[], MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int rdispls[], MPI\_Datatype recvtype, MPI\_Comm comm) | 1 int MPI\_Ialltoallv(const void \*sendbuf, const int sendcounts[], const int sdispls[], MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int rdispls[], MPI\_Datatype recvtype, MPI\_Comm comm, MPI\_Request \*request) | 1 | int MPI\_Ialltoallv(const void \*sendbuf, const int sendcounts[], const int sdispls[], MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int rdispls[], MPI\_Datatype recvtype, MPI\_Comm comm, MPI\_Request \*request) |
| 1 | int MPI\_Alltoallv(const void \*sendbuf, const int sendcounts[], const int sdispls[], MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int rdispls[], MPI\_Datatype recvtype, MPI\_Comm comm) |  |  |  |  |  |  |
| 1 | int MPI\_Ialltoallv(const void \*sendbuf, const int sendcounts[], const int sdispls[], MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int rdispls[], MPI\_Datatype recvtype, MPI\_Comm comm, MPI\_Request \*request) |  |  |  |  |  |  |
| Allgatherv | Allgatherv是MPI数据收集函数。 作用：收集该通信域中每个进程可变的数据，并将收集的数据传送给该通信域中的所有进程。 | 1 int MPI\_Allgatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int displs[], MPI\_Datatype recvtype, MPI\_Comm comm) | 1 | int MPI\_Allgatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int displs[], MPI\_Datatype recvtype, MPI\_Comm comm) | 1 int MPI\_Iallgatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int displs[], MPI\_Datatype recvtype, MPI\_Comm comm, MPI\_Request \*request) | 1 | int MPI\_Iallgatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int displs[], MPI\_Datatype recvtype, MPI\_Comm comm, MPI\_Request \*request) |
| 1 | int MPI\_Allgatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int displs[], MPI\_Datatype recvtype, MPI\_Comm comm) |  |  |  |  |  |  |
| 1 | int MPI\_Iallgatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int displs[], MPI\_Datatype recvtype, MPI\_Comm comm, MPI\_Request \*request) |  |  |  |  |  |  |
| Scatterv | Scatterv是MPI数据分发函数。 作用：该通信域中根进程将不同的数据块分发给该通信域中不同的进程。 | 1 int MPI\_Scatterv(const void \*sendbuf, const int sendcounts[], const int displs[], MPI\_Datatype sendtype, void \*recvbuf, int recvcount, MPI\_Datatype recvtype, int root, MPI\_Comm comm) | 1 | int MPI\_Scatterv(const void \*sendbuf, const int sendcounts[], const int displs[], MPI\_Datatype sendtype, void \*recvbuf, int recvcount, MPI\_Datatype recvtype, int root, MPI\_Comm comm) | 1 int MPI\_Iscatterv(const void \*sendbuf, const int sendcounts[], const int displs[], MPI\_Datatype sendtype, void \*recvbuf, int recvcount, MPI\_Datatype recvtype, int root, MPI\_Comm comm, MPI\_Request \*request) | 1 | int MPI\_Iscatterv(const void \*sendbuf, const int sendcounts[], const int displs[], MPI\_Datatype sendtype, void \*recvbuf, int recvcount, MPI\_Datatype recvtype, int root, MPI\_Comm comm, MPI\_Request \*request) |
| 1 | int MPI\_Scatterv(const void \*sendbuf, const int sendcounts[], const int displs[], MPI\_Datatype sendtype, void \*recvbuf, int recvcount, MPI\_Datatype recvtype, int root, MPI\_Comm comm) |  |  |  |  |  |  |
| 1 | int MPI\_Iscatterv(const void \*sendbuf, const int sendcounts[], const int displs[], MPI\_Datatype sendtype, void \*recvbuf, int recvcount, MPI\_Datatype recvtype, int root, MPI\_Comm comm, MPI\_Request \*request) |  |  |  |  |  |  |
| Gatherv | Gatherv是MPI数据收集函数。 作用：收集该通信域中每个进程可变的数据。 | 1 int MPI\_Gatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int \*recvcounts, const int \*displs, MPI\_Datatype recvtype, int root, MPI\_Comm comm) | 1 | int MPI\_Gatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int \*recvcounts, const int \*displs, MPI\_Datatype recvtype, int root, MPI\_Comm comm) | 1 int MPI\_Igatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int displs[], MPI\_Datatype recvtype, int root, MPI\_Comm comm, MPI\_Request \*request) | 1 | int MPI\_Igatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int displs[], MPI\_Datatype recvtype, int root, MPI\_Comm comm, MPI\_Request \*request) |
| 1 | int MPI\_Gatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int \*recvcounts, const int \*displs, MPI\_Datatype recvtype, int root, MPI\_Comm comm) |  |  |  |  |  |  |
| 1 | int MPI\_Igatherv(const void \*sendbuf, int sendcount, MPI\_Datatype sendtype, void \*recvbuf, const int recvcounts[], const int displs[], MPI\_Datatype recvtype, int root, MPI\_Comm comm, MPI\_Request \*request) |  |  |  |  |  |  |


- Hyper MPI支持Singularity容器化，即支持将Hyper MPI部署在Singularity容器中。
