2021年3月20日星期六

Why does MPI_Init (NULL, NULL) cause memory leakage?

MPI_Init(NULL, NULL) and MPI_Finalize() are required for an MPI project. However, I do not know why I got the definitely lost for MPI_Init(NULL, NULL) when I used Valgrind to check memory leakage. I got the following error multiple times: (My program runs well.)

==27956== 74 (64 direct, 10 indirect) bytes in 1 blocks are definitely lost in loss record 258 of 433  ==27956==    at 0x4C29EA3: malloc (vg_replace_malloc.c:309)  ==27956==    by 0x9538757: ???  ==27956==    by 0x90F550B: ???  ==27956==    by 0x90D8942: ???  ==27956==    by 0x90A7F3D: ???  ==27954==    by 0x50DFFF1: ompi_mpi_init (in /opt/lib/libmpi.so.40.10.2)  ==27954==    by 0x510CC58: PMPI_Init (in /opt/lib/libmpi.so.40.10.2)  ==27954==    by 0x4039D4: main (ssvm_main.cpp:17)  

By the way, MPI_Barrier(MPI_COMM_WORLD) also has error with uninitialised value(s).

How can I fix them? Thank you!

https://stackoverflow.com/questions/66728058/why-does-mpi-init-null-null-cause-memory-leakage March 21, 2021 at 09:31AM

没有评论:

发表评论