You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nemo.apache.org by jo...@apache.org on 2019/01/22 09:00:52 UTC

[incubator-nemo] branch reshaping updated: unit tests pass

This is an automated email from the ASF dual-hosted git repository.

johnyangk pushed a commit to branch reshaping
in repository https://gitbox.apache.org/repos/asf/incubator-nemo.git


The following commit(s) were added to refs/heads/reshaping by this push:
     new a5f22f0  unit tests pass
a5f22f0 is described below

commit a5f22f0a391474046e25fcd05acb004c8dea271a
Author: John Yang <jo...@apache.org>
AuthorDate: Tue Jan 22 18:00:41 2019 +0900

    unit tests pass
---
 .../apache/nemo/compiler/backend/nemo/NemoBackendTest.java  |  7 ++++---
 compiler/optimizer/debug/errored_ir.json                    |  1 +
 .../apache/nemo/runtime/common/plan/TestPlanGenerator.java  | 13 +++++++------
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/compiler/backend/src/test/java/org/apache/nemo/compiler/backend/nemo/NemoBackendTest.java b/compiler/backend/src/test/java/org/apache/nemo/compiler/backend/nemo/NemoBackendTest.java
index 96a7aef..335ef1a 100644
--- a/compiler/backend/src/test/java/org/apache/nemo/compiler/backend/nemo/NemoBackendTest.java
+++ b/compiler/backend/src/test/java/org/apache/nemo/compiler/backend/nemo/NemoBackendTest.java
@@ -19,6 +19,7 @@
 package org.apache.nemo.compiler.backend.nemo;
 
 import org.apache.nemo.common.dag.DAG;
+import org.apache.nemo.common.ir.IRDAG;
 import org.apache.nemo.common.ir.edge.IREdge;
 import org.apache.nemo.common.ir.edge.executionproperty.CommunicationPatternProperty;
 import org.apache.nemo.common.ir.vertex.IRVertex;
