Message Passing Interface (MPI) is a standardized and portable message-passing standard designed to function on parallel computing architectures.
The MPI standard defines the syntax and semantics of library routines that are useful to a wide range of users writing portable message-passing programs in C, C++, and Fortran. There are several open-source MPI implementations, which fostered the development of a parallel software industry, and encouraged development of portable and scalable large-scale parallel applications.1
-
MPICH
-
Open MPI
Open MPI: Open Source High Performance Computing
open-mpi/ompi: Open MPI main development repository
支持 vcpkg。
官方已经停止支持 Windows,但 Cygwin 提供了支持。
-
Intel MPI
-
Microsoft MPI(MS-MPI)
Microsoft MPI - Message Passing Interface | Microsoft Docs
microsoft/Microsoft-MPI: Microsoft MPI
支持 vcpkg。
两年没提交了,只支持 MPI 2.2 和部分 MPI 3.1。
Installing MPI for Windows - Stack Overflow
Chapter 24. Boost.MPI - 1.79.0
2007 年停止维护,只支持到 MPI 1.1。
#include <boost/mpi.hpp>
#include <iostream>
int main(int argc, char* argv[])
{
boost::mpi::environment env(argc, argv);
boost::mpi::communicator world;
if (world.rank() == 0) {
world.send(1, 9, 32);
world.send(2, 9, 33);
} else {
int data;
world.recv(0, 9, data);
std::cout << "In process " << world.rank( ) << "with data " << data
<< std::endl;
// In process 1 with data 32
// In process 2 with data 33
}
return 0;
}MPI is a form of IPC.3 MPI is optimized for efficient, low-latency communication on reliable networks.
Thrift, ProtoBuf, JSON are slow serialization formats that exist primarily for portability and compactness and not for computational efficiency or low latency. You would lose a lot of performance using those for many parallel codes.4

