MPI是范式还是一组库? [英] Is MPI a paradigm or a set of libraries?

查看:76
本文介绍了MPI是范式还是一组库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在学习并行计算入门课程,班主任将MPI描述为:-

I am currently taking an introductory course on parallel computing, where class instructor describes MPI as :-

  1. 还有另一个多处理范例
  2. 一组库
  3. API

我不明白什么是MPI.如果它是一组库或API,那么为什么仍称它为范式?以上3个术语中,哪一个最能准确地解释什么是MPI?

I don't understand what MPI exactly is. If it is a set of libraries or an API, then why is it still called a paradigm ? Which of the above 3 terms most accurately explain what MPI is ?

推荐答案

MPI是一种处理数据的方法(通常是普通类型的数组,例如int或double).它是一个API(如在接口中,而不是在库中),描述了可用于在一组计算节点(可能在单独的计算机上)之间以特定的模式"发送和接收数据的功能.

MPI is a way of working with data (typically arrays of plain types like int or double). It is an API (as in interface, not library) which describes functions you can use to transmit and receive data in specific "patterns" amongst a set of compute nodes (potentially on separate machines).

它还描述了一种启动程序的方式,这些程序以某种方式支持彼此的连接,并支持上述操作,并且还为每个启动的进程提供了知道有多少个对等方的方式.

It also describes a way to launch programs which are connected to each other in some way which supports the above operations, and a way for each launched process to know how many peers it has.

MPI有多种相互竞争的实现,例如OpenMPI和MPICH.如果您按照MPI规范编写程序,则可以将其与计算平台上可用的MPI的任何实现一起使用.但是,一个作业中的所有进程都必须使用相同的MPI实现,因为它仅是一种API,并且不能保证运行时实现之间的互操作性.

There are multiple competing implementations of MPI, such as OpenMPI and MPICH. If you write your program against the MPI specifications, you can use it with any implementation of MPI available on your compute platform. But all the processes in one job must use the same implementation of MPI, because it is an API only, and does not promise interoperability between implementations at runtime.

之所以将MPI称为范例是因为它需要以大多数程序员都不熟悉的特定方式来考虑分布式计算.一旦将其用于单个真实"程序,您将看到它需要一种思考数据结构和算法的方法,这不同于使用套接字或消息队列进行编程.

The reason why MPI might be called a paradigm is that it requires thinking about distributed computing in a specific way which is not familiar to most programmers. Once you have used it for even a single "real" program, you will see that it demands a way of thinking about data structures and algorithms which differs from programming with, say, sockets or message queues.

这篇关于MPI是范式还是一组库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