mnemonic-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject incubator-mnemonic git commit: MNEMONIC-174: Make bench scripts conform to MNEMONIC_HOME as well
Date Thu, 05 Jan 2017 00:31:43 GMT
Repository: incubator-mnemonic
Updated Branches:
  refs/heads/0.5.0-dev 4ace438cc -> 6bc382bf8


MNEMONIC-174: Make bench scripts conform to MNEMONIC_HOME as well


Project: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/commit/6bc382bf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/tree/6bc382bf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/diff/6bc382bf

Branch: refs/heads/0.5.0-dev
Commit: 6bc382bf809748e072769a57357a96b32cc6e4dc
Parents: 4ace438
Author: Wang, Gang(Gary) <gang1.wang@intel.com>
Authored: Wed Jan 4 16:31:11 2017 -0800
Committer: Wang, Gang(Gary) <gang1.wang@intel.com>
Committed: Wed Jan 4 16:31:11 2017 -0800

----------------------------------------------------------------------
 .gitignore                                      |  1 +
 .../mnemonic-sort-bench/bin/benchcommon.py      | 23 ++++++++++++++++++++
 .../mnemonic-sort-bench/bin/gen_data.py         |  2 ++
 mnemonic-benches/mnemonic-sort-bench/bin/run.py |  4 ++++
 4 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/6bc382bf/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index c54ce80..ad45fab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,4 +43,5 @@ testlog/
 .DS_Store
 *.patch
 *.swp
+*.pyc
 

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/6bc382bf/mnemonic-benches/mnemonic-sort-bench/bin/benchcommon.py
----------------------------------------------------------------------
diff --git a/mnemonic-benches/mnemonic-sort-bench/bin/benchcommon.py b/mnemonic-benches/mnemonic-sort-bench/bin/benchcommon.py
new file mode 100755
index 0000000..33a740c
--- /dev/null
+++ b/mnemonic-benches/mnemonic-sort-bench/bin/benchcommon.py
@@ -0,0 +1,23 @@
+#! /usr/bin/env python
+
+import os
+import inspect
+import sys
+
+def findHomeDir():
+  homedir = os.environ.get("MNEMONIC_HOME")
+  if not homedir:
+    filename = inspect.getframeinfo(inspect.currentframe()).filename
+    path = os.path.dirname(os.path.abspath(filename))
+    while 1:
+      pathdeco = os.path.split(path)
+      if not pathdeco[1]:
+        print "Not found mnemonic home directory, please check \$MNEMONIC_HOME"
+        sys.exit(1)
+      if pathdeco[1] == 'incubator-mnemonic':
+        break
+      else:
+        path = pathdeco[0]
+    homedir = path
+  return homedir
+

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/6bc382bf/mnemonic-benches/mnemonic-sort-bench/bin/gen_data.py
----------------------------------------------------------------------
diff --git a/mnemonic-benches/mnemonic-sort-bench/bin/gen_data.py b/mnemonic-benches/mnemonic-sort-bench/bin/gen_data.py
index 8112412..80e9c59 100755
--- a/mnemonic-benches/mnemonic-sort-bench/bin/gen_data.py
+++ b/mnemonic-benches/mnemonic-sort-bench/bin/gen_data.py
@@ -20,6 +20,8 @@
 import argparse
 import sys
 import random
+import os
+from benchcommon import *
 
 parser = argparse.ArgumentParser()
 parser.add_argument("count", type=long, help="specify how many random numbers will be generated")

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/6bc382bf/mnemonic-benches/mnemonic-sort-bench/bin/run.py
----------------------------------------------------------------------
diff --git a/mnemonic-benches/mnemonic-sort-bench/bin/run.py b/mnemonic-benches/mnemonic-sort-bench/bin/run.py
index 42d93ed..226319e 100755
--- a/mnemonic-benches/mnemonic-sort-bench/bin/run.py
+++ b/mnemonic-benches/mnemonic-sort-bench/bin/run.py
@@ -21,6 +21,8 @@ import argparse
 import sys
 import os.path
 import subprocess
+import os
+from benchcommon import *
 
 parser = argparse.ArgumentParser()
 parser.add_argument("input", type=str, help="specify an input file that contains a set of
absolute paths of data files.")
@@ -29,6 +31,8 @@ args = parser.parse_args()
 with open(args.input, "r") as sfinput:
   fns = sfinput.readlines()
 
+os.chdir(findHomeDir())
+
 runcmdtmp = "mvn exec:exec -Pbench -pl mnemonic-benches/mnemonic-sort-bench  -Dmode={0} -Dinput={1}
-Doutput={1}_{0}.out"
 cmpcmdtmp = "diff {1}_{0}.out {3}_{2}.out"
 rstfntmp = "{1}_{0}.out"


Mime
View raw message