我有一个应用程序使用OpenMPI并在Windows和Linux上启动它。 Windows的版本工作正常,但是,在Linux上运行导致内存分配错误。某些应用参数会出现问题,需要更多计算。 为了消除内存泄漏,我使用Valgrind检查了Linux版本的应用程序,并得到了一些output。毕竟,我试图搜索关于输出的信息,并在堆栈溢出和GitHub上发现了一些帖子(没有足够的信誉来附加链接)。毕竟,我更新了openMPI到2.0.2并再次检查应用程序。新output。 OpenMPI中存在内存泄漏还是我做错了什么?有人可以用开放的mpi解释这个valgrind输出吗?
一块输出的:
==16210== 4 bytes in 1 blocks are definitely lost in loss record 5 of 327
==16210== at 0x4C2DBB6: malloc (vg_replace_malloc.c:299)
==16210== by 0x5657A59: strdup (strdup.c:42)
==16210== by 0x51128E6: opal_basename (in /home/vshmelev/OMPI_2.0.2/lib/libopen-pal.so.20.2.0)
==16210== by 0x7DDECA9: ???
==16210== by 0x7DDEDD4: ???
==16210== by 0x6FBFF84: ???
==16210== by 0x4E4EA9E: orte_init (in /home/vshmelev/OMPI_2.0.2/lib/libopen-rte.so.20.1.0)
==16210== by 0x4041FD: orterun (orterun.c:818)
==16210== by 0x4034E5: main (main.c:13)
的openmpi版本:打开MPI:2.0.2
Valgrind的版本:的valgrind-3.12.0
虚拟mashine特征:Ubuntu的16.04 LTS 64
在使用MPICH的情况下,Valgrind输出是:
==87863== HEAP SUMMARY:
==87863== in use at exit: 131,120 bytes in 2 blocks
==87863== total heap usage: 2,577 allocs, 2,575 frees, 279,908 bytes allocated
==87863==
==87863== 131,120 bytes in 2 blocks are still reachable in loss record 1 of 1
==87863== at 0x4C2DBB6: malloc (vg_replace_malloc.c:299)
==87863== by 0x425803: alloc_fwd_hash (sock.c:332)
==87863== by 0x425803: HYDU_sock_forward_stdio (sock.c:376)
==87863== by 0x432A99: HYDT_bscu_stdio_cb (bscu_cb.c:19)
==87863== by 0x42D9BF: HYDT_dmxu_poll_wait_for_event (demux_poll.c:75)
==87863== by 0x42889F: HYDT_bscu_wait_for_completion (bscu_wait.c:60)
==87863== by 0x42863C: HYDT_bsci_wait_for_completion (bsci_wait.c:21)
==87863== by 0x40B123: HYD_pmci_wait_for_completion (pmiserv_pmci.c:217)
==87863== by 0x4035C5: main (mpiexec.c:343)
==87863==
==87863== LEAK SUMMARY:
==87863== definitely lost: 0 bytes in 0 blocks
==87863== indirectly lost: 0 bytes in 0 blocks
==87863== possibly lost: 0 bytes in 0 blocks
==87863== still reachable: 131,120 bytes in 2 blocks
==87863== suppressed: 0 bytes in 0 blocks
==87863==
==87863== For counts of detected and suppressed errors, rerun with: -v
==87863== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
有关问题的链接:[link 1](https://github.com/open-mpi/ompi/issues/2166)和[link 2](http://stackoverflow.com/questions/11218056/can -someone-explain-this-valgrind-error-with-open-mpi) –
使用MPICH版本:Valgrind [输出](https://drive.google.com/file/d/0B871wCRylUoWQlMtTVI5WV9OWTg/view?usp=sharing) 3.2。 –
[Link](https://drive.google.com/file/d/0B871wCRylUoWT2RvV0ZuZ3ZzVFk/view?usp=sharing)to source –