I’m using the boost graph library and having a runtime error that I can’t seem to figure out how to fix.
When I create and breadth first search an rmat graph with the wrong combination of number of vertices and number of processors I get an MPI_Unpack runtime error.
Number of Vertices
Processors | 1,000,000 | 2,000,000
1 | pass | pass
2 | pass | fail
3 | pass | pass
4 | pass | pass
From a stack trace I believe that the code is failing on a call to synchronize the first time that the queue of vertices to process is checked for being empty within the breadth first search code.
Can anyone tell me what is wrong in my code please? I’m using boost version 1.41.0 on a mac pro running red hat linux (release 6.2) with gcc 4.4.6 if that helps any.
My code is:
#include <boost/graph/use_mpi.hpp>
#include <boost/mpi/environment.hpp>
#include <boost/mpi/communicator.hpp>
#include <boost/graph/distributed/concepts.hpp>
#include <boost/graph/adj_list_serialize.hpp>
#include <boost/graph/distributed/mpi_process_group.hpp>
#include <boost/graph/distributed/adjacency_list.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/graph/distributed/breadth_first_search.hpp>
#include <boost/graph/rmat_graph_generator.hpp>
using namespace boost;
using namespace graph;
using namespace distributed;
int main(int argc, char* argv[])
{
mpi::environment env(argc, argv);
mpi::communicator world;
int verts = 20;
if(argc > 1){
verts = atoi(argv[1]);
}
int edgs = 12*verts;
if(argc > 2){
edgs = atoi(argv[2]);
}
typedef adjacency_list<listS, distributedS<mpi_process_group, vecS>, undirectedS> Graph;
minstd_rand gen_rmat;
typedef rmat_iterator<minstd_rand, Graph> RMATgen;
Graph g(RMATgen(gen_rmat, verts, 12*verts, 0.33, 0.15, 0.49, 0.03), RMATgen(), verts);
world.barrier();
synchronize(g.process_group());
world.barrier();
breadth_first_search(g, vertex(0, g), visitor(bfs_visitor<null_visitor>()));
world.barrier();
return 0;
}
And the runtime error I get is:
terminate called after throwing an instance of boost::exception_detail::clone_impl
<boost::exception_detail::error_info_injector<boost::mph::exception> >what(): MPI_Unpack: MPI_ERR_ARG: invalid argument of some other kind
As it turns out upgrading to boost 1.50.0 has fixed this problem.