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

arnabp20 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/systemml.git


The following commit(s) were added to refs/heads/master by this push:
     new 0dc1d16  [SYSTEMDS-74]Fix partial rewrites with new lineageitem 
constructors.
0dc1d16 is described below

commit 0dc1d16694a9fd7b56583b53566eab724d74a4db
Author: arnabp <[email protected]>
AuthorDate: Thu May 21 00:51:03 2020 +0200

    [SYSTEMDS-74]Fix partial rewrites with new lineageitem constructors.
---
 .../sysds/runtime/lineage/LineageRewriteReuse.java | 22 +++++++++++-----------
 .../scripts/functions/lineage/RewriteTest3.dml     | 10 +++++-----
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git 
a/src/main/java/org/apache/sysds/runtime/lineage/LineageRewriteReuse.java 
b/src/main/java/org/apache/sysds/runtime/lineage/LineageRewriteReuse.java
index 8544388..7c67423 100644
--- a/src/main/java/org/apache/sysds/runtime/lineage/LineageRewriteReuse.java
+++ b/src/main/java/org/apache/sysds/runtime/lineage/LineageRewriteReuse.java
@@ -650,7 +650,7 @@ public class LineageRewriteReuse
                                //for (LineageItem input : source.getInputs()) {
                                // create tsmm lineage on top of the input of 
last append
                                LineageItem input1 = source.getInputs()[0];
-                               LineageItem tmp = new LineageItem("toProbe", 
curr.getOpcode(), new LineageItem[] {input1});
+                               LineageItem tmp = new 
LineageItem(curr.getOpcode(), new LineageItem[] {input1});
                                if (LineageCache.probe(tmp)) 
                                        inCache.put("lastMatrix", 
LineageCache.getMatrix(tmp));
                                // look for the appended column in cache
@@ -682,7 +682,7 @@ public class LineageRewriteReuse
                                        return false;
                                // create tsmm lineage on top of the input of 
last append
                                LineageItem input1 = source.getInputs()[0];
-                               LineageItem tmp = new LineageItem("toProbe", 
curr.getOpcode(), new LineageItem[] {input1});
+                               LineageItem tmp = new 
LineageItem(curr.getOpcode(), new LineageItem[] {input1});
                                if (LineageCache.probe(tmp)) 
                                        inCache.put("lastMatrix", 
LineageCache.getMatrix(tmp));
                        }
