in Education by
I am writing some code that uses MPI and I was keeping noticing some memory leaks when running it with valgrind. While trying to identify where the problem was, I ended up with this simple (and totally useless) main: #include "/usr/include/mpi/mpi.h" int main(int argc,char** argv) { MPI_Init(&argc, &argv); MPI_Finalize(); return 0; } As you can see, this code doesn't do anything and shouldn't create any problem. However, when I run the code with valgrind (both in the serial and parallel case), I get the following summary: ==28271== HEAP SUMMARY: ==28271== in use at exit: 190,826 bytes in 2,745 blocks ==28271== total heap usage: 11,214 allocs, 8,469 frees, 16,487,977 bytes allocated ==28271== ==28271== LEAK SUMMARY: ==28271== definitely lost: 5,950 bytes in 55 blocks ==28271== indirectly lost: 3,562 bytes in 32 blocks ==28271== possibly lost: 0 bytes in 0 blocks ==28271== still reachable: 181,314 bytes in 2,658 blocks ==28271== suppressed: 0 bytes in 0 blocks I don't understand why there are these leaks. Maybe it's just me not able to read the valgrind output or to use MPI initialization/finalization correctly... I am using OMPI 1.4.1-3 under ubuntu on a 64 bit architecture, if this can help. Thanks a lot for your time! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The OpenMPI FAQ addresses issues with valgrind. This refers initalization issues and memory leaks during finalization - which should have no practical negative impact. There are many situations, where Open MPI purposefully does not initialize and subsequently communicates memory, e.g., by calling writev. Furthermore, several cases are known, where memory is not properly freed upon MPI_Finalize. This certainly does not help distinguishing real errors from false positives. Valgrind provides functionality to suppress errors and warnings from certain function contexts. In an attempt to ease debugging using Valgrind, starting with v1.5, Open MPI provides a so-called Valgrind-suppression file, that can be passed on the command line: mpirun -np 2 valgrind --suppressions=$PREFIX/share/openmpi/openmpi-valgrind.supp

Related questions

0 votes
    I am getting memory leak during migration using Realm (v1.0.2). My code looks like that: let ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have an ETL requirement like: I need to fetch around 20000 records from a table and process each ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have been doing Java development for a long time, but I am ashamed to say I still don't have ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I have been having some issues with LINQ-To-SQL around memory usage. I'm using it in a Windows ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    I have been having some issues with LINQ-To-SQL around memory usage. I'm using it in a Windows ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 21, 2022 in Education by JackTerrance
0 votes
    I have been having some issues with LINQ-To-SQL around memory usage. I'm using it in a Windows ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 20, 2022 in Education by JackTerrance
0 votes
    Which one of the following causes memory leak? (a) Release database connection when querying is complete (b) ... Miscellaneous of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    We've tried jdk 1.7.0_02. Ten days of running give 420 MB memory leak of the following objects: ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    What is meant by a memory leak in Java, and how to implement it. Select the correct answer from above options...
asked Jan 21, 2022 in Education by JackTerrance
0 votes
    What is meant by a memory leak in Java, and how to implement it. Select the correct answer from above ... ,Core Questions, Core Hadoop MCQ,core interview questions for experienced...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    Which of the below is not a memory leak solution? (a) Code changes (b) JVM parameter tuning (c) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which one of the following causes memory leak? (a) Release database connection when querying is complete (b ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    When does a memory leak happen? (a) Browser doesn't release memory from objects unnecessary (b) Browser ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    When does a cycle occur during memory leak? (a) No reference occurs (b) Two objects reference (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    What is the memory leak in C?...
asked Jan 23, 2021 in Technology by JackTerrance
...