From d130340bd3b5cbaeae7be7fb8022b1fbd9d7a9b4 Mon Sep 17 00:00:00 2001 From: Lipeng Zhu Date: Fri, 10 Mar 2023 09:30:58 +0800 Subject: [PATCH] Make tst.sh workload configurable with MULTI_SH_WORK_FACTOR env (#86) Co-authored-by: Glenn Strauss --- UnixBench/USAGE | 8 +++++++- UnixBench/pgms/multi.sh | 14 +++++++++++++- UnixBench/pgms/tst.sh | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/UnixBench/USAGE b/UnixBench/USAGE index 29e5785..0d0ff9d 100644 --- a/UnixBench/USAGE +++ b/UnixBench/USAGE @@ -107,7 +107,13 @@ The following individual tests are available: fsdisk File Copy 4096 bufsize 8000 maxblocks shell1 Shell Scripts (1 concurrent) (runs "looper 60 multi.sh 1") shell8 Shell Scripts (8 concurrent) (runs "looper 60 multi.sh 8") - shell16 Shell Scripts (8 concurrent) (runs "looper 60 multi.sh 16") + shell16 Shell Scripts (16 concurrent)(runs "looper 60 multi.sh 16") + Environment variable MULTI_SH_WORK_FACTOR (default 1) + can be set to multiply the size of test input data (~8k) + Note: changing MULTI_SH_WORK_FACTOR modifies the test. + However, modifying the user/kernel workload balance may + be useful for comparison with other systems on which the + benchmark was run using the same MULTI_SH_WORK_FACTOR. 2d: 2d-rects 2D graphics: rectangles diff --git a/UnixBench/pgms/multi.sh b/UnixBench/pgms/multi.sh index caab894..72e8716 100755 --- a/UnixBench/pgms/multi.sh +++ b/UnixBench/pgms/multi.sh @@ -15,9 +15,21 @@ ############################################################################### ID="@(#)multi.sh:3.4 -- 5/15/91 19:30:24"; instance=1 +sort_src=sort.src +work_factor=${MULTI_SH_WORK_FACTOR:-1} +if [ $work_factor -gt 1 ]; then + inputs= + for i in $(seq $work_factor); do inputs="$inputs $sort_src"; done + cat $inputs > sort.src-alt.$$ + sort_src=sort.src-alt.$$ +fi + while [ $instance -le $1 ]; do - /bin/sh "$UB_BINDIR/tst.sh" & + /bin/sh "$UB_BINDIR/tst.sh" $sort_src & instance=$(($instance + 1)) done wait +if [ $work_factor -gt 1 ]; then + rm $sort_src +fi diff --git a/UnixBench/pgms/tst.sh b/UnixBench/pgms/tst.sh index 611856a..fb0616d 100755 --- a/UnixBench/pgms/tst.sh +++ b/UnixBench/pgms/tst.sh @@ -14,7 +14,7 @@ # ############################################################################### ID="@(#)tst.sh:3.4 -- 5/15/91 19:30:24"; -sort >sort.$$ sort.$$ < $1 od sort.$$ | sort -n -k 1 > od.$$ grep the sort.$$ | tee grep.$$ | wc > wc.$$ rm sort.$$ grep.$$ od.$$ wc.$$