我试图检查一些使用openmPI的代码,因为它似乎会泄漏内存。
我正在使用valgrind,尽管我对openmPI使用了抑制标志,但是对于下面的琐碎代码,我还是遇到了很多泄漏和错误。我知道openmPI不是“ valgrind clean”,但据我了解,这应该由禁止文件处理
#include <iostream>
#include <mpi.h>
using namespace std;
int main(int argc,char *argv[]) {
MPI_Init(0,NULL);
cout << "Hello World" << endl;
MPI_Finalize();
return 0;
}
我是否以错误的方式使用了禁止文件?还是没有更好的方法?我也尝试过Sanitizer,这使我大致相同。...
PS:我打电话给Valgrind
mpirun -np 2 valgrind --suppressions=/usr/share/openmpi/openmpi-valgrind.supp --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=valgrind%p-out.txt .testProg