有什么更容易学习和调试OpenMP或MPI? [英] What is easier to learn and debug OpenMP or MPI?

查看:109
本文介绍了有什么更容易学习和调试OpenMP或MPI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数字处理C/C ++应用程序.基本上,它是不同数据集的主循环.我们可以访问具有openmp和mpi的100节点群集.我想加快应用程序的速度,但是我是绝对的新手,无论是mpi还是openmp.我只是想知道即使性能不是最好的,最容易学习和调试的是什么.

I have a number crunching C/C++ application. It is basically a main loop for different data sets. We got access to a 100 node cluster with openmp and mpi available. I would like to speedup the application but I am an absolut newbie for both mpi and openmp. I just wonder what is the easiest one to learn and to debug even if the performance is not the best.

我还想知道哪种方法最适合我的主循环应用程序.

I also wonder what is the most adequate for my main loop application.

谢谢

推荐答案

如果您的程序只是使用OpenMP的一个大循环,可以像编写这样简单:

If your program is just one big loop using OpenMP can be as simple as writing:

#pragma omp parallel for

OpenMP仅对共享内存编程有用,除非您的集群运行的是 kerrighed 之类的内容,否则使用OpenMP的并行版本一次最多只能在一个节点上运行.

OpenMP is only useful for shared memory programming, which unless your cluster is running something like kerrighed means that the parallel version using OpenMP will only run on at most one node at a time.

MPI基于消息传递,并且入门起来稍微复杂一些.优点是尽管您的程序可以一次在多个节点上运行,并在需要时在它们之间传递消息.

MPI is based around message passing and is slightly more complicated to get started. The advantage is though that your program could run on several nodes at one time, passing messages between them as and when needed.

鉴于您说的是针对不同的数据集",这听起来好像您的问题可能实际上属于令人尴尬的并行"类别,如果您拥有100多个数据集,则可以将调度程序设置为运行一个数据在每个节点上进行设置,直到它们全部完成为止,而无需修改代码,并且仅使用一个节点就可以将速度提高近100倍.

Given that you said "for different data sets" it sounds like your problem might actually fall into the "embarrassingly parallel" category, where provided you've got more than 100 data sets you could just setup the scheduler to run one data set per node until they are all completed, with no need to modify your code and almost a 100x speed up over just using a single node.

例如,如果您的集群使用秃鹰作为调度程序,则可以将每个数据项提交1个作业到原始" Universe,仅更改作业描述的"Arguments"行. (对于Condor,还有其他方法可能更明智,并且对于扭矩,sge等也有类似的方法.)

For example if your cluster is using condor as the scheduler then you could submit 1 job per data item to the "vanilla" universe, varying only the "Arguments =" line of the job description. (There are other ways to do this for Condor which may be more sensible and there are also similar things for torque, sge etc.)

这篇关于有什么更容易学习和调试OpenMP或MPI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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