Skip to content

Commit 8caa29c

Browse files
author
ibmcb
authored
Merge pull request #122 from chriskirkland/feature/unixbench
Added UnixBench as a workload for CBTool
2 parents 136960b + f27c890 commit 8caa29c

File tree

4 files changed

+289
-0
lines changed

4 files changed

+289
-0
lines changed

configs/templates/PUBLIC_application_submitters.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,11 @@ IAIT = uniformIXIXI60I180
101101
LOAD_LEVEL = uniformIXIXI1I3
102102
LOAD_DURATION = uniformIXIXI40I60
103103
LIFETIME = uniformIXIXI200I300
104+
105+
[AIDRS_TEMPLATES : SIMPLEUB]
106+
TYPE = unixbench
107+
MAX_AIS = 8000
108+
IAIT = uniformIXIXI120I180
109+
LOAD_LEVEL = uniformIXIXI1I5
110+
LOAD_DURATION = uniformIXIXI40I60
111+
LIFETIME = uniformIXIXI500I600

scripts/unixbench/cb_unixbench.sh

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2012 IBM Corp.
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
9+
# Unless required by applicable law or agreed to in writing, software
10+
set -x
11+
12+
source $(echo $0 | sed -e "s/\(.*\/\)*.*/\1.\//g")/cb_common.sh
13+
14+
LOAD_PROFILE=$1
15+
LOAD_LEVEL=$2
16+
LOAD_DURATION=$3
17+
LOAD_ID=$4
18+
SLA_RUNTIME_TARGETS=$5
19+
20+
if [[ -z "$LOAD_PROFILE" || -z "$LOAD_LEVEL" || -z "$LOAD_DURATION" || -z "$LOAD_ID" ]]
21+
then
22+
syslog_netcat "Usage: cb_unixbench.sh <load profile> <load level> <load duration> <load_id>"
23+
exit 1
24+
fi
25+
26+
UNIXBENCH_DIR="~/byte-unixbench/UnixBench"
27+
eval UNIXBENCH_DIR=${UNIXBENCH_DIR}
28+
29+
UNIXBENCH_IP=`get_ips_from_role unixbench`
30+
update_app_errors 0 reset
31+
32+
syslog_netcat "Benchmarking UnixBench SUT: UNIXBENCH=${UNIXBENCH_IP} with (default) Index tests."
33+
34+
OUTPUT_FILE=$(mktemp)
35+
if [[ $LOAD_PROFILE == "test" ]]
36+
then
37+
execute_load_generator "cat ./test_output.txt" ${OUTPUT_FILE}
38+
else
39+
cd ${UNIXBENCH_DIR}
40+
execute_load_generator "./Run" ${OUTPUT_FILE}
41+
cd -
42+
fi
43+
44+
NUM_CORES=`grep -P -m1 "CPUs? in system" ${OUTPUT_FILE} | cut -d' ' -f1`
45+
46+
# --------------------- START Aggregate metrics -------------------------------- #
47+
TMP=$(mktemp)
48+
grep -m 1 -A 14 "System Benchmarks .* INDEX" ${OUTPUT_FILE} > $TMP
49+
50+
# Dhrystone 2 using register variables
51+
DHRY_RESULT=$(grep "Dhrystone 2 using register variables" $TMP | awk '{print $(NF-1)}')
52+
DHRY_INDEX=$(grep "Dhrystone 2 using register variables" $TMP | awk '{print $NF}')
53+
# Double-Precision Whetstone
54+
WHET_RESULT=$(grep "Double-Precision Whetstone" $TMP | awk '{print $(NF-1)}')
55+
WHET_INDEX=$(grep "Double-Precision Whetstone" $TMP | awk '{print $NF}')
56+
# Execl Throughput
57+
EXECL_RESULT=$(grep "Execl Throughput" $TMP | awk '{print $(NF-1)}')
58+
EXECL_INDEX=$(grep "Execl Throughput" $TMP | awk '{print $NF}')
59+
# File Copy 1024 bufsize 2000 maxblocks
60+
FC1024_RESULT=$(grep "File Copy 1024 bufsize 2000 maxblocks" $TMP | awk '{print $(NF-1)}')
61+
FC1024_INDEX=$(grep "File Copy 1024 bufsize 2000 maxblocks" $TMP | awk '{print $NF}')
62+
# File Copy 256 bufsize 500 maxblocks
63+
FC256_RESULT=$(grep "File Copy 256 bufsize 500 maxblocks" $TMP | awk '{print $(NF-1)}')
64+
FC256_INDEX=$(grep "File Copy 256 bufsize 500 maxblocks" $TMP | awk '{print $NF}')
65+
# File Copy 4096 bufsize 8000 maxblocks
66+
FC4096_RESULT=$(grep "File Copy 4096 bufsize 8000 maxblocks" $TMP | awk '{print $(NF-1)}')
67+
FC4096_INDEX=$(grep "File Copy 4096 bufsize 8000 maxblocks" $TMP | awk '{print $NF}')
68+
# Pipe Throughput
69+
PIPE_RESULT=$(grep "Pipe Throughput" $TMP | awk '{print $(NF-1)}')
70+
PIPE_INDEX=$(grep "Pipe Throughput" $TMP | awk '{print $NF}')
71+
# Pipe-based Context Switching
72+
CTXT_RESULT=$(grep "Pipe-based Context Switching" $TMP | awk '{print $(NF-1)}')
73+
CTXT_INDEX=$(grep "Pipe-based Context Switching" $TMP | awk '{print $NF}')
74+
# Process Creation
75+
PROC_RESULT=$(grep "Process Creation" $TMP | awk '{print $(NF-1)}')
76+
PROC_INDEX=$(grep "Process Creation" $TMP | awk '{print $NF}')
77+
# Shell Scripts (1 concurrent)
78+
SH1_RESULT=$(grep "Shell Scripts (1 concurrent)" $TMP | awk '{print $(NF-1)}')
79+
SH1_INDEX=$(grep "Shell Scripts (1 concurrent)" $TMP | awk '{print $NF}')
80+
# Shell Scripts (8 concurrent)
81+
SH8_RESULT=$(grep "Shell Scripts (8 concurrent)" $TMP | awk '{print $(NF-1)}')
82+
SH8_INDEX=$(grep "Shell Scripts (8 concurrent)" $TMP | awk '{print $NF}')
83+
# System Call Overhead
84+
SYSO_RESULT=$(grep "System Call Overhead" $TMP | awk '{print $(NF-1)}')
85+
SYSO_INDEX=$(grep "System Call Overhead" $TMP | awk '{print $NF}')
86+
# System Benchmarks Index Score
87+
TOTAL_INDEX=$(grep "System Benchmarks Index Score" $TMP | awk '{print $NF}')
88+
89+
# multi-core results (when available)
90+
NUM_RESULTS=`grep -c "System Benchmarks .* INDEX" ${OUTPUT_FILE}`
91+
if [ "$NUM_RESULTS" -gt 1 ]
92+
then
93+
TMP=$(mktemp)
94+
grep -m 2 -A 14 "System Benchmarks .* INDEX" ${OUTPUT_FILE} | tail -n 15 > $TMP
95+
96+
# Dhrystone 2 using register variables
97+
MC_DHRY_RESULT=$(grep "Dhrystone 2 using register variables" $TMP | awk '{print $(NF-1)}')
98+
MC_DHRY_INDEX=$(grep "Dhrystone 2 using register variables" $TMP | awk '{print $NF}')
99+
# Double-Precision Whetstone
100+
MC_WHET_RESULT=$(grep "Double-Precision Whetstone" $TMP | awk '{print $(NF-1)}')
101+
MC_WHET_INDEX=$(grep "Double-Precision Whetstone" $TMP | awk '{print $NF}')
102+
# Execl Throughput
103+
MC_EXECL_RESULT=$(grep "Execl Throughput" $TMP | awk '{print $(NF-1)}')
104+
MC_EXECL_INDEX=$(grep "Execl Throughput" $TMP | awk '{print $NF}')
105+
# File Copy 1024 bufsize 2000 maxblocks
106+
MC_FC1024_RESULT=$(grep "File Copy 1024 bufsize 2000 maxblocks" $TMP | awk '{print $(NF-1)}')
107+
MC_FC1024_INDEX=$(grep "File Copy 1024 bufsize 2000 maxblocks" $TMP | awk '{print $NF}')
108+
# File Copy 256 bufsize 500 maxblocks
109+
MC_FC256_RESULT=$(grep "File Copy 256 bufsize 500 maxblocks" $TMP | awk '{print $(NF-1)}')
110+
MC_FC256_INDEX=$(grep "File Copy 256 bufsize 500 maxblocks" $TMP | awk '{print $NF}')
111+
# File Copy 4096 bufsize 8000 maxblocks
112+
MC_FC4096_RESULT=$(grep "File Copy 4096 bufsize 8000 maxblocks" $TMP | awk '{print $(NF-1)}')
113+
MC_FC4096_INDEX=$(grep "File Copy 4096 bufsize 8000 maxblocks" $TMP | awk '{print $NF}')
114+
# Pipe Throughput
115+
MC_PIPE_RESULT=$(grep "Pipe Throughput" $TMP | awk '{print $(NF-1)}')
116+
MC_PIPE_INDEX=$(grep "Pipe Throughput" $TMP | awk '{print $NF}')
117+
# Pipe-based Context Switching
118+
MC_CTXT_RESULT=$(grep "Pipe-based Context Switching" $TMP | awk '{print $(NF-1)}')
119+
MC_CTXT_INDEX=$(grep "Pipe-based Context Switching" $TMP | awk '{print $NF}')
120+
# Process Creation
121+
MC_PROC_RESULT=$(grep "Process Creation" $TMP | awk '{print $(NF-1)}')
122+
MC_PROC_INDEX=$(grep "Process Creation" $TMP | awk '{print $NF}')
123+
# Shell Scripts (1 concurrent)
124+
MC_SH1_RESULT=$(grep "Shell Scripts (1 concurrent)" $TMP | awk '{print $(NF-1)}')
125+
MC_SH1_INDEX=$(grep "Shell Scripts (1 concurrent)" $TMP | awk '{print $NF}')
126+
# Shell Scripts (8 concurrent)
127+
MC_SH8_RESULT=$(grep "Shell Scripts (8 concurrent)" $TMP | awk '{print $(NF-1)}')
128+
MC_SH8_INDEX=$(grep "Shell Scripts (8 concurrent)" $TMP | awk '{print $NF}')
129+
# System Call Overhead
130+
MC_SYSO_RESULT=$(grep "System Call Overhead" $TMP | awk '{print $(NF-1)}')
131+
MC_SYSO_INDEX=$(grep "System Call Overhead" $TMP | awk '{print $NF}')
132+
# System Benchmarks Index Score
133+
MC_TOTAL_INDEX=$(grep "System Benchmarks Index Score" $TMP | awk '{print $NF}')
134+
fi
135+
# ---------------------- END Aggregate metrics --------------------------------- #
136+
137+
# --------------------- START Reporting metrics -------------------------------- #
138+
~/cb_report_app_metrics.py load_id:${LOAD_ID}:seqnum \
139+
load_level:${LOAD_LEVEL}:load \
140+
load_profile:${LOAD_PROFILE}:name \
141+
load_duration:${LOAD_DURATION}:sec \
142+
num_cores:${NUM_CORES}:num \
143+
dhry_result:${DHRY_RESULT}:lps \
144+
dhry_index:${DHRY_INDEX}:num \
145+
whet_result:${WHET_RESULT}:MWIPS \
146+
whet_index:${WHET_INDEX}:num \
147+
execl_result:${EXECL_RESULT}:lps \
148+
execl_index:${EXECL_INDEX}:num \
149+
fc1024_result:${FC1024_RESULT}:KBPs \
150+
fc1024_index:${FC1024_INDEX}:num \
151+
fc256_result:${FC256_RESULT}:KBPs \
152+
fc256_index:${FC256_INDEX}:num \
153+
fc4096_result:${FC4096_RESULT}:KBPs \
154+
fc4096_index:${FC4096_INDEX}:num \
155+
pipe_result:${PIPE_RESULT}:lps \
156+
pipe_index:${PIPE_INDEX}:num \
157+
ctxt_result:${CTXT_RESULT}:lps \
158+
ctxt_index:${CTXT_INDEX}:num \
159+
proc_result:${PROC_RESULT}:lps \
160+
proc_index:${PROC_INDEX}:num \
161+
sh1_result:${SH1_RESULT}:lpm \
162+
sh1_index:${SH1_INDEX}:num \
163+
sh8_result:${SH8_RESULT}:lpm \
164+
sh8_index:${SH8_INDEX}:num \
165+
syso_result:${SYSO_RESULT}:lps \
166+
syso_index:${SYSO_INDEX}:num \
167+
total_index:${TOTAL_INDEX}:num \
168+
mc_dhry_result:${MC_DHRY_RESULT}:lps \
169+
mc_dhry_index:${MC_DHRY_INDEX}:num \
170+
mc_whet_result:${MC_WHET_RESULT}:MWIPS \
171+
mc_whet_index:${MC_WHET_INDEX}:num \
172+
mc_execl_result:${MC_EXECL_RESULT}:lps \
173+
mc_execl_index:${MC_EXECL_INDEX}:num \
174+
mc_fc1024_result:${MC_FC1024_RESULT}:KBPs \
175+
mc_fc1024_index:${MC_FC1024_INDEX}:num \
176+
mc_fc256_result:${MC_FC256_RESULT}:KBPs \
177+
mc_fc256_index:${MC_FC256_INDEX}:num \
178+
mc_fc4096_result:${MC_FC4096_RESULT}:KBPs \
179+
mc_fc4096_index:${MC_FC4096_INDEX}:num \
180+
mc_pipe_result:${MC_PIPE_RESULT}:lps \
181+
mc_pipe_index:${MC_PIPE_INDEX}:num \
182+
mc_ctxt_result:${MC_CTXT_RESULT}:lps \
183+
mc_ctxt_index:${MC_CTXT_INDEX}:num \
184+
mc_proc_result:${MC_PROC_RESULT}:lps \
185+
mc_proc_index:${MC_PROC_INDEX}:num \
186+
mc_sh1_result:${MC_SH1_RESULT}:lpm \
187+
mc_sh1_index:${MC_SH1_INDEX}:num \
188+
mc_sh8_result:${MC_SH8_RESULT}:lpm \
189+
mc_sh8_index:${MC_SH8_INDEX}:num \
190+
mc_syso_result:${MC_SYSO_RESULT}:lps \
191+
mc_syso_index:${MC_SYSO_INDEX}:num \
192+
mc_total_index:${MC_TOTAL_INDEX}:num \
193+
errors:$(update_app_errors):num \
194+
completion_time:$(update_app_completiontime):sec \
195+
quiescent_time:$(update_app_quiescent):sec\
196+
${SLA_RUNTIME_TARGETS}
197+
# --------------------- END Reporting metrics -------------------------------- #
198+
199+
rm ${OUTPUT_FILE}
200+
201+
exit 0

