You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by mb...@apache.org on 2021/03/20 13:59:17 UTC

[systemds] branch master updated: [MINOR] Cleanup repo, part II (test output buffering, formatting)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new f4427b5  [MINOR] Cleanup repo, part II (test output buffering, formatting)
f4427b5 is described below

commit f4427b5684540cb62cc6a50ff9db6df02fc76a1e
Author: Matthias Boehm <mb...@gmail.com>
AuthorDate: Sat Mar 20 14:58:58 2021 +0100

    [MINOR] Cleanup repo, part II (test output buffering, formatting)
---
 .../compress/colgroup/mapping/MapToBit.java        |  66 +++---
 .../compress/colgroup/mapping/MapToByte.java       |  79 ++++---
 .../compress/colgroup/mapping/MapToFactory.java    |  80 +++----
 .../compress/colgroup/mapping/MapToInt.java        |   4 +-
 .../org/apache/sysds/test/TestConfiguration.java   | 239 ++++++++++----------
 .../functions/builtin/BuiltinLogSumExpTest.java    |   1 -
 .../functions/compress/compressInstruction.java    | 163 +++++++-------
 .../compress/compressInstructionRewrite.java       | 247 ++++++++++-----------
 .../test/functions/compress/compressScale.java     | 215 +++++++++---------
 .../sysds/test/functions/dnn/Conv1DTest.java       |   1 -
 .../test/functions/dnn/Conv2DBackwardDataTest.java |   4 +-
 .../primitives/FederatedBinaryMatrixTest.java      |   4 +-
 .../primitives/FederatedBinaryVectorTest.java      |   4 +-
 .../test/functions/frame/FrameAppendDistTest.java  |  20 +-
 .../test/functions/misc/AssertExpressionTest.java  |   2 -
 .../functions/misc/ConditionalValidateTest.java    |   2 -
 .../test/functions/misc/DataTypeCastingTest.java   |  43 ++--
 .../test/functions/misc/DataTypeChangeTest.java    |   5 +-
 .../test/functions/misc/ExistsVariableTest.java    |   2 -
 .../functions/misc/FunctionInExpressionTest.java   |   2 -
 .../test/functions/misc/FunctionInliningTest.java  |  10 +-
 .../test/functions/misc/FunctionNamespaceTest.java |   2 -
 .../test/functions/misc/FunctionNotFoundTest.java  |   2 -
 .../test/functions/misc/FunctionReturnTest.java    |   4 -
 ...nstantFoldingScalarVariablePropagationTest.java |   2 -
 .../functions/misc/IPADeadCodeEliminationTest.java |   2 -
 .../functions/misc/IPAFunctionInliningTest.java    |   2 -
 .../functions/misc/IPALiteralReplacementTest.java  |   6 +-
 .../test/functions/misc/IPANnzPropagationTest.java |   2 -
 .../functions/misc/IPAScalarRecursionTest.java     |  16 +-
 .../misc/IPAScalarVariablePropagationTest.java     |   8 +-
 .../functions/misc/IPAUnknownRecursionTest.java    |   6 +-
 .../test/functions/misc/ListAndStructTest.java     |   2 -
 .../test/functions/misc/ListAppendRemove.java      |   2 -
 .../test/functions/misc/LongOverflowTest.java      |  11 +-
 .../functions/misc/NegativeLoopIncrementsTest.java |   2 -
 .../test/functions/misc/NrowNcolStringTest.java    |   9 +-
 .../test/functions/misc/PrintExpressionTest.java   |   7 +-
 .../sysds/test/functions/misc/PrintMatrixTest.java |   9 +-
 .../test/functions/misc/ReadAfterWriteTest.java    |  15 +-
 .../sysds/test/functions/misc/ToStringTest.java    |  44 ++--
 .../functions/misc/ZeroRowsColsMatrixTest.java     |   2 -
 .../sysds/test/functions/nary/NaryListTest.java    |  19 +-
 43 files changed, 635 insertions(+), 732 deletions(-)

diff --git a/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToBit.java b/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToBit.java
index 5b81266..03ecc69 100644
--- a/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToBit.java
+++ b/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToBit.java
@@ -28,56 +28,54 @@ import org.apache.sysds.utils.MemoryEstimates;
 
 public class MapToBit implements IMapToData {
 
-    private BitSet _data;
+	private BitSet _data;
 
-    public MapToBit(int size){
-        _data = new BitSet(size);
-    }
+	public MapToBit(int size){
+		_data = new BitSet(size);
+	}
 
-    @Override
-    public int getIndex(int n) {
-        return _data.get(n)? 1: 0;
-    }
+	@Override
+	public int getIndex(int n) {
+		return _data.get(n)? 1: 0;
+	}
 
-    @Override
-    public void fill(int v) {
-        if(v == 1)
-            _data.flip(0, _data.length());
-    }
+	@Override
+	public void fill(int v) {
+		if(v == 1)
+			_data.flip(0, _data.length());
+	}
 
 	@Override
 	public long getInMemorySize() {
 		return getInMemorySize(_data.size());
 	}
 
-    public static long getInMemorySize(int dataLength){
-        long size = 16; // object header
+	public static long getInMemorySize(int dataLength){
+		long size = 16; // object header
 		size += MemoryEstimates.bitSetCost(dataLength);
 		return size;
-    }
+	}
 
-    @Override
-    public void set(int n, int v) {
-        _data.set(n, v == 1);
-    }
-    
-    @Override
+	@Override
+	public void set(int n, int v) {
+		_data.set(n, v == 1);
+	}
+	
+	@Override
 	public void write(DataOutput out) throws IOException {
-        long[] internals =  _data.toLongArray();
-        out.writeInt(internals.length);
-        for(int i = 0; i < internals.length; i++)
-            out.writeLong(internals[i]);
+		long[] internals =  _data.toLongArray();
+		out.writeInt(internals.length);
+		for(int i = 0; i < internals.length; i++)
+			out.writeLong(internals[i]);
 	}
 
 	@Override
 	public MapToBit readFields(DataInput in) throws IOException {
-        long[] internalLong = new long[in.readInt()];
-        for(int i = 0; i < internalLong.length; i++)
-            internalLong[i] = in.readLong();
-        
-        _data = BitSet.valueOf(internalLong);
-        return this;
+		long[] internalLong = new long[in.readInt()];
+		for(int i = 0; i < internalLong.length; i++)
+			internalLong[i] = in.readLong();
+		
+		_data = BitSet.valueOf(internalLong);
+		return this;
 	}
-
-
 }
diff --git a/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToByte.java b/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToByte.java
index b894693..b9fee2d 100644
--- a/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToByte.java
+++ b/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToByte.java
@@ -28,60 +28,57 @@ import org.apache.sysds.utils.MemoryEstimates;
 
 public class MapToByte implements IMapToData {
 
-    private byte[] _data;
+	private byte[] _data;
 
-    public MapToByte(int size) {
-        _data = new byte[size];
-    }
-
-    @Override
-    public int getIndex(int n) {
-        return _data[n] & 0xFF;
-    }
+	public MapToByte(int size) {
+		_data = new byte[size];
+	}
 
-    @Override
-    public void fill(int v) {
-        Arrays.fill(_data, (byte) v);
-    }
+	@Override
+	public int getIndex(int n) {
+		return _data[n] & 0xFF;
+	}
 
-    @Override
-    public long getInMemorySize() {
-        return getInMemorySize(_data.length);
-    }
+	@Override
+	public void fill(int v) {
+		Arrays.fill(_data, (byte) v);
+	}
 
-    public static long getInMemorySize(int dataLength) {
-        long size = 16; // object header
-        size += MemoryEstimates.byteArrayCost(dataLength);
-        return size;
-    }
+	@Override
+	public long getInMemorySize() {
+		return getInMemorySize(_data.length);
+	}
 
-    @Override
-    public void set(int n, int v) {
-        _data[n] = (byte) v;
-    }
+	public static long getInMemorySize(int dataLength) {
+		long size = 16; // object header
+		size += MemoryEstimates.byteArrayCost(dataLength);
+		return size;
+	}
 
-    @Override
-    public void write(DataOutput out) throws IOException {
+	@Override
+	public void set(int n, int v) {
+		_data[n] = (byte) v;
+	}
 
-        for(int i = 0; i < _data.length; i++)
-            out.writeByte(_data[i]);
-    }
+	@Override
+	public void write(DataOutput out) throws IOException {
 
-    @Override
-    public MapToByte readFields(DataInput in) throws IOException {
-        for(int i = 0; i < _data.length; i++)
-            _data[i] = in.readByte();
-        return this;
-    }
+		for(int i = 0; i < _data.length; i++)
+			out.writeByte(_data[i]);
+	}
 
+	@Override
+	public MapToByte readFields(DataInput in) throws IOException {
+		for(int i = 0; i < _data.length; i++)
+			_data[i] = in.readByte();
+		return this;
+	}
 
 	@Override
 	public String toString() {
 		StringBuilder sb = new StringBuilder();
-        sb.append("\nDataLength: " + this._data.length);
-        sb.append(Arrays.toString(this._data));
+		sb.append("\nDataLength: " + this._data.length);
+		sb.append(Arrays.toString(this._data));
 		return sb.toString();
 	}
-
-
 }
