crunch-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 陈竞 <cj.mag...@gmail.com>
Subject confused about node split in MSCRPlanner.prepareFinalGraph
Date Thu, 28 Apr 2016 06:17:38 GMT
i'm reading crunch source code, i am very confused about the code
of  MSCRPlanner.prepareFinalGraph():

if (baseVertex.isGBK()) {
  Vertex vertex = graph.getVertexAt(baseVertex.getPCollection());
  for (Edge e : baseVertex.getIncomingEdges()) {
    if (e.getHead().isOutput()) {
      // Execute an edge split.
      Vertex splitTail = e.getHead();
      PCollectionImpl<?> split = splitTail.getPCollection();
      InputCollection<?> inputNode = handleSplitTarget(split);
      Vertex splitHead = graph.addVertex(inputNode, false);

      // Divide up the node paths in the edge between the two GBK nodes so
      // that each node is either owned by GBK1 -> newTail or newHead -> GBK2.
      for (NodePath path : e.getNodePaths()) {
        NodePath headPath = path.splitAt(split, splitHead.getPCollection());
        graph.getEdge(vertex, splitTail).addNodePath(headPath);
        graph.getEdge(splitHead, vertex).addNodePath(path);
      }

      // Note the dependency between the vertices in the graph.
      graph.markDependency(splitHead, splitTail);
    }


my question is , since $vertex is e's tail, why  graph.getEdge(vertex,
splitTail).addNodePath(headPath)?

it seems like crunch reverse the edeg e?


-- 

Jing Chen HPCC.ICT.AC China

Mime
View raw message