Boost C++ Libraries: Ticket #2586: all_gather generates a memory leak https://svn.boost.org/trac10/ticket/2586 <p> Running valgrind on the attached sample program with the command below<br /><br /> <code>mpiexec -n 2 valgrind --leak-check=full --show-reachable=yes ./test_all_gather</code><br /><br /> gives the errors reported into the attached "valgrind_out.txt" file.<br /><br /> I've found this error on a Linux CentOS 5, 32 bit machine, with mpich2-1.0.6p1 and Boost 1.36.0.<br /><br /> I noticed that if you change the data type of the gathered pair into <code>std::pair&lt;int,int&gt;</code> (and, obviously, the corresponding data-type of the output vector), the leak disappears. So may be the error is generated by the usage of the <code>size_t</code> data type. I don't know if it is linked to the usage of the <code>std::pair</code> or not.<br /> <br /> Before submitting this ticket I've done a search on "all_gather still reachable", but I did not find anything. Furthermore, I've seen that there is not any update in Boost MPI between releases 1.36.0 and 1.37.0. So, I reported.<br /> <br /><br /> Thank you in advance<br /> Best Regards<br /> Michele De Stefano </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2586 Trac 1.4.3 anonymous Fri, 12 Dec 2008 15:48:37 GMT attachment set https://svn.boost.org/trac10/ticket/2586 https://svn.boost.org/trac10/ticket/2586 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_all_gather.cpp</span> </li> </ul> Ticket anonymous Fri, 12 Dec 2008 15:49:07 GMT attachment set https://svn.boost.org/trac10/ticket/2586 https://svn.boost.org/trac10/ticket/2586 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">valgrind_out.txt</span> </li> </ul> Ticket anonymous Fri, 12 Dec 2008 16:12:05 GMT owner, severity changed https://svn.boost.org/trac10/ticket/2586#comment:1 https://svn.boost.org/trac10/ticket/2586#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">Matthias Troyer</span> </li> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Cosmetic</span> </li> </ul> <p> This is a minor issue. Boost.MPI creates a global map of MPI Datatypes used that are cached until the end of execution. They cannot be released at the end of program execution when the map is destroyed, since at that time MPI is no longer initialized. Since at that point in time a memory leak is irrelevant this is an acceptable decision. </p> <p> However, it causes this warning when users check their code by valgrind. Note that it will appear anytime you use a custom MPI datatype anywhere, not just when using all_reduce. </p> <p> We can still fix it in the next release, at the cost of slightly slower finalization of MPI. </p> Ticket micdestefano@… Mon, 15 Dec 2008 06:52:39 GMT <link>https://svn.boost.org/trac10/ticket/2586#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2586#comment:2</guid> <description> <p> Ok. I didn't know if it was a serious problem or not. So, I simply reported.<br /> If it does not prevent the normal execution of any program, for me it's OK.<br /> <br /> Thank you very much.<br /> Best Regards<br /> Michele De Stefano </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Matthias Troyer</dc:creator> <pubDate>Mon, 03 Aug 2009 20:41:19 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2586#comment:3 https://svn.boost.org/trac10/ticket/2586#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket