四核和虚拟机上的并行编程?
我正在考虑慢慢学习并行编程。我见过人们使用安装了 OpenMPI 的集群来学习这些东西。我无法访问集群,但有一台四核机器。我能在这里体验到任何好处吗?另外,如果我在虚拟机中运行 linux,那么在虚拟机中使用 OpenMPI 是否有意义?
I'm thinking of slowly picking up Parallel Programming. I've seen people use clusters with OpenMPI installed to learn this stuff. I do not have access to a cluster but have a Quad-Core machine. Will I be able to experience any benefit here? Also, if I'm running linux inside a Virtual machine, does it make sense in using OpenMPI inside a VM?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的目标是学习,则根本不需要集群。您的四核(或任何双核甚至单核)计算机就足够了。要点是学习如何“并行”思考以及如何设计应用程序。
一些重要的要点是:
拥有四核后,您可以测量方法加速(由于并行化而获得的性能增益),这通常由非并行执行时间与并行执行时间之间的除法给出。
越接近 4(四个核心意味着执行时间的 1/4),您的并行化策略就越好(一旦您可以均匀地分配工作和数据)。
If your target is to learn, you don't need a cluster at all. Your quad-core (or any dual-core or even a single-cored) computer will be more than enough. The main point is to learn how to think "in parallel" and how to design your application.
Some important points are to:
Having a quad-core you can measure your approach speedup (the gain on performance attained because of the parallelization) which is normally given by the division between the time of the non parallelized execution and the time of the parallel execution.
The closer you get to 4 (four cores meaning 1/4th the execution time), the better your parallelization strategy was (once you could evenly distribute work and data).