Boost C++ Libraries: Ticket #6436: Exception on destruction of communicator mpi_comm_null https://svn.boost.org/trac10/ticket/6436 <p> Using boost trunk mpi the communicator destructor does not check for the possibility of an MPI_COMM_NULL underlying communicator, code which produces a null underlying can exception on ref counted destruction. </p> <p> For instance, this code: </p> <p> void pool(bmpi::communicator &amp;world, bmpi::communicator &amp;local) { </p> <blockquote> <p> LDEBUG(PSTR("Pool - local: "), pantheios::integer(local.rank()), PSTR(" of "), pantheios::integer(local.size())); </p> <blockquote> <p> bmpi::group localGroup = local.group(); </p> </blockquote> <p> dump_group(localGroup); </p> </blockquote> <p> </p> <blockquote> <p> std::vector&lt;int&gt; inc(1, 0); bmpi::group tinyGroup = localGroup.include(inc.begin(), inc.end()); dump_group(tinyGroup); </p> </blockquote> <blockquote> <p> bmpi::communicator tinyCom(local, tinyGroup); </p> </blockquote> <p> } </p> <p> When tinyCom goes out of scope, this exception gets thrown: </p> <p> "MPI_Comm_free: MPI_ERR_COMM: invalid communicator" </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6436 Trac 1.4.3 aelaguiz@… Mon, 23 Jan 2012 02:51:14 GMT attachment set https://svn.boost.org/trac10/ticket/6436 https://svn.boost.org/trac10/ticket/6436 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">aelaguizy_mpi_destructor.patch</span> </li> </ul> <p> Proposed patch to check for MPI_COMM_NULL on destruction </p> Ticket aelaguiz@… Mon, 23 Jan 2012 13:04:33 GMT attachment set https://svn.boost.org/trac10/ticket/6436 https://svn.boost.org/trac10/ticket/6436 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">aelaguizy_mpi_comm_null.patch</span> </li> </ul> <p> better fix </p> Ticket anonymous Mon, 23 Jan 2012 13:05:43 GMT <link>https://svn.boost.org/trac10/ticket/6436#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6436#comment:1</guid> <description> <p> Attached a better fix, the real problem is that the subgroup constructor allows direct assignment to the underlying of MPI_COMM_NULL without a check, modified this to call the normal constructor with a take ownership flag </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Matthias Troyer</dc:creator> <pubDate>Tue, 01 Jan 2013 11:30:42 GMT</pubDate> <title>owner changed https://svn.boost.org/trac10/ticket/6436#comment:2 https://svn.boost.org/trac10/ticket/6436#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">Matthias Troyer</span> </li> </ul> Ticket Matthias Troyer Tue, 11 Jun 2013 08:30:41 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6436#comment:3 https://svn.boost.org/trac10/ticket/6436#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> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/84739" title="Fixed #6436 #5596 and added threaded initialization">[84739]</a>) Fixed <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6436" title="#6436: Patches: Exception on destruction of communicator mpi_comm_null (closed: fixed)">#6436</a> <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5596" title="#5596: Bugs: MPI: problem creating communicator (closed: fixed)">#5596</a> and added threaded initialization </p> Ticket