带有valgrind的openmpi(我可以在Ubuntu发行版中使用MPI进行编译吗?) [英] openmpi with valgrind (can I compile with MPI in Ubuntu distro?)

查看:74
本文介绍了带有valgrind的openmpi(我可以在Ubuntu发行版中使用MPI进行编译吗?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个幼稚的问题: 我编译了一个Openmpi 1.4.4版本.与Valgrind在一起:

I have a naive question: I compiled a version of Openmpi 1.4.4. with Valgrind :

./configure --prefix=/opt/openmpi-1.4.4/ --enable-debug --enable-memchecker --with-valgrind=/usr....

我想进行内存检查.

通常用于调试(并运行),我在Ubuntu发行版中使用OpenMPI对其进行编译

Usually for debuggin (and running) I compile it with OpenMPI in Ubuntu distributive with

CC =            mpic++
CCFLAGS =   -g

问题是,我可以仅使用Ubuntu Distro MPI 1.4.3编译我的代码,然后使用此modified(valgrind)mpirun版本运行:

The question is, can I compile my code just with Ubuntu distro MPI 1.4.3 and then run with this modified (valgrind) mpirun version:

mpirun -np 8 valgrind ....

?

推荐答案

您始终可以对任何MPI实现和任何valgrind进行mpirun -np 8 valgrind ...位.但是,(当然)您将无法获得启用了memcheck并指向valgrind的OpenMPI安装中内置的memchecker的全部好处.

You can always do the mpirun -np 8 valgrind ... bit with any MPI implementation and any valgrind. But you won't (of course) get the full benefit of the memchecker built into the OpenMPI installation that you built with memcheck enabled and pointing to your valgrind.

还请注意,如果执行此操作,则MPI例程中的valgrind可能会得到很多误报;您可以按照 Valgrind手册.

Note too that if you do this you'll probably get a lot of false positives from valgrind in the MPI routines; you can improve that by building the valgrind MPI wrappers for your stock Ubuntu OpenMPI, as described in the Valgrind manual.

但是对于使用一个MPI发行版编译代码并与另一个MPI发行版运行代码而言,这只会导致问题,而与使用valgrind或不使用valgrind无关.实际上,OpenMPI 1.4.3和1.4.4足够相似,可能会起作用,但我不建议您这样做,因为它会引入不确定性-无论如何,您运行valgrind的原因是为了查找问题,正确的?引入一个可能出现问题的新地方是没有意义的.

But as to compiling code with one MPI distribution and running it with another, that can only lead to problems, regardless of the whole with/without valgrind thing. In practice, OpenMPI 1.4.3 and 1.4.4 are similar enough that it will probably work but I wouldn't recommend it, as it just introduces uncertainty -- and the reason why you're running valgrind anyway is to track down problems, right? There's no sense in introducing a new place where problems could occur.

这篇关于带有valgrind的openmpi(我可以在Ubuntu发行版中使用MPI进行编译吗?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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