@@ -48,16 +49,16 @@ public final class NemoBackendTest<I, O> {
   private NemoBackend nemoBackend;
 
   private final DAGBuilder<IRVertex, IREdge> builder = new DAGBuilder<>();
-  private DAG<IRVertex, IREdge> dag;
+  private IRDAG dag;
 
   @Before
   public void setUp() throws Exception {
-    this.dag = builder.addVertex(source).addVertex(map1).addVertex(groupByKey).addVertex(combine).addVertex(map2)
+    this.dag = new IRDAG(builder.addVertex(source).addVertex(map1).addVertex(groupByKey).addVertex(combine).addVertex(map2)
         .connectVertices(new IREdge(CommunicationPatternProperty.Value.OneToOne, source, map1))
         .connectVertices(new IREdge(CommunicationPatternProperty.Value.Shuffle, map1, groupByKey))
         .connectVertices(new IREdge(CommunicationPatternProperty.Value.OneToOne, groupByKey, combine))
         .connectVertices(new IREdge(CommunicationPatternProperty.Value.OneToOne, combine, map2))
-        .build();
+        .build());
 
     this.dag = new TransientResourcePolicy().runCompileTimeOptimization(dag, EMPTY_DAG_DIRECTORY);
 
diff --git a/compiler/optimizer/debug/errored_ir.json b/compiler/optimizer/debug/errored_ir.json
new file mode 100644
index 0000000..fa6d2cf
--- /dev/null
+++ b/compiler/optimizer/debug/errored_ir.json
@@ -0,0 +1 @@
+{"vertices":[{"id":"vertex75","properties":{}},{"id":"vertex76","properties":{"class":"OperatorVertex","executionProperties":{"org.apache.nemo.common.ir.vertex.executionproperty.ParallelismProperty":"1","org.apache.nemo.common.ir.vertex.executionproperty.ResourceSiteProperty":"{}","org.apache.nemo.common.ir.vertex.executionproperty.ScheduleGroupProperty":"0","org.apache.nemo.common.ir.vertex.executionproperty.ResourceSlotProperty":"true","org.apache.nemo.common.ir.vertex.executionpropert [...]
diff --git a/runtime/test/src/main/java/org/apache/nemo/runtime/common/plan/TestPlanGenerator.java b/runtime/test/src/main/java/org/apache/nemo/runtime/common/plan/TestPlanGenerator.java
index 8cc5f1a..849f32e 100644
--- a/runtime/test/src/main/java/org/apache/nemo/runtime/common/plan/TestPlanGenerator.java
+++ b/runtime/test/src/main/java/org/apache/nemo/runtime/common/plan/TestPlanGenerator.java
@@ -20,6 +20,7 @@ package org.apache.nemo.runtime.common.plan;
 
 import org.apache.nemo.common.dag.DAG;
 import org.apache.nemo.common.dag.DAGBuilder;
+import org.apache.nemo.common.ir.IRDAG;
 import org.apache.nemo.common.ir.edge.IREdge;
 import org.apache.nemo.common.ir.edge.executionproperty.CommunicationPatternProperty;
 import org.apache.nemo.common.ir.vertex.IRVertex;
@@ -94,9 +95,9 @@ public final class TestPlanGenerator {
    * @return convert an IR into a physical plan using the given policy.
    * @throws Exception exception.
    */
-  private static PhysicalPlan convertIRToPhysical(final DAG<IRVertex, IREdge> irDAG,
+  private static PhysicalPlan convertIRToPhysical(final IRDAG irDAG,
                                                   final Policy policy) throws Exception {
-    final DAG<IRVertex, IREdge> optimized = policy.runCompileTimeOptimization(irDAG, EMPTY_DAG_DIRECTORY);
+    final IRDAG optimized = policy.runCompileTimeOptimization(irDAG, EMPTY_DAG_DIRECTORY);
     final DAG<Stage, StageEdge> physicalDAG = PLAN_GENERATOR.apply(optimized);
     return new PhysicalPlan("TestPlan", physicalDAG);
   }
@@ -104,7 +105,7 @@ public final class TestPlanGenerator {
   /**
    * @return a dag that joins two vertices.
    */
-  private static DAG<IRVertex, IREdge> getTwoVerticesJoinedDAG() {
+  private static IRDAG getTwoVerticesJoinedDAG() {
     final DAGBuilder<IRVertex, IREdge> dagBuilder = new DAGBuilder<>();
 
     final Transform t = new EmptyComponents.EmptyTransform("empty");
@@ -145,14 +146,14 @@ public final class TestPlanGenerator {
     final IREdge e4 = new IREdge(CommunicationPatternProperty.Value.OneToOne, v4, v5);
     dagBuilder.connectVertices(e4);
 
-    return dagBuilder.buildWithoutSourceSinkCheck();
+    return new IRDAG(dagBuilder.buildWithoutSourceSinkCheck());
   }
 
   /**
    * @param sameContainerType whether all three vertices are of the same container type
    * @return a dag with 3 sequential vertices.
    */
-  private static DAG<IRVertex, IREdge> getThreeSequentialVerticesDAG(final boolean sameContainerType) {
+  private static IRDAG getThreeSequentialVerticesDAG(final boolean sameContainerType) {
     final DAGBuilder<IRVertex, IREdge> dagBuilder = new DAGBuilder<>();
 
     final Transform t = new EmptyComponents.EmptyTransform("empty");
@@ -185,6 +186,6 @@ public final class TestPlanGenerator {
     final IREdge e2 = new IREdge(CommunicationPatternProperty.Value.OneToOne, v2, v3);
     dagBuilder.connectVertices(e2);
 
-    return dagBuilder.buildWithoutSourceSinkCheck();
+    return new IRDAG(dagBuilder.buildWithoutSourceSinkCheck());
   }
 }