Skip to content

Commit

Permalink
[MINOR][TESTS] Added flags to toggle GPU and stats from command line.…
Browse files Browse the repository at this point in the history
… Also:

* Used EXCEPTION_EXPECTED instead of "true" with one test case because it makes the code clearer and silences a warning.
  • Loading branch information
corepointer committed Sep 29, 2020
1 parent 5461f42 commit 77010bf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -53,6 +53,7 @@
<jacoco.skip>true</jacoco.skip>
<automatedtestbase.outputbuffering>false</automatedtestbase.outputbuffering>
<argLine>-Xms4g -Xmx4g -Xmn400m</argLine>
<enableStats>false</enableStats>
</properties>

<repositories>
Expand Down
8 changes: 7 additions & 1 deletion src/test/java/org/apache/sysds/test/AutomatedTestBase.java
Expand Up @@ -99,7 +99,7 @@ public abstract class AutomatedTestBase {
public static final boolean EXCEPTION_NOT_EXPECTED = false;

// By default: TEST_GPU is set to false to allow developers without Nvidia GPU to run integration test suite
public static final boolean TEST_GPU = false;
public static boolean TEST_GPU = false;
public static final double GPU_TOLERANCE = 1e-9;

public static final int FED_WORKER_WAIT = 1000; // in ms
Expand Down Expand Up @@ -170,6 +170,8 @@ public String getCodgenConfig() {

protected static final boolean DEBUG = false;

public static boolean VERBOSE_STATS = false;

protected String fullDMLScriptName; // utilize for both DML and PyDML, should probably be renamed.
// protected String fullPYDMLScriptName;
protected String fullRScriptName;
Expand Down Expand Up @@ -209,6 +211,8 @@ public String getCodgenConfig() {
e.printStackTrace();
}
outputBuffering = Boolean.parseBoolean(properties.getProperty("automatedtestbase.outputbuffering"));
TEST_GPU = Boolean.parseBoolean(properties.getProperty("enableGPU"));
VERBOSE_STATS = Boolean.parseBoolean(properties.getProperty("enableStats"));
}

// Timestamp before test start.
Expand Down Expand Up @@ -1292,6 +1296,8 @@ else if(rtplatform == ExecMode.SPARK)

if(TEST_GPU)
args.add("-gpu");
if(VERBOSE_STATS)
args.add("-stats");
}

public static int getRandomAvailablePort() {
Expand Down
Expand Up @@ -205,7 +205,7 @@ public void testTwoParameters() {

createHelperMatrix();

runTest(true, LanguageException.class);
runTest(EXCEPTION_EXPECTED, LanguageException.class);
}

}

0 comments on commit 77010bf

Please sign in to comment.