简单的分布式图BGL示例

老师

我正在使用分布式Boost Graph库,但没有成功。我的目标非常简单:从示例中分发由BGL生成器生成的图形但是,关于bsp_process_group以下内容,我有编译错误

错误列表是HUGE,但基本上说我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文档非常稀少...

谢谢!

杰夫·特鲁尔

我认为文档已经过时了。boost::parallel::bsp_process_group似乎不再存在。使用boost::graph::distributed::mpi_process_group代替代替(加上添加#include <map>)可以使此代码在我的计算机上编译(使用Boost 1.59的Ubuntu 15.04)。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何运行tensorflow分布式mnist示例

来自分类Dev

在分布式系统中传递消息的简单方法

来自分类Dev

反转dask分布式数据帧的简单方法

来自分类Dev

分布式认证

来自分类Dev

分布式计算

来自分类Dev

Hadoop-示例jar中包含的示例无法在伪分布式模式下完成

来自分类Dev

Hadoop分布式文件系统与分布式缓存

来自分类Dev

Julia Parallel分布式

来自分类Dev

分布式电源集

来自分类Dev

什么是分布式缓存?

来自分类Dev

分布式Tensorflow错误/

来自分类Dev

Julia Parallel分布式

来自分类Dev

什么是分布式缓存?

来自分类Dev

Hadoop分布式缓存

来自分类Dev

Pig分布式缓存

来自分类Dev

分布式分散环

来自分类Dev

Spark的分布式存储

来自分类Dev

调试分布式OR操作

来自分类Dev

分布式引擎 DBException

来自分类Dev

分布式tensorflow源码

来自分类Dev

分布式TensorFlow示例不适用于TensorFlow 0.9

来自分类Dev

分布式系统中逻辑顺序和总顺序的示例

来自分类Dev

支持分布式消息传递的最简单的C ++库-观察者模式

来自分类Dev

简单来说,分布式系统中的透明性是什么?

来自分类Dev

集中式和分布式顺序图有什么区别?

来自分类Dev

Azure Service Fabric-分布式计算代码示例蒙特卡洛模拟-性能问题

来自分类Dev

分布式tensorflow复制训练示例:grpc_tensorflow_server-没有这样的文件或目录

来自分类Dev

代表分布式VCS中的“问题”

来自分类Dev

如何创建分布式文件系统