Skip to content

Latest commit

 

History

History
88 lines (57 loc) · 3.54 KB

File metadata and controls

88 lines (57 loc) · 3.54 KB

Message Passing Interface

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

Issues · mpi-forum/mpi-issues

Implementations

Installing MPI for Windows - Stack Overflow

Microsoft MPI

Boost.MPI

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;
}

2

IPC

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

Footnotes

  1. Message Passing Interface - Wikipedia

  2. Concurrent programming with Boost using IPC and MPI libraries - IBM Developer

  3. What's the difference between IPC and MPI conceptually and implementation? - Quora

  4. Heterogeneous Parallel Programming | Hacker News