Problems with MPI and PBGL

Hi friends,
I am working on delta stepping algorithm. Recently I came across "Parallel Boost Library" but when I tried to call distributed delta-stepping, from /libs/graph_parallel/test as, "mpiCC -I/usr/lib/openmpi/include/ distributed_shortest_paths_test.cpp ", it is reporting,
distributed_shortest_paths_test.cpp:(.text+0x5892): undefined reference to `boost::mpi::communicator::communicator()' distributed_shortest_paths_test.cpp:(.text+0x58a8): undefined reference to `boost::graph::distributed::mpi_process_group::mpi_process_group(boost::mpi::communicator)' distributed_shortest_paths_test.cpp:(.text+0x5a00): undefined reference to `boost::graph::distributed::mpi_process_group::~mpi_process_group()' distributed_shortest_paths_test.cpp:(.text+0x5a17): undefined reference to `boost::graph::distributed::mpi_process_group::~mpi_process_group()' /tmp/ccP7trmD.o: In function `test_main(int, char**)': distributed_shortest_paths_test.cpp:(.text+0x5ca7): undefined reference to `boost::mpi::environment::environment(int&, char**&, bool)' distributed_shortest_paths_test.cpp:(.text+0x5d60): undefined reference to `boost::mpi::environment::~environment()' distributed_shortest_paths_test.cpp:(.text+0x5d7c): undefined reference to `boost::mpi::environment::~environment()' /tmp/ccP7trmD.o: In function `__static_initialization_and_destruction_0(int, int)': distributed_shortest_paths_test.cpp:(.text+0x5e84): undefined reference to `boost::system::generic_category()' distributed_shortest_paths_test.cpp:(.text+0x5e90): undefined reference to `boost::system::generic_category()' distributed_shortest_paths_test.cpp:(.text+0x5e9c): undefined reference to `boost::system::system_category() ... ... .. ..
I am not able to compile any of the parallel graph examples. I tested MPI with some mpi examples from boost website<http://www.boost.org/doc/libs/1_43_0/doc/html/mpi/getting_started.html#mpi.installation>and they worked fine. I guess the problem is with linking MPI. I would be grateful if you could help me out of this situation.
Thanking you, Siva teja.

