谁能用通俗易懂的英语解释 index
在函数 MPI_Graph_create(MPI_Comm comm_old, int nnodes, const int index[],
const int edges[]、int reorder、MPI_Comm *comm_graph)
我一直在分析 MPI 手册页中指定的 MPI_Graph_create
函数。我怀念 index[]
的计算方式。该标准指定 index
变量指的是节点的度数,这意味着从特定节点入射的边数。对于下面的邻接矩阵,标准有 index = 2, 3, 4, 6
。我期待 2 , 1 ,1 ,2
基于邻接矩阵指定的边。
Process Neighbors
0 1,3
1 0
2 3
3 0,2
MPI 标准的正确答案是:-
nnodes = 4
index = 2, 3, 4, 6
edges = 1 ,3, 0, 3, 0 ,2
最佳答案
你理解正确,但是索引写错了。也就是说,“答案”index= 2, 3, 4, 6
与 index= 2, 1, 1, 2
相同。
只需注意
2 = 2
3 = 2 + 1
4 = 2 + 1 + 1
6 = 2 + 1 + 1 + 2
您可以看到您对问题的理解如何与规范的答案相匹配。您所要做的就是汇总您的版本,以便为 MPI_Graph_create()
提供所需的索引。
关于c++ - 我们如何计算 `MPI_graph_create` 索引数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32832662/