Please find below the stack trace in GDB. As I said, I have tried a single process and it crashes anyway. If I add edges, then it doesn’t crash anymore. I also paste again the entire program below in case you want to try it. I can’t figure out what’s wrong and therefore I have to decide whether I need to stop using BOOST for this task.
Thanks,
Alessio
Program received signal SIGSEGV, Segmentation fault.
0x000000010006ace3 in boost::detail::parallel::edge_descriptor >::out_generator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >::map(boost::detail::edge_desc_impl, boost::undirectedS) const ()
(gdb) stack
Undefined command: "stack". Try "help".
(gdb) backtrace
#0 0x000000010006ace3 in boost::detail::parallel::edge_descriptor >::out_generator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >::map(boost::detail::edge_desc_impl, boost::undirectedS) const ()
#1 0x000000010006ac84 in boost::detail::parallel::edge_descriptor >::out_generator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >::operator()(boost::detail::edge_desc_impl) const ()
#2 0x000000010006ac17 in boost::iterators::transform_iterator >::out_generator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter > >*>, unsigned long, boost::detail::edge_desc_impl, long>, boost::iterators::use_default, boost::iterators::use_default>::dereference() const ()
#3 0x000000010006ab7c in boost::iterators::transform_iterator >::out_generator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter > >*>, unsigned long, boost::detail::edge_desc_impl, long>, boost::iterators::use_default, boost::iterators::use_default>::reference boost::iterators::iterator_core_access::dereference >::out_generator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter > >*>, unsigned long, boost::detail::edge_desc_impl, long>, boost::iterators::use_default, boost::iterators::use_default> >(boost::iterators::transform_iterator >::out_generator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter > >*>, unsigned long, boost::detail::edge_desc_impl, long>, boost::iterators::use_default, boost::iterators::use_default> const&)
()
#4 0x000000010006ab4f in boost::iterators::detail::iterator_facade_base >::out_generator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter > >*>, unsigned long, boost::detail::edge_desc_impl, long>, boost::iterators::use_default, boost::iterators::use_default>, boost::detail::parallel::edge_descriptor >, boost::iterators::detail::iterator_category_with_traversal, boost::detail::parallel::edge_descriptor >, long, false, false>::operator*() const ()
#5 0x000000010006aaf5 in boost::adjacency_iterator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>, boost::detail::parallel::global_descriptor<unsigned long>, boost::iterators::transform_iterator >::out_generator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter > >*>, unsigned long, boost::detail::edge_desc_impl, long>, boost::iterators::use_default, boost::iterators::use_default>, long>::dereference() const ()
#6 0x000000010006aa91 in boost::adjacency_iterator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>, boost::detail::parallel::global_descriptor<unsigned long>, boost::iterators::transform_iterator >::out_generator, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter > >*>, unsigned long, boost::detail::edge_desc_impl 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 = 1;
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;
}