Repository: systemml
Updated Branches:
  refs/heads/master dbe7427e9 -> a2db1ad89


[SYSTEMML-1804] Compile time for statistics via MLContext

If statistics is on via the MLContext API, compute and display the
program compile-time.

Closes #595.


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

Branch: refs/heads/master
Commit: a2db1ad895f09ccc7e56b43d8b6baf21fc887fe4
Parents: dbe7427
Author: Deron Eriksson <de...@apache.org>
Authored: Tue Aug 1 11:07:45 2017 -0700
Committer: Deron Eriksson <de...@apache.org>
Committed: Tue Aug 1 11:07:45 2017 -0700

----------------------------------------------------------------------
 .../apache/sysml/api/mlcontext/ScriptExecutor.java  | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/a2db1ad8/src/main/java/org/apache/sysml/api/mlcontext/ScriptExecutor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/api/mlcontext/ScriptExecutor.java 
b/src/main/java/org/apache/sysml/api/mlcontext/ScriptExecutor.java
index 5665308..467e94e 100644
--- a/src/main/java/org/apache/sysml/api/mlcontext/ScriptExecutor.java
+++ b/src/main/java/org/apache/sysml/api/mlcontext/ScriptExecutor.java
@@ -183,10 +183,8 @@ public class ScriptExecutor {
                        return;
 
                try {
-                       ExplainType explainType = (explainLevel != null) ? 
-                               explainLevel.getExplainType() : 
ExplainType.RUNTIME;
-                       System.out.println(Explain.display(
-                               dmlProgram, runtimeProgram, explainType, null));
+                       ExplainType explainType = (explainLevel != null) ? 
explainLevel.getExplainType() : ExplainType.RUNTIME;
+                       System.out.println(Explain.display(dmlProgram, 
runtimeProgram, explainType, null));
                } catch (Exception e) {
                        throw new MLContextException("Exception occurred while 
explaining dml program", e);
                }
@@ -298,6 +296,9 @@ public class ScriptExecutor {
 
                // main steps in script execution
                setup(script);
+               if (statistics) {
+                       Statistics.startCompileTimer();
+               }
                parseScript();
                liveVariableAnalysis();
                validateScript();
@@ -311,6 +312,9 @@ public class ScriptExecutor {
                countCompiledMRJobsAndSparkInstructions();
                initializeCachingAndScratchSpace();
                cleanupRuntimeProgram();
+               if (statistics) {
+                       Statistics.stopCompileTimer();
+               }
 
                try {
                        createAndInitializeExecutionContext();
@@ -342,9 +346,9 @@ public class ScriptExecutor {
                // Set global variable indicating the script type
                DMLScript.SCRIPT_TYPE = script.getScriptType();
                setGlobalFlags();
-               //reset all relevant summary statistics 
+               // reset all relevant summary statistics
                Statistics.resetNoOfExecutedJobs();
-               if( statistics ) {
+               if (statistics) {
                        CacheStatistics.reset();
                        Statistics.reset();
                }

Reply via email to