Hello.
I try to calculate brandes_betweenness_centrality.
#include <boost/graph/use_mpi.hpp>
#include <boost/mpi/environment.hpp>
#include <boost/mpi/communicator.hpp>
#include <boost/graph/distributed/mpi_process_group.hpp>
#include <boost/graph/parallel/process_group.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/distributed/adjacency_list.hpp>
#include <boost/graph/small_world_generator.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/graph/distributed/betweenness_centrality.hpp>
#include <boost/graph/distributed/graphviz.hpp>
#include <boost/graph/rmat_graph_generator.hpp>
#include <boost/random/linear_congruential.hpp>
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace boost;
using namespace graph;
using namespace distributed;
namespace mpi = boost::mpi;
typedef boost::adjacency_list<listS,
distributedS<mpi_process_group,vecS>,
undirectedS> Graph;
typedef boost::unique_rmat_iterator<boost::minstd_rand, Graph> RMATGen;
struct no_self_loops
{
no_self_loops() {}
bool operator()(const std::pair<int,int>& e) { return e.first != e.second; }
};
int main(int argc, char* argv[])
{
boost::mpi::environment env(argc, argv);
boost::minstd_rand gen;
unsigned int SCALE = atoi(argv[1]);
unsigned int EDGE_FACTOR = atoi(argv[2]);
unsigned int N = pow(2, SCALE);
unsigned int E = EDGE_FACTOR * N;
Graph g(
boost::make_filter_iterator<no_self_loops>
(
RMATGen(gen, N, E, 0.45, 0.15, 0.15, 0.25), RMATGen()),
boost::make_filter_iterator<no_self_loops>(RMATGen(), RMATGen()),
N);
typedef boost::property_map<Graph, vertex_index_t>::type LocalMap;
boost::parallel::distributed_property_map<mpi_process_group, LocalMap, ||||||> centrality_map;
//brandes_betweenness_centrality(g, centrality_map);
}
What should be here "|||||" ?
I see
template<typename ProcessGroup, typename LocalPropertyMap, typename Key,
typename GhostCellS = gc_mapS>
Key: The key_type of the distributed property map, which must model the Global Descriptor concept
But don`t understand, is not work - typedef property_traits<LocalMap>::key_type key_type;
Can you provide example?