From 624b5016f8e68d4beff3adcb009e9a6dba0180b8 Mon Sep 17 00:00:00 2001 From: Lipeng Zhu Date: Tue, 28 Feb 2023 20:43:45 -0500 Subject: [PATCH 1/5] Make the tst.sh workload can be configurable --- UnixBench/pgms/multi.sh | 2 +- UnixBench/pgms/tst.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/UnixBench/pgms/multi.sh b/UnixBench/pgms/multi.sh index caab894..76c4165 100755 --- a/UnixBench/pgms/multi.sh +++ b/UnixBench/pgms/multi.sh @@ -16,7 +16,7 @@ ID="@(#)multi.sh:3.4 -- 5/15/91 19:30:24"; instance=1 while [ $instance -le $1 ]; do - /bin/sh "$UB_BINDIR/tst.sh" & + /bin/sh "$UB_BINDIR/tst.sh" 20 & instance=$(($instance + 1)) done wait diff --git a/UnixBench/pgms/tst.sh b/UnixBench/pgms/tst.sh index 611856a..15be37f 100755 --- a/UnixBench/pgms/tst.sh +++ b/UnixBench/pgms/tst.sh @@ -14,7 +14,8 @@ # ############################################################################### ID="@(#)tst.sh:3.4 -- 5/15/91 19:30:24"; -sort >sort.$$ sort.src.$$ od sort.$$ | sort -n -k 1 > od.$$ grep the sort.$$ | tee grep.$$ | wc > wc.$$ rm sort.$$ grep.$$ od.$$ wc.$$ From 549fe4fa472a8d760fc0de7489a0cc4a01dda9c6 Mon Sep 17 00:00:00 2001 From: Lipeng Zhu Date: Tue, 28 Feb 2023 21:35:06 -0500 Subject: [PATCH 2/5] add a variable of times_of_sort_src --- UnixBench/pgms/multi.sh | 3 ++- UnixBench/pgms/tst.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/UnixBench/pgms/multi.sh b/UnixBench/pgms/multi.sh index 76c4165..8e391d0 100755 --- a/UnixBench/pgms/multi.sh +++ b/UnixBench/pgms/multi.sh @@ -15,8 +15,9 @@ ############################################################################### ID="@(#)multi.sh:3.4 -- 5/15/91 19:30:24"; instance=1 +times_of_sort_src=20 while [ $instance -le $1 ]; do - /bin/sh "$UB_BINDIR/tst.sh" 20 & + /bin/sh "$UB_BINDIR/tst.sh" $times_of_sort_src & instance=$(($instance + 1)) done wait diff --git a/UnixBench/pgms/tst.sh b/UnixBench/pgms/tst.sh index 15be37f..4ea0e49 100755 --- a/UnixBench/pgms/tst.sh +++ b/UnixBench/pgms/tst.sh @@ -15,7 +15,7 @@ ############################################################################### ID="@(#)tst.sh:3.4 -- 5/15/91 19:30:24"; sort_src_content=$(cat sort.src) -printf "$sort_src_content%.0s\n" $(seq $1) | sort > sort.src.$$ +printf "$sort_src_content%.0s\n" $(seq $1) | sort > sort.$$ od sort.$$ | sort -n -k 1 > od.$$ grep the sort.$$ | tee grep.$$ | wc > wc.$$ rm sort.$$ grep.$$ od.$$ wc.$$ From 569ba093b87002be0b427aeadd46237d698dee82 Mon Sep 17 00:00:00 2001 From: Lipeng Zhu Date: Thu, 9 Mar 2023 19:09:16 -0500 Subject: [PATCH 3/5] Introduce TIMES_OF_SORT_SRC env to let user expand the sort.src to balance cycles distribution. --- UnixBench/pgms/multi.sh | 15 +++++++++++++-- UnixBench/pgms/tst.sh | 3 +-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/UnixBench/pgms/multi.sh b/UnixBench/pgms/multi.sh index 8e391d0..c432746 100755 --- a/UnixBench/pgms/multi.sh +++ b/UnixBench/pgms/multi.sh @@ -15,10 +15,21 @@ ############################################################################### ID="@(#)multi.sh:3.4 -- 5/15/91 19:30:24"; instance=1 -times_of_sort_src=20 +sort_src=sort.src +times_of_sort_src=${TIMES_OF_SORT_SRC:-1} +if [ $times_of_sort_src -gt 1 ]; then + for i in $(seq $times_of_sort_src); do combine_sort_src+=" $sort_src"; done + cat $combine_sort_src > sort.src-alt.$$ + sort_src=sort.src-alt.$$ +fi + while [ $instance -le $1 ]; do - /bin/sh "$UB_BINDIR/tst.sh" $times_of_sort_src & + /bin/sh "$UB_BINDIR/tst.sh" $sort_src & instance=$(($instance + 1)) done wait +if [ $times_of_sort_src -gt 1 ]; then + rm $sort_src +fi + diff --git a/UnixBench/pgms/tst.sh b/UnixBench/pgms/tst.sh index 4ea0e49..fb0616d 100755 --- a/UnixBench/pgms/tst.sh +++ b/UnixBench/pgms/tst.sh @@ -14,8 +14,7 @@ # ############################################################################### ID="@(#)tst.sh:3.4 -- 5/15/91 19:30:24"; -sort_src_content=$(cat sort.src) -printf "$sort_src_content%.0s\n" $(seq $1) | sort > sort.$$ +sort > sort.$$ < $1 od sort.$$ | sort -n -k 1 > od.$$ grep the sort.$$ | tee grep.$$ | wc > wc.$$ rm sort.$$ grep.$$ od.$$ wc.$$ From 6a091c010e3d1e2968b92ae881b2f5c0ea9a30f2 Mon Sep 17 00:00:00 2001 From: Lipeng Zhu Date: Fri, 10 Mar 2023 09:34:26 -0500 Subject: [PATCH 4/5] Optionally expand the size of sort.src for tst.sh shell workload --- UnixBench/pgms/multi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnixBench/pgms/multi.sh b/UnixBench/pgms/multi.sh index c432746..d8f41a4 100755 --- a/UnixBench/pgms/multi.sh +++ b/UnixBench/pgms/multi.sh @@ -18,7 +18,7 @@ instance=1 sort_src=sort.src times_of_sort_src=${TIMES_OF_SORT_SRC:-1} if [ $times_of_sort_src -gt 1 ]; then - for i in $(seq $times_of_sort_src); do combine_sort_src+=" $sort_src"; done + for i in $(seq $times_of_sort_src); do combine_sort_src="$combine_sort_src $sort_src"; done cat $combine_sort_src > sort.src-alt.$$ sort_src=sort.src-alt.$$ fi From d18b4c9fcdd7a6a22bd989e7914f83dc766dcbe2 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Thu, 9 Mar 2023 10:05:55 -0500 Subject: [PATCH 5/5] MULTI_SH_WORK_FACTOR --- UnixBench/USAGE | 8 +++++++- UnixBench/pgms/multi.sh | 12 ++++++------ 2 files changed, 13 insertions(+), 7 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 d8f41a4..72e8716 100755 --- a/UnixBench/pgms/multi.sh +++ b/UnixBench/pgms/multi.sh @@ -16,10 +16,11 @@ ID="@(#)multi.sh:3.4 -- 5/15/91 19:30:24"; instance=1 sort_src=sort.src -times_of_sort_src=${TIMES_OF_SORT_SRC:-1} -if [ $times_of_sort_src -gt 1 ]; then - for i in $(seq $times_of_sort_src); do combine_sort_src="$combine_sort_src $sort_src"; done - cat $combine_sort_src > sort.src-alt.$$ +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 @@ -29,7 +30,6 @@ while [ $instance -le $1 ]; do done wait -if [ $times_of_sort_src -gt 1 ]; then +if [ $work_factor -gt 1 ]; then rm $sort_src fi -