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

[27/50] [abbrv] incubator-systemml git commit: [SYSML-367] Enable functions.reorg tests to run in parallel

[SYSML-367] Enable functions.reorg tests to run in parallel


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

Branch: refs/heads/master
Commit: 12920c6c4a96c8079879d720df1cc9d87630434c
Parents: 4d28340
Author: Glenn Weidner <gw...@us.ibm.com>
Authored: Tue Nov 3 13:39:56 2015 -0300
Committer: Luciano Resende <lr...@apache.org>
Committed: Tue Nov 3 13:39:56 2015 -0300

----------------------------------------------------------------------
 .../functions/reorg/DiagV2MTest.java            | 19 +++++--------
 .../functions/reorg/FullOrderTest.java          | 28 ++++++++-----------
 .../functions/reorg/FullTransposeTest.java      | 20 ++++++--------
 .../functions/reorg/MatrixReshapeTest.java      | 29 ++++++--------------
 4 files changed, 36 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/12920c6c/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/DiagV2MTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/DiagV2MTest.java b/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/DiagV2MTest.java
index d805a57..abf3f36 100644
--- a/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/DiagV2MTest.java
+++ b/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/DiagV2MTest.java
@@ -31,8 +31,8 @@ import com.ibm.bi.dml.test.utils.TestUtils;
 
 public class DiagV2MTest extends AutomatedTestBase
 {
-	
 	private final static String TEST_DIR = "functions/reorg/";
+	private static final String TEST_CLASS_DIR = TEST_DIR + DiagV2MTest.class.getSimpleName() + "/";
 
 	private final static double epsilon=0.0000000001;
 	private final static int rows = 1059;
@@ -41,8 +41,8 @@ public class DiagV2MTest extends AutomatedTestBase
 	
 	@Override
 	public void setUp() {
-		addTestConfiguration("DiagV2MTest", new TestConfiguration(TEST_DIR, "DiagV2MTest", 
-				new String[] {"C"}));
+		addTestConfiguration("DiagV2MTest", 
+			new TestConfiguration(TEST_CLASS_DIR, "DiagV2MTest", new String[] {"C"}));
 	}
 	
 	public void commonReorgTest(RUNTIME_PLATFORM platform)
@@ -58,32 +58,27 @@ public class DiagV2MTest extends AutomatedTestBase
 
 		try {
 	        config.addVariable("rows", rows);
+			loadTestConfiguration(config);
 	          
 			/* This is for running the junit test the new way, i.e., construct the arguments directly */
 			String RI_HOME = SCRIPT_DIR + TEST_DIR;
 			fullDMLScriptName = RI_HOME + "DiagV2MTest" + ".dml";
-			programArgs = new String[]{"-explain", "-args",  RI_HOME + INPUT_DIR + "A" , 
-					Long.toString(rows), RI_HOME + OUTPUT_DIR + "C" };
+			programArgs = new String[]{"-explain", "-args",  input("A"), Long.toString(rows), output("C") };
+			
 			fullRScriptName = RI_HOME + "DiagV2MTest" + ".R";
-			rCmd = "Rscript" + " " + fullRScriptName + " " + 
-			       RI_HOME + INPUT_DIR + " "+ RI_HOME + EXPECTED_DIR;
+			rCmd = "Rscript" + " " + fullRScriptName + " " + inputDir() + " " + expectedDir();
 	
 			Random rand=new Random(System.currentTimeMillis());
-			loadTestConfiguration(config);
 			double sparsity=0.599200924665577;//rand.nextDouble();
 			double[][] A = getRandomMatrix(rows, 1, min, max, sparsity, 1397289950533L); // System.currentTimeMillis()
 	        writeInputMatrix("A", A, true);
 	        sparsity=rand.nextDouble();   
 			
-	        //boolean exceptionExpected = false;
-			//int expectedNumberOfJobs = 12;
-			//runTest(exceptionExpected, null, expectedNumberOfJobs);
 	        boolean exceptionExpected = false;
 			int expectedNumberOfJobs = -1;
 			runTest(true, exceptionExpected, null, expectedNumberOfJobs);
 			
 			runRScript(true);
-			//disableOutAndExpectedDeletion();
 		
 			for(String file: config.getOutputFiles())
 			{

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/12920c6c/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/FullOrderTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/FullOrderTest.java b/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/FullOrderTest.java
index 07deb43..4f81a2e 100644
--- a/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/FullOrderTest.java
+++ b/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/FullOrderTest.java
@@ -39,12 +39,11 @@ import com.ibm.bi.dml.test.utils.TestUtils;
  */
 public class FullOrderTest extends AutomatedTestBase 
 {
-	
 	private final static String TEST_NAME1 = "Order";
 	private final static String TEST_NAME2 = "OrderDyn";
 	
-	
 	private final static String TEST_DIR = "functions/reorg/";
+	private static final String TEST_CLASS_DIR = TEST_DIR + FullOrderTest.class.getSimpleName() + "/";
 	private final static double eps = 1e-10;
 	
 	private final static int rows1 = 1017;
@@ -74,15 +73,16 @@ public class FullOrderTest extends AutomatedTestBase
 
 		long elapsedMsec = System.currentTimeMillis() - startMsec;
 		System.err.printf("Finished in %1.3f sec\n", elapsedMsec / 1000.0);
-
 	}
 	
 	@Override
 	public void setUp() 
 	{
 		TestUtils.clearAssertionInformation();
-		addTestConfiguration(TEST_NAME1,new TestConfiguration(TEST_DIR, TEST_NAME1,new String[]{"B"})); 
-		addTestConfiguration(TEST_NAME2,new TestConfiguration(TEST_DIR, TEST_NAME2,new String[]{"B"})); 
+		addTestConfiguration(TEST_NAME1,
+			new TestConfiguration(TEST_CLASS_DIR, TEST_NAME1,new String[]{"B"}));
+		addTestConfiguration(TEST_NAME2,
+			new TestConfiguration(TEST_CLASS_DIR, TEST_NAME2,new String[]{"B"}));
 	}
 
 	
@@ -948,22 +948,18 @@ public class FullOrderTest extends AutomatedTestBase
 			int bycol = matrix ? by : 1;
 			double sparsity = dtype==InputType.DENSE ? sparsity1 : sparsity2;
 			
-			TestConfiguration config = getTestConfiguration(TEST_NAME);
+			getAndLoadTestConfiguration(TEST_NAME);
 			
 			/* This is for running the junit test the new way, i.e., construct the arguments directly */
 			String HOME = SCRIPT_DIR + TEST_DIR;
 			fullDMLScriptName = HOME + TEST_NAME + ".dml";
-			programArgs = new String[]{"-explain","-args", HOME + INPUT_DIR + "A",
-					                        Integer.toString(bycol),
-					                        Boolean.toString(desc).toUpperCase(),
-					                        Boolean.toString(ixreturn).toUpperCase(),
-					                        HOME + OUTPUT_DIR + "B"    };
-			fullRScriptName = HOME + TEST_NAME + ".R";
-			rCmd = "Rscript" + " " + fullRScriptName + " " + 
-			       HOME + INPUT_DIR + " " + bycol + " " + Boolean.toString(desc).toUpperCase() + " " + 
-				   Boolean.toString(ixreturn).toUpperCase() + " " + HOME + EXPECTED_DIR;
+			programArgs = new String[]{"-explain","-args", input("A"), Integer.toString(bycol),
+				Boolean.toString(desc).toUpperCase(), Boolean.toString(ixreturn).toUpperCase(), output("B") };
 			
-			loadTestConfiguration(config);
+			fullRScriptName = HOME + TEST_NAME + ".R";
+			rCmd = "Rscript" + " " + fullRScriptName + " " + inputDir() + " " + 
+				bycol + " " + Boolean.toString(desc).toUpperCase() + " " + 
+				Boolean.toString(ixreturn).toUpperCase() + " " + expectedDir();
 	
 			//generate actual dataset 
 			double min = (dtype==InputType.EMPTY)? 0 : -1;

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/12920c6c/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/FullTransposeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/FullTransposeTest.java b/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/FullTransposeTest.java
index 3d4b45b..2fa4c63 100644
--- a/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/FullTransposeTest.java
+++ b/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/FullTransposeTest.java
@@ -35,11 +35,10 @@ import com.ibm.bi.dml.test.utils.TestUtils;
  */
 public class FullTransposeTest extends AutomatedTestBase 
 {
-	
 	private final static String TEST_NAME1 = "Transpose";
-
 	
 	private final static String TEST_DIR = "functions/reorg/";
+	private static final String TEST_CLASS_DIR = TEST_DIR + FullTransposeTest.class.getSimpleName() + "/";
 	private final static double eps = 1e-10;
 	
 	private final static int rows1 = 1751;
@@ -58,7 +57,8 @@ public class FullTransposeTest extends AutomatedTestBase
 	public void setUp() 
 	{
 		TestUtils.clearAssertionInformation();
-		addTestConfiguration(TEST_NAME1,new TestConfiguration(TEST_DIR, TEST_NAME1,new String[]{"Y"})); 
+		addTestConfiguration(TEST_NAME1,
+			new TestConfiguration(TEST_CLASS_DIR, TEST_NAME1, new String[]{"Y"})); 
 	}
 
 	
@@ -208,20 +208,16 @@ public class FullTransposeTest extends AutomatedTestBase
 			
 			double sparsity = (sparse) ? sparsity1 : sparsity2;
 			
-			TestConfiguration config = getTestConfiguration(TEST_NAME);
+			getAndLoadTestConfiguration(TEST_NAME);
 			
 			/* This is for running the junit test the new way, i.e., construct the arguments directly */
 			String HOME = SCRIPT_DIR + TEST_DIR;
 			fullDMLScriptName = HOME + TEST_NAME + ".dml";
-			programArgs = new String[]{"-args", HOME + INPUT_DIR + "X",
-					                        Integer.toString(rows),
-					                        Integer.toString(cols),
-					                        HOME + OUTPUT_DIR + "Y"    };
-			fullRScriptName = HOME + TEST_NAME + ".R";
-			rCmd = "Rscript" + " " + fullRScriptName + " " + 
-			       HOME + INPUT_DIR + " " + HOME + EXPECTED_DIR;
+			programArgs = new String[]{"-args", input("X"),
+				Integer.toString(rows), Integer.toString(cols), output("Y") };
 			
-			loadTestConfiguration(config);
+			fullRScriptName = HOME + TEST_NAME + ".R";
+			rCmd = "Rscript" + " " + fullRScriptName + " " + inputDir() + " " + expectedDir();
 	
 			//generate actual dataset 
 			double[][] A = getRandomMatrix(rows, cols, -0.05, 1, sparsity, 7); 

http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/12920c6c/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/MatrixReshapeTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/MatrixReshapeTest.java b/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/MatrixReshapeTest.java
index 56ee32b..f331ef5 100644
--- a/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/MatrixReshapeTest.java
+++ b/src/test/java/com/ibm/bi/dml/test/integration/functions/reorg/MatrixReshapeTest.java
@@ -37,10 +37,10 @@ import com.ibm.bi.dml.test.utils.TestUtils;
  */
 public class MatrixReshapeTest extends AutomatedTestBase 
 {
-	
 	private final static String TEST_NAME1 = "MatrixReshape1";
 	private final static String TEST_NAME2 = "MatrixReshape2";
 	private final static String TEST_DIR = "functions/reorg/";
+	private static final String TEST_CLASS_DIR = TEST_DIR + MatrixReshapeTest.class.getSimpleName() + "/";
 
 	//note: (1) even number of rows/cols required, (2) same dims because controlled via exec platform
 	private final static int rows1 = 35;
@@ -48,8 +48,6 @@ public class MatrixReshapeTest extends AutomatedTestBase
 	private final static int rows2 = 2500; 
 	private final static int cols2 = 1500; 
 	
-	
-	
 	private final static double sparsityDense = 0.7;
 	private final static double sparsitySparse = 0.1;
 	
@@ -66,15 +64,11 @@ public class MatrixReshapeTest extends AutomatedTestBase
 	@Override
 	public void setUp() 
 	{
-		addTestConfiguration(
-				TEST_NAME1, 
-				new TestConfiguration(TEST_DIR, TEST_NAME1, 
-				new String[] { "Y" })   );
+		addTestConfiguration(TEST_NAME1, 
+			new TestConfiguration(TEST_CLASS_DIR, TEST_NAME1, new String[] { "Y" }) );
 		
-		addTestConfiguration(
-				TEST_NAME2, 
-				new TestConfiguration(TEST_DIR, TEST_NAME2, 
-				new String[] { "Y" })   );
+		addTestConfiguration(TEST_NAME2, 
+			new TestConfiguration(TEST_CLASS_DIR, TEST_NAME2, new String[] { "Y" }) );
 	}
 
 	//CP exec type
@@ -365,22 +359,17 @@ public class MatrixReshapeTest extends AutomatedTestBase
 			TestConfiguration config = getTestConfiguration(TEST_NAME);
 			config.addVariable("rows", rows);
 			config.addVariable("cols", cols);
+			loadTestConfiguration(config);
 			
 			// This is for running the junit test the new way, i.e., construct the arguments directly 
 			String HOME = SCRIPT_DIR + TEST_DIR;
 			fullDMLScriptName = HOME + TEST_NAME + ".dml";
-			programArgs = new String[]{"-args", HOME + INPUT_DIR + "X" , 
-					                            String.valueOf(rows),
-												String.valueOf(cols),
-												String.valueOf(trows),
-												String.valueOf(tcols),
-												HOME + OUTPUT_DIR + "Y" };
+			programArgs = new String[]{"-args", input("X"), String.valueOf(rows), String.valueOf(cols),
+				String.valueOf(trows), String.valueOf(tcols), output("Y") };
 			
 			fullRScriptName = HOME + TEST_NAME + ".R";
 			rCmd = "Rscript" + " " + fullRScriptName + " " + 
-		           HOME + INPUT_DIR + " " + trows + " " + tcols + " " + HOME + EXPECTED_DIR;
-			
-			loadTestConfiguration(config);
+		           inputDir() + " " + trows + " " + tcols + " " + expectedDir();
 			
 			double[][] X = getRandomMatrix(rows, cols, 0, 1, sparsity, 7);
 			writeInputMatrix("X", X, true);