2015-07-30 3 views
2

Я играю с распределенной библиотекой графов Boost без успеха. Моя цель очень проста: распределить граф, сгенерированный генератором BGL from the examples. Тем не менее, у меня есть ошибки компиляции относительно bsp_process_group:Простой распределенный график BGL Пример

Список ошибок является ОГРОМНЫЙ, но в основном говорит, что мой typedef является ошибочным.

/usr/local/include/boost/graph/distributed/detail/mpi_process_group.ipp:137:8: No type named 'list' in namespace 'std' 
/usr/local/include/boost/graph/distributed/detail/mpi_process_group.ipp:137:12: Expected member name or ';' after declaration specifiers 
/Users/sensei/Documents/Projects/scratch/pbgl/pbgl/main.cpp:17:68: No template named 'bsp_process_group' in namespace 'boost::parallel'; did you mean 'boost::process_group'? 
/Users/sensei/Documents/Projects/scratch/pbgl/pbgl/main.cpp:17:85: No member named 'bsp_process_group' in namespace 'boost::parallel'; did you mean 'bsp_process_group_tag'? 
/Users/sensei/Documents/Projects/scratch/pbgl/pbgl/main.cpp:17:116: Expected a type 
/usr/local/include/boost/graph/graph_traits.hpp:57:26: Type 'int' cannot be used prior to '::' because it has no members 
/usr/local/include/boost/graph/graph_traits.hpp:58:26: Type 'int' cannot be used prior to '::' because it has no members 
/usr/local/include/boost/graph/graph_traits.hpp:65:26: Type 'int' cannot be used prior to '::' because it has no members 
/usr/local/include/boost/graph/graph_traits.hpp:66:26: Type 'int' cannot be used prior to '::' because it has no members 
/usr/local/include/boost/graph/graph_traits.hpp:67:26: Type 'int' cannot be used prior to '::' because it has no members 
/usr/local/include/boost/graph/erdos_renyi_generator.hpp:48:67: Argument may not have 'void' type 
/usr/local/include/boost/graph/erdos_renyi_generator.hpp:57:67: Argument may not have 'void' type 
/usr/local/include/boost/graph/erdos_renyi_generator.hpp:87:24: Field has incomplete type 'vertices_size_type' (aka 'void') 
/usr/local/include/boost/graph/erdos_renyi_generator.hpp:88:21: Field has incomplete type 'edges_size_type' (aka 'void') 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/utility:253:9: Field has incomplete type 'void' 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/utility:254:9: Field has incomplete type 'void' 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/utility:262:19: Cannot form a reference to 'void' 

Вот мой очень простой и ошибочный код:

#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> 
#include <boost/graph/erdos_renyi_generator.hpp> 
#include <boost/random/linear_congruential.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; 

    boost::minstd_rand gen; 

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

    if (comm.rank() == 0) 
    { 
     // print all nodes for rank 0 here 
    } 
    return 0; 
} 

Можете ли вы ошибку? Кроме того, есть ли место, где я могу найти исходный код для чтения? Распределенная документация BGL, которую я нахожу, очень скудна ...

Спасибо!

ответ

2

Я считаю, что документация устарела; boost::parallel::bsp_process_group больше не появляется. Используя boost::graph::distributed::mpi_process_group вместо этого в качестве замены (плюс добавление #include <map>), этот код может компилироваться на моей машине (Ubuntu 15.04 с использованием Boost 1.59).

Смежные вопросы