openmpi with valgrind (can I compile with MPI in Ubuntu distro?)

强颜欢笑 提交于 2019-12-23 05:11:52

问题


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....

I want to do memory check.

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

CC =            mpic++
CCFLAGS =   -g

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 ....

?


回答1:


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.

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.

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.



来源:https://stackoverflow.com/questions/11077746/openmpi-with-valgrind-can-i-compile-with-mpi-in-ubuntu-distro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!