コード例 #1
0
 /** Adds an edge to the batch ingress buffer, and updates the query set. */
 void add_edge(vertex_id_type source, vertex_id_type target, const EdgeData& edata) {
   BEGIN_TRACEPOINT(batch_ingress_add_edge);
   edgesend_lock.lock();
   ASSERT_LT(edgesend.size(), bufsize);
   edgesend.push_back(std::make_pair(source, target)); 
   edatasend.push_back(edata);        
   query_set[graph_hash::hash_vertex(source) % rpc.numprocs()].insert(source);
   query_set[graph_hash::hash_vertex(target) % rpc.numprocs()].insert(target);
   ++num_edges;
   edgesend_lock.unlock();
   END_TRACEPOINT(batch_ingress_add_edge);
   if (is_full()) flush();
 } // end of add_edge
コード例 #2
0
ファイル: dc.cpp プロジェクト: RedSunCMX/graphlab
void distributed_control::exec_function_call(procid_t source,
                                            unsigned char packet_type_mask,
                                            const char* data,
                                            const size_t len) {
  BEGIN_TRACEPOINT(dc_call_dispatch);
  // extract the dispatch function
  iarchive arc(data, len);
  size_t f;
  arc >> f;
  // a regular funcion call
  dc_impl::dispatch_type dispatch = (dc_impl::dispatch_type)f;
  dispatch(*this, source, packet_type_mask, data + arc.off, len - arc.off);
  if ((packet_type_mask & CONTROL_PACKET) == 0) inc_calls_received(source);
  END_TRACEPOINT(dc_call_dispatch);
}
コード例 #3
0
ファイル: math.hpp プロジェクト: bmabey/graphchi
void orthogonalize_vs_all(DistSlicedMat & mat, int curoffset){
  assert(mi.ortho_repeats >=1 && mi.ortho_repeats <= 3);
  INITIALIZE_TRACER(orthogonalize_vs_alltrace, "orthogonalization step");
  BEGIN_TRACEPOINT(orthogonalize_vs_alltrace);
  bool old_debug = debug;
  debug = false;
  DistVec current = mat[curoffset];
  //DistDouble * alphas = new DistDouble[curoffset];
  //cout<<current.to_vec().transpose() << endl;
  for (int j=0; j < mi.ortho_repeats; j++){
    for (int i=0; i< curoffset; i++){
      DistDouble alpha = mat[i]*current;
      //     //cout<<mat[i].to_vec().transpose()<<endl;
      //     //cout<<"alpha is: " <<alpha.toDouble()<<endl;
      if (alpha.toDouble() > 1e-10)
        current = current - mat[i]*alpha;
    }
  }
  END_TRACEPOINT(orthogonalize_vs_alltrace);
  debug = old_debug;
  current.debug_print(current.name);
}