Graph和init
在pagerank.cpp中对图进行初始化:
Graph<Empty> * graph;
graph = new Graph<Empty>();
具体实现在graph.hpp中,设置threads和sockets,其中threads—cpus—partitions,sockets—nodes—machines,threads_per_socket表示每个节点(机器)上分到的线程数(分区数):
Graph() {
threads = numa_num_configured_cpus();
sockets = numa_num_configured_nodes();
threads_per_socket = threads / sockets;
init();
}
init()函数设置分区数
void init() {
edge_data_size = std::is_same<Ed

本文聚焦于Gemini中的Graph初始化过程,详细解释了如何设置threads和sockets,以及如何根据边的数量来初始化分区。同时介绍了init()函数的作用,如何计算点的分区号,以及如何更新点的出度和入度。alpha值被设定为分区数量的8倍。
最低0.47元/天 解锁文章
5752





