You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by mb...@apache.org on 2017/11/09 19:38:33 UTC

systemml git commit: [HOTFIX][SYSTEMML-1990] Fix cbind/rbind folding test (exec type)

Repository: systemml
Updated Branches:
  refs/heads/master 11723cde8 -> bd139a575


[HOTFIX][SYSTEMML-1990] Fix cbind/rbind folding test (exec type)

Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/bd139a57
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/bd139a57
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/bd139a57

Branch: refs/heads/master
Commit: bd139a575de8a57af40b5f0e8ae10403cd3c060e
Parents: 11723cd
Author: Matthias Boehm <mb...@gmail.com>
Authored: Thu Nov 9 11:39:52 2017 -0800
Committer: Matthias Boehm <mb...@gmail.com>
Committed: Thu Nov 9 11:39:52 2017 -0800

----------------------------------------------------------------------
 .../functions/misc/RewriteFoldRCBindTest.java   | 28 +++++++++++++++-----
 1 file changed, 22 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/bd139a57/src/test/java/org/apache/sysml/test/integration/functions/misc/RewriteFoldRCBindTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/sysml/test/integration/functions/misc/RewriteFoldRCBindTest.java b/src/test/java/org/apache/sysml/test/integration/functions/misc/RewriteFoldRCBindTest.java
index 83050bd..476f573 100644
--- a/src/test/java/org/apache/sysml/test/integration/functions/misc/RewriteFoldRCBindTest.java
+++ b/src/test/java/org/apache/sysml/test/integration/functions/misc/RewriteFoldRCBindTest.java
@@ -21,7 +21,10 @@ package org.apache.sysml.test.integration.functions.misc;
 
 import org.junit.Assert;
 import org.junit.Test;
+import org.apache.sysml.api.DMLScript;
+import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM;
 import org.apache.sysml.hops.OptimizerUtils;
+import org.apache.sysml.lops.LopProperties.ExecType;
 import org.apache.sysml.runtime.matrix.data.MatrixValue.CellIndex;
 import org.apache.sysml.test.integration.AutomatedTestBase;
 import org.apache.sysml.test.integration.TestConfiguration;
@@ -48,26 +51,37 @@ public class RewriteFoldRCBindTest extends AutomatedTestBase
 
 	@Test
 	public void testRewriteFoldCBindNoRewrite() {
-		testRewriteFoldRCBind( TEST_NAME1, false );
+		testRewriteFoldRCBind( TEST_NAME1, false, ExecType.CP );
 	}
 	
 	@Test
 	public void testRewriteFoldCBindRewrite() {
-		testRewriteFoldRCBind( TEST_NAME1, true );
+		testRewriteFoldRCBind( TEST_NAME1, true, ExecType.CP );
 	}
 	
 	@Test
 	public void testRewriteFoldRBindNoRewrite() {
-		testRewriteFoldRCBind( TEST_NAME2, false );
+		testRewriteFoldRCBind( TEST_NAME2, false, ExecType.CP );
 	}
 	
 	@Test
 	public void testRewriteFoldRBindRewrite() {
-		testRewriteFoldRCBind( TEST_NAME2, true );
+		testRewriteFoldRCBind( TEST_NAME2, true, ExecType.CP );
 	}
 
-	private void testRewriteFoldRCBind( String testname, boolean rewrites )
-	{	
+	private void testRewriteFoldRCBind( String testname, boolean rewrites, ExecType et )
+	{
+		RUNTIME_PLATFORM platformOld = rtplatform;
+		switch( et ){
+			case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break;
+			case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break;
+			default: rtplatform = RUNTIME_PLATFORM.HYBRID_SPARK; break;
+		}
+		
+		boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
+		if( rtplatform == RUNTIME_PLATFORM.SPARK || rtplatform == RUNTIME_PLATFORM.HYBRID_SPARK )
+			DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+		
 		boolean oldFlag = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
 		
 		try {
@@ -96,6 +110,8 @@ public class RewriteFoldRCBindTest extends AutomatedTestBase
 		}
 		finally {
 			OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = oldFlag;
+			DMLScript.USE_LOCAL_SPARK_CONFIG = sparkConfigOld;
+			rtplatform = platformOld;
 		}
 	}
 }