|
Boost Users : |
Subject: [Boost-users] [BGL] Connected components of a distributed graph with few edges
From: Quaglino Alessio (alessio.quaglino_at_[hidden])
Date: 2015-10-19 05:39:41
Hello,
I am trying to compute the number of connected components of a graph with only few edges (i.e. many vertices do not have edges). This works OK for a non-distributed graph. The simplest example of the issue I could come up with is the following:
typedef adjacency_list <vecS, vecS, undirectedS> SerialGraph;
typedef adjacency_list<vecS, distributedS<mpi_process_group, vecS>, undirectedS> Graph;
typedef iterator_property_map<std::vector<int>::iterator, property_map<Graph, vertex_index_t>::type> LocalMap;
#ifdef PARALLEL_GRAPH
Graph G(nV+1);
synchronize(G);
std::vector<int> localComponent(nV+1);
LocalMap components(localComponent.begin(),get(vertex_index, G));
num = connected_components_ps(G, components);
#else
SerialGraph G(nV+1);
std::vector<int> globalComponent(nV+1);
num = connected_components(G, &globalComponent[0]);
#endif
The distributed version causes a seg fault when calling connected_components_ps, while the non-distributed works fine and correctly finds nV+1 components. If I populate the graph connecting all vertices with edges, both do work fine. What am I doing wrong? Thank you in advance.
Regards,
Alessio
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net