diff --git a/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToFactory.java b/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToFactory.java
index 5c55b6c..006a17e 100644
--- a/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToFactory.java
+++ b/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToFactory.java
@@ -23,47 +23,47 @@ import java.io.DataInput;
 import java.io.IOException;
 
 public class MapToFactory {
-    public static IMapToData create(int size, int numTuples) {
-        if(numTuples <= 1)
-            return new MapToBit(size);
-        else if(numTuples <= 256)
-            return new MapToByte(size);
-        else if(numTuples <= Character.MAX_VALUE)
-            return new MapToChar(size);
-        else
-            return new MapToInt(size);
-    }
+	public static IMapToData create(int size, int numTuples) {
+		if(numTuples <= 1)
+			return new MapToBit(size);
+		else if(numTuples <= 256)
+			return new MapToByte(size);
+		else if(numTuples <= Character.MAX_VALUE)
+			return new MapToChar(size);
+		else
+			return new MapToInt(size);
+	}
 
-    public static long estimateInMemorySize(int size, int numTuples) {
-        if(numTuples <= 1)
-            return MapToBit.getInMemorySize(size);
-        else if(numTuples <= 256)
-            return MapToByte.getInMemorySize(size);
-        else if(numTuples <= Character.MAX_VALUE)
-            return MapToChar.getInMemorySize(size);
-        else
-            return MapToInt.getInMemorySize(size);
-    }
+	public static long estimateInMemorySize(int size, int numTuples) {
+		if(numTuples <= 1)
+			return MapToBit.getInMemorySize(size);
+		else if(numTuples <= 256)
+			return MapToByte.getInMemorySize(size);
+		else if(numTuples <= Character.MAX_VALUE)
+			return MapToChar.getInMemorySize(size);
+		else
+			return MapToInt.getInMemorySize(size);
+	}
 
-    public static IMapToData readIn(int size, DataInput in, int numTuples) throws IOException {
-        if(numTuples <= 1)
-            return new MapToBit(size).readFields(in);
-        else if(numTuples <= 255)
-            return new MapToByte(size).readFields(in);
-        else if(numTuples <= Character.MAX_VALUE)
-            return new MapToChar(size).readFields(in);
-        else
-            return new MapToInt(size).readFields(in);
-    }
+	public static IMapToData readIn(int size, DataInput in, int numTuples) throws IOException {
+		if(numTuples <= 1)
+			return new MapToBit(size).readFields(in);
+		else if(numTuples <= 255)
+			return new MapToByte(size).readFields(in);
+		else if(numTuples <= Character.MAX_VALUE)
+			return new MapToChar(size).readFields(in);
+		else
+			return new MapToInt(size).readFields(in);
+	}
 
-    public static long getExactSizeOnDisk(int size, int numTuples) {
-        if(numTuples <= 1)
-            return 4 + size / 8 + (size % 8 > 1 ? 1 : 0);
-        else if(numTuples <= 256)
-            return size;
-        else if(numTuples <= Character.MAX_VALUE)
-            return size * 2;
-        else
-            return size * 4;
-    }
+	public static long getExactSizeOnDisk(int size, int numTuples) {
+		if(numTuples <= 1)
+			return 4 + size / 8 + (size % 8 > 1 ? 1 : 0);
+		else if(numTuples <= 256)
+			return size;
+		else if(numTuples <= Character.MAX_VALUE)
+			return size * 2;
+		else
+			return size * 4;
+	}
 }
