gpt4 book ai didi

c++ - 有人可以用 open mpi 解释这个 valgrind 输出吗?

转载 作者:太空宇宙 更新时间:2023-11-04 13:06:08 25 4
gpt4 key购买 nike

我有一个使用 OpenMPI 并在 Windows 和 Linux 上启动它的应用程序。 Windows 版本运行良好,但是在 Linux 上运行会导致内存分配错误。某些需要更多计算的应用程序参数会出现此问题。 为了消除内存泄漏,我使用 Valgrind 检查了 Linux 版本的应用程序并得到了一些 output .毕竟,我尝试搜索有关输出的信息并在 stack overflow 和 GitHub 上找到了一些帖子(没有足够的声誉来附加链接)。毕竟,我将openMPI更新为2.0.2并再次检查应用程序。新output .是 OpenMPI 内存泄漏还是我做错了什么?

一段输出:

==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 版本:Open MPI:2.0.2
Valgrind 版本:valgrind-3.12.0
虚拟机特性:Ubuntu 16.04 LTS x64

在使用 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)

最佳答案

这些输出指向 MPI 库中的某些内存泄漏,而不是您的应用程序代码。您可以安全地忽略它们。

更具体地说,这些泄漏来自发射器。 ORTE是 OpenMPI 的运行时环境,负责启动和管理 MPI 进程。 Hydra是 MPICH 的启动器和进程管理器。

关于c++ - 有人可以用 open mpi 解释这个 valgrind 输出吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42268816/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com