Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Segmentation fault with parallel BGL
From: Quaglino Alessio (alessio.quaglino_at_[hidden])
Date: 2015-11-06 04:25:38


It looks like the error appears only when a processor ends up with an empty edge list.

That is, the following works with mpirun -np 1 but gives a segmentation fault with -np 2

using namespace boost;
using boost::graph::distributed::mpi_process_group;
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;

    int nV = 30000;
    int num = 0;

    Graph G(nV);
    synchronize(G);
    std::vector<int> localComponent(nV);
    LocalMap components(localComponent.begin(),get(vertex_index, G));
    add_edge(vertex(0,G),vertex(1,G),G);
    num = connected_components_ps(G, components);

The following works with -np 2 as well (the only thing I did was adding an edge)

    int nV = 30000;
    int num = 0;

    Graph G(nV);
    synchronize(G);
    std::vector<int> localComponent(nV);
    LocalMap components(localComponent.begin(),get(vertex_index, G));
    add_edge(vertex(0,G),vertex(1,G),G);
    add_edge(vertex(29998,G),vertex(29999,G),G);
    num = connected_components_ps(G, components);

Unfortunately, in my application it is very likely that some processors end up with no edges. Is there a way to fix this other than adding fake edges from a vertex to itself?

Thanks,
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