This was missing in the trace g>, long>, boost::iterators::use_default, boost::iterators::use_default>, long>::reference boost::iterators::iterator_core_access::dereference<boost::adjacency_iterator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>, boost::detail::parallel::global_descriptor<unsigned long>, boost::iterators::transform_iterator<boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter<std::__1::__wrap_iter<boost::detail::stored_edge_property<unsigned long, boost::property<boost::edge_locally_owned_t, bool, boost::property<boost::edge_target_processor_id_t, short, boost::no_property> > >*>, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>, boost::iterators::use_default, boost::iterators::use_default>, long> >(boost::adjacency_iterator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>, boost::detail::parallel::global_descriptor<unsigned long>, boost::iterators::transform_iterator<boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter<std::__1::__wrap_iter<boost::detail::stored_edge_property<unsigned long, boost::property<boost::edge_locally_owned_t, bool, boost::property<boost::edge_target_processor_id_t, short, boost::no_property> > >*>, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>, boost::iterators::use_default, boost::iterators::use_default>, long> const&) () #7 0x0000000100050249 in boost::iterators::detail::iterator_facade_base<boost::adjacency_iterator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>, boost::detail::parallel::global_descriptor<unsigned long>, boost::iterators::transform_iterator<boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter<std::__1::__wrap_iter<boost::detail::stored_edge_property<unsigned long, boost::property<boost::edge_locally_owned_t, bool, boost::property<boost::edge_target_processor_id_t, short, boost::no_property> > >*>, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>, boost::iterators::use_default, boost::iterators::use_default>, long>, boost::detail::parallel::global_descriptor<unsigned long>, boost::iterators::detail::iterator_category_with_traversal<std::__1::input_iterator_tag, boost::iterators::random_access_traversal_tag>, boost::detail::parallel::global_descriptor<unsigned long>, long, false, false>::operator*() const () #8 0x000000010000361e in boost::property_traits<boost::iterator_property_map<std::__1::__wrap_iter<int*>, boost::local_property_map<boost::graph::distributed::mpi_process_group, boost::detail::parallel::global_descriptor_property_map<unsigned long>, boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long> >, int, int&> >::value_type boost::graph::distributed::connected_components_ps<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>, boost::iterator_property_map<std::__1::__wrap_iter<int*>, boost::local_property_map<boost::graph::distributed::mpi_process_group, boost::detail::parallel::global_descriptor_property_map<unsigned long>, boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long> >, int, int&> >(boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> const&, boost::iterator_property_map<std::__1::__wrap_iter<int*>, boost::local_property_map<boost::graph::distributed::mpi_process_group, boost::detail::parallel::global_descriptor_property_map<unsigned long>, boost::vec_adj_list_vertex_id_map<boost::no_property, unsigned long> >, int, int&>) () #9 0x00000001000018a7 in main () On 05 Nov 2015, at 16:48, Quaglino Alessio <quagla@usi.ch<mailto:quagla@usi.ch>> wrote: 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<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >::map(boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, boost::undirectedS) const () (gdb) stack Undefined command: "stack". Try "help". (gdb) backtrace #0 0x000000010006ace3 in boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >::map(boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, boost::undirectedS) const () #1 0x000000010006ac84 in boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >::operator()(boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>) const () #2 0x000000010006ac17 in boost::iterators::transform_iterator<boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter<std::__1::__wrap_iter<boost::detail::stored_edge_property<unsigned long, boost::property<boost::edge_locally_owned_t, bool, boost::property<boost::edge_target_processor_id_t, short, boost::no_property> > >*>, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>, boost::iterators::use_default, boost::iterators::use_default>::dereference() const () #3 0x000000010006ab7c in boost::iterators::transform_iterator<boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter<std::__1::__wrap_iter<boost::detail::stored_edge_property<unsigned long, boost::property<boost::edge_locally_owned_t, bool, boost::property<boost::edge_target_processor_id_t, short, boost::no_property> > >*>, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>, boost::iterators::use_default, boost::iterators::use_default>::reference boost::iterators::iterator_core_access::dereference<boost::iterators::transform_iterator<boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter<std::__1::__wrap_iter<boost::detail::stored_edge_property<unsigned long, boost::property<boost::edge_locally_owned_t, bool, boost::property<boost::edge_target_processor_id_t, short, boost::no_property> > >*>, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>, boost::iterators::use_default, boost::iterators::use_default> >(boost::iterators::transform_iterator<boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter<std::__1::__wrap_iter<boost::detail::stored_edge_property<unsigned long, boost::property<boost::edge_locally_owned_t, bool, boost::property<boost::edge_target_processor_id_t, short, boost::no_property> > >*>, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>, boost::iterators::use_default, boost::iterators::use_default> const&) () #4 0x000000010006ab4f in boost::iterators::detail::iterator_facade_base<boost::iterators::transform_iterator<boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter<std::__1::__wrap_iter<boost::detail::stored_edge_property<unsigned long, boost::property<boost::edge_locally_owned_t, bool, boost::property<boost::edge_target_processor_id_t, short, boost::no_property> > >*>, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>, boost::iterators::use_default, boost::iterators::use_default>, boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >, boost::iterators::detail::iterator_category_with_traversal<std::__1::input_iterator_tag, boost::iterators::random_access_traversal_tag>, boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >, long, false, false>::operator*() const () #5 0x000000010006aaf5 in boost::adjacency_iterator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>, boost::detail::parallel::global_descriptor<unsigned long>, boost::iterators::transform_iterator<boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter<std::__1::__wrap_iter<boost::detail::stored_edge_property<unsigned long, boost::property<boost::edge_locally_owned_t, bool, boost::property<boost::edge_target_processor_id_t, short, boost::no_property> > >*>, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned long>, long>, boost::iterators::use_default, boost::iterators::use_default>, long>::dereference() const () #6 0x000000010006aa91 in boost::adjacency_iterator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS>, boost::detail::parallel::global_descriptor<unsigned long>, boost::iterators::transform_iterator<boost::detail::parallel::edge_descriptor<boost::detail::edge_desc_impl<boost::directed_tag, unsigned long> >::out_generator<boost::adjacency_list<boost::vecS, boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS, boost::defaultS>, boost::undirectedS, boost::no_property, boost::no_property, boost::no_property, boost::listS> >, boost::detail::out_edge_iter<std::__1::__wrap_iter<boost::detail::stored_edge_property<unsigned long, boost::property<boost::edge_locally_owned_t, bool, boost::property<boost::edge_target_processor_id_t, short, boost::no_property> > >*>, unsigned long, boost::detail::edge_desc_impl<boost::directed_tag, unsigned lon---Type <return> to continue, or q <return> to quit--- #define PARALLEL_GRAPH using namespace boost; using boost::graph::distributed::mpi_process_group; 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; 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; }