http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAAssignConstantPropagationTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAAssignConstantPropagationTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAAssignConstantPropagationTest.java index 8d0736b..47f9463 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAAssignConstantPropagationTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAAssignConstantPropagationTest.java @@ -22,7 +22,6 @@ package org.apache.sysml.test.integration.functions.recompile; import java.util.HashMap; import org.junit.Test; - import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.runtime.matrix.data.MatrixValue.CellIndex; import org.apache.sysml.test.integration.AutomatedTestBase; @@ -69,6 +68,9 @@ public class IPAAssignConstantPropagationTest extends AutomatedTestBase private void runIPAAssignConstantPropagationTest( boolean branchRemoval, boolean IPA ) { + if(shouldSkipTest()) + return; + boolean oldFlagBranchRemoval = OptimizerUtils.ALLOW_BRANCH_REMOVAL; boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS;
http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAComplexAppendTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAComplexAppendTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAComplexAppendTest.java index 58f9f46..c8a422b 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAComplexAppendTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAComplexAppendTest.java @@ -74,6 +74,9 @@ public class IPAComplexAppendTest extends AutomatedTestBase private void runIPAAppendTest( boolean IPA, boolean rewrites ) throws IOException { + if(shouldSkipTest()) + return; + boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS; boolean oldFlagRewrites = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION; http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAConstantPropagationTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAConstantPropagationTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAConstantPropagationTest.java index 871d3f1..a865262 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAConstantPropagationTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAConstantPropagationTest.java @@ -22,7 +22,6 @@ package org.apache.sysml.test.integration.functions.recompile; import java.util.HashMap; import org.junit.Test; - import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.runtime.matrix.data.MatrixValue.CellIndex; import org.apache.sysml.test.integration.AutomatedTestBase; @@ -87,6 +86,9 @@ public class IPAConstantPropagationTest extends AutomatedTestBase private void runIPAConstantPropagationTest( boolean update, boolean branchRemoval, boolean IPA ) { + if(shouldSkipTest()) + return; + boolean oldFlagBranchRemoval = OptimizerUtils.ALLOW_BRANCH_REMOVAL; boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS; http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAPropagationSizeMultipleFunctionsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAPropagationSizeMultipleFunctionsTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAPropagationSizeMultipleFunctionsTest.java index 7103775..d8c54c3 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAPropagationSizeMultipleFunctionsTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/IPAPropagationSizeMultipleFunctionsTest.java @@ -108,6 +108,9 @@ public class IPAPropagationSizeMultipleFunctionsTest extends AutomatedTestBase private void runIPASizePropagationMultipleFunctionsTest( String TEST_NAME, boolean IPA ) { + if(shouldSkipTest()) + return; + boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS; try http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/LiteralReplaceCastScalarReadTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/LiteralReplaceCastScalarReadTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/LiteralReplaceCastScalarReadTest.java index 2a7fd61..a9c0c55 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/LiteralReplaceCastScalarReadTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/LiteralReplaceCastScalarReadTest.java @@ -19,7 +19,6 @@ package org.apache.sysml.test.integration.functions.recompile; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.lops.UnaryCP; @@ -59,6 +58,9 @@ public class LiteralReplaceCastScalarReadTest extends AutomatedTestBase } private void runScalarCastTest( ValueType vt ) { + if(shouldSkipTest()) + return; + boolean oldCF = OptimizerUtils.ALLOW_CONSTANT_FOLDING; try { @@ -84,10 +86,10 @@ public class LiteralReplaceCastScalarReadTest extends AutomatedTestBase runTest(true, false, null, -1); //CHECK cast replacement and sum replacement - Assert.assertEquals(false, Statistics.getCPHeavyHitterOpCodes().contains(UnaryCP.CAST_AS_INT_OPCODE)); - Assert.assertEquals(false, Statistics.getCPHeavyHitterOpCodes().contains(UnaryCP.CAST_AS_DOUBLE_OPCODE)); - Assert.assertEquals(false, Statistics.getCPHeavyHitterOpCodes().contains(UnaryCP.CAST_AS_BOOLEAN_OPCODE)); - Assert.assertEquals(false, Statistics.getCPHeavyHitterOpCodes().contains("uak+")); //sum + assertEquals(false, Statistics.getCPHeavyHitterOpCodes().contains(UnaryCP.CAST_AS_INT_OPCODE)); + assertEquals(false, Statistics.getCPHeavyHitterOpCodes().contains(UnaryCP.CAST_AS_DOUBLE_OPCODE)); + assertEquals(false, Statistics.getCPHeavyHitterOpCodes().contains(UnaryCP.CAST_AS_BOOLEAN_OPCODE)); + assertEquals(false, Statistics.getCPHeavyHitterOpCodes().contains("uak+")); //sum } finally { OptimizerUtils.ALLOW_CONSTANT_FOLDING = oldCF; http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/MultipleReadsIPATest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/MultipleReadsIPATest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/MultipleReadsIPATest.java index 8ae8ab8..d800672 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/MultipleReadsIPATest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/MultipleReadsIPATest.java @@ -23,7 +23,6 @@ import java.util.HashMap; import org.junit.Test; - import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM; import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.lops.LopProperties.ExecType; @@ -84,7 +83,9 @@ public class MultipleReadsIPATest extends AutomatedTestBase */ private void runMultipleReadsTest( ExecType et, boolean IPA ) { - RUNTIME_PLATFORM platformOld = rtplatform; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS; try http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/PredicateRecompileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/PredicateRecompileTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/PredicateRecompileTest.java index 9f8c82f..71942db 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/PredicateRecompileTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/PredicateRecompileTest.java @@ -21,7 +21,6 @@ package org.apache.sysml.test.integration.functions.recompile; import java.util.HashMap; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.conf.CompilerConfig; import org.apache.sysml.hops.OptimizerUtils; @@ -239,6 +238,9 @@ public class PredicateRecompileTest extends AutomatedTestBase private void runRecompileTest( String testname, boolean recompile, boolean evalExpr, boolean constFold, boolean IPA ) { + if(shouldSkipTest()) + return; + boolean oldFlagRecompile = CompilerConfig.FLAG_DYN_RECOMPILE; boolean oldFlagEval = OptimizerUtils.ALLOW_SIZE_EXPRESSION_EVALUATION; boolean oldFlagFold = OptimizerUtils.ALLOW_CONSTANT_FOLDING; @@ -277,7 +279,7 @@ public class PredicateRecompileTest extends AutomatedTestBase //check expected number of compiled and executed MR jobs if( recompile ) { - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", 1 - ((evalExpr || constFold)?1:0), Statistics.getNoOfExecutedMRJobs()); //rand } else @@ -285,26 +287,26 @@ public class PredicateRecompileTest extends AutomatedTestBase if( IPA ) { //old expected numbers before IPA if( testname.equals(TEST_NAME1) ) - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", 4 - ((evalExpr||constFold)?4:0), Statistics.getNoOfExecutedMRJobs()); //rand, 2xgmr while pred, 1x gmr while body else //if( testname.equals(TEST_NAME2) ) - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", 3 - ((evalExpr||constFold)?3:0), Statistics.getNoOfExecutedMRJobs()); //rand, 1xgmr if pred, 1x gmr if body } else { //old expected numbers before IPA if( testname.equals(TEST_NAME1) ) - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", 4 - ((evalExpr||constFold)?1:0), Statistics.getNoOfExecutedMRJobs()); //rand, 2xgmr while pred, 1x gmr while body else //if( testname.equals(TEST_NAME2) ) - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", 3 - ((evalExpr||constFold)?1:0), Statistics.getNoOfExecutedMRJobs()); //rand, 1xgmr if pred, 1x gmr if body } } //compare matrices HashMap<CellIndex, Double> dmlfile = readDMLMatrixFromHDFS("R"); - Assert.assertEquals(Double.valueOf((double)val), dmlfile.get(new CellIndex(1,1))); + assertEquals(Double.valueOf((double)val), dmlfile.get(new CellIndex(1,1))); } finally { @@ -319,4 +321,4 @@ public class PredicateRecompileTest extends AutomatedTestBase } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandJobRecompileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandJobRecompileTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandJobRecompileTest.java index 1f20197..39cef29 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandJobRecompileTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandJobRecompileTest.java @@ -22,7 +22,6 @@ package org.apache.sysml.test.integration.functions.recompile; import java.util.HashMap; import org.junit.Test; - import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.runtime.matrix.data.MatrixValue.CellIndex; import org.apache.sysml.test.integration.AutomatedTestBase; @@ -70,6 +69,9 @@ public class RandJobRecompileTest extends AutomatedTestBase */ private void runRandJobRecompileTest( boolean estSizeEval ) { + if(shouldSkipTest()) + return; + boolean oldFlagSizeEval = OptimizerUtils.ALLOW_WORSTCASE_SIZE_EXPRESSION_EVALUATION; try @@ -110,4 +112,4 @@ public class RandJobRecompileTest extends AutomatedTestBase OptimizerUtils.ALLOW_WORSTCASE_SIZE_EXPRESSION_EVALUATION = oldFlagSizeEval; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandRecompileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandRecompileTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandRecompileTest.java index a1ed7f2..979836f 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandRecompileTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandRecompileTest.java @@ -19,7 +19,6 @@ package org.apache.sysml.test.integration.functions.recompile; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.conf.CompilerConfig; import org.apache.sysml.hops.OptimizerUtils; @@ -113,6 +112,9 @@ public class RandRecompileTest extends AutomatedTestBase private void runRandTest( String testName, boolean recompile, boolean IPA ) { + if(shouldSkipTest()) + return; + boolean oldFlagRecompile = CompilerConfig.FLAG_DYN_RECOMPILE; boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS; @@ -147,7 +149,7 @@ public class RandRecompileTest extends AutomatedTestBase int expectNumCompiled = -1; if( IPA ) expectNumCompiled = 0; else expectNumCompiled = 2;//rand, GMR - Assert.assertEquals("Unexpected number of compiled MR jobs.", + assertEquals("Unexpected number of compiled MR jobs.", expectNumCompiled, Statistics.getNoOfCompiledMRJobs()); //CHECK executed MR jobs @@ -155,7 +157,7 @@ public class RandRecompileTest extends AutomatedTestBase if( recompile ) expectNumExecuted = 0; else if( IPA ) expectNumExecuted = 0; else expectNumExecuted = 2; //rand, GMR - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", expectNumExecuted, Statistics.getNoOfExecutedMRJobs()); } finally @@ -169,4 +171,4 @@ public class RandRecompileTest extends AutomatedTestBase } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandSizeExpressionEvalTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandSizeExpressionEvalTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandSizeExpressionEvalTest.java index 5708b75..a30463a 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandSizeExpressionEvalTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RandSizeExpressionEvalTest.java @@ -21,7 +21,6 @@ package org.apache.sysml.test.integration.functions.recompile; import java.util.HashMap; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.hops.OptimizerUtils; @@ -63,6 +62,9 @@ public class RandSizeExpressionEvalTest extends AutomatedTestBase private void runRandTest( String testName, boolean evalExpr, boolean constFold ) { + if(shouldSkipTest()) + return; + boolean oldFlagEval = OptimizerUtils.ALLOW_SIZE_EXPRESSION_EVALUATION; boolean oldFlagFold = OptimizerUtils.ALLOW_CONSTANT_FOLDING; boolean oldFlagRand1 = OptimizerUtils.ALLOW_RAND_JOB_RECOMPILE; @@ -93,15 +95,15 @@ public class RandSizeExpressionEvalTest extends AutomatedTestBase //check correct propagated size via final results HashMap<CellIndex, Double> dmlfile = readDMLMatrixFromHDFS("R"); - Assert.assertEquals("Unexpected results.", Double.valueOf(rows*cols*3.0), dmlfile.get(new CellIndex(1,1))); + assertEquals("Unexpected results.", Double.valueOf(rows*cols*3.0), dmlfile.get(new CellIndex(1,1))); //check expected number of compiled and executed MR jobs if( evalExpr || constFold ) { - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", 0, Statistics.getNoOfExecutedMRJobs()); } else { - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", 2, Statistics.getNoOfExecutedMRJobs()); //Rand, GMR (sum) } } http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/ReblockRecompileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/ReblockRecompileTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/ReblockRecompileTest.java index 83ebb9a..e00d07a 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/ReblockRecompileTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/ReblockRecompileTest.java @@ -22,7 +22,6 @@ package org.apache.sysml.test.integration.functions.recompile; import java.io.IOException; import java.util.HashMap; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.runtime.matrix.data.InputInfo; @@ -92,6 +91,9 @@ public class ReblockRecompileTest extends AutomatedTestBase */ private void runReblockTest(int scriptNum, long seed) { + if(shouldSkipTest()) + return; + String TEST_NAME = null; switch(scriptNum) { @@ -124,7 +126,7 @@ public class ReblockRecompileTest extends AutomatedTestBase runTest(true, exceptionExpected, null, -1); //0 due to recompile runRScript(true); - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", 0, Statistics.getNoOfExecutedMRJobs()); //compare matrices @@ -142,7 +144,7 @@ public class ReblockRecompileTest extends AutomatedTestBase System.out.println("Matrix compare found differences for input data generated with seed="+seed); } catch (IOException e) { - Assert.fail(e.getMessage()); + fail(e.getMessage()); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/RecursiveFunctionRecompileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RecursiveFunctionRecompileTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RecursiveFunctionRecompileTest.java index 99459b0..dbbecf8 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RecursiveFunctionRecompileTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RecursiveFunctionRecompileTest.java @@ -19,7 +19,6 @@ package org.apache.sysml.test.integration.functions.recompile; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.parser.Expression.ValueType; @@ -110,6 +109,9 @@ public class RecursiveFunctionRecompileTest extends AutomatedTestBase private void runRecompileTest( String testname, boolean IPA ) { + if(shouldSkipTest()) + return; + boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS; try @@ -136,14 +138,14 @@ public class RecursiveFunctionRecompileTest extends AutomatedTestBase //check number of recompiled functions (recompile_once is not applicable for recursive functions //because the single recompilation on entry would implicitly change the remaining plan of the caller; //if not not handled correctly, TEST_NAME1 and TEST_NAME2 would have show with IPA 1111 function recompilations. - Assert.assertEquals(testname.equals(TEST_NAME4) && IPA ? 1 : 0, Statistics.getFunRecompiles()); + assertEquals(testname.equals(TEST_NAME4) && IPA ? 1 : 0, Statistics.getFunRecompiles()); } catch(Exception ex) { ex.printStackTrace(); - Assert.fail("Failed to run test: "+ex.getMessage()); + fail("Failed to run test: "+ex.getMessage()); } finally { OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS = oldFlagIPA; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/RemoveEmptyPotpourriTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RemoveEmptyPotpourriTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RemoveEmptyPotpourriTest.java index 31a6287..db94db0 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RemoveEmptyPotpourriTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RemoveEmptyPotpourriTest.java @@ -21,9 +21,7 @@ package org.apache.sysml.test.integration.functions.recompile; import java.util.HashMap; -import org.junit.Assert; import org.junit.Test; - import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.runtime.matrix.data.MatrixValue.CellIndex; import org.apache.sysml.test.integration.AutomatedTestBase; @@ -119,6 +117,9 @@ public class RemoveEmptyPotpourriTest extends AutomatedTestBase private void runRemoveEmptyTest( String TEST_NAME, boolean rewrite ) { getAndLoadTestConfiguration(TEST_NAME); + if(shouldSkipTest()) + return; + boolean oldFlag = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION; try @@ -141,8 +142,8 @@ public class RemoveEmptyPotpourriTest extends AutomatedTestBase TestUtils.compareMatrices(dmlfile, rfile, eps, "DML", "R"); if( TEST_NAME.equals(TEST_NAME5) ) { - Assert.assertTrue(Statistics.getNoOfExecutedMRJobs()==0); - Assert.assertTrue(Statistics.getNoOfExecutedSPInst()==0); + assertTrue(Statistics.getNoOfExecutedMRJobs()==0); + assertTrue(Statistics.getNoOfExecutedSPInst()==0); } } finally @@ -152,4 +153,4 @@ public class RemoveEmptyPotpourriTest extends AutomatedTestBase } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/RemoveEmptyRecompileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RemoveEmptyRecompileTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RemoveEmptyRecompileTest.java index c1bac4e..af6ec44 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RemoveEmptyRecompileTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RemoveEmptyRecompileTest.java @@ -21,9 +21,7 @@ package org.apache.sysml.test.integration.functions.recompile; import java.util.HashMap; -import org.junit.Assert; import org.junit.Test; - import org.apache.sysml.hops.OptimizerUtils; import org.apache.sysml.lops.LeftIndex; import org.apache.sysml.lops.RightIndex; @@ -243,6 +241,9 @@ public class RemoveEmptyRecompileTest extends AutomatedTestBase */ private void runRemoveEmptyTest( OpType type, boolean empty ) { + if(shouldSkipTest()) + return; + boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS; try @@ -275,11 +276,11 @@ public class RemoveEmptyRecompileTest extends AutomatedTestBase //CHECK compiled MR jobs int expectNumCompiled = 21; //reblock, 10xGMR, 2x(MMCJ+GMR), 2xGMR(LIX), write - Assert.assertEquals("Unexpected number of compiled MR jobs.", + assertEquals("Unexpected number of compiled MR jobs.", expectNumCompiled, Statistics.getNoOfCompiledMRJobs()); //CHECK executed MR jobs int expectNumExecuted = 0; - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", expectNumExecuted, Statistics.getNoOfExecutedMRJobs()); //CHECK rewrite application @@ -288,7 +289,7 @@ public class RemoveEmptyRecompileTest extends AutomatedTestBase String opcode = getOpcode(type); //sum subject to literal replacement (no-op for empty) which happens before the rewrites boolean lempty = (type == OpType.SUM && empty) ? false : empty; - Assert.assertEquals(lempty, !Statistics.getCPHeavyHitterOpCodes().contains(opcode)); + assertEquals(lempty, !Statistics.getCPHeavyHitterOpCodes().contains(opcode)); } //compare matrices @@ -325,4 +326,4 @@ public class RemoveEmptyRecompileTest extends AutomatedTestBase return null; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/RewriteComplexMapMultChainTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RewriteComplexMapMultChainTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RewriteComplexMapMultChainTest.java index 224a19e..b6758c6 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/RewriteComplexMapMultChainTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/RewriteComplexMapMultChainTest.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.util.HashMap; import org.junit.Test; - import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM; import org.apache.sysml.lops.LopProperties.ExecType; import org.apache.sysml.runtime.matrix.data.MatrixValue.CellIndex; @@ -101,7 +100,9 @@ public class RewriteComplexMapMultChainTest extends AutomatedTestBase } private void runRewriteMapMultChain( String TEST_NAME, boolean singleCol, ExecType et ) throws IOException { - RUNTIME_PLATFORM platformOld = rtplatform; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; try { http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/SparsityFunctionRecompileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/SparsityFunctionRecompileTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/SparsityFunctionRecompileTest.java index 5cafd6a..d835947 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/SparsityFunctionRecompileTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/SparsityFunctionRecompileTest.java @@ -21,7 +21,6 @@ package org.apache.sysml.test.integration.functions.recompile; import java.util.HashMap; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.conf.CompilerConfig; import org.apache.sysml.hops.OptimizerUtils; @@ -165,6 +164,9 @@ public class SparsityFunctionRecompileTest extends AutomatedTestBase private void runRecompileTest( String testname, boolean recompile, boolean IPA ) { + if(shouldSkipTest()) + return; + boolean oldFlagRecompile = CompilerConfig.FLAG_DYN_RECOMPILE; boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS; boolean oldFlagBranchRemoval = OptimizerUtils.ALLOW_BRANCH_REMOVAL; @@ -196,7 +198,7 @@ public class SparsityFunctionRecompileTest extends AutomatedTestBase int expectNumCompiled = (testname.equals(TEST_NAME2)?3:4) //reblock,GMR,GMR,GMR (one GMR less for if) + ((testname.equals(TEST_NAME4))?2:0) //(+2 resultmerge) + (IPA ? 0 : (testname.equals(TEST_NAME2)?3:1)); //GMR ua(+), 3x for if - Assert.assertEquals("Unexpected number of compiled MR jobs.", + assertEquals("Unexpected number of compiled MR jobs.", expectNumCompiled, Statistics.getNoOfCompiledMRJobs()); //CHECK executed MR jobs (changed 07/2015 due to better sparsity inference) @@ -205,18 +207,18 @@ public class SparsityFunctionRecompileTest extends AutomatedTestBase else expectNumExecuted = (testname.equals(TEST_NAME2)?3:4) //reblock,GMR,GMR,GMR (one GMR less for if) + ((testname.equals(TEST_NAME4))?2:0) //(+2 resultmerge) + (IPA ? 0 : (testname.equals(TEST_NAME2)?2:1)); //GMR ua(+) - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", expectNumExecuted, Statistics.getNoOfExecutedMRJobs()); //compare matrices HashMap<CellIndex, Double> dmlfile = readDMLMatrixFromHDFS("R"); - Assert.assertEquals(Double.valueOf(val), dmlfile.get(new CellIndex(1,1))); + assertEquals(Double.valueOf(val), dmlfile.get(new CellIndex(1,1))); } catch(Exception ex) { ex.printStackTrace(); - Assert.fail("Failed to run test: "+ex.getMessage()); + fail("Failed to run test: "+ex.getMessage()); } finally { @@ -226,4 +228,4 @@ public class SparsityFunctionRecompileTest extends AutomatedTestBase } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/recompile/SparsityRecompileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/recompile/SparsityRecompileTest.java b/src/test/java/org/apache/sysml/test/integration/functions/recompile/SparsityRecompileTest.java index c8a883a..0d18cbf 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/recompile/SparsityRecompileTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/recompile/SparsityRecompileTest.java @@ -21,7 +21,6 @@ package org.apache.sysml.test.integration.functions.recompile; import java.util.HashMap; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.conf.CompilerConfig; import org.apache.sysml.hops.OptimizerUtils; @@ -116,6 +115,9 @@ public class SparsityRecompileTest extends AutomatedTestBase private void runRecompileTest( String testname, boolean recompile ) { + if(shouldSkipTest()) + return; + boolean oldFlagRecompile = CompilerConfig.FLAG_DYN_RECOMPILE; try @@ -141,7 +143,7 @@ public class SparsityRecompileTest extends AutomatedTestBase //CHECK compiled MR jobs int expectNumCompiled = (testname.equals(TEST_NAME2)?3:4) //reblock,GMR,GMR,GMR (one GMR less for if) + (testname.equals(TEST_NAME4)?2:0);//(+2 resultmerge) - Assert.assertEquals("Unexpected number of compiled MR jobs.", + assertEquals("Unexpected number of compiled MR jobs.", expectNumCompiled, Statistics.getNoOfCompiledMRJobs()); //CHECK executed MR jobs @@ -149,18 +151,18 @@ public class SparsityRecompileTest extends AutomatedTestBase if( recompile ) expectNumExecuted = 0 + ((testname.equals(TEST_NAME4))?2:0); //(+2 resultmerge) else expectNumExecuted = (testname.equals(TEST_NAME2)?3:4) //reblock,GMR,GMR,GMR (one GMR less for if) + ((testname.equals(TEST_NAME4))?2:0); //(+2 resultmerge) - Assert.assertEquals("Unexpected number of executed MR jobs.", + assertEquals("Unexpected number of executed MR jobs.", expectNumExecuted, Statistics.getNoOfExecutedMRJobs()); //compare matrices HashMap<CellIndex, Double> dmlfile = readDMLMatrixFromHDFS("R"); - Assert.assertEquals((Double)val, dmlfile.get(new CellIndex(1,1))); + assertEquals((Double)val, dmlfile.get(new CellIndex(1,1))); } catch(Exception ex) { throw new RuntimeException(ex); - //Assert.fail("Failed to run test: "+ex.getMessage()); + //fail("Failed to run test: "+ex.getMessage()); } finally { @@ -168,4 +170,4 @@ public class SparsityRecompileTest extends AutomatedTestBase } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/reorg/DiagV2MTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/reorg/DiagV2MTest.java b/src/test/java/org/apache/sysml/test/integration/functions/reorg/DiagV2MTest.java index 07e95cb..c648f17 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/reorg/DiagV2MTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/reorg/DiagV2MTest.java @@ -51,12 +51,10 @@ public class DiagV2MTest extends AutomatedTestBase { TestConfiguration config = getTestConfiguration("DiagV2MTest"); - RUNTIME_PLATFORM prevPlfm=rtplatform; - - rtplatform = platform; boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM prevPlfm = setRuntimePlatform(platform); + if(shouldSkipTest()) + return; try { config.addVariable("rows", rows); http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullOrderTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullOrderTest.java b/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullOrderTest.java index 9026ed4..5d49a5e 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullOrderTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullOrderTest.java @@ -922,25 +922,17 @@ public class FullOrderTest extends AutomatedTestBase */ private void runOrderTest( String testname, boolean matrix, InputType dtype, boolean desc, boolean ixreturn, boolean rewrite, ExecType instType, boolean forceDistSort) { - RUNTIME_PLATFORM platformOld = rtplatform; + boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType); + if(shouldSkipTest()) + return; + boolean rewriteOld = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION; boolean forceOpOld = ReorgOp.FORCE_DIST_SORT_INDEXES; - boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - try { String TEST_NAME = testname; - - //set flags - if(instType == ExecType.SPARK) { - rtplatform = RUNTIME_PLATFORM.SPARK; - } - else { - rtplatform = (instType==ExecType.MR) ? RUNTIME_PLATFORM.HADOOP : RUNTIME_PLATFORM.HYBRID; - } - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = rewrite; ReorgOp.FORCE_DIST_SORT_INDEXES = forceDistSort; @@ -992,4 +984,4 @@ public class FullOrderTest extends AutomatedTestBase } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullReverseTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullReverseTest.java b/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullReverseTest.java index 35b7391..71b5dba 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullReverseTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullReverseTest.java @@ -21,7 +21,6 @@ package org.apache.sysml.test.integration.functions.reorg; import java.util.HashMap; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.api.DMLScript; import org.apache.sysml.api.DMLScript.RUNTIME_PLATFORM; @@ -133,16 +132,10 @@ public class FullReverseTest extends AutomatedTestBase */ private void runReverseTest(String testname, boolean matrix, boolean sparse, ExecType instType) { - //rtplatform for MR - RUNTIME_PLATFORM platformOld = rtplatform; - switch( instType ){ - case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break; - case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break; - default: rtplatform = RUNTIME_PLATFORM.HYBRID; break; - } boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType); + if(shouldSkipTest()) + return; String TEST_NAME = testname; @@ -174,9 +167,9 @@ public class FullReverseTest extends AutomatedTestBase //check generated opcode if( instType == ExecType.CP ) - Assert.assertTrue("Missing opcode: rev", Statistics.getCPHeavyHitterOpCodes().contains("rev")); + assertTrue("Missing opcode: rev", Statistics.getCPHeavyHitterOpCodes().contains("rev")); else if ( instType == ExecType.SPARK ) - Assert.assertTrue("Missing opcode: "+Instruction.SP_INST_PREFIX+"rev", Statistics.getCPHeavyHitterOpCodes().contains(Instruction.SP_INST_PREFIX+"rev")); + assertTrue("Missing opcode: "+Instruction.SP_INST_PREFIX+"rev", Statistics.getCPHeavyHitterOpCodes().contains(Instruction.SP_INST_PREFIX+"rev")); } finally { @@ -187,4 +180,4 @@ public class FullReverseTest extends AutomatedTestBase } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullTransposeTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullTransposeTest.java b/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullTransposeTest.java index d28d268..2c62e6d 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullTransposeTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/reorg/FullTransposeTest.java @@ -184,16 +184,10 @@ public class FullTransposeTest extends AutomatedTestBase */ private void runTransposeTest( OpType type, boolean sparse, ExecType instType) { - //rtplatform for MR - RUNTIME_PLATFORM platformOld = rtplatform; - switch( instType ){ - case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break; - case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break; - default: rtplatform = RUNTIME_PLATFORM.HYBRID; break; - } boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(instType); + if(shouldSkipTest()) + return; try { @@ -243,4 +237,4 @@ public class FullTransposeTest extends AutomatedTestBase } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/reorg/MatrixReshapeTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/reorg/MatrixReshapeTest.java b/src/test/java/org/apache/sysml/test/integration/functions/reorg/MatrixReshapeTest.java index 20d4cd8..715f257 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/reorg/MatrixReshapeTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/reorg/MatrixReshapeTest.java @@ -298,17 +298,10 @@ public class MatrixReshapeTest extends AutomatedTestBase private void runTestMatrixReshape( ReshapeType type, boolean rowwise, boolean sparse, ExecType et ) { - //rtplatform for MR - 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; break; - } - boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; //handle reshape type int rows = -1, cols = -1; http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/reorg/MultipleOrderByColsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/reorg/MultipleOrderByColsTest.java b/src/test/java/org/apache/sysml/test/integration/functions/reorg/MultipleOrderByColsTest.java index 5f11038..7bd1c82 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/reorg/MultipleOrderByColsTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/reorg/MultipleOrderByColsTest.java @@ -21,7 +21,6 @@ package org.apache.sysml.test.integration.functions.reorg; import java.util.HashMap; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.api.DMLScript; @@ -156,16 +155,10 @@ public class MultipleOrderByColsTest extends AutomatedTestBase private void runOrderTest( String testname, boolean sparse, boolean desc, boolean ixret, 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; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; try { @@ -196,7 +189,7 @@ public class MultipleOrderByColsTest extends AutomatedTestBase //check for applied rewrite if( testname.equals(TEST_NAME2) && !ixret ) - Assert.assertTrue(Statistics.getCPHeavyHitterCount("rsort")==1); + assertTrue(Statistics.getCPHeavyHitterCount("rsort")==1); } finally { rtplatform = platformOld; http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/reorg/VectorReshapeTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/reorg/VectorReshapeTest.java b/src/test/java/org/apache/sysml/test/integration/functions/reorg/VectorReshapeTest.java index 0be3e2f..57c838b 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/reorg/VectorReshapeTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/reorg/VectorReshapeTest.java @@ -83,16 +83,10 @@ public class VectorReshapeTest extends AutomatedTestBase private void runVectorReshape(boolean sparse, ExecType et) { - //rtplatform for MR - 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; break; - } boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; try { http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockAlignment.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockAlignment.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockAlignment.java index 6b9caa8..77667dd 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockAlignment.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockAlignment.java @@ -19,7 +19,6 @@ package org.apache.sysml.test.integration.functions.sparse; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.data.SparseBlock; @@ -147,6 +146,9 @@ public class SparseBlockAlignment extends AutomatedTestBase */ private void runSparseBlockScanTest( SparseBlock.Type btype, double sparsity, boolean positive) { + if(shouldSkipTest()) + return; + try { //data generation @@ -179,7 +181,7 @@ public class SparseBlockAlignment extends AutomatedTestBase //check for block comparison boolean blockAligned = sblock.isAligned(sblock2); if( blockAligned != positive ) - Assert.fail("Wrong block alignment indicated: "+blockAligned+", expected: "+positive); + fail("Wrong block alignment indicated: "+blockAligned+", expected: "+positive); //check for row comparison boolean rowsAligned37 = true; @@ -191,13 +193,13 @@ public class SparseBlockAlignment extends AutomatedTestBase rowsAlignedRest &= sblock.isAligned(i, sblock2); } if( rowsAligned37 != positive ) - Assert.fail("Wrong row alignment indicated: "+rowsAligned37+", expected: "+positive); + fail("Wrong row alignment indicated: "+rowsAligned37+", expected: "+positive); if( !rowsAlignedRest ) - Assert.fail("Wrong row alignment rest indicated: false."); + fail("Wrong row alignment rest indicated: false."); } catch(Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockAppendSort.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockAppendSort.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockAppendSort.java index 11038e1..27441f4 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockAppendSort.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockAppendSort.java @@ -19,7 +19,6 @@ package org.apache.sysml.test.integration.functions.sparse; -import org.junit.Assert; import org.junit.Test; import java.util.Iterator; @@ -155,6 +154,9 @@ public class SparseBlockAppendSort extends AutomatedTestBase */ private void runSparseBlockAppendSortTest( SparseBlock.Type btype, double sparsity, InitType itype) { + if(shouldSkipTest()) + return; + try { //data generation @@ -196,12 +198,12 @@ public class SparseBlockAppendSort extends AutomatedTestBase nnz += rnnz[i]; } if( nnz != sblock.size() ) - Assert.fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); + fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); //check correct isEmpty return for( int i=0; i<rows; i++ ) if( sblock.isEmpty(i) != (rnnz[i]==0) ) - Assert.fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); + fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); //check correct values for( int i=0; i<rows; i++ ) @@ -209,7 +211,7 @@ public class SparseBlockAppendSort extends AutomatedTestBase for( int j=0; j<cols; j++ ) { double tmp = sblock.get(i, j); if( tmp != A[i][j] ) - Assert.fail("Wrong get value for cell ("+i+","+j+"): "+tmp+", expected: "+A[i][j]); + fail("Wrong get value for cell ("+i+","+j+"): "+tmp+", expected: "+A[i][j]); } } catch(Exception ex) { @@ -217,4 +219,4 @@ public class SparseBlockAppendSort extends AutomatedTestBase throw new RuntimeException(ex); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockDelete.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockDelete.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockDelete.java index 55958a6..8e63e1b 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockDelete.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockDelete.java @@ -21,7 +21,6 @@ package org.apache.sysml.test.integration.functions.sparse; import java.util.Iterator; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.runtime.matrix.data.IJV; import org.apache.sysml.runtime.matrix.data.MatrixBlock; @@ -106,6 +105,9 @@ public class SparseBlockDelete extends AutomatedTestBase */ private void runSparseBlockDeleteTest( SparseBlock.Type btype, double sparsity) { + if(shouldSkipTest()) + return; + try { //data generation @@ -136,12 +138,12 @@ public class SparseBlockDelete extends AutomatedTestBase nnz += rnnz[i]; } if( nnz != sblock.size() ) - Assert.fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); + fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); //check correct isEmpty return for( int i=0; i<rows; i++ ) if( sblock.isEmpty(i) != (rnnz[i]==0) ) - Assert.fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); + fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); //check correct values Iterator<IJV> iter = sblock.getIterator(); @@ -149,15 +151,15 @@ public class SparseBlockDelete extends AutomatedTestBase while( iter.hasNext() ) { IJV cell = iter.next(); if( cell.getV() != A[cell.getI()][cell.getJ()] ) - Assert.fail("Wrong value returned by iterator: "+cell.getV()+", expected: "+A[cell.getI()][cell.getJ()]); + fail("Wrong value returned by iterator: "+cell.getV()+", expected: "+A[cell.getI()][cell.getJ()]); count++; } if( count != nnz ) - Assert.fail("Wrong number of values returned by iterator: "+count+", expected: "+nnz); + fail("Wrong number of values returned by iterator: "+count+", expected: "+nnz); } catch(Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockGetFirstIndex.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockGetFirstIndex.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockGetFirstIndex.java index 16ffbcd..dc3c325 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockGetFirstIndex.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockGetFirstIndex.java @@ -19,7 +19,6 @@ package org.apache.sysml.test.integration.functions.sparse; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.data.SparseBlock; @@ -198,6 +197,9 @@ public class SparseBlockGetFirstIndex extends AutomatedTestBase */ private void runSparseBlockGetFirstIndexTest( SparseBlock.Type btype, double sparsity, IndexType itype) { + if(shouldSkipTest()) + return; + try { //data generation @@ -221,12 +223,12 @@ public class SparseBlockGetFirstIndex extends AutomatedTestBase nnz += rnnz[i]; } if( nnz != sblock.size() ) - Assert.fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); + fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); //check correct isEmpty return for( int i=0; i<rows; i++ ) if( sblock.isEmpty(i) != (rnnz[i]==0) ) - Assert.fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); + fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); //check correct index values for( int i=0; i<rows; i++ ) { @@ -240,7 +242,7 @@ public class SparseBlockGetFirstIndex extends AutomatedTestBase int six = (sixpos>=0) ? sblock.indexes(i)[sblock.pos(i)+sixpos] : -1; if( six != ix ) { - Assert.fail("Wrong index returned by index probe ("+ + fail("Wrong index returned by index probe ("+ itype.toString()+","+i+"): "+six+", expected: "+ix); } } @@ -273,4 +275,4 @@ public class SparseBlockGetFirstIndex extends AutomatedTestBase return -1; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockGetSet.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockGetSet.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockGetSet.java index e8cbaa8..34da1db 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockGetSet.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockGetSet.java @@ -19,7 +19,6 @@ package org.apache.sysml.test.integration.functions.sparse; -import org.junit.Assert; import org.junit.Test; import java.util.Iterator; @@ -203,6 +202,9 @@ public class SparseBlockGetSet extends AutomatedTestBase */ private void runSparseBlockGetSetTest( SparseBlock.Type btype, double sparsity, InitType itype) { + if(shouldSkipTest()) + return; + try { //data generation @@ -246,7 +248,7 @@ public class SparseBlockGetSet extends AutomatedTestBase //check basic meta data if( sblock.numRows() != rows ) - Assert.fail("Wrong number of rows: "+sblock.numRows()+", expected: "+rows); + fail("Wrong number of rows: "+sblock.numRows()+", expected: "+rows); //check for correct number of non-zeros int[] rnnz = new int[rows]; int nnz = 0; @@ -256,12 +258,12 @@ public class SparseBlockGetSet extends AutomatedTestBase nnz += rnnz[i]; } if( nnz != sblock.size() ) - Assert.fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); + fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); //check correct isEmpty return for( int i=0; i<rows; i++ ) if( sblock.isEmpty(i) != (rnnz[i]==0) ) - Assert.fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); + fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); //check correct values for( int i=0; i<rows; i++ ) @@ -269,7 +271,7 @@ public class SparseBlockGetSet extends AutomatedTestBase for( int j=0; j<cols; j++ ) { double tmp = sblock.get(i, j); if( tmp != A[i][j] ) - Assert.fail("Wrong get value for cell ("+i+","+j+"): "+tmp+", expected: "+A[i][j]); + fail("Wrong get value for cell ("+i+","+j+"): "+tmp+", expected: "+A[i][j]); } } catch(Exception ex) { @@ -277,4 +279,4 @@ public class SparseBlockGetSet extends AutomatedTestBase throw new RuntimeException(ex); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockIndexRange.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockIndexRange.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockIndexRange.java index 69e6beb..f4908d6 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockIndexRange.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockIndexRange.java @@ -22,7 +22,6 @@ package org.apache.sysml.test.integration.functions.sparse; import java.util.Arrays; import java.util.Iterator; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.runtime.matrix.data.IJV; import org.apache.sysml.runtime.matrix.data.MatrixBlock; @@ -157,6 +156,9 @@ public class SparseBlockIndexRange extends AutomatedTestBase */ private void runSparseBlockIndexRangeTest( SparseBlock.Type btype, double sparsity, UpdateType utype) { + if(shouldSkipTest()) + return; + try { //data generation @@ -197,12 +199,12 @@ public class SparseBlockIndexRange extends AutomatedTestBase nnz += rnnz[i]; } if( nnz != sblock.size() ) - Assert.fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); + fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); //check correct isEmpty return for( int i=0; i<rows; i++ ) if( sblock.isEmpty(i) != (rnnz[i]==0) ) - Assert.fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); + fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); //check correct values Iterator<IJV> iter = sblock.getIterator(); @@ -210,15 +212,15 @@ public class SparseBlockIndexRange extends AutomatedTestBase while( iter.hasNext() ) { IJV cell = iter.next(); if( cell.getV() != A[cell.getI()][cell.getJ()] ) - Assert.fail("Wrong value returned by iterator: "+cell.getV()+", expected: "+A[cell.getI()][cell.getJ()]); + fail("Wrong value returned by iterator: "+cell.getV()+", expected: "+A[cell.getI()][cell.getJ()]); count++; } if( count != nnz ) - Assert.fail("Wrong number of values returned by iterator: "+count+", expected: "+nnz); + fail("Wrong number of values returned by iterator: "+count+", expected: "+nnz); } catch(Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockIterator.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockIterator.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockIterator.java index e9c4a1a..39f4647 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockIterator.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockIterator.java @@ -21,7 +21,6 @@ package org.apache.sysml.test.integration.functions.sparse; import java.util.Iterator; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.runtime.matrix.data.IJV; import org.apache.sysml.runtime.matrix.data.MatrixBlock; @@ -152,6 +151,9 @@ public class SparseBlockIterator extends AutomatedTestBase */ private void runSparseBlockIteratorTest( SparseBlock.Type btype, double sparsity, boolean partial) { + if(shouldSkipTest()) + return; + try { //data generation @@ -176,12 +178,12 @@ public class SparseBlockIterator extends AutomatedTestBase nnz += rnnz[i]; } if( !partial && nnz != sblock.size() ) - Assert.fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); + fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); //check correct isEmpty return for( int i=rl; i<rows; i++ ) if( sblock.isEmpty(i) != (rnnz[i]==0) ) - Assert.fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); + fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); //check correct values Iterator<IJV> iter = !partial ? sblock.getIterator() : @@ -190,15 +192,15 @@ public class SparseBlockIterator extends AutomatedTestBase while( iter.hasNext() ) { IJV cell = iter.next(); if( cell.getV() != A[cell.getI()][cell.getJ()] ) - Assert.fail("Wrong value returned by iterator: "+cell.getV()+", expected: "+A[cell.getI()][cell.getJ()]); + fail("Wrong value returned by iterator: "+cell.getV()+", expected: "+A[cell.getI()][cell.getJ()]); count++; } if( count != nnz ) - Assert.fail("Wrong number of values returned by iterator: "+count+", expected: "+nnz); + fail("Wrong number of values returned by iterator: "+count+", expected: "+nnz); } catch(Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockMemEstimate.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockMemEstimate.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockMemEstimate.java index c68fb83..32e8976 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockMemEstimate.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockMemEstimate.java @@ -54,8 +54,11 @@ public class SparseBlockMemEstimate extends AutomatedTestBase runSparseBlockMemoryTest(sparsity2); } - private static void runSparseBlockMemoryTest( double sparsity) + private void runSparseBlockMemoryTest( double sparsity) { + if(shouldSkipTest()) + return; + double memMCSR = SparseBlockFactory.estimateSizeSparseInMemory(SparseBlock.Type.MCSR, rows, cols, sparsity); double memCSR = SparseBlockFactory.estimateSizeSparseInMemory(SparseBlock.Type.CSR, rows, cols, sparsity); double memCOO = SparseBlockFactory.estimateSizeSparseInMemory(SparseBlock.Type.COO, rows, cols, sparsity); @@ -91,4 +94,4 @@ public class SparseBlockMemEstimate extends AutomatedTestBase Assert.fail("SparseBlockCSR memory estimate smaller than SparseBlockCOO estimate."); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockMerge.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockMerge.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockMerge.java index b6c9324..0e9379c 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockMerge.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockMerge.java @@ -19,7 +19,6 @@ package org.apache.sysml.test.integration.functions.sparse; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.data.SparseBlock; @@ -224,6 +223,9 @@ public class SparseBlockMerge extends AutomatedTestBase private void runSparseBlockMergeTest( SparseBlock.Type btype1, SparseBlock.Type btype2, double sparsity) { + if(shouldSkipTest()) + return; + try { //data generation @@ -253,7 +255,7 @@ public class SparseBlockMerge extends AutomatedTestBase //check for correct number of non-zeros if( nnz != mb1.getNonZeros() ) - Assert.fail("Wrong number of non-zeros: "+mb1.getNonZeros()+", expected: "+nnz); + fail("Wrong number of non-zeros: "+mb1.getNonZeros()+", expected: "+nnz); //check correct values long count = 0; @@ -267,13 +269,13 @@ public class SparseBlockMerge extends AutomatedTestBase double[] avals = sblock.values(i); for( int j=0; j<alen; j++ ) { if( avals[apos+j] != A[i][aix[apos+j]] ) - Assert.fail("Wrong value returned by scan: "+avals[apos+j]+", expected: "+A[i][apos+aix[j]]); + fail("Wrong value returned by scan: "+avals[apos+j]+", expected: "+A[i][apos+aix[j]]); count++; } } } if( count != nnz ) - Assert.fail("Wrong number of values returned by merge: "+count+", expected: "+nnz); + fail("Wrong number of values returned by merge: "+count+", expected: "+nnz); } catch(Exception ex) { ex.printStackTrace(); http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockScan.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockScan.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockScan.java index 53d2b6d..99f56f0 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockScan.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockScan.java @@ -19,7 +19,6 @@ package org.apache.sysml.test.integration.functions.sparse; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.data.SparseBlock; @@ -102,6 +101,9 @@ public class SparseBlockScan extends AutomatedTestBase */ private void runSparseBlockScanTest( SparseBlock.Type btype, double sparsity) { + if(shouldSkipTest()) + return; + try { //data generation @@ -125,12 +127,12 @@ public class SparseBlockScan extends AutomatedTestBase nnz += rnnz[i]; } if( nnz != sblock.size() ) - Assert.fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); + fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); //check correct isEmpty return for( int i=0; i<rows; i++ ) if( sblock.isEmpty(i) != (rnnz[i]==0) ) - Assert.fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); + fail("Wrong isEmpty(row) result for row nnz: "+rnnz[i]); //check correct values int count = 0; @@ -141,16 +143,16 @@ public class SparseBlockScan extends AutomatedTestBase double[] avals = sblock.values(i); for( int j=0; j<alen; j++ ) { if( avals[apos+j] != A[i][aix[apos+j]] ) - Assert.fail("Wrong value returned by scan: "+avals[apos+j]+", expected: "+A[i][apos+aix[j]]); + fail("Wrong value returned by scan: "+avals[apos+j]+", expected: "+A[i][apos+aix[j]]); count++; } } if( count != nnz ) - Assert.fail("Wrong number of values returned by scan: "+count+", expected: "+nnz); + fail("Wrong number of values returned by scan: "+count+", expected: "+nnz); } catch(Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockSize.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockSize.java b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockSize.java index afeb374..da45e5f 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockSize.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/sparse/SparseBlockSize.java @@ -19,7 +19,6 @@ package org.apache.sysml.test.integration.functions.sparse; -import org.junit.Assert; import org.junit.Test; import org.apache.sysml.runtime.matrix.data.MatrixBlock; import org.apache.sysml.runtime.matrix.data.SparseBlock; @@ -106,6 +105,9 @@ public class SparseBlockSize extends AutomatedTestBase */ private void runSparseBlockSizeTest( SparseBlock.Type btype, double sparsity) { + if(shouldSkipTest()) + return; + try { //data generation @@ -135,25 +137,25 @@ public class SparseBlockSize extends AutomatedTestBase //check full block nnz if( nnz != sblock.size() ) - Assert.fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); + fail("Wrong number of non-zeros: "+sblock.size()+", expected: "+nnz); //check row nnz for( int i=0; i<rows; i++ ) if( sblock.size(i) != rnnz[i] ) { - Assert.fail("Wrong number of row non-zeros ("+i+"): " + + fail("Wrong number of row non-zeros ("+i+"): " + sblock.size(i)+", expected: "+rnnz[i]); } //check two row nnz for( int i=1; i<rows; i++ ) if( sblock.size(i-1,i+1) != rnnz[i-1]+rnnz[i] ) { - Assert.fail("Wrong number of row block non-zeros ("+(i-1)+","+(i+1)+"): " + + fail("Wrong number of row block non-zeros ("+(i-1)+","+(i+1)+"): " + sblock.size(i-1,i+1)+", expected: "+rnnz[i-1]+rnnz[i]); } //check index range nnz if( sblock.size(rl, ru, cl, cu) != nnz2 ) - Assert.fail("Wrong number of range non-zeros: " + + fail("Wrong number of range non-zeros: " + sblock.size(rl, ru, cl, cu)+", expected: "+nnz2); } catch(Exception ex) { @@ -161,4 +163,4 @@ public class SparseBlockSize extends AutomatedTestBase throw new RuntimeException(ex); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DBackwardDataTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DBackwardDataTest.java b/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DBackwardDataTest.java index b479b5e..a64eaef 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DBackwardDataTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DBackwardDataTest.java @@ -132,22 +132,15 @@ public class Conv2DBackwardDataTest extends AutomatedTestBase public void runConv2DTest( ExecType et, int imgSize, int numImg, int numChannels, int numFilters, int filterSize, int stride, int pad, boolean sparse1, boolean sparse2) { - RUNTIME_PLATFORM oldRTP = rtplatform; - boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; + RUNTIME_PLATFORM oldRTP = setRuntimePlatform(et); + if(shouldSkipTest()) + return; try { - TestConfiguration config = getTestConfiguration(TEST_NAME); - if(et == ExecType.SPARK) { - rtplatform = RUNTIME_PLATFORM.SPARK; - } - else { - rtplatform = (et==ExecType.MR)? RUNTIME_PLATFORM.HADOOP : RUNTIME_PLATFORM.SINGLE_NODE; - } - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; - + TestConfiguration config = getTestConfiguration(TEST_NAME); + loadTestConfiguration(config); /* This is for running the junit test the new way, i.e., construct the arguments directly */ http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DBackwardTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DBackwardTest.java b/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DBackwardTest.java index c45327c..a30b54f 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DBackwardTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DBackwardTest.java @@ -179,15 +179,10 @@ public class Conv2DBackwardTest extends AutomatedTestBase public void runConv2DBackwardFilterTest( ExecType et, int imgSize, int numImg, int numChannels, int numFilters, int filterSize, int stride, int pad, boolean sparse1, boolean sparse2) { - 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; break; - } boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; try { http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DTest.java b/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DTest.java index 1341212..4468f5e 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/tensor/Conv2DTest.java @@ -251,15 +251,10 @@ public class Conv2DTest extends AutomatedTestBase public void runConv2DTest( ExecType et, int imgSize, int numImg, int numChannels, int numFilters, int filterSize, int stride, int pad, boolean sparse1, boolean sparse2) { - 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; break; - } boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; try { http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/tensor/PoolBackwardTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/tensor/PoolBackwardTest.java b/src/test/java/org/apache/sysml/test/integration/functions/tensor/PoolBackwardTest.java index f623666..b56087a 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/tensor/PoolBackwardTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/tensor/PoolBackwardTest.java @@ -135,15 +135,11 @@ public class PoolBackwardTest extends AutomatedTestBase public void runPoolTest( ExecType et, int imgSize, int numImg, int numChannels, int stride, int pad, int poolSize1, int poolSize2, String poolMode, boolean sparse1, boolean sparse2) { - 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; break; - } boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; + try { http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/tensor/PoolTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/tensor/PoolTest.java b/src/test/java/org/apache/sysml/test/integration/functions/tensor/PoolTest.java index 1acb14c..c16f445 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/tensor/PoolTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/tensor/PoolTest.java @@ -133,15 +133,11 @@ public class PoolTest extends AutomatedTestBase public void runPoolTest( ExecType et, int imgSize, int numImg, int numChannels, int stride, int pad, int poolSize1, int poolSize2, String poolMode, boolean sparse) { - 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; break; - } boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; + try { http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/tensor/ReluBackwardTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/tensor/ReluBackwardTest.java b/src/test/java/org/apache/sysml/test/integration/functions/tensor/ReluBackwardTest.java index 9dd2338..3fd2c99 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/tensor/ReluBackwardTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/tensor/ReluBackwardTest.java @@ -66,22 +66,16 @@ public class ReluBackwardTest extends AutomatedTestBase * @param sparse */ public void runReluBackwardTest( ExecType et, int M, int N) - { - RUNTIME_PLATFORM oldRTP = rtplatform; - + { boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; + RUNTIME_PLATFORM oldRTP = setRuntimePlatform(et); + if(shouldSkipTest()) + return; + try { TestConfiguration config = getTestConfiguration(TEST_NAME); - if(et == ExecType.SPARK) { - rtplatform = RUNTIME_PLATFORM.SPARK; - } - else { - rtplatform = (et==ExecType.MR)? RUNTIME_PLATFORM.HADOOP : RUNTIME_PLATFORM.SINGLE_NODE; - } - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; loadTestConfiguration(config); http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/ternary/ABATernaryAggregateTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/ternary/ABATernaryAggregateTest.java b/src/test/java/org/apache/sysml/test/integration/functions/ternary/ABATernaryAggregateTest.java index 12525c9..052d0cb 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/ternary/ABATernaryAggregateTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/ternary/ABATernaryAggregateTest.java @@ -32,7 +32,6 @@ import org.apache.sysml.test.integration.AutomatedTestBase; import org.apache.sysml.test.integration.TestConfiguration; import org.apache.sysml.test.utils.TestUtils; import org.apache.sysml.utils.Statistics; -import org.junit.Assert; import org.junit.Test; /** @@ -356,17 +355,10 @@ public class ABATernaryAggregateTest extends AutomatedTestBase private void runTernaryAggregateTest(String testname, boolean sparse, boolean vectors, boolean rewrites, ExecType et) { - //rtplatform for MR - 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; break; - } - boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; boolean rewritesOld = OptimizerUtils.ALLOW_SUM_PRODUCT_REWRITES; @@ -403,7 +395,7 @@ public class ABATernaryAggregateTest extends AutomatedTestBase if( rewrites && et != ExecType.MR ) { String opcode = ((et == ExecType.SPARK) ? Instruction.SP_INST_PREFIX : "") + (((testname.equals(TEST_NAME1) || testname.equals(TEST_NAME3) || vectors ) ? "tak+*" : "tack+*")); - Assert.assertTrue(Statistics.getCPHeavyHitterOpCodes().contains(opcode)); + assertTrue(Statistics.getCPHeavyHitterOpCodes().contains(opcode)); } } finally { http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/ternary/CTableMatrixIgnoreZerosTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/ternary/CTableMatrixIgnoreZerosTest.java b/src/test/java/org/apache/sysml/test/integration/functions/ternary/CTableMatrixIgnoreZerosTest.java index 14464bb..9110bd0 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/ternary/CTableMatrixIgnoreZerosTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/ternary/CTableMatrixIgnoreZerosTest.java @@ -130,20 +130,12 @@ public class CTableMatrixIgnoreZerosTest extends AutomatedTestBase { String TEST_NAME = TEST_NAME1; - //rtplatform for MR - RUNTIME_PLATFORM platformOld = rtplatform; - boolean rewriteOld = TernaryOp.ALLOW_CTABLE_SEQUENCE_REWRITES; - - switch( et ){ - case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break; - case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break; - default: rtplatform = RUNTIME_PLATFORM.HYBRID; break; - } - boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; - + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; + + boolean rewriteOld = TernaryOp.ALLOW_CTABLE_SEQUENCE_REWRITES; TernaryOp.ALLOW_CTABLE_SEQUENCE_REWRITES = rewrite; double sparsity = sparse ? sparsity2: sparsity1; @@ -180,4 +172,4 @@ public class CTableMatrixIgnoreZerosTest extends AutomatedTestBase TernaryOp.ALLOW_CTABLE_SEQUENCE_REWRITES = rewriteOld; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/ternary/CTableSequenceTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/ternary/CTableSequenceTest.java b/src/test/java/org/apache/sysml/test/integration/functions/ternary/CTableSequenceTest.java index a147a8f..bd1bd25 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/ternary/CTableSequenceTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/ternary/CTableSequenceTest.java @@ -223,20 +223,12 @@ public class CTableSequenceTest extends AutomatedTestBase { String TEST_NAME = left ? TEST_NAME1 : TEST_NAME2; - //rtplatform for MR - RUNTIME_PLATFORM platformOld = rtplatform; - boolean rewriteOld = TernaryOp.ALLOW_CTABLE_SEQUENCE_REWRITES; - - switch( et ){ - case MR: rtplatform = RUNTIME_PLATFORM.HADOOP; break; - case SPARK: rtplatform = RUNTIME_PLATFORM.SPARK; break; - default: rtplatform = RUNTIME_PLATFORM.HYBRID; break; - } - boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; + boolean rewriteOld = TernaryOp.ALLOW_CTABLE_SEQUENCE_REWRITES; TernaryOp.ALLOW_CTABLE_SEQUENCE_REWRITES = rewrite; try @@ -281,4 +273,4 @@ public class CTableSequenceTest extends AutomatedTestBase TernaryOp.ALLOW_CTABLE_SEQUENCE_REWRITES = rewriteOld; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/ternary/CentralMomentWeightsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/ternary/CentralMomentWeightsTest.java b/src/test/java/org/apache/sysml/test/integration/functions/ternary/CentralMomentWeightsTest.java index 876fa18..18c596c 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/ternary/CentralMomentWeightsTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/ternary/CentralMomentWeightsTest.java @@ -171,17 +171,10 @@ public class CentralMomentWeightsTest extends AutomatedTestBase */ private void runCentralMomentTest( int order, boolean sparse, ExecType et) { - //rtplatform for MR - 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; break; - } - boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; try { @@ -220,4 +213,4 @@ public class CentralMomentWeightsTest extends AutomatedTestBase } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/systemml/blob/95bf8cfe/src/test/java/org/apache/sysml/test/integration/functions/ternary/CovarianceWeightsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/sysml/test/integration/functions/ternary/CovarianceWeightsTest.java b/src/test/java/org/apache/sysml/test/integration/functions/ternary/CovarianceWeightsTest.java index 53fba92..0aba1e8 100644 --- a/src/test/java/org/apache/sysml/test/integration/functions/ternary/CovarianceWeightsTest.java +++ b/src/test/java/org/apache/sysml/test/integration/functions/ternary/CovarianceWeightsTest.java @@ -99,17 +99,10 @@ public class CovarianceWeightsTest extends AutomatedTestBase */ private void runCovarianceTest( boolean sparse, ExecType et) { - //rtplatform for MR - 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; break; - } - boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG; - if( rtplatform == RUNTIME_PLATFORM.SPARK ) - DMLScript.USE_LOCAL_SPARK_CONFIG = true; + RUNTIME_PLATFORM platformOld = setRuntimePlatform(et); + if(shouldSkipTest()) + return; try { @@ -150,4 +143,4 @@ public class CovarianceWeightsTest extends AutomatedTestBase } } -} \ No newline at end of file +}