@@ -703,7 +703,7 @@ public class LineageRewriteReuse
                        if (source.getOpcode().equalsIgnoreCase("rbind")) {
                                // create tsmm lineage on top of the input of 
last append
                                LineageItem input1 = source.getInputs()[0];
-                               LineageItem tmp = new LineageItem("toProbe", 
curr.getOpcode(), new LineageItem[] {input1});
+                               LineageItem tmp = new 
LineageItem(curr.getOpcode(), new LineageItem[] {input1});
                                if (LineageCache.probe(tmp)) 
                                        inCache.put("lastMatrix", 
LineageCache.getMatrix(tmp));
                                // look for the appended column in cache
@@ -730,8 +730,8 @@ public class LineageRewriteReuse
                                LineageItem input = source.getInputs()[0];
                                if 
(input.getOpcode().equalsIgnoreCase("cbind")) {
                                        LineageItem L2appin1 = 
input.getInputs()[0]; 
-                                       LineageItem tmp = new 
LineageItem("comb", "cbind", new LineageItem[] {L2appin1, 
source.getInputs()[1]});
-                                       LineageItem toProbe = new 
LineageItem("toProbe", curr.getOpcode(), new LineageItem[] {tmp});
+                                       LineageItem tmp = new 
LineageItem("cbind", new LineageItem[] {L2appin1, source.getInputs()[1]});
+                                       LineageItem toProbe = new 
LineageItem(curr.getOpcode(), new LineageItem[] {tmp});
                                        if (LineageCache.probe(toProbe)) 
                                                inCache.put("lastMatrix", 
LineageCache.getMatrix(toProbe));
                                        // look for the appended column in cache
@@ -757,7 +757,7 @@ public class LineageRewriteReuse
                        if (left.getOpcode().equalsIgnoreCase("rbind")){
                                LineageItem leftSource = left.getInputs()[0]; 
//left inpur of rbind = X
                                // create ba+* lineage on top of the input of 
last append
-                               LineageItem tmp = new LineageItem("toProbe", 
curr.getOpcode(), new LineageItem[] {leftSource, right});
+                               LineageItem tmp = new 
LineageItem(curr.getOpcode(), new LineageItem[] {leftSource, right});
                                if (LineageCache.probe(tmp))
                                        inCache.put("lastMatrix", 
LineageCache.getMatrix(tmp));
                                // look for the appended column in cache
@@ -782,7 +782,7 @@ public class LineageRewriteReuse
                        if (right.getOpcode().equalsIgnoreCase("cbind")) {
                                LineageItem rightSource = right.getInputs()[0]; 
//left inpur of rbind = X
                                // create ba+* lineage on top of the input of 
last append
-                               LineageItem tmp = new LineageItem("toProbe", 
curr.getOpcode(), new LineageItem[] {left, rightSource});
+                               LineageItem tmp = new 
LineageItem(curr.getOpcode(), new LineageItem[] {left, rightSource});
                                if (LineageCache.probe(tmp))
                                        inCache.put("lastMatrix", 
LineageCache.getMatrix(tmp));
                                // look for the appended column in cache
@@ -813,7 +813,7 @@ public class LineageRewriteReuse
                                if (!((DataGenCPInstruction)ins).isOnesCol())
                                        return false;
                                // create ba+* lineage on top of the input of 
last append
-                               LineageItem tmp = new LineageItem("toProbe", 
curr.getOpcode(), new LineageItem[] {left, rightSource1});
+                               LineageItem tmp = new 
LineageItem(curr.getOpcode(), new LineageItem[] {left, rightSource1});
                                if (LineageCache.probe(tmp))
                                        inCache.put("lastMatrix", 
LineageCache.getMatrix(tmp));
                        }
@@ -835,7 +835,7 @@ public class LineageRewriteReuse
                                LineageItem leftSource = left.getInputs()[0]; 
//left inpur of rbind = X
                                LineageItem rightSource = right.getInputs()[0]; 
//right inpur of rbind = Y 
                                // create * lineage on top of the input of last 
append
-                               LineageItem tmp = new LineageItem("toProbe", 
curr.getOpcode(), new LineageItem[] {leftSource, rightSource});
+                               LineageItem tmp = new 
LineageItem(curr.getOpcode(), new LineageItem[] {leftSource, rightSource});
                                if (LineageCache.probe(tmp))
                                        inCache.put("lastMatrix", 
LineageCache.getMatrix(tmp));
                                // look for the appended rows in cache
@@ -862,7 +862,7 @@ public class LineageRewriteReuse
                                LineageItem leftSource = left.getInputs()[0]; 
//left inpur of cbind = X
                                LineageItem rightSource = right.getInputs()[0]; 
//right inpur of cbind = Y 
                                // create * lineage on top of the input of last 
append
-                               LineageItem tmp = new LineageItem("toProbe", 
curr.getOpcode(), new LineageItem[] {leftSource, rightSource});
+                               LineageItem tmp = new 
LineageItem(curr.getOpcode(), new LineageItem[] {leftSource, rightSource});
                                if (LineageCache.probe(tmp))
                                        inCache.put("lastMatrix", 
LineageCache.getMatrix(tmp));
                                // look for the appended columns in cache
@@ -892,7 +892,7 @@ public class LineageRewriteReuse
                        if (target.getOpcode().equalsIgnoreCase("cbind")) {
                                // create groupedagg lineage on top of the 
input of last append
                                LineageItem input1 = target.getInputs()[0];
-                               LineageItem tmp = new LineageItem("toProbe", 
curr.getOpcode(), 
+                               LineageItem tmp = new 
LineageItem(curr.getOpcode(), 
                                                new LineageItem[] {input1, 
groups, weights, fn, ngroups});
                                if (LineageCache.probe(tmp)) 
                                        inCache.put("lastMatrix", 
LineageCache.getMatrix(tmp));
diff --git a/src/test/scripts/functions/lineage/RewriteTest3.dml 
b/src/test/scripts/functions/lineage/RewriteTest3.dml
index 1e72529..a3da294 100644
--- a/src/test/scripts/functions/lineage/RewriteTest3.dml
+++ b/src/test/scripts/functions/lineage/RewriteTest3.dml
@@ -23,15 +23,15 @@ X = read($1);
 
 sum = 0;
 tmp = X[,1];
-tmp1 = matrix(0, rows=nrow(X), cols=1);
+tmp1 = matrix(0, rows=nrow(X), cols=0);
 R = matrix(0, 1, ncol(X));
+ones_n = matrix(1, rows=nrow(X), cols=1);
 
-for (i in 2:ncol(X)) {
-  Res1 = t(tmp1) %*% tmp1;
+for (i in 1:ncol(X)) {
   tmp = cbind(tmp, X[,i]);
-  while(FALSE) {};
-  ones_n = matrix(1, rows=nrow(X), cols=1);
   tmp1 = cbind(tmp, ones_n);
+  Res1 = t(tmp1) %*% tmp1;
+  while(FALSE) {};
   R[1,i] = sum(Res1);
   sum = sum + sum(Res1);
 }

Reply via email to