2017-01-17 3 views
2

P-BGL PageRank에 대한 속성 맵을 인스턴스화하려고합니다. 그러나, 서명 부스트 1.63로PBGL에서`make_distributed_property_map` 사용하기

template<typename ProcessGroup, typename GlobalMap, typename StorageMap> 
inline distributed_property_map<ProcessGroup, GlobalMap, StorageMap> 

template<typename ProcessGroup, typename GlobalMap, typename StorageMap, 
     typename Reduce> 
inline distributed_property_map<ProcessGroup, GlobalMap, StorageMap> 
make_distributed_property_map(const ProcessGroup& pg, GlobalMap global, 
           StorageMap storage, Reduce reduce) 

template<typename Key, typename ProcessGroup, typename LocalPropertyMap> 
distributed_property_map<ProcessGroup, LocalPropertyMap, Key> 
make_distributed_property_map(const ProcessGroup& pg, LocalPropertyMap pmap); 

template<typename Key, typename ProcessGroup, typename LocalPropertyMap, 
     typename Reduce> 
distributed_property_map<ProcessGroup, LocalPropertyMap, Key> 
make_distributed_property_map(const ProcessGroup& pg, LocalPropertyMap pmap, 
           Reduce reduce); 

에서 변경으로 documentation는 오래된이고, 나는의 인스턴스 수없는 것 템플릿 매개 변수의 올바른 모델.

어떤 도움이 크게 감사합니다
#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> 
#include <boost/graph/erdos_renyi_generator.hpp> 
#include <boost/random/linear_congruential.hpp> 
#include <boost/graph/page_rank.hpp> 

int main(int argc, char * argv[]) 
{ 
    boost::mpi::environment env(argc, argv); 
    boost::mpi::communicator comm; 

    typedef boost::adjacency_list<boost::vecS, 
      boost::distributedS<boost::graph::distributed::mpi_process_group, boost::vecS>, 
      boost::directedS, 
      // ???? 
    > Graph; 
    typedef boost::erdos_renyi_iterator<boost::minstd_rand, Graph> generator; 
    typedef boost::parallel::distributed_property_map<boost::graph::distributed::mpi_process_group, 
      // ???? 
    > PropertyMap; 

    boost::minstd_rand gen; 

    Graph g(generator(gen, 100, 0.05), generator(), 100); 


    auto map = boost::parallel::make_distributed_property_map< // ???? 
      boost::graph::distributed::mpi_process_group, 
      // ??? 
      >process_group(g), ???); 

    boost::graph::page_rank(g, map); 

    return 0; 
} 

가능한 거의없는 문서 나 예제가 : 여기

가 표시 갭 골격 코드입니다.

답변

2

이 내가 원하는 정확히 수행 graph_parallel/test/distributed_rmat_pagerank.cpp에서 테스트 코드 예제의 알려지지 않은 부분이다 :

typedef parallel::variant_distribution<mpi_process_group> Distribution; Distribution distrib = parallel::block(pg, n); 

typedef adjacency_list<vecS, 
     distributedS<mpi_process_group, vecS>, 
     bidirectionalS> Graph; 

Graph g(...); 

page_rank(g, make_iterator_property_map(ranks.begin(), get(boost::vertex_index, g)), 
      graph::n_iterations(iters), 0.85, n); 

코드는 https://github.com/boostorg/graph_parallel/blob/develop/test/distributed_rmat_pagerank.cpp에서 확인할 수있다.