mnemonic-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject [12/14] incubator-mnemonic git commit: MNEMONIC-164: Create a run script for sort-bench
Date Mon, 21 Nov 2016 17:32:38 GMT
MNEMONIC-164: Create a run script for sort-bench


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

Branch: refs/heads/master
Commit: 17d764898ae020c1890beb39f53e2e746a1254ce
Parents: b5fbd94
Author: Wang, Gang(Gary) <gang1.wang@intel.com>
Authored: Thu Nov 17 15:27:38 2016 -0800
Committer: Wang, Gang(Gary) <gang1.wang@intel.com>
Committed: Thu Nov 17 16:01:59 2016 -0800

----------------------------------------------------------------------
 mnemonic-benches/mnemonic-sort-bench/bin/run.py | 49 ++++++++++++++++++++
 1 file changed, 49 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/17d76489/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
new file mode 100755
index 0000000..42d93ed
--- /dev/null
+++ b/mnemonic-benches/mnemonic-sort-bench/bin/run.py
@@ -0,0 +1,49 @@
+#! /usr/bin/env python
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import argparse
+import sys
+import os.path
+import subprocess
+
+parser = argparse.ArgumentParser()
+parser.add_argument("input", type=str, help="specify an input file that contains a set of
absolute paths of data files.")
+args = parser.parse_args()
+
+with open(args.input, "r") as sfinput:
+  fns = sfinput.readlines()
+
+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"
+
+for efn in fns:
+  fn = efn.strip().rstrip('\n')
+  if fn:
+    if os.path.isfile(fn):
+      print("Processing {0}, run mode A".format(fn))
+      subprocess.check_call(runcmdtmp.format('A', fn), shell=True);
+      print("Processing {0}, run mode B".format(fn))
+      subprocess.check_call(runcmdtmp.format('B', fn), shell=True);
+      print("Comparing results {0} - {1}".format(rstfntmp.format('A', fn), rstfntmp.format('B',
fn)))
+      subprocess.check_call(cmpcmdtmp.format('A', fn, 'B', fn), shell=True);
+    else:
+      print("Input data file {0} does not exist.".format(fn))
+
+print("Finished!")


Mime
View raw message