Multi-thread: What is the difference between OpenMP and MPI
2017-03-12 04:39
676 查看
MPI(MPI是一个标准,有不同的具体实现,比如MPICH等)是多主机联网协作进行并行计算的工具,当然也可以用于单主机上多核/多CPU的并行计算,不过效率低。它能协调多台主机间的并行计算,因此并行规模上的可伸缩性很强,能在从个人电脑到世界TOP10的超级计算机上使用。缺点是使用进程间通信的方式协调并行计算,这导致并行效率较低、内存开销大、不直观、编程麻烦。
OpenMP是针对单主机上多核/多CPU并行计算而设计的工具,换句话说,OpenMP更适合单台计算机共享内存结构上的并行计算。由于使用线程间共享内存的方式协调并行计算,它在多核/多CPU结构上的效率很高、内存开销小、编程语句简洁直观,因此编程容易、编译器实现也容易(现在最新版的C、C++、Fortran编译器基本上都内置OpenMP支持)。不过OpenMP最大的缺点是只能在单台主机上工作,不能用于多台主机间的并行计算!
所以,OpenMP不适用于多主机的情况。因为无法共享内存。
转自:知乎问题的回答。
OpenMP是针对单主机上多核/多CPU并行计算而设计的工具,换句话说,OpenMP更适合单台计算机共享内存结构上的并行计算。由于使用线程间共享内存的方式协调并行计算,它在多核/多CPU结构上的效率很高、内存开销小、编程语句简洁直观,因此编程容易、编译器实现也容易(现在最新版的C、C++、Fortran编译器基本上都内置OpenMP支持)。不过OpenMP最大的缺点是只能在单台主机上工作,不能用于多台主机间的并行计算!
所以,OpenMP不适用于多主机的情况。因为无法共享内存。
转自:知乎问题的回答。
相关文章推荐
- Multi-thread: What is the difference between OpenMP and MPI
- Multi-thread: What is the difference between OpenMP and MPI
- Multi-thread: What is the difference between OpenMP and MPI
- Multi-thread: What is the difference between OpenMP and MPI
- Multi-thread: What is the difference between OpenMP and MPI
- Multi-thread: What is the difference between OpenMP and MPI
- What is the difference between XHTML MP, XHTML Basic, WML, i-mode, and HDML?
- What is the basic difference between NSTimer, NSTask, NSThread and NSRunloop?
- What is the basic difference between NSTimer, NSTask, NSThread and NSRunloop ?
- What is the basic difference between NSTimer, NSTask, NSThread and NSRunloop?
- What is the difference between task and thread?
- What is the difference between a process and a thread?
- What is the difference between a thread and a process?
- 进程与线程的区别 What is the difference between process and thread
- What is the basic difference between NSTimer, NSTask, NSThread and NSRunloop?
- What is the difference between SET and SELECT when assigning values to variables, in T-SQL?
- What is the difference between SSL, TLS, and HTTPS?
- What is the difference between tag and branch-id?
- what is the difference between definition and declaration in c
- What is the difference between syntax and semantic