diff --git a/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToInt.java b/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToInt.java
index 195c343..75bd782 100644
--- a/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToInt.java
+++ b/src/main/java/org/apache/sysds/runtime/compress/colgroup/mapping/MapToInt.java
@@ -76,8 +76,8 @@ public class MapToInt implements IMapToData {
 	@Override
 	public String toString() {
 		StringBuilder sb = new StringBuilder();
-        sb.append("\nDataLength: " + this._data.length);
-        sb.append(Arrays.toString(this._data));
+		sb.append("\nDataLength: " + this._data.length);
+		sb.append(Arrays.toString(this._data));
 		return sb.toString();
 	}
 
diff --git a/src/test/java/org/apache/sysds/test/TestConfiguration.java b/src/test/java/org/apache/sysds/test/TestConfiguration.java
index 6d303d7..1c96db0 100644
--- a/src/test/java/org/apache/sysds/test/TestConfiguration.java
+++ b/src/test/java/org/apache/sysds/test/TestConfiguration.java
@@ -47,125 +47,124 @@ public class TestConfiguration
 	private HashMap<String, String> variables = new HashMap<>();
 
 	/**
-     * <p>
-     *  Creates a new test configuration with the name of the test script and the output files which are produced by
-     *  the test.
-     * </p>
-     * 
-     * @param testScript test script
-     * @param outputFiles output files
-     * @deprecated use TestConfiguration(String, String, String[]) instead
-     */
-    @Deprecated
-    public TestConfiguration(String testScript, String[] outputFiles) {
-        this.testScript = testScript;
-        this.outputFiles = outputFiles;
-    }
-    
-    /**
-     * <p>
-     *  Creates a new test configuration with the directory where the test data can be found, the name of the test
-     *  script and the output files which are produced by the test.
-     * </p>
-     * 
-     * @param testDirectory test directory
-     * @param testScript test script
-     * @param outputFiles output files
-     */
-    public TestConfiguration(String testDirectory, String testScript, String[] outputFiles) {
-        this.testDirectory = testDirectory;
-        this.testScript = testScript;
-        this.outputFiles = outputFiles;
-    }
-    
-    /**
-     * <p>
-     *  Creates a new test configuration with the directory where the test data can be found and the name of the test
-     *  script.
-     * </p>
-     * 
-     * @param testDirectory test directory
-     * @param testScript test script
-     */
-    public TestConfiguration(String testDirectory, String testScript) {
-    	this.testDirectory = testDirectory;
-    	this.testScript = testScript;
-    }
-    
-    /**
-     * <p>Adds a variable to the test configuration.</p>
-     * 
-     * @param variableName variable name
-     * @param variableValue variable value
-     */
-    public void addVariable(String variableName, String variableValue) {
-        variables.put(variableName, variableValue);
-    }
-    
-    /**
-     * <p>Adds a variable to the test configuration.</p>
-     * 
-     * @param variableName variable name
-     * @param variableValue variable value
-     */
-    public void addVariable(String variableName, Boolean variableValue) {
-        variables.put(variableName, variableValue.toString());
-    }
+	 * <p>
+	 *  Creates a new test configuration with the name of the test script and the output files which are produced by
+	 *  the test.
+	 * </p>
+	 * 
+	 * @param testScript test script
+	 * @param outputFiles output files
+	 * @deprecated use TestConfiguration(String, String, String[]) instead
+	 */
+	@Deprecated
+	public TestConfiguration(String testScript, String[] outputFiles) {
+		this.testScript = testScript;
+		this.outputFiles = outputFiles;
+	}
+	
+	/**
+	 * <p>
+	 *  Creates a new test configuration with the directory where the test data can be found, the name of the test
+	 *  script and the output files which are produced by the test.
+	 * </p>
+	 * 
+	 * @param testDirectory test directory
+	 * @param testScript test script
+	 * @param outputFiles output files
+	 */
+	public TestConfiguration(String testDirectory, String testScript, String[] outputFiles) {
+		this.testDirectory = testDirectory;
+		this.testScript = testScript;
+		this.outputFiles = outputFiles;
+	}
+	
+	/**
+	 * <p>
+	 *  Creates a new test configuration with the directory where the test data can be found and the name of the test
+	 *  script.
+	 * </p>
+	 * 
+	 * @param testDirectory test directory
+	 * @param testScript test script
+	 */
+	public TestConfiguration(String testDirectory, String testScript) {
+		this.testDirectory = testDirectory;
+		this.testScript = testScript;
+	}
+	
+	/**
+	 * <p>Adds a variable to the test configuration.</p>
+	 * 
+	 * @param variableName variable name
+	 * @param variableValue variable value
+	 */
+	public void addVariable(String variableName, String variableValue) {
+		variables.put(variableName, variableValue);
+	}
+	
+	/**
+	 * <p>Adds a variable to the test configuration.</p>
+	 * 
+	 * @param variableName variable name
+	 * @param variableValue variable value
+	 */
+	public void addVariable(String variableName, Boolean variableValue) {
+		variables.put(variableName, variableValue.toString());
+	}
 
-    /**
-     * <p>Adds a variable to the test configuration.</p>
-     * 
-     * @param variableName variable name
-     * @param variableValue variable value
-     */
-    public void addVariable(String variableName, double variableValue) {
-    	variables.put(variableName, TestUtils.getStringRepresentationForDouble(variableValue));
-    }
-    
-    /**
-     * <p>Adds a variable to the test configuration.</p>
-     * 
-     * @param variableName variable name
-     * @param variableValue variable value
-     */
-    public void addVariable(String variableName, long variableValue) {
-        variables.put(variableName, Long.toString(variableValue));
-    }
-    
-    /**
-     * <p>Provides the directory which contains the test data.</p>
-     * 
-     * @return test directory
-     */
-    public String getTestDirectory() {
-        return testDirectory;
-    }
-    
-    /**
-     * <p>Provides the name of the test script.</p>
-     * 
-     * @return test script name
-     */
-    public String getTestScript() {
-        return testScript;
-    }
-    
-    /**
-     * <p>Provides the list of specified output files for the test.</p>
-     * 
-     * @return output files
-     */
-    public String[] getOutputFiles() {
-        return outputFiles;
-    }
-    
-    /**
-     * <p>Provides the list of the specified variables with their replacements.</p>
-     * 
-     * @return variables
-     */
-    public HashMap<String, String> getVariables() {
-        return variables;
-    }
-    
+	/**
+	 * <p>Adds a variable to the test configuration.</p>
+	 * 
+	 * @param variableName variable name
+	 * @param variableValue variable value
+	 */
+	public void addVariable(String variableName, double variableValue) {
+		variables.put(variableName, TestUtils.getStringRepresentationForDouble(variableValue));
+	}
+	
+	/**
+	 * <p>Adds a variable to the test configuration.</p>
+	 * 
+	 * @param variableName variable name
+	 * @param variableValue variable value
+	 */
+	public void addVariable(String variableName, long variableValue) {
+		variables.put(variableName, Long.toString(variableValue));
+	}
+	
+	/**
+	 * <p>Provides the directory which contains the test data.</p>
+	 * 
+	 * @return test directory
+	 */
+	public String getTestDirectory() {
+		return testDirectory;
+	}
+	
+	/**
+	 * <p>Provides the name of the test script.</p>
+	 * 
+	 * @return test script name
+	 */
+	public String getTestScript() {
+		return testScript;
+	}
+	
+	/**
+	 * <p>Provides the list of specified output files for the test.</p>
+	 * 
+	 * @return output files
+	 */
+	public String[] getOutputFiles() {
+		return outputFiles;
+	}
+	
+	/**
+	 * <p>Provides the list of the specified variables with their replacements.</p>
+	 * 
+	 * @return variables
+	 */
+	public HashMap<String, String> getVariables() {
+		return variables;
+	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/builtin/BuiltinLogSumExpTest.java b/src/test/java/org/apache/sysds/test/functions/builtin/BuiltinLogSumExpTest.java
index 1a66e6a..9c433ef 100644
--- a/src/test/java/org/apache/sysds/test/functions/builtin/BuiltinLogSumExpTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/builtin/BuiltinLogSumExpTest.java
@@ -76,7 +76,6 @@ public class BuiltinLogSumExpTest extends AutomatedTestBase
 	private void runlogSumExpTest(String axis, ExecType instType)
 	{
 		ExecMode platformOld = setExecMode(instType);
-		setOutputBuffering(false);
 		try
 		{
 			loadTestConfiguration(getTestConfiguration(TEST_NAME));
diff --git a/src/test/java/org/apache/sysds/test/functions/compress/compressInstruction.java b/src/test/java/org/apache/sysds/test/functions/compress/compressInstruction.java
index 0e9e529..0eaf662 100644
--- a/src/test/java/org/apache/sysds/test/functions/compress/compressInstruction.java
+++ b/src/test/java/org/apache/sysds/test/functions/compress/compressInstruction.java
@@ -32,86 +32,85 @@ import org.apache.sysds.utils.Statistics;
 import org.junit.Test;
 
 public class compressInstruction extends AutomatedTestBase {
-    // private static final Log LOG = LogFactory.getLog(compressInstruction.class.getName());
-
-    protected String getTestClassDir() {
-        return getTestDir() + this.getClass().getSimpleName() + "/";
-    }
-
-    protected String getTestName() {
-        return "compress";
-    }
-
-    protected String getTestDir() {
-        return "functions/compress/compressInstruction/";
-    }
-
-    @Test
-    public void testCompressInstruction_01() {
-        compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 0, 1, "01");
-    }
-
-    @Test
-    public void testCompressInstruction_02() {
-        compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 1, 1, "02");
-    }
-
-    @Test
-    public void testCompressInstruction_07() {
-        compressTest(10, 10000, 0.3, ExecType.CP, 0, 5, 1, 1, "07");
-    }
-
-    // @Test
-    // public void testCompressInstruction_07_noCompress() {
-    // compressTest(10, 10000, 0.3, ExecType.CP, 0, 5, 1, 1, "07_noCompress");
-    // }
-
-    public void testCompressInstruction_07_timeCompare() {
-
-        compressTest(10, 1000, 0.3, ExecType.CP, 0, 5, 1, 1, "07");
-
-        for(int i = 0; i < 10; i++) {
-            Timing time = new Timing(true);
-            compressTest(10, 100000, 1.0, ExecType.CP, 0, 5, 1, 1, "07");
-            System.out.println("CLA " + time.stop() + " ms.");
-            Statistics.reset();
-        }
-        for(int i = 0; i < 10; i++) {
-            Timing time = new Timing(true);
-            compressTest(10, 100000, 1.0, ExecType.CP, 0, 5, 0, 0, "07_noCompress");
-            System.out.println("ULA " + time.stop() + " ms.");
-        }
-    }
-
-    public void compressTest(int cols, int rows, double sparsity, LopProperties.ExecType instType, int min, int max,
-        int decompressionCountExpected, int compressionCountsExpected, String name) {
-
-        Types.ExecMode platformOld = setExecMode(instType);
-        try {
-
-            loadTestConfiguration(getTestConfiguration(getTestName()));
-
-            fullDMLScriptName = SCRIPT_DIR + "/" + getTestDir() + "compress_" + name + ".dml";
-
-            programArgs = new String[] {"-stats", "100", "-nvargs", "cols=" + cols, "rows=" + rows,
-                "sparsity=" + sparsity, "min=" + min, "max= " + max};
-            runTest(null);
-            // LOG.error(runTest(null));
-
-        }
-        catch(Exception e) {
-            e.printStackTrace();
-            assertTrue("Exception in execution: " + e.getMessage(), false);
-        }
-        finally {
-            rtplatform = platformOld;
-        }
-    }
-
-    @Override
-    public void setUp() {
-        TestUtils.clearAssertionInformation();
-        addTestConfiguration(getTestName(), new TestConfiguration(getTestClassDir(), getTestName()));
-    }
-
+	// private static final Log LOG = LogFactory.getLog(compressInstruction.class.getName());
+
+	protected String getTestClassDir() {
+		return getTestDir() + this.getClass().getSimpleName() + "/";
+	}
+
+	protected String getTestName() {
+		return "compress";
+	}
+
+	protected String getTestDir() {
+		return "functions/compress/compressInstruction/";
+	}
+
+	@Test
+	public void testCompressInstruction_01() {
+		compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 0, 1, "01");
+	}
+
+	@Test
+	public void testCompressInstruction_02() {
+		compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 1, 1, "02");
+	}
+
+	@Test
+	public void testCompressInstruction_07() {
+		compressTest(10, 10000, 0.3, ExecType.CP, 0, 5, 1, 1, "07");
+	}
+
+	// @Test
+	// public void testCompressInstruction_07_noCompress() {
+	// compressTest(10, 10000, 0.3, ExecType.CP, 0, 5, 1, 1, "07_noCompress");
+	// }
+
+	public void testCompressInstruction_07_timeCompare() {
+
+		compressTest(10, 1000, 0.3, ExecType.CP, 0, 5, 1, 1, "07");
+
+		for(int i = 0; i < 10; i++) {
+			Timing time = new Timing(true);
+			compressTest(10, 100000, 1.0, ExecType.CP, 0, 5, 1, 1, "07");
+			System.out.println("CLA " + time.stop() + " ms.");
+			Statistics.reset();
+		}
+		for(int i = 0; i < 10; i++) {
+			Timing time = new Timing(true);
+			compressTest(10, 100000, 1.0, ExecType.CP, 0, 5, 0, 0, "07_noCompress");
+			System.out.println("ULA " + time.stop() + " ms.");
+		}
+	}
+
+	public void compressTest(int cols, int rows, double sparsity, LopProperties.ExecType instType, int min, int max,
+		int decompressionCountExpected, int compressionCountsExpected, String name) {
+
+		Types.ExecMode platformOld = setExecMode(instType);
+		try {
+
+			loadTestConfiguration(getTestConfiguration(getTestName()));
+
+			fullDMLScriptName = SCRIPT_DIR + "/" + getTestDir() + "compress_" + name + ".dml";
+
+			programArgs = new String[] {"-stats", "100", "-nvargs", "cols=" + cols, "rows=" + rows,
+				"sparsity=" + sparsity, "min=" + min, "max= " + max};
+			runTest(null);
+			// LOG.error(runTest(null));
+
+		}
+		catch(Exception e) {
+			e.printStackTrace();
+			assertTrue("Exception in execution: " + e.getMessage(), false);
+		}
+		finally {
+			rtplatform = platformOld;
+		}
+	}
+
+	@Override
+	public void setUp() {
+		TestUtils.clearAssertionInformation();
+		addTestConfiguration(getTestName(), new TestConfiguration(getTestClassDir(), getTestName()));
+	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/compress/compressInstructionRewrite.java b/src/test/java/org/apache/sysds/test/functions/compress/compressInstructionRewrite.java
index 5e0df61..434a2eb 100644
--- a/src/test/java/org/apache/sysds/test/functions/compress/compressInstructionRewrite.java
+++ b/src/test/java/org/apache/sysds/test/functions/compress/compressInstructionRewrite.java
@@ -38,128 +38,127 @@ import org.junit.Assert;
 import org.junit.Test;
 
 public class compressInstructionRewrite extends AutomatedTestBase {
-    private static final Log LOG = LogFactory.getLog(compressInstructionRewrite.class.getName());
-
-    private String TEST_CONF = "SystemDS-config-compress-cost.xml";
-    private File TEST_CONF_FILE = new File(SCRIPT_DIR + getTestDir(), TEST_CONF);
-
-    protected String getTestClassDir() {
-        return getTestDir() + this.getClass().getSimpleName() + "/";
-    }
-
-    protected String getTestName() {
-        return "compress";
-    }
-
-    protected String getTestDir() {
-        return "functions/compress/compressInstructionRewrite/";
-    }
-
-    @Test
-    public void testCompressInstruction_01() {
-        compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 0, 0, "01");
-    }
-
-    @Test
-    public void testCompressInstruction_02() {
-        compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 0, 1, "02");
-    }
-
-    @Test
-    public void testCompressInstruction_02_toSmallToCompress() {
-        compressTest(1, 74, 0.2, ExecType.CP, 0, 5, 0, 0, "02");
-    }
-
-    @Test
-    public void testCompressInstruction_03() {
-        compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 0, 1, "03");
-    }
-
-    @Test
-    public void testCompressInstruction_04() {
-        compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 0, 0, "04");
-    }
-
-    @Test
-    public void testCompressInstruction_05() {
-        compressTest(3, 1000, 0.2, ExecType.CP, 0, 5, 0, 0, "05");
-    }
-
-    @Test
-    public void testCompressInstruction_06() {
-        compressTest(3, 1000, 0.2, ExecType.CP, 0, 5, 0, 1, "06");
-    }
-
-    @Test
-    public void testCompressInstruction_07() {
-        compressTest(6, 6000, 0.2, ExecType.CP, 0, 5, 0, 1, "07");
-    }
-
-    @Test
-    public void testCompressInstruction_08() {
-        compressTest(6, 6000, 0.2, ExecType.CP, 0, 5, 0, 1, "08");
-    }
-
-    @Test
-    public void testCompressInstruction_09() {
-        compressTest(1, 1000, 1.0, ExecType.CP, 1, 5, 0, 1, "09");
-    }
-
-    @Test
-    public void testCompressInstruction_10() {
-        compressTest(1, 1000, 1.0, ExecType.CP, 5, 5, 0, 0, "10");
-    }
-
-
-    public void compressTest(int cols, int rows, double sparsity, LopProperties.ExecType instType, int min, int max,
-        int decompressionCountExpected, int compressionCountsExpected, String name) {
-
-        Types.ExecMode platformOld = setExecMode(instType);
-        try {
-
-            loadTestConfiguration(getTestConfiguration(getTestName()));
-
-            fullDMLScriptName = SCRIPT_DIR + "/" + getTestDir() + "compress_" + name + ".dml";
-            programArgs = new String[] {"-explain", "-stats", "100", "-nvargs", "cols=" + cols, "rows=" + rows,
-                "sparsity=" + sparsity, "min=" + min, "max= " + max};
-
-            ByteArrayOutputStream stdout = runTest(null);
-
-            if(LOG.isDebugEnabled())
-                LOG.debug(stdout);
-
-            int decompressCount = 0;
-            decompressCount += DMLCompressionStatistics.getDecompressionCount();
-            decompressCount += DMLCompressionStatistics.getDecompressionSTCount();
-            long compressionCount = Statistics.getCPHeavyHitterCount("compress");
-
-            Assert.assertEquals(compressionCountsExpected, compressionCount);
-            Assert.assertEquals(decompressionCountExpected, decompressCount);
-            if(decompressionCountExpected > 0)
-                Assert.assertTrue(heavyHittersContainsString("decompress", decompressionCountExpected));
-        }
-        catch(Exception e) {
-            e.printStackTrace();
-            assertTrue("Exception in execution: " + e.getMessage(), false);
-        }
-        finally {
-            rtplatform = platformOld;
-        }
-    }
-
-    @Override
-    public void setUp() {
-        TestUtils.clearAssertionInformation();
-        addTestConfiguration(getTestName(), new TestConfiguration(getTestClassDir(), getTestName()));
-    }
-
-    /**
-     * Override default configuration with custom test configuration to ensure scratch space and local temporary
-     * directory locations are also updated.
-     */
-    @Override
-    protected File getConfigTemplateFile() {
-        return TEST_CONF_FILE;
-    }
-
+	private static final Log LOG = LogFactory.getLog(compressInstructionRewrite.class.getName());
+
+	private String TEST_CONF = "SystemDS-config-compress-cost.xml";
+	private File TEST_CONF_FILE = new File(SCRIPT_DIR + getTestDir(), TEST_CONF);
+
+	protected String getTestClassDir() {
+		return getTestDir() + this.getClass().getSimpleName() + "/";
+	}
+
+	protected String getTestName() {
+		return "compress";
+	}
+
+	protected String getTestDir() {
+		return "functions/compress/compressInstructionRewrite/";
+	}
+
+	@Test
+	public void testCompressInstruction_01() {
+		compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 0, 0, "01");
+	}
+
+	@Test
+	public void testCompressInstruction_02() {
+		compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 0, 1, "02");
+	}
+
+	@Test
+	public void testCompressInstruction_02_toSmallToCompress() {
+		compressTest(1, 74, 0.2, ExecType.CP, 0, 5, 0, 0, "02");
+	}
+
+	@Test
+	public void testCompressInstruction_03() {
+		compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 0, 1, "03");
+	}
+
+	@Test
+	public void testCompressInstruction_04() {
+		compressTest(1, 1000, 0.2, ExecType.CP, 0, 5, 0, 0, "04");
+	}
+
+	@Test
+	public void testCompressInstruction_05() {
+		compressTest(3, 1000, 0.2, ExecType.CP, 0, 5, 0, 0, "05");
+	}
+
+	@Test
+	public void testCompressInstruction_06() {
+		compressTest(3, 1000, 0.2, ExecType.CP, 0, 5, 0, 1, "06");
+	}
+
+	@Test
+	public void testCompressInstruction_07() {
+		compressTest(6, 6000, 0.2, ExecType.CP, 0, 5, 0, 1, "07");
+	}
+
+	@Test
+	public void testCompressInstruction_08() {
+		compressTest(6, 6000, 0.2, ExecType.CP, 0, 5, 0, 1, "08");
+	}
+
+	@Test
+	public void testCompressInstruction_09() {
+		compressTest(1, 1000, 1.0, ExecType.CP, 1, 5, 0, 1, "09");
+	}
+
+	@Test
+	public void testCompressInstruction_10() {
+		compressTest(1, 1000, 1.0, ExecType.CP, 5, 5, 0, 0, "10");
+	}
+
+
+	public void compressTest(int cols, int rows, double sparsity, LopProperties.ExecType instType, int min, int max,
+		int decompressionCountExpected, int compressionCountsExpected, String name) {
+
+		Types.ExecMode platformOld = setExecMode(instType);
+		try {
+
+			loadTestConfiguration(getTestConfiguration(getTestName()));
+
+			fullDMLScriptName = SCRIPT_DIR + "/" + getTestDir() + "compress_" + name + ".dml";
+			programArgs = new String[] {"-explain", "-stats", "100", "-nvargs", "cols=" + cols, "rows=" + rows,
+				"sparsity=" + sparsity, "min=" + min, "max= " + max};
+
+			ByteArrayOutputStream stdout = runTest(null);
+
+			if(LOG.isDebugEnabled())
+				LOG.debug(stdout);
+
+			int decompressCount = 0;
+			decompressCount += DMLCompressionStatistics.getDecompressionCount();
+			decompressCount += DMLCompressionStatistics.getDecompressionSTCount();
+			long compressionCount = Statistics.getCPHeavyHitterCount("compress");
+
+			Assert.assertEquals(compressionCountsExpected, compressionCount);
+			Assert.assertEquals(decompressionCountExpected, decompressCount);
+			if(decompressionCountExpected > 0)
+				Assert.assertTrue(heavyHittersContainsString("decompress", decompressionCountExpected));
+		}
+		catch(Exception e) {
+			e.printStackTrace();
+			assertTrue("Exception in execution: " + e.getMessage(), false);
+		}
+		finally {
+			rtplatform = platformOld;
+		}
+	}
+
+	@Override
+	public void setUp() {
+		TestUtils.clearAssertionInformation();
+		addTestConfiguration(getTestName(), new TestConfiguration(getTestClassDir(), getTestName()));
+	}
+
+	/**
+	 * Override default configuration with custom test configuration to ensure scratch space and local temporary
+	 * directory locations are also updated.
+	 */
+	@Override
+	protected File getConfigTemplateFile() {
+		return TEST_CONF_FILE;
+	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/compress/compressScale.java b/src/test/java/org/apache/sysds/test/functions/compress/compressScale.java
index f1ac926..6c89908 100644
--- a/src/test/java/org/apache/sysds/test/functions/compress/compressScale.java
+++ b/src/test/java/org/apache/sysds/test/functions/compress/compressScale.java
@@ -34,112 +34,111 @@ import org.apache.sysds.utils.DMLCompressionStatistics;
 import org.junit.Test;
 
 public class compressScale extends AutomatedTestBase {
-    private static final Log LOG = LogFactory.getLog(compressScale.class.getName());
-
-    protected String getTestClassDir() {
-        return getTestDir() + this.getClass().getSimpleName() + "/";
-    }
-
-    protected String getTestName() {
-        return "scale";
-    }
-
-    protected String getTestDir() {
-        return "functions/compress/compressScale/";
-    }
-
-    // @Test
-    // public void testInstruction_01() {
-    //     compressTest(4, 1000000, 0.2, ExecType.CP, -100, 1000, 1, 1);
-    // }
-
-    @Test
-    public void testInstruction_01_1() {
-        compressTest(50, 1000000, 0.2, ExecType.CP, 1, 2, 1, 1);
-    }
-
-    // @Test
-    // public void testInstruction_02() {
-    // compressTest(10, 200000, 0.2, ExecType.CP, 0, 5, 0, 1);
-    // }
-
-    // @Test
-    // public void testInstruction_03() {
-    // compressTest(10, 200000, 0.2, ExecType.CP, 0, 5, 0, 0);
-    // }
-
-    // @Test
-    // public void testInstruction_04() {
-    // compressTest(10, 200000, 0.2, ExecType.CP, 0, 5, 1, 0);
-    // }
-
-    public void compressTest(int cols, int rows, double sparsity, LopProperties.ExecType instType, int min, int max,
-        int scale, int center) {
-
-        Types.ExecMode platformOld = setExecMode(instType);
-        try {
-
-            fullDMLScriptName = SCRIPT_DIR + "/" + getTestDir() + getTestName() + ".dml";
-            loadTestConfiguration(getTestConfiguration(getTestName()));
-
-            // Default arguments
-            programArgs = new String[] {"-config", "", "-nvargs", "cols=" + cols, "rows=" + rows,
-                "sparsity=" + sparsity, "min=" + min, "max= " + max, "scale=" + scale, "center=" + center};
-
-            // Default execution
-            programArgs[1] = configPath("SystemDS-config-default.xml");
-            double outStd = Double.parseDouble(runTest(null).toString().split("\n")[0].split(" ")[0]);
-            LOG.debug("ULA : " + outStd);
-
-            programArgs[1] = configPath("SystemDS-config-compress-cost-RLE.xml");
-            double RLEoutC = Double.parseDouble(runTest(null).toString().split("\n")[0].split(" ")[0]);
-            assertTrue(DMLCompressionStatistics.haveCompressed());
-            DMLCompressionStatistics.reset();
-            LOG.debug("RLE : " + RLEoutC);
-            
-            programArgs[1] = configPath("SystemDS-config-compress-cost-OLE.xml");
-            double OLEOutC = Double.parseDouble(runTest(null).toString().split("\n")[0].split(" ")[0]);
-            assertTrue(DMLCompressionStatistics.haveCompressed());
-            DMLCompressionStatistics.reset();
-            LOG.debug("OLE : " + OLEOutC);
-            
-            programArgs[1] = configPath("SystemDS-config-compress-cost-DDC.xml");
-            double DDCoutC = Double.parseDouble(runTest(null).toString().split("\n")[0].split(" ")[0]);
-            assertTrue(DMLCompressionStatistics.haveCompressed());
-            DMLCompressionStatistics.reset();
-            LOG.debug("DDC : " + DDCoutC);
-            
-            programArgs[1] = configPath("SystemDS-config-compress-cost.xml");
-            double ALLoutC = Double.parseDouble(runTest(null).toString().split("\n")[0].split(" ")[0]);
-            assertTrue(DMLCompressionStatistics.haveCompressed());
-            DMLCompressionStatistics.reset();
-            LOG.debug("CLA : " + ALLoutC);
-
-            assertEquals(outStd, OLEOutC, 0.1);
-            assertEquals(outStd, RLEoutC, 0.1);
-            assertEquals(outStd, DDCoutC, 0.1);
-            assertEquals(outStd, ALLoutC, 0.1);
-
-        }
-        catch(Exception e) {
-            e.printStackTrace();
-            assertTrue("Exception in execution: " + e.getMessage(), false);
-        }
-        finally {
-            rtplatform = platformOld;
-        }
-    }
-
-    @Override
-    public void setUp() {
-        disableConfigFile = true;
-        TestUtils.clearAssertionInformation();
-        addTestConfiguration(getTestName(), new TestConfiguration(getTestClassDir(), getTestName()));
-    }
-
-    private String configPath(String file) {
-        String out = (SCRIPT_DIR + getTestDir() + file).substring(2);
-        return out;
-    }
-
+	private static final Log LOG = LogFactory.getLog(compressScale.class.getName());
+
+	protected String getTestClassDir() {
+		return getTestDir() + this.getClass().getSimpleName() + "/";
+	}
+
+	protected String getTestName() {
+		return "scale";
+	}
+
+	protected String getTestDir() {
+		return "functions/compress/compressScale/";
+	}
+
+	// @Test
+	// public void testInstruction_01() {
+	//	 compressTest(4, 1000000, 0.2, ExecType.CP, -100, 1000, 1, 1);
+	// }
+
+	@Test
+	public void testInstruction_01_1() {
+		compressTest(50, 1000000, 0.2, ExecType.CP, 1, 2, 1, 1);
+	}
+
+	// @Test
+	// public void testInstruction_02() {
+	// compressTest(10, 200000, 0.2, ExecType.CP, 0, 5, 0, 1);
+	// }
+
+	// @Test
+	// public void testInstruction_03() {
+	// compressTest(10, 200000, 0.2, ExecType.CP, 0, 5, 0, 0);
+	// }
+
+	// @Test
+	// public void testInstruction_04() {
+	// compressTest(10, 200000, 0.2, ExecType.CP, 0, 5, 1, 0);
+	// }
+
+	public void compressTest(int cols, int rows, double sparsity, LopProperties.ExecType instType, int min, int max,
+		int scale, int center) {
+
+		Types.ExecMode platformOld = setExecMode(instType);
+		try {
+
+			fullDMLScriptName = SCRIPT_DIR + "/" + getTestDir() + getTestName() + ".dml";
+			loadTestConfiguration(getTestConfiguration(getTestName()));
+
+			// Default arguments
+			programArgs = new String[] {"-config", "", "-nvargs", "cols=" + cols, "rows=" + rows,
+				"sparsity=" + sparsity, "min=" + min, "max= " + max, "scale=" + scale, "center=" + center};
+
+			// Default execution
+			programArgs[1] = configPath("SystemDS-config-default.xml");
+			double outStd = Double.parseDouble(runTest(null).toString().split("\n")[0].split(" ")[0]);
+			LOG.debug("ULA : " + outStd);
+
+			programArgs[1] = configPath("SystemDS-config-compress-cost-RLE.xml");
+			double RLEoutC = Double.parseDouble(runTest(null).toString().split("\n")[0].split(" ")[0]);
+			assertTrue(DMLCompressionStatistics.haveCompressed());
+			DMLCompressionStatistics.reset();
+			LOG.debug("RLE : " + RLEoutC);
+			
+			programArgs[1] = configPath("SystemDS-config-compress-cost-OLE.xml");
+			double OLEOutC = Double.parseDouble(runTest(null).toString().split("\n")[0].split(" ")[0]);
+			assertTrue(DMLCompressionStatistics.haveCompressed());
+			DMLCompressionStatistics.reset();
+			LOG.debug("OLE : " + OLEOutC);
+			
+			programArgs[1] = configPath("SystemDS-config-compress-cost-DDC.xml");
+			double DDCoutC = Double.parseDouble(runTest(null).toString().split("\n")[0].split(" ")[0]);
+			assertTrue(DMLCompressionStatistics.haveCompressed());
+			DMLCompressionStatistics.reset();
+			LOG.debug("DDC : " + DDCoutC);
+			
+			programArgs[1] = configPath("SystemDS-config-compress-cost.xml");
+			double ALLoutC = Double.parseDouble(runTest(null).toString().split("\n")[0].split(" ")[0]);
+			assertTrue(DMLCompressionStatistics.haveCompressed());
+			DMLCompressionStatistics.reset();
+			LOG.debug("CLA : " + ALLoutC);
+
+			assertEquals(outStd, OLEOutC, 0.1);
+			assertEquals(outStd, RLEoutC, 0.1);
+			assertEquals(outStd, DDCoutC, 0.1);
+			assertEquals(outStd, ALLoutC, 0.1);
+
+		}
+		catch(Exception e) {
+			e.printStackTrace();
+			assertTrue("Exception in execution: " + e.getMessage(), false);
+		}
+		finally {
+			rtplatform = platformOld;
+		}
+	}
+
+	@Override
+	public void setUp() {
+		disableConfigFile = true;
+		TestUtils.clearAssertionInformation();
+		addTestConfiguration(getTestName(), new TestConfiguration(getTestClassDir(), getTestName()));
+	}
+
+	private String configPath(String file) {
+		String out = (SCRIPT_DIR + getTestDir() + file).substring(2);
+		return out;
+	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/dnn/Conv1DTest.java b/src/test/java/org/apache/sysds/test/functions/dnn/Conv1DTest.java
index 9f5add5..87b8a91 100644
--- a/src/test/java/org/apache/sysds/test/functions/dnn/Conv1DTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/dnn/Conv1DTest.java
@@ -235,7 +235,6 @@ public class Conv1DTest extends AutomatedTestBase
 			runTest(true, false, null, -1);
 
 			HashMap<CellIndex, Double> dmlfile = readDMLMatrixFromOutputDir("output");
-			System.out.println(dmlfile.toString());
 			if ( expected != null)
 				TestUtils.compareMatrices(dmlfile, expected, epsilon, "B-DML", "B-R");
 		}
diff --git a/src/test/java/org/apache/sysds/test/functions/dnn/Conv2DBackwardDataTest.java b/src/test/java/org/apache/sysds/test/functions/dnn/Conv2DBackwardDataTest.java
index be2087f..9d1fd9d 100644
--- a/src/test/java/org/apache/sysds/test/functions/dnn/Conv2DBackwardDataTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/dnn/Conv2DBackwardDataTest.java
@@ -148,7 +148,7 @@ public class Conv2DBackwardDataTest extends AutomatedTestBase
 				DMLScript.USE_LOCAL_SPARK_CONFIG = true;
 			
 			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 + TEST_NAME + ".dml";
@@ -162,7 +162,7 @@ public class Conv2DBackwardDataTest extends AutomatedTestBase
 					"" + filterSize, "" + stride, "" + pad,
 					"" + P, "" + P, 
 					output("B"), sparseVal1, sparseVal2};
-			        
+			
 			boolean exceptionExpected = false;
 			int expectedNumberOfJobs = -1;
 			runTest(true, exceptionExpected, null, expectedNumberOfJobs);
diff --git a/src/test/java/org/apache/sysds/test/functions/federated/primitives/FederatedBinaryMatrixTest.java b/src/test/java/org/apache/sysds/test/functions/federated/primitives/FederatedBinaryMatrixTest.java
index 279f524..2517470 100644
--- a/src/test/java/org/apache/sysds/test/functions/federated/primitives/FederatedBinaryMatrixTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/federated/primitives/FederatedBinaryMatrixTest.java
@@ -56,11 +56,11 @@ public class FederatedBinaryMatrixTest extends AutomatedTestBase {
 	public static Collection<Object[]> data() {
 		// rows have to be even and > 1
 		return Arrays.asList(new Object[][] {
-            // {2, 1000}, 
+			// {2, 1000}, 
 			{10, 100}, 
 			// {100, 10}, {1000, 1}, 
 			// {10, 2000}, {2000, 10}
-        });
+		});
 	}
 
 	@Test