On Fri, 10 May 2013, siva teja wrote:
Hi friends,
I am working on delta stepping algorithm. Recently I came across "Parallel Boost Library" but when I tried to call distributed delta-stepping, from /libs/graph_parallel/test as, "mpiCC -I/usr/lib/openmpi/include/ distributed_shortest_paths_test.cpp ", it is reporting,
distributed_shortest_paths_test.cpp:(.text+0x5892): undefined reference to `boost::mpi::communicator::communicator()' distributed_shortest_paths_test.cpp:(.text+0x58a8): undefined reference to `boost::graph::distributed::mpi_process_group::mpi_process_group(boost::mpi::communicator)' distributed_shortest_paths_test.cpp:(.text+0x5a00): undefined reference to `boost::graph::distributed::mpi_process_group::~mpi_process_group()' distributed_shortest_paths_test.cpp:(.text+0x5a17): undefined reference to `boost::graph::distributed::mpi_process_group::~mpi_process_group()' /tmp/ccP7trmD.o: In function `test_main(int, char**)': distributed_shortest_paths_test.cpp:(.text+0x5ca7): undefined reference to `boost::mpi::environment::environment(int&, char**&, bool)' distributed_shortest_paths_test.cpp:(.text+0x5d60): undefined reference to `boost::mpi::environment::~environment()' distributed_shortest_paths_test.cpp:(.text+0x5d7c): undefined reference to `boost::mpi::environment::~environment()' /tmp/ccP7trmD.o: In function `__static_initialization_and_destruction_0(int, int)': distributed_shortest_paths_test.cpp:(.text+0x5e84): undefined reference to `boost::system::generic_category()' distributed_shortest_paths_test.cpp:(.text+0x5e90): undefined reference to `boost::system::generic_category()' distributed_shortest_paths_test.cpp:(.text+0x5e9c): undefined reference to `boost::system::system_category() ... ... .. ..
I am not able to compile any of the parallel graph examples. I tested MPI with some mpi examples from boost website and they worked fine. I guess the problem is with linking MPI. I would be grateful if you could help me out of this situation.
You need to add -lboost_graph_parallel -lboost_mpi -lboost_system to your link command, plus a -L option for wherever your Boost libraries are (<top of Boost source tree>/stage/lib is one location if you haven't installed the files). -- Jeremiah Willcock

Hi, Thanks for your reply, it worked. I have to run distributed_delta_stepping with graphs in CSR fromat. So I tried with "distributed_shortest_path_test.cpp" located at "<top of boost source tree>/libs/graph_parallel/test/ ". It reads a random graph in adjacency list format. But I have to run DIMACS_USA graph in CSR format. So, I edited the code but it resulted in following errors. I guess I am facing problems while representing a graph in CSR format.. CODE : void test_distributed_shortest_paths(int n, double p, int c, int seed) { char *graf = "./dimacs_USA_sort_wdup" ; // line no :169 typedef compressed_sparse_row_graph<directedS, VertexProperties, WeightedEdge, no_property, distributedS<mpi_process_group>
Graph;
typedef graph_traits<Graph>::vertex_descriptor vertex_descriptor; typedef graph_traits<Graph>::edge_descriptor edge_descriptor; typedef graph_traits<Graph>::vertex_iterator vertex_iterator; typedef graph_traits<Graph>::vertices_size_type vertices_size_type; typedef property_map<Graph, vertex_index_t>::type vertex_index_map; typedef std::pair<long int, long int> Edge; struct timeval starttime,endtime,timediff; gettimeofday(&starttime,0x0); char ch; long int num_nodes; long int num_arcs; Edge *edge_array; long int *weights; long int arc_index=0, wt_index=0; long int vert1, vert2, dist; std::fstream input; input.open(graf); if( !input.eof()) { input >> ch; if(ch == 'v') { input >> num_nodes; } } if(!input.eof()) { input >> ch; if(ch =='e') { input >> num_arcs; } else std::cout << "Wrong graph format\n"; } edge_array=(Edge *)malloc(sizeof(Edge) * num_arcs); weights=(long int *)malloc(sizeof(long int) * num_arcs); while(!input.eof()) { input >> ch; if(ch == 'a') { input >> vert1 >> vert2 >> dist; Edge temp; temp.first=vert1; temp.second=vert2; edge_array[arc_index++]=temp; weights[wt_index++]=dist; } } gettimeofday(&endtime,0x0); Graph g(edges_are_unsorted_t, edge_array, edge_array + num_arcs, num_nodes); //line no:267 vertex_descriptor s = vertex(1, g); // line no:271 graph::distributed::delta_stepping_shortest_paths(g, s, dummy_property_map(), get(&VertexProperties::distance, g), //line no :283 get(&WeightedEdge::weight, g)); // line no:284 } ERRORS : distributed_shortest_paths_test.cpp: In function ‘void test_distributed_shortest_paths(int, double, int, int)’: distributed_shortest_paths_test.cpp:169: warning: deprecated conversion from string constant to ‘char*’ distributed_shortest_paths_test.cpp:267: error: ‘edge_array’ is not a type distributed_shortest_paths_test.cpp:267: error: ‘edge_array’ is not a type distributed_shortest_paths_test.cpp:267: error: expected ‘,’ or ‘...’ before ‘+’ token distributed_shortest_paths_test.cpp:271: error: no matching function for call to ‘vertex(int, test_distributed_shortest_paths(int, double, int, int)::Graph (&)(boost::edges_are_unsorted_t, int, int))’ distributed_shortest_paths_test.cpp:283: error: no matching function for call to ‘get(int VertexProperties::*, test_distributed_shortest_paths(int, double, int, int)::Graph (&)(boost::edges_are_unsorted_t, int, int))’ distributed_shortest_paths_test.cpp:284: error: no matching function for call to ‘get(weight_type WeightedEdge::*, test_distributed_shortest_paths(int, double, int, int)::Graph (&)(boost::edges_are_unsorted_t, int, int))’ Thank you in advance. Regards, Sivateja

Hi jeremiah, It compiled without errors when I edited line number 267 as, Graph g(edge_array, edge_array + num_arcs, weights, num_nodes); But when I run the command " mpirun -np 2 ./a.out" Following errors occured, **** Testing aborted. **** 1 error detected -------------------------------------------------------------------------- mpirun has exited due to process rank 0 with PID 19096 on node rise-02 exiting without calling "finalize". This may have caused other processes in the application to be terminated by signals sent by mpirun (as reported here). -------------------------------------------------------------------------- What does that mean ??
participants (2)
-
Jeremiah Willcock
-
siva teja