如何调试 MPI 程序? [英] How do I debug an MPI program?

查看:27
本文介绍了如何调试 MPI 程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以编译和运行的 MPI 程序,但我想逐步执行它以确保没有发生任何奇怪的事情.理想情况下,我想要一种将 GDB 附加到任何特定进程的简单方法,但我不确定这是否可行或如何实现.另一种方法是让每个进程将调试输出写入单独的日志文件,但这并没有真正提供与调试器相同的自由.

I have an MPI program which compiles and runs, but I would like to step through it to make sure nothing bizarre is happening. Ideally, I would like a simple way to attach GDB to any particular process, but I'm not really sure whether that's possible or how to do it. An alternative would be having each process write debug output to a separate log file, but this doesn't really give the same freedom as a debugger.

有更好的方法吗?您如何调试 MPI 程序?

Are there better approaches? How do you debug MPI programs?

推荐答案

正如其他人所说,TotalView 是这个的标准.但它会花费你一条胳膊和一条腿.

As someone else said, TotalView is the standard for this. But it will cost you an arm and a leg.

OpenMPI 站点有一个很棒的有关 MPI 调试的常见问题解答.FAQ 中的第 6 项描述了如何将 GDB 附加到 MPI 进程.通读全文,其中有一些很棒的提示.

The OpenMPI site has a great FAQ on MPI debugging. Item #6 in the FAQ describes how to attach GDB to MPI processes. Read the whole thing, there are some great tips.

如果您发现要跟踪的进程太多,请查看堆栈跟踪分析工具(统计).我们在 Livermore 使用它来从潜在的数十万个正在运行的进程中收集堆栈跟踪,并将它们智能地呈现给用户.它不是一个全功能的调试器(一个全功能的调试器永远不会扩展到 208k 核),但它会告诉你哪些进程组在做同样的事情.然后,您可以在标准调试器中逐步查看每个组的代表.

If you find that you have far too many processes to keep track of, though, check out Stack Trace Analysis Tool (STAT). We use this at Livermore to collect stack traces from potentially hundreds of thousands of running processes and to represent them intelligently to users. It's not a full-featured debugger (a full-featured debugger would never scale to 208k cores), but it will tell you which groups of processes are doing the same thing. You can then step through a representative from each group in a standard debugger.

这篇关于如何调试 MPI 程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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