scripts/unixbench/dependencies.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
### START - Dependency installation order ###
2+
git-order = 50
3+
gcc-order = 51
4+
perl-order = 52
5+
unixbench-order = 53
6+
### END - Dependency installation order ###
7+
8+
### START - Dependency-specific installation method ###
9+
# pm = "package manager" (yum or apt-get)
10+
# sl = "soft link" (assume that the dependency is already installed, just has to
11+
# be properly exposed to the user's path.
12+
# git = git clone using above giturl
13+
# pip = python pip utility
14+
# man = "manual"
15+
gcc-install = pm
16+
git-install = pm
17+
perl-install = pm
18+
unixbench-install = git
19+
### END - Dependency-specific installation method ###
20+
21+
### START - Tests ###
22+
git-configure = gcc -v
23+
git-configure = git --version
24+
perl-configure = perl -v; perl -e 'require Time::HiRes'
25+
unixbench-configure = ls -la ~/byte-unixbench/UnixBench/Run
26+
### END - Tests ###
27+
28+
### START - Dependency versions ###
29+
gcc-ver = ANY
30+
git-ver = ANY
31+
perl-ver = 5.10
32+
unixbench-ver = ANY
33+
### END - Dependency versions ###
34+
35+
### START - Dependency URLs ###
36+
common-unixbench-urls-man = https://github.com/kdlucas/byte-unixbench.git
37+
### END - Dependency URLs ###
38+
39+
### START - Dependency and method-specific command lines ###
40+
ubuntu-gcc-preinstall-pm = apt-get update -y
41+
ubuntu-gcc-install-pm = package_install build-essential
42+
fedora-gcc-install-pm = package_install gcc
43+
44+
common-git-install-pm = package_install git-all
45+
46+
# perl package only need to be explicitly installed on CentOS 6.x
47+
fedora-perl-install-pm = package_install perl-Time-HiRes
48+
49+
common-unixbench-preinstall-git = cd ~
50+
common-unixbench-install-git = git clone URL
51+
### END - Dependency and method-specific command lines ###
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Parameters for this Virtual Application (Application Instance - AI) type should
2+
# be set on YOUR private configuration configuration file, including the ones
3+
# commented.
4+
5+
[AI_TEMPLATES : UNIXBENCH]
6+
7+
# Attributes MANDATORY for all Virtual Applications
8+
SUT = unixbench
9+
LOAD_BALANCER_SUPPORTED = $False
10+
RESIZE_SUPPORTED = $False
11+
REGENERATE_DATA = $False
12+
LOAD_GENERATOR_ROLE = unixbench
13+
LOAD_MANAGER_ROLE = unixbench
14+
METRIC_AGGREGATOR_ROLE = unixbench
15+
CAPTURE_ROLE = unixbench
16+
# unused
17+
LOAD_PROFILE = default
18+
LOAD_LEVEL = uniformIXIXI1I5
19+
LOAD_DURATION = 60
20+
REPORTED_METRICS = num_cores, dhry_result, dhry_index, whet_result, whet_index, execl_result, execl_index, fc1024_result, fc1024_index, fc256_result, fc256_index, fc4096_result, fc4096_index, pipe_result, pipe_index, ctxt_result, ctxt_index, proc_result, proc_index, sh1_result, sh1_index, sh8_result, sh8_index, syso_result, syso_index, total_index, mc_dhry_result, mc_dhry_index, mc_whet_result, mc_whet_index, mc_execl_result, mc_execl_index, mc_fc1024_result, mc_fc1024_index, mc_fc256_result, mc_fc256_index, mc_fc4096_result, mc_fc4096_index, mc_pipe_result, mc_pipe_index, mc_ctxt_result, mc_ctxt_index, mc_proc_result, mc_proc_index, mc_sh1_result, mc_sh1_index, mc_sh8_result, mc_sh8_index, mc_syso_result, mc_syso_index, mc_total_index, errors, completion_time, quiescent_time
21+
22+
23+
# VApp-specific MANDATORY attributes
24+
DESCRIPTION = Deploys an SINGLE VM and runs the Index set of tests in UnixBench.\n
25+
START = cb_unixbench.sh
26+
27+
# VApp-specific modifier parameters. Commented attributes imply default values assumed
28+
29+
# Inter-Virtual Application instances (inter-AI) synchronized execution. Entirely optional

0 commit comments

Comments
 (0)