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 2016/01/25 02:36:15 UTC

incubator-systemml git commit: Fix robustness univariate statistics application tests (fixed seed)

Repository: incubator-systemml
Updated Branches:
  refs/heads/master 2d32f6d58 -> 58c0d186c


Fix robustness univariate statistics application tests (fixed seed)

This patch fixes the used seeds for all univarate statistics tests in
order to prevent random test failures w/ small absolute error. 

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

Branch: refs/heads/master
Commit: 58c0d186ca77dabeb4fb556665cecba78b1f9b5b
Parents: 2d32f6d
Author: Matthias Boehm <mb...@us.ibm.com>
Authored: Sun Jan 24 17:35:53 2016 -0800
Committer: Matthias Boehm <mb...@us.ibm.com>
Committed: Sun Jan 24 17:35:53 2016 -0800

----------------------------------------------------------------------
 .../descriptivestats/UnivariateStatsBase.java   | 36 +++-----------------
 1 file changed, 5 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/58c0d186/src/test/java/org/apache/sysml/test/integration/applications/descriptivestats/UnivariateStatsBase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/sysml/test/integration/applications/descriptivestats/UnivariateStatsBase.java b/src/test/java/org/apache/sysml/test/integration/applications/descriptivestats/UnivariateStatsBase.java
index 6fa50be..385fa2d 100644
--- a/src/test/java/org/apache/sysml/test/integration/applications/descriptivestats/UnivariateStatsBase.java
+++ b/src/test/java/org/apache/sysml/test/integration/applications/descriptivestats/UnivariateStatsBase.java
@@ -169,28 +169,14 @@ public abstract class UnivariateStatsBase extends AutomatedTestBase {
 			fullRScriptName = S_HOME + "Scale" + ".R";
 			rCmd = "Rscript" + " " + fullRScriptName + " " + inputDir() + " " + expectedDir();
 
-			long seed1 = System.currentTimeMillis();
-			long seed2 = System.currentTimeMillis();
-			double[][] vector = getRandomMatrix(sz.size, 1, rng.min, rng.max,
-					sp.sparsity, seed1);
-			double[][] prob = getRandomMatrix(rows2, 1, 0, 1, 1, seed2);
-			System.out.println("seeds: " + seed1 + " " + seed2);
+			double[][] vector = getRandomMatrix(sz.size, 1, rng.min, rng.max, sp.sparsity, 20160124165501L);
+			double[][] prob = getRandomMatrix(rows2, 1, 0, 1, 1, 20160124165502L);
 
 			writeInputMatrix("vector", vector, true);
 			writeInputMatrix("prob", prob, true);
 
-			// Expected number of jobs:
-			// Reblock - 1 job
-			// While loop iteration - 10 jobs
-			// Final output write - 1 job
-			//
-			// boolean exceptionExpected = false;
-			// int expectedNumberOfJobs = 12;
-			// runTest(exceptionExpected, null, expectedNumberOfJobs);
 			runTest(true, false, null, -1);
-
 			runRScript(true);
-			// disableOutAndExpectedDeletion();
 
 			for (String file : config.getOutputFiles()) {
 				// NOte that some files do not contain matrix, but just a single
@@ -262,28 +248,17 @@ public abstract class UnivariateStatsBase extends AutomatedTestBase {
 			rCmd = "Rscript" + " " + fullRScriptName + " " + inputDir() + " " + expectedDir();
 
 			createHelperMatrix();
-			double[][] vector = getRandomMatrix(sz.size, 1, rng.min, rng.max,
-					sp.sparsity, System.currentTimeMillis());
-			double[][] weight = getRandomMatrix(sz.size, 1, 1, 10, 1,
-					System.currentTimeMillis());
+			double[][] vector = getRandomMatrix(sz.size, 1, rng.min, rng.max, sp.sparsity, 20160124165503L);
+			double[][] weight = getRandomMatrix(sz.size, 1, 1, 10, 1, 20160124165504L);
 			OrderStatisticsTest.round(weight);
-			double[][] prob = getRandomMatrix(rows2, 1, 0, 1, 1,
-					System.currentTimeMillis());
+			double[][] prob = getRandomMatrix(rows2, 1, 0, 1, 1, 20160124165505L);
 
 			writeInputMatrix("vector", vector, true);
 			writeInputMatrix("weight", weight, true);
 			writeInputMatrix("prob", prob, true);
 
-			//
-			// Expected number of jobs:
-			// Reblock - 1 job
-			// While loop iteration - 10 jobs
-			// Final output write - 1 job
-
 			runTest(true, false, null, -1);
-
 			runRScript(true);
-			// disableOutAndExpectedDeletion();
 
 			for (String file : config.getOutputFiles()) {
 				// NOte that some files do not contain matrix, but just a single
@@ -306,5 +281,4 @@ public abstract class UnivariateStatsBase extends AutomatedTestBase {
 			rtplatform = oldrt;
 		}
 	}
-
 }