You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by de...@apache.org on 2016/11/11 00:47:52 UTC
incubator-systemml git commit: [SYSTEMML-1102] Argument to print top
n heavy hitters
Repository: incubator-systemml
Updated Branches:
refs/heads/master c96ed96af -> 06c5057d3
[SYSTEMML-1102] Argument to print top n heavy hitters
Add argument for "-stats" option to specify the top n heavy hitters.
Closes #286.
Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/06c5057d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/06c5057d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/06c5057d
Branch: refs/heads/master
Commit: 06c5057d395c78cfcb1d9950bab9269c0333e6c6
Parents: c96ed96
Author: Nakul Jindal <na...@gmail.com>
Authored: Thu Nov 10 16:43:29 2016 -0800
Committer: Deron Eriksson <de...@us.ibm.com>
Committed: Thu Nov 10 16:43:29 2016 -0800
----------------------------------------------------------------------
src/main/java/org/apache/sysml/api/DMLScript.java | 8 ++++++--
.../controlprogram/parfor/RemoteDPParWorkerReducer.java | 2 +-
.../runtime/controlprogram/parfor/RemoteParWorkerMapper.java | 2 +-
src/main/java/org/apache/sysml/utils/Statistics.java | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/06c5057d/src/main/java/org/apache/sysml/api/DMLScript.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/api/DMLScript.java b/src/main/java/org/apache/sysml/api/DMLScript.java
index ad62a72..db38894 100644
--- a/src/main/java/org/apache/sysml/api/DMLScript.java
+++ b/src/main/java/org/apache/sysml/api/DMLScript.java
@@ -100,6 +100,7 @@ public class DMLScript
public static RUNTIME_PLATFORM rtplatform = OptimizerUtils.getDefaultExecutionMode();
public static boolean STATISTICS = false; //default statistics
+ public static int STATISTICS_COUNT = 10; //default statistics count
public static boolean ENABLE_DEBUG_MODE = false; //default debug mode
public static boolean USE_LOCAL_SPARK_CONFIG = false; //set default local spark configuration - used for local testing
public static String DML_FILE_PATH_ANTLR_PARSER = null;
@@ -133,7 +134,7 @@ public class DMLScript
//+ " Optional <flags> that is supported for this mode is optimize=(on|off)\n"
+ " -exec: <mode> (optional) execution mode (hadoop, singlenode, [hybrid], hybrid_spark)\n"
+ " -explain: <type> (optional) explain plan (hops, [runtime], recompile_hops, recompile_runtime)\n"
- + " -stats: (optional) monitor and report caching/recompilation statistics\n"
+ + " -stats: <count> (optional) monitor and report caching/recompilation statistics, default count is 10\n"
+ " -clean: (optional) cleanup all SystemML working directories (FS, DFS).\n"
+ " All other flags are ignored in this mode. \n"
+ " -config: (optional) use config file <config_filename> (default: use parameter\n"
@@ -285,8 +286,11 @@ public class DMLScript
if( args.length > (i+1) && !args[i+1].startsWith("-") )
EXPLAIN = Explain.parseExplainType(args[++i]);
}
- else if( args[i].equalsIgnoreCase("-stats") )
+ else if( args[i].equalsIgnoreCase("-stats") ) {
STATISTICS = true;
+ if (args.length > (i + 1) && !args[i + 1].startsWith("-"))
+ STATISTICS_COUNT = Integer.parseInt(args[++i]);
+ }
else if ( args[i].equalsIgnoreCase("-exec")) {
rtplatform = parseRuntimePlatform(args[++i]);
if( rtplatform==null )
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/06c5057d/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParWorkerReducer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParWorkerReducer.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParWorkerReducer.java
index 3596c1e..893a2ac 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParWorkerReducer.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteDPParWorkerReducer.java
@@ -229,7 +229,7 @@ public class RemoteDPParWorkerReducer extends ParWorker
//print heaver hitter per task
JobConf job = ConfigurationManager.getCachedJobConf();
if( DMLScript.STATISTICS && !InfrastructureAnalyzer.isLocalMode(job) )
- LOG.info("\nSystemML Statistics:\nHeavy hitter instructions (name, time, count):\n" + Statistics.getHeavyHitters(10));
+ LOG.info("\nSystemML Statistics:\nHeavy hitter instructions (name, time, count):\n" + Statistics.getHeavyHitters(DMLScript.STATISTICS_COUNT));
}
catch(Exception ex)
{
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/06c5057d/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParWorkerMapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParWorkerMapper.java b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParWorkerMapper.java
index 7a48974..ae68b68 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParWorkerMapper.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/parfor/RemoteParWorkerMapper.java
@@ -113,7 +113,7 @@ public class RemoteParWorkerMapper extends ParWorker //MapReduceBase not requir
//print heaver hitter per task
JobConf job = ConfigurationManager.getCachedJobConf();
if( DMLScript.STATISTICS && !InfrastructureAnalyzer.isLocalMode(job) )
- LOG.info("\nSystemML Statistics:\nHeavy hitter instructions (name, time, count):\n" + Statistics.getHeavyHitters(10));
+ LOG.info("\nSystemML Statistics:\nHeavy hitter instructions (name, time, count):\n" + Statistics.getHeavyHitters(DMLScript.STATISTICS_COUNT));
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/06c5057d/src/main/java/org/apache/sysml/utils/Statistics.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/utils/Statistics.java b/src/main/java/org/apache/sysml/utils/Statistics.java
index 5cd7cb5..2f13d09 100644
--- a/src/main/java/org/apache/sysml/utils/Statistics.java
+++ b/src/main/java/org/apache/sysml/utils/Statistics.java
@@ -696,7 +696,7 @@ public class Statistics
sb.append("Total JIT compile time:\t\t" + ((double)getJITCompileTime())/1000 + " sec.\n");
sb.append("Total JVM GC count:\t\t" + getJVMgcCount() + ".\n");
sb.append("Total JVM GC time:\t\t" + ((double)getJVMgcTime())/1000 + " sec.\n");
- sb.append("Heavy hitter instructions (name, time, count):\n" + getHeavyHitters(10));
+ sb.append("Heavy hitter instructions (name, time, count):\n" + getHeavyHitters(DMLScript.STATISTICS_COUNT));
}
return sb.toString();