我的基本问题是关于抑制文件如何在valgrind中工作。我已经查看了很多指向在mpi版本上使用以下内容的文档> 1.5(我的是1.6):
mpirun -np 2 valgrind --suppressions=/usr/share/openmpi/openmpi-valgrind.supp --track-origins=yes ./myprog
然而,当我像这样运行它时,文件有600多个错误! 我得到的错误是这两个一遍又一遍。我不知道如何用我目前对valgrind和mpi的理解来解释其中任何一个。
==8821== Address 0xad5e4d7 is 87 bytes inside a block of size 128 alloc'd
==8821== at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8821== by 0x6348C52: ??? (in /usr/lib/openmpi/lib/libopen-pal.so.0.0.0)
==8821== by 0x6349AF1: ??? (in /usr/lib/openmpi/lib/libopen-pal.so.0.0.0)
==8821== by 0x6349B81: ??? (in /usr/lib/openmpi/lib/libopen-pal.so.0.0.0)
==8821== by 0x7DA5B9C: ??? (in /usr/lib/openmpi/lib/openmpi/mca_grpcomm_bad.so)
==8821== by 0x7DA52F4: ??? (in /usr/lib/openmpi/lib/openmpi/mca_grpcomm_bad.so)
==8821== by 0x5082AF2: ??? (in /usr/lib/openmpi/lib/libmpi.so.0.0.2)
==8821== by 0x50A33FA: PMPI_Init (in /usr/lib/openmpi/lib/libmpi.so.0.0.2)
==8821== by 0x408AB5: main (test_send-receive.cpp:8)
==8821== Uninitialised value was created by a heap allocation
==8821== at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==8821== by 0x635FE2B: ??? (in /usr/lib/openmpi/lib/libopen-pal.so.0.0.0)
==8821== by 0x6360634: opal_ifcount (in /usr/lib/openmpi/lib/libopen-pal.so.0.0.0)
==8821== by 0x81B36AA: ??? (in /usr/lib/openmpi/lib/openmpi/mca_oob_tcp.so)
==8821== by 0x5C01EE2: mca_oob_base_init (in /usr/lib/openmpi/lib/libopen-rte.so.0.0.0)
==8821== by 0x7FA97FB: ??? (in /usr/lib/openmpi/lib/openmpi/mca_rml_oob.so)
==8821== by 0x5C083E4: orte_rml_base_select (in /usr/lib/openmpi/lib/libopen-rte.so.0.0.0)
==8821== by 0x5BF5EC4: orte_ess_base_app_setup (in /usr/lib/openmpi/lib/libopen-rte.so.0.0.0)
==8821== by 0x7BA1EAE: ??? (in /usr/lib/openmpi/lib/openmpi/mca_ess_env.so)
==8821== by 0x5BDDB72: orte_init (in /usr/lib/openmpi/lib/libopen-rte.so.0.0.0)
==8821== by 0x50822E0: ??? (in /usr/lib/openmpi/lib/libmpi.so.0.0.2)
==8821== by 0x50A33FA: PMPI_Init (in /usr/lib/openmpi/lib/libmpi.so.0.0.2)
产生这些错误的代码是:
int main(int argc, char *argv[]) {
/* init MPI */
MPI_Init(&argc, &argv);
int myid;
MPI_Comm_rank(MPI_COMM_WORLD, &myid);
int i;
if(myid == 0){
double * d = new double [10];
for(i = 0; i<10; i++){
d[i] = i + 1.0;
}
MPI_Send(d,
10,
MPI_DOUBLE,
1,
1,
MPI_COMM_WORLD);
delete[] d;
} else {
MPI_Status status;
double * c = new double [10];
MPI_Recv(c,
10,
MPI_DOUBLE,
0,
MPI_ANY_TAG,
MPI_COMM_WORLD,
&status);
for(i = 0; i<10; i++){
printf("%f\n", c[i]);
}
delete[] c;
}
MPI_Finalize();
return 0;
}
此外,此代码运行正常并输出预期结果。我是否误解了数据是如何通过网络发送的,或者是否有其他事情发生在我不明白的地方?
对于这篇文章的篇幅感到抱歉,你们甚至还在阅读这篇文章。
答案 0 :(得分:0)
我们的抑制文件很可能在OMPI v1.6中不是最新的。 : - \
您应该在OMPI邮件列表中报告此情况。请参阅http://www.open-mpi.org/community/lists/ompi.php。