Is anyone using the parallel BGL? The following code gives me a segmentation fault for the parallel case but I can’t figure out what can be wrong. You can replace PetscInitialize and PetscFinalize with the respective standard MPI calls.
Regards,
Alessio Quaglino
#define PARALLEL_GRAPH
using namespace boost;
using boost::graph::distributed::mpi_process_group;
typedef adjacency_list SerialGraph;
typedef adjacency_list, undirectedS> Graph;
typedef iterator_property_map::type> LocalMap;
static char help[] = "";
int main(int argc,char **args)
{
PetscErrorCode ierr;
PetscInitialize(&argc,&args,(char*)0,help);
int nV = 40000;
int num = 0;
#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
std::cout << num << " connected components" << std::endl;
ierr = PetscFinalize();
return 0;
}