diff --git a/src/test/java/org/apache/sysds/test/functions/federated/primitives/FederatedBinaryVectorTest.java b/src/test/java/org/apache/sysds/test/functions/federated/primitives/FederatedBinaryVectorTest.java
index d3cea77..6ac77c4 100644
--- a/src/test/java/org/apache/sysds/test/functions/federated/primitives/FederatedBinaryVectorTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/federated/primitives/FederatedBinaryVectorTest.java
@@ -57,11 +57,11 @@ public class FederatedBinaryVectorTest extends AutomatedTestBase {
 	public static Collection<Object[]> data() {
 		// rows have to be even and > 1
 		return Arrays.asList(new Object[][] {
-            // {2, 1000}, 
+			// {2, 1000}, 
 			// {10, 100}, 
 			{100, 10}, 
 			// {1000, 1}, {10, 2000}, {2000, 10}
-        });
+		});
 	}
 
 	@Test
diff --git a/src/test/java/org/apache/sysds/test/functions/frame/FrameAppendDistTest.java b/src/test/java/org/apache/sysds/test/functions/frame/FrameAppendDistTest.java
index 0eb7a6a..0a4c3a1 100644
--- a/src/test/java/org/apache/sysds/test/functions/frame/FrameAppendDistTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/frame/FrameAppendDistTest.java
@@ -83,12 +83,12 @@ public class FrameAppendDistTest extends AutomatedTestBase
 	@Test
 	public void testAppendInBlock1DenseRBindSP() {
 		commonAppendTest(ExecMode.SPARK, rows1, rows2, cols1a, cols1a, false, AppendMethod.MR_RAPPEND, true);
-	}   
+	}
 	
 	@Test
 	public void testAppendInBlock1SparseRBindSP() {
 		commonAppendTest(ExecMode.SPARK, rows1, rows1, cols1a, cols1a, true, AppendMethod.MR_RAPPEND, true);
-	}   
+	}
 	
 	//NOTE: mappend only applied for m2_cols<=blocksize
 	@Test
