|
Boost Users : |
Subject: [Boost-users] [graph] Example parallel BGL
From: Sensei (senseiwa_at_[hidden])
Date: 2015-07-30 09:51:09
Dear all,
I'd like to play with Parallel BGL (with MPI), and I'd like to see some
example code. I've followed the Overview and the Adjacency List example,
but I cannot compile my code.
Right now, I'd like to create a graph, and then fill in with some nodes.
Then, access the nodes belonging to a single process, but I wish I had
an error there
My error concerns the definition of the graph: No template named
'bsp_process_group' in namespace 'boost::parallel'; did you mean
'boost::process_group'? The code follows.
What am I doing wrong here? I may have forgotten some header... Is there
any distributed (complete) example code that I might read?
Thanks & Cheers!
#include <iostream>
#include <string>
#include <vector>
#include <boost/mpi.hpp>
#include <boost/graph/use_mpi.hpp>
#include <boost/graph/distributed/mpi_process_group.hpp>
#include <boost/graph/distributed/adjacency_list.hpp>
int main(int argc, const char * argv[])
{
boost::mpi::environment env;
boost::mpi::communicator comm;
typedef boost::adjacency_list<boost::vecS,
boost::distributedS<boost::parallel::bsp_process_group, boost::vecS>,
boost::directedS> graph;
typedef boost::erdos_renyi_iterator<boost::minstd_rand, graph>
generator;
if (comm.rank() == 0)
{
boost::add_edge(1, 2);
boost::add_edge(2, 2);
boost::add_edge(2, 3);
boost::add_edge(3, 4);
boost::add_edge(4, 5);
boost::add_edge(5, 1);
// access ***only rank 0 nodes***
}
return 0;
}
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