Skip to content

Commit d130340

Browse files
zhulipenggstrauss
andauthored
Make tst.sh workload configurable with MULTI_SH_WORK_FACTOR env (#86)
Co-authored-by: Glenn Strauss <[email protected]>
1 parent 81e9de5 commit d130340

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

UnixBench/USAGE

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ The following individual tests are available:
107107
fsdisk File Copy 4096 bufsize 8000 maxblocks
108108
shell1 Shell Scripts (1 concurrent) (runs "looper 60 multi.sh 1")
109109
shell8 Shell Scripts (8 concurrent) (runs "looper 60 multi.sh 8")
110-
shell16 Shell Scripts (8 concurrent) (runs "looper 60 multi.sh 16")
110+
shell16 Shell Scripts (16 concurrent)(runs "looper 60 multi.sh 16")
111+
Environment variable MULTI_SH_WORK_FACTOR (default 1)
112+
can be set to multiply the size of test input data (~8k)
113+
Note: changing MULTI_SH_WORK_FACTOR modifies the test.
114+
However, modifying the user/kernel workload balance may
115+
be useful for comparison with other systems on which the
116+
benchmark was run using the same MULTI_SH_WORK_FACTOR.
111117

112118
2d:
113119
2d-rects 2D graphics: rectangles

UnixBench/pgms/multi.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,21 @@
1515
###############################################################################
1616
ID="@(#)multi.sh:3.4 -- 5/15/91 19:30:24";
1717
instance=1
18+
sort_src=sort.src
19+
work_factor=${MULTI_SH_WORK_FACTOR:-1}
20+
if [ $work_factor -gt 1 ]; then
21+
inputs=
22+
for i in $(seq $work_factor); do inputs="$inputs $sort_src"; done
23+
cat $inputs > sort.src-alt.$$
24+
sort_src=sort.src-alt.$$
25+
fi
26+
1827
while [ $instance -le $1 ]; do
19-
/bin/sh "$UB_BINDIR/tst.sh" &
28+
/bin/sh "$UB_BINDIR/tst.sh" $sort_src &
2029
instance=$(($instance + 1))
2130
done
2231
wait
2332

33+
if [ $work_factor -gt 1 ]; then
34+
rm $sort_src
35+
fi

UnixBench/pgms/tst.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
###############################################################################
1616
ID="@(#)tst.sh:3.4 -- 5/15/91 19:30:24";
17-
sort >sort.$$ <sort.src
17+
sort > sort.$$ < $1
1818
od sort.$$ | sort -n -k 1 > od.$$
1919
grep the sort.$$ | tee grep.$$ | wc > wc.$$
2020
rm sort.$$ grep.$$ od.$$ wc.$$

0 commit comments

Comments
 (0)