学习 MPI for C++ 的最佳教程是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2275184/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 22:50:08  来源:igfitidea点击:

What is the best tutorial for learning MPI for C++?

c++mpi

提问by Hymanie

I plan to use MPI for my C++ code. I have installed MPICH2 on my computers. But I do not know much about MPI and hope to find some materials to read. I hope you experts can recommend some good materails to me. Any advice will be appreciated.

我计划将 MPI 用于我的 C++ 代码。我已经在我的电脑上安装了 MPICH2。但是我对MPI了解不多,希望能找到一些资料来阅读。希望各位高手给我推荐一些好的材料。任何建议将被认真考虑。

采纳答案by J Teller

I'm assuming you already know how to program C++ pretty well and have a basic understanding of parallel programming (or at least know how you want to parallelize your code).

我假设您已经非常了解如何编写 C++ 并且对并行编程有基本的了解(或者至少知道您想如何并行化您的代码)。

I would check out the book Using MPIfirst. Using MPI 2 is the follow on book that discusses using the new bits in MPi-2. Both books were written by the guys who wrote the MPI library and headed up the standardization effort. One nice thing about Using MPI is that it's available online so you can check it out w/o spending money :-)

我会先查看Using MPI一书。使用 MPI 2 是讨论使用 MPI-2 中的新位的后续书籍。这两本书都是由编写 MPI 库并领导标准化工作的人编写的。使用 MPI 的一个好处是它可以在线获得,因此您无需花钱就可以查看它:-)

回答by Taylor Leese

Parallel Programming with MPIby Peter S. Pacheco is a good intro book. Note, the book uses C, but it should be an easy transition to using the C++ MPI bindings.

Peter S. Pacheco 的Parallel Programming with MPI是一本很好的介绍书。请注意,本书使用 C 语言,但它应该可以轻松过渡到使用 C++ MPI 绑定。

回答by Jerry Coffin

回答by Stan Graves

I would advise against using the MPI C++ bindings for any new development. The program itself can be in C++, but invest the extra effort to use the C interface to the MPI library.

我建议不要在任何新开发中使用 MPI C++ 绑定。程序本身可以使用 C++,但要付出额外的努力来使用 MPI 库的 C 接口。

The MPI Forum is deprecating the C++ bindings. So, future implementations of MPI will probably drop support for C++. In general, most implementations skimp on features when it comes to C++. The basics will work, but things like dynamic processes (i.e. spawn), the PMPI interfaces, and so on are less well supported.

MPI 论坛正在弃用 C++ 绑定。因此,未来的 MPI 实现可能会放弃对 C++ 的支持。一般来说,当涉及到 C++ 时,大多数实现都会忽略特性。基础知识会起作用,但诸如动态进程(即 spawn)、PMPI 接口等的支持不太好。

The C and Fortran bindings are reasonably well supported by all the major implementations, and will continue to be supported into the foreseeable future.

C 和 Fortran 绑定得到了所有主要实现的合理支持,并将在可预见的未来继续得到支持。

回答by Edric

As @semiuseless pointed out, the MPI forum is deprecating the C++ bindings. One of the reasons for that is that the boost MPI interfacedoes a much better job.

正如@semiuseless 所指出的,MPI 论坛正在弃用 C++ 绑定。原因之一是boost MPI 接口做得更好。

回答by shuvalov

some get started manual may be found on LAM/MPI site

一些入门手册可以在LAM/MPI 网站上找到

回答by Anycorn

Mpich2 comes with a number of examples in C++/C. probably the most famous is cpi, which computes pi in parallel. Read through the program together with manuals/books other people suggested. This way you will see actual working code right away and can make your own modifications to play with things.

Mpich2 带有许多 C++/C 示例。可能最著名的是 cpi,它并行计算 pi。与其他人建议的手册/书籍一起通读该程序。通过这种方式,您将立即看到实际的工作代码,并可以进行自己的修改以进行操作。