mpi - MPI、MPICH 和 OPENMPI 究竟是什么? "implementation"在这种情况下是什么意思?

标签 mpi openmpi mpich

对于长期从事该领域的人来说,我的问题可能看起来很愚蠢,但我感谢您耐心地为我详细阐述。

当他们说 MPICH 是 MPI 的“实现”时,这是什么意思?

下面的类比是否正确(?): 如果我们将 MPI 视为 FORTRAN 编译器的一组标准,那么 MPICH 和 OPENMPI 就是 FORTRAN 编译器的不同版本,如 Intel.Fortran、Compaq.Fortran、GNU.Fortran 等。

最佳答案

MPI 是一个标准:它概述了分布式系统中消息传递的特定模型。然而,它只是给出了一系列的要求:它实际上并不包含任何代码,也没有具体说明这些要求究竟需要如何实现。例如,看一下官方 MPI 2.2 规范(截至今天)的摘录:

A valid MPI implementation guarantees certain general properties of point-to-point communication, which are described in this section.

Order Messages are non-overtaking: If a sender sends two messages in succession to the same destination, and both match the same receive, then this operation cannot receive the second message if the first one is still pending.

然后它继续解释此要求背后的基本原理并提供示例,但没有更多地说明要求本身。

MPI 实现是一个库,它满足 MPI 规范中的所有要求(如上述要求)。但是,该标准绝对不包含关于可以/不能/应该使用什么语言构造、操作系统调用、第 3 方库等的要求。偶尔,它会向实现者提供建议,如下所示:

Advice to implementors. The implementation may keep a reference count of active communications that use the datatype, in order to decide when to free it. Also, one may implement constructors of derived datatypes so that they keep pointers to their datatype arguments, rather then copying them. In this case, one needs to keep track of active datatype definition references in order to know when a datatype object can be freed. (End of advice to implementors.)

然而,这些仍然含糊不清,与语言无关,而且只是建议:实现可以忽略这些建议中的每一个,但仍然符合标准。

所以是的,本质上它类似于编译器的各种实现。如果一个程序采用一种语言的有效源代码,并生成二进制代码来执行语言规范规定的所有原始源代码应该做的事情,那么它就是该语言的符合标准的编译器。同样,如果您可以使用一个库以不违反 MPI 规范任何规则的方式传递消息,那么这就是一个有效的 MPI 实现。

关于mpi - MPI、MPICH 和 OPENMPI 究竟是什么? "implementation"在这种情况下是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11301388/

相关文章:

c++ - 通过 MPI 发送 Lambda 闭包

c - MPI_Comm_rank 总是写 0

c++ - 如何在 MPI 中创建新类型

c++ - Boost.MPI/Boost.Interprocess - 如何检测进程是否在同一台机器上运行?

python - 在 Windows 上使用 Anaconda 通过 mpio 配置 H5py

java - 使用 MPI 分配进程

c++ - 在 openMPI、C++ 中发送 ImageMagick 对象

security - MPI 实现(OpenMPI、MPICH)如何处理安全/身份验证

c++ - mpirun 不工作并要求将 TMPDIR 变量更改为/tmp

MPI:MPICH2 局域网内安装和编程,使用 Windows