1

私の仕事に関連しています(ここではadjacency_listでジェネリック型を使用しています)私は今、次のことを行う単純なコードの実行をテストしています:

  • boost-mpi環境を初期化します
  • ファイルから分散adjacency_listにグラフをロードします
  • 最後に、各マシンで2つの簡単な操作を実行します。エッジの数をカウントし、クラスタリング係数を計算します。

コードは次のとおりです。

#include "Common.h"
#include "GraphFileReader.h"
#include "GraphNeighbors.h"
#include <boost/graph/metis.hpp>
#include <boost/mpi/environment.hpp>
#include <boost/mpi/communicator.hpp>
#include <time.h>

int main(int argc, char *argv []){

    // Start mpi enviroment
    boost::mpi::environment env(argc, argv);
    boost::mpi::communicator world;

    // Create the graph
    GraphFileReader *graphFileReader;
    undirectedAdjacencyList graph;

    if(process_id(graph.process_group()) == 0){
            // Load the graph's path
            graphFileReader = new GraphFileReader(argv[1]);
            // Read the graph file and adds the vertices and edges
            graphFileReader->loadGraph(graph);
    }

    // Wait until the process 0 has finished loading the graph
    world.barrier();
    synchronize(graph.process_group());

    GraphNeighbors graphNeighbors;

    // Now each machine should process it's own graph piece
    graphNeighbors.countEdges(graph);
    graphNeighbors.clusteringCoefficient(graph);

    // Wait for the other processes before finishing
    world.barrier();
    synchronize(graph.process_group());
    cout << "\n process: " << world.rank() <<" finishing\n" << std::endl;

結果は次のとおりです。

graphs: /usr/include/boost/graph/distributed/adjacency_list.hpp:2679: 
std::pair<typename boost::adjacency_list<OutEdgeListS, boost::distributedS<ProcessGroup, 
InVertexListS, InDistribution>, DirectedS, VertexProperty, EdgeProperty, GraphProperty,
 EdgeListS>::out_edge_iterator, typename boost::adjacency_list<OutEdgeListS, 
boost::distributedS<ProcessGroup, InVertexListS, InDistribution>, DirectedS, 
VertexProperty, EdgeProperty, GraphProperty, EdgeListS>::out_edge_iterator> 
boost::out_edges(typename boost::adjacency_list<OutEdgeListS, 
boost::distributedS<ProcessGroup, InVertexListS, InDistribution>, DirectedS, 
VertexProperty, EdgeProperty, GraphProperty, EdgeListS>::vertex_descriptor, const 
boost::adjacency_list<OutEdgeListS, boost::distributedS<ProcessGroup, InVertexListS, 
InDistribution>, DirectedS, VertexProperty, EdgeProperty, GraphProperty, EdgeListS>&) [with
 OutEdgeListS = boost::vecS, ProcessGroup = boost::graph::distributed::mpi_process_group,
 InVertexListS = boost::vecS, InDistribution = boost::defaultS, DirectedS = 
boost::undirectedS, VertexProperty = Node, EdgeProperty = boost::no_property, GraphProperty
= boost::no_property, EdgeListS = boost::listS]: Assertion `v.owner == g.processor()' failed.

_________________________________________________________________

I'm process: 0    
I'm process: 1

Number of edges: 4
        0.37694 milliseconds
Number of edges: 2
        0.16284 milliseconds
rank 1 in job 1  compute-1-4_49342   caused collective abort of all ranks
  exit status of rank 1: killed by signal 6
_________________________________________________________________
Epilogue Args:
Job  ID:        138573.tucan
User ID:        ***
Group ID:       ***
Job Name:       mpiGraphs.job
Resource List:  5746
Queue Name:     ncpus=1,neednodes=2:ppn=2,nodes=2:ppn=2
Account String: cput=00:00:00,mem=420kb,vmem=13444kb,walltime=00:00:02
Date:           Thu Mar  1 14:28:19 CET 2012
_________________________________________________________________

一方、1台のマシンのみでの実行は完全に機能します。

I'm process: 0

Number of edges: 6
        8.46696 milliseconds
The network average clustering coefficient is: 0.53333
        0.12708 milliseconds


 process: 0 finishing

私の家庭教師と私は、これは一方のマシンが終了し、もう一方のマシンがまだ操作を実行しているためである可能性があると考えたので、同期とバリアを追加します(実際には両方の違いがわからないため、同じものでいくつかの組み合わせをテストしました結果)。

残りのコード(Common.h、GraphFileReader、またはGraphNeighbors)が必要な場合は、巨大な投稿を避けるために、コードをアップロードしてここにリンクを投稿することができます。

4

1 に答える 1

1

同期エラーについて考えているので、表示されるエラーメッセージを簡略化します。

グラフ:(ブースト)adjacency_list.hpp:2679:boost :: out_edges(vertex_descriptor v、adjacency_list&g):アサーション `v.owner == g.processor()'が失敗しました。

ランク1の終了ステータス:シグナル6によって強制終了されました

シグナル6はabort()、によってトリガーされます。これは、上記のアサーションの失敗によってトリガーされます。

このグラフライブラリについては何も知りませんが、adjacency_list.hppによると、プロセッサ1がプロセッサ0に属する頂点を呼び出しout_edgesて渡しているようです。v

于 2012-03-01T14:52:40.370 に答える