OpenMPI를 사용하는 응용 프로그램이 있으며 Windows 및 Linux에서 실행합니다. Windows 용 버전은 정상적으로 작동하지만 Linux에서 실행하면 메모리 할당 오류가 발생합니다. 더 많은 계산이 필요한 특정 앱 인수에 대해 문제가 발생합니다. 메모리 누수를 제거하기 위해 Valgrind를 사용하여 Linux 버전 앱을 확인하고 출력을 얻었습니다 . 결국, 나는 출력에 대한 정보를 검색하려고 시도했고 스택 오버플로 및 GitHub (링크를 첨부 할만한 평판이 충분하지 않음)에서 일부 게시물을 찾았습니다. 결국 openMPI를 2.0.2로 업데이트하고 앱을 다시 확인했습니다. 새로운 출력 . 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
가상 mashine 특성 : 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)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다