Example #1
0
  void update(Graph<Vertex>& phigraph,VertexSubset* nextFrontier,uphiLong curVertex){


    uphiLong degree = phigraph.vertex[curVertex].getOutDegree();
    //printf("vertex[%ld]:degree=%ld\n",curVertex,degree);
    parallel_for(uphiLong j = 0;j < degree;j++){
      phiLong out = phigraph.vertex[curVertex].getOutVertexes(j);
      //#pragma omp atomic
      //path_num[temp]++;
      if(path_num[out] == -1){
        phiCAS(&path_num[out],path_num[out],path_num[curVertex]+1);
        //writeAdd(&path_num[out],path_num[curVertex]);
        nextFrontier->add(out);
      }

      if(path_num[out] == (path_num[curVertex]+1))
        writeAdd(&delta[out],delta[curVertex]);

    }

  }
Example #2
0
 inline bool updateAtomic (uintE s, uintE d) { //atomic Update
   writeAdd(&p_next[d],p_curr[s]/V[s].getOutDegree());
   return 1;
 }