summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McDermott <andrew.mcdermott@linaro.org>2014-05-19 06:38:36 +0100
committerAndrew McDermott <andrew.mcdermott@linaro.org>2014-05-19 06:38:36 +0100
commitbb66650693707d380da08558dde8e83ab69d4898 (patch)
tree03a0957cb24023438bad49b9f5b5d0eee3d95659
parent896f011b0284f3b976bb2f0d956283ee0a6b7e1a (diff)
benchmark-terasort: parametrise jvm variant
And will also call stop-all.sh on exit. Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
-rwxr-xr-xbenchmark-terasort9
1 files changed, 6 insertions, 3 deletions
diff --git a/benchmark-terasort b/benchmark-terasort
index 730e473..6aa69f4 100755
--- a/benchmark-terasort
+++ b/benchmark-terasort
@@ -55,9 +55,11 @@ hadoop fs -copyFromLocal $THIS_BENCHMARK_DIR/${NGIGABYTES}GB /user/$USER
mkdir -p $BENCHMARK_RESULTS_DIR
+trap "stop-all.sh" EXIT
+
function benchmark_terasort() {
local jvm_type=$1
- local elapsed_time_file=/tmp/benchmark-$USER.$$
+ local elapsed_time_file=$(mktemp /tmp/benchmark-terasort-XXXXXX.$$)
HADOOP_OPTS=-${jvm_type} /usr/bin/time -o $elapsed_time_file -f "%e" terasort ${NGIGABYTES}GB ${NGIGABYTES}GB-sorted
hadoop fs -rm -R ${NGIGABYTES}GB-sorted
sed -i 's/\..*//' $elapsed_time_file
@@ -66,8 +68,9 @@ function benchmark_terasort() {
rm -f $elapsed_time_file
}
-benchmark_terasort "server"
-benchmark_terasort "client"
+for i in "$@"; do
+ benchmark_terasort $i
+done
stop-all.sh