Boost C++ Libraries: Ticket #4899: Parallel graphs don't work with named vertices https://svn.boost.org/trac10/ticket/4899 <p> <code>brandes_betweenness_centrality</code> doesn't work with named vertices. </p> <p> Here are two reproducible examples: <a class="ext-link" href="https://gist.github.com/f02f18f30f0eef146a58"><span class="icon">​</span>https://gist.github.com/f02f18f30f0eef146a58</a> </p> <p> This is probably caused by the lack of a <code>local()</code> function in the <code>hashed_distribution</code> declared in <code>named_graph.hpp</code>. </p> <p> See also this discussion on the mailing list: <a class="ext-link" href="http://lists.boost.org/boost-users/2010/11/64489.php"><span class="icon">​</span>http://lists.boost.org/boost-users/2010/11/64489.php</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4899 Trac 1.4.3 cpaolino@… Sun, 28 Nov 2010 14:57:26 GMT <link>https://svn.boost.org/trac10/ticket/4899#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4899#comment:1</guid> <description> <p> Another useful info might be, as Cedric Laczny pointed out on that mailing list thread: </p> <blockquote> <p> …when I look at your error logs, I see </p> </blockquote> <blockquote> <p> <code>/usr/local/include/boost/graph/distributed/shuffled_distribution.hpp: In member function ‘size_t boost::graph::distributed::shuffled_distribution&lt;BaseDistribution&gt;::operator() (const T&amp;) const [with T = size_t, BaseDistribution = boost::graph::distributed::hashed_distribution&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;]’:</code> </p> </blockquote> <blockquote> <p> The problem here is the collision between size_t and char* (std::basic_string). The argument should be of type size_t (index of a vertex for the local process) but the underlying distribution is based on std::basic_string, probably due to the named vertices (specialization in named_graph.hpp). This causes an error at line 40 of boost/graph/distributed/named_graph.hpp which is called by line 68 in boost/graph/distributed/shuffled_distribution.hpp. So the specialization to named vertices could be the cause. </p> </blockquote> <blockquote> <p> While this might not resolve the issue with local(), it could actually track down one error and might reveal a bug. </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Mon, 29 Nov 2010 14:33:07 GMT</pubDate> <title>owner changed https://svn.boost.org/trac10/ticket/4899#comment:2 https://svn.boost.org/trac10/ticket/4899#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Andrew Sutton</span> to <span class="trac-author">ngedmond</span> </li> </ul> Ticket Jeremiah Willcock Wed, 01 Dec 2010 20:32:24 GMT owner, status changed https://svn.boost.org/trac10/ticket/4899#comment:3 https://svn.boost.org/trac10/ticket/4899#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">ngedmond</span> to <span class="trac-author">Jeremiah Willcock</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> I agree with <a class="new ticket" href="https://svn.boost.org/trac10/ticket/4899#comment:1" title="#4899: Bugs: Parallel graphs don't work with named vertices (new)">comment 1</a> -- it seems like you are trying to use a distribution that uses numbers to index vertex locations (it appears to use an <code>std::vector</code>), while something is trying to find vertex locations using their names. Do any PBGL algorithms work with your named vertex example? How important is it to you to use named vertices as opposed to just vertex numbers? </p> Ticket Jeremiah Willcock Wed, 01 Dec 2010 20:33:19 GMT summary changed https://svn.boost.org/trac10/ticket/4899#comment:4 https://svn.boost.org/trac10/ticket/4899#comment:4 <ul> <li><strong>summary</strong> <span class="trac-field-old">Parallel Brandes Betweenness Centrality doesn't work with named vertices (hashed_distribution doesn't have `local()`)</span> → <span class="trac-field-new">Parallel graphs don't work with named vertices</span> </li> </ul> Ticket cpaolino@… Thu, 02 Dec 2010 10:11:41 GMT <link>https://svn.boost.org/trac10/ticket/4899#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4899#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4899#comment:3" title="Comment 3">jewillco</a>: </p> <blockquote class="citation"> <p> I agree with <a class="new ticket" href="https://svn.boost.org/trac10/ticket/4899#comment:1" title="#4899: Bugs: Parallel graphs don't work with named vertices (new)">comment 1</a> -- it seems like you are trying to use a distribution that uses numbers to index vertex locations (it appears to use an <code>std::vector</code>), while something is trying to find vertex locations using their names. </p> </blockquote> <p> I think it's the other way around: I'm trying to use <a href="http://www.boost.org/doc/libs/1_45_0/libs/graph_parallel/doc/html/distributed_adjacency_list.html#named-vertices">named graphs</a> with an algorithm that not expects them. </p> <blockquote class="citation"> <p> Do any PBGL algorithms work with your named vertex example? </p> </blockquote> <p> Yes, PageRank and Degree centrality (<a class="ext-link" href="https://github.com/earcar/lana/blob/develop/src/degree_centrality.hpp"><span class="icon">​</span>the same from the non-parallel BGL</a>, with two line changes to make it work with distributed graphs; will make another bug report for that). </p> <blockquote class="citation"> <p> How important is it to you to use named vertices as opposed to just vertex numbers? </p> </blockquote> <p> I'll quote myself and Cedric Laczny on that mailing list thread: </p> <p> Cedric Laczny wrote: </p> <blockquote class="citation"> <p> Carmine Paolino wrote: </p> <blockquote class="citation"> <p> Yes, without this declaration (editor's note: that makes it a named graph) it does compile: </p> <p> <code>template&lt;&gt; </code> <code>struct internal_vertex_name&lt;Vertex&gt; { </code> <code>typedef multi_index::member&lt;Vertex, std::string, &amp;Vertex::name&gt; </code> <code>type; }; </code> </p> <p> But the comfort of having boost manage adding and finding vertexes also goes away, which means we have to use something like a map of all the inserted names on a single process to know if a name should be added to the graph or not. And that doesn't scale well. Anyway I'm open to suggestion on this if the named graph way doesn't work… </p> </blockquote> <p> I agree with you on this one. I experienced the boost library to be very efficient in all cases where I used it and the authors probably have thought about this in order to make it suitable (and fast) for distributed purposes. In fact, I find this feature very convenient and I think it may be also helpful in non-distributed graphs. Using already existing features is IMHO definitively nicer than putting all kinds of maps or such on top for lookup-purposes. It will only bloat the code and make it harder to read and maintain and probably will steal preformance. That's why it is important to check if this is actually a bug :) </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Mon, 16 Apr 2012 17:56:49 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/4899#comment:6 https://svn.boost.org/trac10/ticket/4899#comment:6 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Jeremiah Willcock</span> to <span class="trac-author">ngedmond</span> </li> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> </ul> Ticket