Gemini代码摘抄(一)Graph和init

Graph和init


在pagerank.cpp中对图进行初始化:

  Graph<Empty> * graph;
  graph = new Graph<Empty>();

具体实现在graph.hpp中,设置threads和sockets,其中threads—cpus—partitionssockets—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::value ? 0 : sizeof(EdgeData);
    unit_size = sizeof(VertexId) + edge_data_size;
    edge_unit_size &

你可能感兴趣的:(Gemini,gemini)