@@ -114,7 +114,7 @@ public class FrameAppendDistTest extends AutomatedTestBase
 	public void commonAppendTest(ExecMode platform, int rows1, int rows2, int cols1, int cols2, boolean sparse, AppendMethod forcedAppendMethod, boolean rbind)
 	{
 		TestConfiguration config = getAndLoadTestConfiguration(TEST_NAME);
-	    
+		
 		ExecMode prevPlfm=rtplatform;
 		
 		double sparsity = (sparse) ? sparsity2 : sparsity1; 
@@ -131,21 +131,17 @@ public class FrameAppendDistTest extends AutomatedTestBase
 	
 			config.addVariable("rows", rows1);
 			config.addVariable("cols", cols1);
-	          
+			
 			/* 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 + TEST_NAME + ".dml";
 			programArgs = new String[]{"-explain","-args",  input("A"), 
-					                             Long.toString(rows1), 
-					                             Long.toString(cols1),
-								                 input("B"),
-					                             Long.toString(rows2), 
-								                 Long.toString(cols2),
-		                                         output("C"),
-		                                         (rbind? "rbind": "cbind")};
+				Long.toString(rows1), Long.toString(cols1), input("B"),
+				Long.toString(rows2), Long.toString(cols2), output("C"),
+				(rbind? "rbind": "cbind")};
 			fullRScriptName = RI_HOME + TEST_NAME + ".R";
 			rCmd = "Rscript" + " " + fullRScriptName + " " + 
-			       inputDir() + " " + expectedDir() + " " + (rbind? "rbind": "cbind");
+				inputDir() + " " + expectedDir() + " " + (rbind? "rbind": "cbind");
 	
 			//initialize the frame data.
 			ValueType[] lschemaA = genMixSchema(cols1);
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/AssertExpressionTest.java b/src/test/java/org/apache/sysds/test/functions/misc/AssertExpressionTest.java
index 1ee0e4f..7fadbe7 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/AssertExpressionTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/AssertExpressionTest.java
@@ -58,7 +58,6 @@ public class AssertExpressionTest extends AutomatedTestBase
 	 */
 	private void runPrintExpressionTest( String testname, boolean rewrites )
 	{
-		setOutputBuffering(true);
 		String TEST_NAME = testname;
 		TestConfiguration config = getTestConfiguration(TEST_NAME);
 		loadTestConfiguration(config);
@@ -83,6 +82,5 @@ public class AssertExpressionTest extends AutomatedTestBase
 		{
 			OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = oldRewriteFlag;
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/ConditionalValidateTest.java b/src/test/java/org/apache/sysds/test/functions/misc/ConditionalValidateTest.java
index bec66c3..b911a4a 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/ConditionalValidateTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/ConditionalValidateTest.java
@@ -102,7 +102,6 @@ public class ConditionalValidateTest extends AutomatedTestBase
 	
 	private void runTest( String testName, Class<?> exceptionClass, boolean fileExists )
 	{
-		setOutputBuffering(true);
 		String TEST_NAME = testName;
 
 		try
@@ -136,6 +135,5 @@ public class ConditionalValidateTest extends AutomatedTestBase
 		catch(Exception ex) {
 			throw new RuntimeException(ex);
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/DataTypeCastingTest.java b/src/test/java/org/apache/sysds/test/functions/misc/DataTypeCastingTest.java
index d524f64..8906fc6 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/DataTypeCastingTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/DataTypeCastingTest.java
@@ -30,12 +30,8 @@ import org.apache.sysds.test.TestConfiguration;
 import org.junit.Assert;
 import org.junit.Test;
 
-/**
- *   
- */
 public class DataTypeCastingTest extends AutomatedTestBase
 {
-	
 	private final static String TEST_DIR = "functions/misc/";
 	private final static String TEST_CLASS_DIR = TEST_DIR + DataTypeCastingTest.class.getSimpleName() + "/";
 	
@@ -87,16 +83,15 @@ public class DataTypeCastingTest extends AutomatedTestBase
 	 */
 	private void runTest( String testName, boolean matrixInput, Class<?> exceptionClass ) 
 	{
-		setOutputBuffering(true);
 		String TEST_NAME = testName;
 		int numVals = (exceptionClass != null ? 7 : 1);
 		
 		try
-		{		
+		{
 			TestConfiguration config = getTestConfiguration(TEST_NAME);	
 			loadTestConfiguration(config);
-   
-		    String HOME = SCRIPT_DIR + TEST_DIR;
+
+			String HOME = SCRIPT_DIR + TEST_DIR;
 			fullDMLScriptName = HOME + TEST_NAME + ".dml";
 			programArgs = new String[]{"-args", input("V"), 
 				Integer.toString(numVals), Integer.toString(numVals),
@@ -105,7 +100,7 @@ public class DataTypeCastingTest extends AutomatedTestBase
 			//write input
 			double[][] V = getRandomMatrix(numVals, numVals, 0, 1, 1.0, 7);
 			if( matrixInput ){
-				writeInputMatrix("V", V, false);	
+				writeInputMatrix("V", V, false);
 			}
 			else{
 				HDFSTool.writeDoubleToHDFS(V[0][0], input("V"));
@@ -113,28 +108,26 @@ public class DataTypeCastingTest extends AutomatedTestBase
 			}
 			
 			//run tests
-	        runTest(true, exceptionClass != null, exceptionClass, -1);
-	        
-	        if( exceptionClass == null ){
-		        //read output
-		        double ret = -1;
-		        if( testName.equals(TEST_NAME2) ){
-		        	HashMap<CellIndex, Double> dmlfile = readDMLMatrixFromOutputDir("R");
-		        	ret = dmlfile.get(new CellIndex(1,1));		
-		        }
+			runTest(true, exceptionClass != null, exceptionClass, -1);
+	
+			if( exceptionClass == null ){
+				//read output
+				double ret = -1;
+				if( testName.equals(TEST_NAME2) ){
+					HashMap<CellIndex, Double> dmlfile = readDMLMatrixFromOutputDir("R");
+					ret = dmlfile.get(new CellIndex(1,1));
+				}
 				else if( testName.equals(TEST_NAME1) ){
 					HashMap<CellIndex, Double> dmlfile = readDMLScalarFromOutputDir("R");
 					ret = dmlfile.get(new CellIndex(1,1));
 				}
-		        
-		        //compare results
-		        Assert.assertEquals(V[0][0], ret, 1e-16);
-	        }
+		
+				//compare results
+				Assert.assertEquals(V[0][0], ret, 1e-16);
+			}
 		}
-		catch(Exception ex)
-		{
+		catch(Exception ex) {
 			throw new RuntimeException(ex);
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/DataTypeChangeTest.java b/src/test/java/org/apache/sysds/test/functions/misc/DataTypeChangeTest.java
index 3b4741a..b180480 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/DataTypeChangeTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/DataTypeChangeTest.java
@@ -150,8 +150,7 @@ public class DataTypeChangeTest extends AutomatedTestBase
 
 	private void runTest( String testName, Class<?> exceptionExpected ) 
 	{
-		setOutputBuffering(true);
-        String RI_HOME = SCRIPT_DIR + TEST_DIR;
+		String RI_HOME = SCRIPT_DIR + TEST_DIR;
 		fullDMLScriptName = RI_HOME + testName + ".dml";
 		programArgs = new String[]{};
 		
@@ -160,9 +159,7 @@ public class DataTypeChangeTest extends AutomatedTestBase
 		
 		//integration test from outside SystemDS
 		runTest(true, exceptionExpected != null, exceptionExpected, -1);
-		setOutputBuffering(false);
 	}
-	
 
 	private void runValidateTest( String fullTestName, boolean expectedException )
 	{
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/ExistsVariableTest.java b/src/test/java/org/apache/sysds/test/functions/misc/ExistsVariableTest.java
index 9d229fb..5e9caad 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/ExistsVariableTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/ExistsVariableTest.java
@@ -63,7 +63,6 @@ public class ExistsVariableTest extends AutomatedTestBase
 	}
 	
 	private void runExistsTest(String testName, boolean pos) {
-		setOutputBuffering(true);
 		TestConfiguration config = getTestConfiguration(testName);
 		loadTestConfiguration(config);
 		String HOME = SCRIPT_DIR + TEST_DIR;
@@ -79,6 +78,5 @@ public class ExistsVariableTest extends AutomatedTestBase
 		val = (val!=null) ? val : 0;
 		Assert.assertTrue("Wrong result: "+param+" vs "+val,
 			val==Double.parseDouble(param));
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/FunctionInExpressionTest.java b/src/test/java/org/apache/sysds/test/functions/misc/FunctionInExpressionTest.java
index 6d0b260..78ad721 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/FunctionInExpressionTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/FunctionInExpressionTest.java
@@ -89,7 +89,6 @@ public class FunctionInExpressionTest extends AutomatedTestBase
 	
 	private void runFunInExpressionTest( String testName )
 	{
-		setOutputBuffering(true);
 		TestConfiguration config = getTestConfiguration(testName);
 		loadTestConfiguration(config);
 		
@@ -106,6 +105,5 @@ public class FunctionInExpressionTest extends AutomatedTestBase
 		//compare results
 		double val = readDMLMatrixFromOutputDir("R").get(new CellIndex(1,1));
 		Assert.assertTrue("Wrong result: 7 vs "+val, Math.abs(val-7)<Math.pow(10, -13));
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/FunctionInliningTest.java b/src/test/java/org/apache/sysds/test/functions/misc/FunctionInliningTest.java
index b539328..562071f 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/FunctionInliningTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/FunctionInliningTest.java
@@ -84,8 +84,7 @@ public class FunctionInliningTest extends AutomatedTestBase
 	}
 
 	private void runInliningTest( String testname, boolean IPA )
-	{	
-		setOutputBuffering(true);
+	{
 		boolean oldIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS;
 		
 		try
@@ -118,15 +117,12 @@ public class FunctionInliningTest extends AutomatedTestBase
 			Assert.assertEquals("Unexpected number of executed Spark instructions.", 
 				expectNumExecuted, Statistics.getNoOfExecutedSPInst());
 		}
-		catch(Exception ex)
-		{
+		catch(Exception ex) {
 			Assert.fail("Failed to run test: "+ex.getMessage());
 		}
-		finally
-		{
+		finally {
 			OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS = oldIPA;
 		}
-		setOutputBuffering(false);
 	}
 	
 }
\ No newline at end of file
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/FunctionNamespaceTest.java b/src/test/java/org/apache/sysds/test/functions/misc/FunctionNamespaceTest.java
index f3f3fe9..b76b954 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/FunctionNamespaceTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/FunctionNamespaceTest.java
@@ -161,7 +161,6 @@ public class FunctionNamespaceTest extends AutomatedTestBase
 	
 	private void runFunctionNamespaceTest(String TEST_NAME)
 	{
-		setOutputBuffering(true);
 		getAndLoadTestConfiguration(TEST_NAME);
 		
 		fullDMLScriptName = SCRIPT_DIR + TEST_DIR + TEST_NAME + ".dml";
@@ -184,7 +183,6 @@ public class FunctionNamespaceTest extends AutomatedTestBase
 		finally {
 			System.setErr(origStdErr);
 		}
-		setOutputBuffering(false);
 	}
 
 	private void runFunctionNoInliningNamespaceTest(String TEST_NAME, boolean IPA)
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/FunctionNotFoundTest.java b/src/test/java/org/apache/sysds/test/functions/misc/FunctionNotFoundTest.java
index c7ed903..4c56806 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/FunctionNotFoundTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/FunctionNotFoundTest.java
@@ -50,7 +50,6 @@ public class FunctionNotFoundTest extends AutomatedTestBase {
 	}
 
 	private void runFunctionNotFoundTest(String testName, Class<?> error) {
-		setOutputBuffering(true);
 		TestConfiguration config = getTestConfiguration(testName);
 		loadTestConfiguration(config);
 
@@ -59,6 +58,5 @@ public class FunctionNotFoundTest extends AutomatedTestBase {
 		programArgs = new String[] {};
 
 		runTest(true, true, error, -1);
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/FunctionReturnTest.java b/src/test/java/org/apache/sysds/test/functions/misc/FunctionReturnTest.java
index 1dd9d62..e9a4917 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/FunctionReturnTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/FunctionReturnTest.java
@@ -58,8 +58,6 @@ public class FunctionReturnTest extends AutomatedTestBase
 	}
 
 	private void runFunctionReturnTest( String testname, boolean IPA ) {
-
-		setOutputBuffering(true);
 		boolean oldIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS;
 		OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS = IPA;
 		try {
@@ -75,7 +73,5 @@ public class FunctionReturnTest extends AutomatedTestBase
 		finally {
 			OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS = oldIPA;
 		}
-
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/IPAConstantFoldingScalarVariablePropagationTest.java b/src/test/java/org/apache/sysds/test/functions/misc/IPAConstantFoldingScalarVariablePropagationTest.java
index 8d2213c..74b60d5 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/IPAConstantFoldingScalarVariablePropagationTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/IPAConstantFoldingScalarVariablePropagationTest.java
@@ -94,7 +94,6 @@ public class IPAConstantFoldingScalarVariablePropagationTest extends AutomatedTe
 	 */
 	private void runIPAScalarVariablePropagationTest(String testname, boolean IPA_SECOND_CHANCE)
 	{
-		setOutputBuffering(true);
 		// Save old settings
 		int oldIPANumRep = OptimizerUtils.IPA_NUM_REPETITIONS;
 		boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
@@ -126,6 +125,5 @@ public class IPAConstantFoldingScalarVariablePropagationTest extends AutomatedTe
 			DMLScript.USE_LOCAL_SPARK_CONFIG = sparkConfigOld;
 			rtplatform = platformOld;
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/IPADeadCodeEliminationTest.java b/src/test/java/org/apache/sysds/test/functions/misc/IPADeadCodeEliminationTest.java
index 35a4d34..daf034a 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/IPADeadCodeEliminationTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/IPADeadCodeEliminationTest.java
@@ -87,7 +87,6 @@ public class IPADeadCodeEliminationTest extends AutomatedTestBase
 
 	private void runIPALiteralReplacementTest( String testname, boolean IPA )
 	{
-		setOutputBuffering(true);
 		boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS;
 		
 		try {
@@ -107,6 +106,5 @@ public class IPADeadCodeEliminationTest extends AutomatedTestBase
 		finally {
 			OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS = oldFlagIPA;
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/IPAFunctionInliningTest.java b/src/test/java/org/apache/sysds/test/functions/misc/IPAFunctionInliningTest.java
index 83c90ca..ca9d156 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/IPAFunctionInliningTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/IPAFunctionInliningTest.java
@@ -122,7 +122,6 @@ public class IPAFunctionInliningTest extends AutomatedTestBase
 	
 	private void runIPAFunInlineTest( String testName, boolean IPA )
 	{
-		setOutputBuffering(true);
 		boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS;
 		
 		try
@@ -163,6 +162,5 @@ public class IPAFunctionInliningTest extends AutomatedTestBase
 		finally {
 			OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS = oldFlagIPA;
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/IPALiteralReplacementTest.java b/src/test/java/org/apache/sysds/test/functions/misc/IPALiteralReplacementTest.java
index 1a96f52..e8e9f09 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/IPALiteralReplacementTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/IPALiteralReplacementTest.java
@@ -79,8 +79,7 @@ public class IPALiteralReplacementTest extends AutomatedTestBase
 	 * @param IPA
 	 */
 	private void runIPALiteralReplacementTest( String testname, boolean IPA )
-	{	
-		setOutputBuffering(true);
+	{
 		boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS;
 		
 		try
@@ -108,6 +107,5 @@ public class IPALiteralReplacementTest extends AutomatedTestBase
 		{
 			OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS = oldFlagIPA;
 		}
-		setOutputBuffering(false);
-	}	
+	}
 }
\ No newline at end of file
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/IPANnzPropagationTest.java b/src/test/java/org/apache/sysds/test/functions/misc/IPANnzPropagationTest.java
index ffbaf23..a57fee2 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/IPANnzPropagationTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/IPANnzPropagationTest.java
@@ -54,7 +54,6 @@ public class IPANnzPropagationTest extends AutomatedTestBase
 
 	private void runIPANnzPropgationTest(String testname)
 	{
-		setOutputBuffering(true);
 		// Save old settings
 		boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
 		ExecMode platformOld = rtplatform;
@@ -80,6 +79,5 @@ public class IPANnzPropagationTest extends AutomatedTestBase
 			DMLScript.USE_LOCAL_SPARK_CONFIG = sparkConfigOld;
 			rtplatform = platformOld;
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/IPAScalarRecursionTest.java b/src/test/java/org/apache/sysds/test/functions/misc/IPAScalarRecursionTest.java
index a216cb8..8c6c2c3 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/IPAScalarRecursionTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/IPAScalarRecursionTest.java
@@ -42,24 +42,18 @@ public class IPAScalarRecursionTest extends AutomatedTestBase
 	@Test
 	public void testScalarRecursion() 
 	{
-		setOutputBuffering(true);
 		String TEST_NAME = TEST_NAME1;
 		
-		try
-		{		
+		try {
 			getAndLoadTestConfiguration(TEST_NAME);
-		    
-		    String HOME = SCRIPT_DIR + TEST_DIR;
+		
+			String HOME = SCRIPT_DIR + TEST_DIR;
 			fullDMLScriptName = HOME + TEST_NAME + ".dml";
 			programArgs = new String[]{"-args", Integer.toString(7) };
-			
-			//run tests
-	        runTest(true, false, null, 0);
+			runTest(true, false, null, 0);
 		}
-		catch(Exception ex)
-		{
+		catch(Exception ex) {
 			throw new RuntimeException(ex);
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/IPAScalarVariablePropagationTest.java b/src/test/java/org/apache/sysds/test/functions/misc/IPAScalarVariablePropagationTest.java
index 533d945..c6a887c 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/IPAScalarVariablePropagationTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/IPAScalarVariablePropagationTest.java
@@ -60,9 +60,7 @@ public class IPAScalarVariablePropagationTest extends AutomatedTestBase
 	 * @param IPA
 	 */
 	private void runIPAScalarVariablePropagationTest( String testname, boolean IPA )
-	{	
-
-		setOutputBuffering(true);
+	{
 		boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS;
 		
 		try
@@ -89,7 +87,5 @@ public class IPAScalarVariablePropagationTest extends AutomatedTestBase
 		finally {
 			OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS = oldFlagIPA;
 		}
-
-		setOutputBuffering(false);
-	}	
+	}
 }
\ No newline at end of file
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/IPAUnknownRecursionTest.java b/src/test/java/org/apache/sysds/test/functions/misc/IPAUnknownRecursionTest.java
index 4d0c180..4221b03 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/IPAUnknownRecursionTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/IPAUnknownRecursionTest.java
@@ -62,8 +62,7 @@ public class IPAUnknownRecursionTest extends AutomatedTestBase
 	 * @param IPA
 	 */
 	private void runIPAUnknownRecursionTest( boolean IPA )
-	{	
-		setOutputBuffering(true);
+	{
 		boolean oldFlagIPA = OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS;
 		
 		try
@@ -92,6 +91,5 @@ public class IPAUnknownRecursionTest extends AutomatedTestBase
 		{
 			OptimizerUtils.ALLOW_INTER_PROCEDURAL_ANALYSIS = oldFlagIPA;
 		}
-		setOutputBuffering(false);
-	}	
+	}
 }
\ No newline at end of file
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/ListAndStructTest.java b/src/test/java/org/apache/sysds/test/functions/misc/ListAndStructTest.java
index 03598f3..4f7c31a 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/ListAndStructTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/ListAndStructTest.java
@@ -163,7 +163,6 @@ public class ListAndStructTest extends AutomatedTestBase
 	
 	private void runListStructTest(String testname, boolean rewrites)
 	{
-		setOutputBuffering(true);
 		boolean oldFlag = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
 		
 		try {
@@ -194,6 +193,5 @@ public class ListAndStructTest extends AutomatedTestBase
 		finally {
 			OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = oldFlag;
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/ListAppendRemove.java b/src/test/java/org/apache/sysds/test/functions/misc/ListAppendRemove.java
index aa83b4f..946ef67 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/ListAppendRemove.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/ListAppendRemove.java
@@ -96,7 +96,6 @@ public class ListAppendRemove extends AutomatedTestBase
 	
 	private void runListAppendRemove(String testname, ExecType type, boolean rewrites, boolean conditional)
 	{
-		setOutputBuffering(true);
 		Types.ExecMode platformOld = setExecMode(type);
 		boolean rewriteOld = OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION;
 		
@@ -133,6 +132,5 @@ public class ListAppendRemove extends AutomatedTestBase
 			rtplatform = platformOld;
 			OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = rewriteOld;
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/LongOverflowTest.java b/src/test/java/org/apache/sysds/test/functions/misc/LongOverflowTest.java
index e16cc3d..452ecbe 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/LongOverflowTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/LongOverflowTest.java
@@ -92,28 +92,25 @@ public class LongOverflowTest extends AutomatedTestBase
 	 */
 	private void runOverflowTest( String testscript, boolean error ) 
 	{
-		setOutputBuffering(true);
 		String TEST_NAME = testscript;
 		
 		try
 		{		
 			getAndLoadTestConfiguration(TEST_NAME);
-		    
+		
 			//generate input data;
 			long input1 = (TEST_NAME.equals(TEST_NAME3)? val5 : val1);
 			long input2 = (TEST_NAME.equals(TEST_NAME3)? val4 : error ? val3 : val2 );
 			
-		    String HOME = SCRIPT_DIR + TEST_DIR;
+		String HOME = SCRIPT_DIR + TEST_DIR;
 			fullDMLScriptName = HOME + TEST_NAME + ".dml";
 			programArgs = new String[]{"-args", Long.toString(input1), Long.toString(input2) };
 			
 			//run tests
-	        runTest(true, error, DMLRuntimeException.class, -1);
+			runTest(true, error, DMLRuntimeException.class, -1);
 		}
-		catch(Exception ex)
-		{
+		catch(Exception ex) {
 			throw new RuntimeException(ex);
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/NegativeLoopIncrementsTest.java b/src/test/java/org/apache/sysds/test/functions/misc/NegativeLoopIncrementsTest.java
index 4ab4063..1802e48 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/NegativeLoopIncrementsTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/NegativeLoopIncrementsTest.java
@@ -91,7 +91,6 @@ public class NegativeLoopIncrementsTest extends AutomatedTestBase
 	
 	private void runNegativeLoopIncrementsTest( String testname, boolean vect, boolean multiStep )
 	{
-		setOutputBuffering(true);
 		String TEST_NAME = testname;
 		TestConfiguration config = getTestConfiguration(TEST_NAME);
 		loadTestConfiguration(config);
@@ -119,6 +118,5 @@ public class NegativeLoopIncrementsTest extends AutomatedTestBase
 			
 		//check meta data
 		checkDMLMetaDataFile("R", new MatrixCharacteristics(1,1,1,1));
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/NrowNcolStringTest.java b/src/test/java/org/apache/sysds/test/functions/misc/NrowNcolStringTest.java
index cd0865e..7a9bca6 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/NrowNcolStringTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/NrowNcolStringTest.java
@@ -69,24 +69,21 @@ public class NrowNcolStringTest extends AutomatedTestBase
 	 */
 	private void runNxxStringTest( String testName ) 
 	{
-		setOutputBuffering(true);
 		String TEST_NAME = testName;
 		
 		try
 		{	
 			//test configuration
 			getAndLoadTestConfiguration(TEST_NAME);
-		    String HOME = SCRIPT_DIR + TEST_DIR;
+			String HOME = SCRIPT_DIR + TEST_DIR;
 			fullDMLScriptName = HOME + TEST_NAME + ".dml";
 			programArgs = new String[]{"-args", "100", "10"};
 			
 			//run tests
-	        runTest(true, false, null, -1);
+			runTest(true, false, null, -1);
 		}
-		catch(Exception ex)
-		{
+		catch(Exception ex) {
 			throw new RuntimeException(ex);
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/PrintExpressionTest.java b/src/test/java/org/apache/sysds/test/functions/misc/PrintExpressionTest.java
index a4ab57c..767190e 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/PrintExpressionTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/PrintExpressionTest.java
@@ -70,7 +70,6 @@ public class PrintExpressionTest extends AutomatedTestBase
 	 */
 	private void runPrintExpressionTest( String testname, boolean rewrites )
 	{
-		setOutputBuffering(true);
 		String TEST_NAME = testname;
 		TestConfiguration config = getTestConfiguration(TEST_NAME);
 		loadTestConfiguration(config);
@@ -81,7 +80,7 @@ public class PrintExpressionTest extends AutomatedTestBase
 		
 		try
 		{
-			String HOME = SCRIPT_DIR + TEST_DIR;			
+			String HOME = SCRIPT_DIR + TEST_DIR;
 			fullDMLScriptName = HOME + TEST_NAME + ".dml";
 			programArgs = new String[]{"-args", output("R")};
 			
@@ -91,10 +90,8 @@ public class PrintExpressionTest extends AutomatedTestBase
 			//run Tests
 			runTest(true, false, null, -1);
 		}
-		finally
-		{
+		finally {
 			OptimizerUtils.ALLOW_ALGEBRAIC_SIMPLIFICATION = oldRewriteFlag;
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/PrintMatrixTest.java b/src/test/java/org/apache/sysds/test/functions/misc/PrintMatrixTest.java
index a9e3038..4ef018b 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/PrintMatrixTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/PrintMatrixTest.java
@@ -39,13 +39,11 @@ public class PrintMatrixTest extends AutomatedTestBase
 	}
 	
 	@Test
-	public void testPrintMatrix() { 
-		runTest( TEST_NAME1, false ); 
+	public void testPrintMatrix() {
+		runTest( TEST_NAME1, false );
 	}
 	
-	private void runTest( String testName, boolean exceptionExpected ) 
-	{
-		setOutputBuffering(true);
+	private void runTest( String testName, boolean exceptionExpected ) {
 		TestConfiguration config = getTestConfiguration(TEST_NAME1);
 		loadTestConfiguration(config);
 		
@@ -55,6 +53,5 @@ public class PrintMatrixTest extends AutomatedTestBase
 		
 		//run tests
 		runTest(true, exceptionExpected, DMLException.class, -1);
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/ReadAfterWriteTest.java b/src/test/java/org/apache/sysds/test/functions/misc/ReadAfterWriteTest.java
index 1b2f609..1f5fb1b 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/ReadAfterWriteTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/ReadAfterWriteTest.java
@@ -105,7 +105,6 @@ public class ReadAfterWriteTest extends AutomatedTestBase
 	 */
 	private void runReadAfterWriteTest( String testName, boolean positive ) 
 	{
-		setOutputBuffering(true);
 		String TEST_NAME = testName;
 		
 		try
@@ -119,22 +118,18 @@ public class ReadAfterWriteTest extends AutomatedTestBase
 			String filename = output(Integer.toString(suffix));
 			String filename2 = positive ? filename : filename+"_nonexisting";
 			
-		    String HOME = SCRIPT_DIR + TEST_DIR;
+			String HOME = SCRIPT_DIR + TEST_DIR;
 			fullDMLScriptName = HOME + TEST_NAME + ".dml";
 			programArgs = new String[]{"-args", filename, filename2};
 			
 			//run tests
-	        runTest(true, !positive, LanguageException.class, -1);
+			runTest(true, !positive, LanguageException.class, -1);
 		}
-		catch(Exception ex)
-		{
+		catch(Exception ex) {
 			throw new RuntimeException(ex);
 		}
-		finally
-		{
-	        //cleanup
-	        TestUtils.clearDirectory(outputDir());
+		finally {
+			TestUtils.clearDirectory(outputDir());
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/ToStringTest.java b/src/test/java/org/apache/sysds/test/functions/misc/ToStringTest.java
index 6bcc24c..ee6a295 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/ToStringTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/ToStringTest.java
@@ -238,7 +238,7 @@ public class ToStringTest extends AutomatedTestBase {
 								"3 1 5.000\n" +
 								"3 2 6.000\n" +
 								"3 3 7.000\n";
-								
+		
 		addTestConfiguration(testName, new TestConfiguration(TEST_CLASS_DIR, testName));
 		toStringTestHelper(ExecMode.SINGLE_NODE, testName, expectedOutput);
 	}
@@ -248,30 +248,26 @@ public class ToStringTest extends AutomatedTestBase {
 		
 		rtplatform = platform;
 		boolean sparkConfigOld = DMLScript.USE_LOCAL_SPARK_CONFIG;
-        if (rtplatform == ExecMode.SPARK)
-            DMLScript.USE_LOCAL_SPARK_CONFIG = true;
-        try {
-            // Create and load test configuration
-        	getAndLoadTestConfiguration(testName);
-            String HOME = SCRIPT_DIR + TEST_DIR;
-            fullDMLScriptName = HOME + testName + ".dml";
-            programArgs = new String[]{"-args", output(OUTPUT_NAME)};
+		if (rtplatform == ExecMode.SPARK)
+			DMLScript.USE_LOCAL_SPARK_CONFIG = true;
+		try {
+			// Create and load test configuration
+			getAndLoadTestConfiguration(testName);
+			String HOME = SCRIPT_DIR + TEST_DIR;
+			fullDMLScriptName = HOME + testName + ".dml";
+			programArgs = new String[]{"-args", output(OUTPUT_NAME)};
 
+			// Run DML and R scripts
+			runTest(true, false, null, -1);
 
-            // Run DML and R scripts
-            runTest(true, false, null, -1);
-
-            // Compare output strings
-            String output = TestUtils.readDMLString(output(OUTPUT_NAME));
-            TestUtils.compareScalars(expectedOutput, output);
-           
-        }
-        finally {
-            // Reset settings
-            rtplatform = platformOld;
-            DMLScript.USE_LOCAL_SPARK_CONFIG = sparkConfigOld;
-        }
+			// Compare output strings
+			String output = TestUtils.readDMLString(output(OUTPUT_NAME));
+			TestUtils.compareScalars(expectedOutput, output);
+		}
+		finally {
+			// Reset settings
+			rtplatform = platformOld;
+			DMLScript.USE_LOCAL_SPARK_CONFIG = sparkConfigOld;
+		}
 	}
-	
-
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/misc/ZeroRowsColsMatrixTest.java b/src/test/java/org/apache/sysds/test/functions/misc/ZeroRowsColsMatrixTest.java
index fb22b62..a5bbd98 100644
--- a/src/test/java/org/apache/sysds/test/functions/misc/ZeroRowsColsMatrixTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/misc/ZeroRowsColsMatrixTest.java
@@ -160,7 +160,6 @@ public class ZeroRowsColsMatrixTest extends AutomatedTestBase
 	
 	private void runEmptyMatrixTest( String testname, boolean rewrites, boolean emptyRet, ExecType et )
 	{
-		setOutputBuffering(true);
 		ExecMode platformOld = rtplatform;
 		switch( et ){
 			case SPARK: rtplatform = ExecMode.SPARK; break;
@@ -206,6 +205,5 @@ public class ZeroRowsColsMatrixTest extends AutomatedTestBase
 			rtplatform = platformOld;
 			DMLScript.USE_LOCAL_SPARK_CONFIG = sparkConfigOld;
 		}
-		setOutputBuffering(false);
 	}
 }
diff --git a/src/test/java/org/apache/sysds/test/functions/nary/NaryListTest.java b/src/test/java/org/apache/sysds/test/functions/nary/NaryListTest.java
index 34cfe94..beca943 100644
--- a/src/test/java/org/apache/sysds/test/functions/nary/NaryListTest.java
+++ b/src/test/java/org/apache/sysds/test/functions/nary/NaryListTest.java
@@ -27,27 +27,26 @@ import org.apache.sysds.test.TestUtils;
 import org.junit.Test;
 
 public class NaryListTest extends AutomatedTestBase {
-    private final static String TEST_NAME = "NaryList";
+	private final static String TEST_NAME = "NaryList";
 	private final static String TEST_DIR = "functions/nary/";
 	private final static String TEST_CLASS_DIR = TEST_DIR + NaryListTest.class.getSimpleName() + "/";
 
-    @Override
+	@Override
 	public void setUp() {
 		TestUtils.clearAssertionInformation();
 		addTestConfiguration(TEST_NAME, new TestConfiguration(TEST_CLASS_DIR, TEST_NAME, new String[] {"R"}));
 	}
 
-    @Test
-    public void test(){
-        TestConfiguration config = getAndLoadTestConfiguration(TEST_NAME);
+	@Test
+	public void test(){
+		TestConfiguration config = getAndLoadTestConfiguration(TEST_NAME);
 		loadTestConfiguration(config);
 		
 		String RI_HOME = SCRIPT_DIR + TEST_DIR;
 		fullDMLScriptName = RI_HOME + TEST_NAME + ".dml";
-        programArgs = new String[]{"-stats" };
-
-        String out = runTest(true, false, null, -1).toString();
-        assertTrue( "Output: " + out, out.contains("[hi, Im, a, list]"));
-    }
+		programArgs = new String[]{"-stats" };
 
+		String out = runTest(true, false, null, -1).toString();
+		assertTrue( "Output: " + out, out.contains("[hi, Im, a, list]"));
+	}
 }
\ No newline at end of file