From bc73ab91e781549e3600c5f33cf5974224429931 Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Mon, 30 Jan 2012 15:34:03 +0100 Subject: [PATCH] update testscript --- merge/generate_random.sh | 6 +++--- merge/test_threads.sh | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/merge/generate_random.sh b/merge/generate_random.sh index 2554aa4..6a84d25 100755 --- a/merge/generate_random.sh +++ b/merge/generate_random.sh @@ -8,7 +8,7 @@ function pwait() { } # 10 ^ x values -X=4 +X=$1 NULLEN="" PUNKTE="." for i in $(seq `expr $X - 1`); @@ -53,8 +53,8 @@ rm -f unsorted1 unsorted2 rm -f numlist.h echo "#define LISTSIZEA ${VALUES}" >> numlist.h echo "#define LISTSIZEB ${VALUES}" >> numlist.h -echo "extern int a["`expr ${VALUES} + 1`"];" >> numlist.h -echo "extern int b["`expr ${VALUES} + 1`"];" >> numlist.h +echo "extern int a[${VALUES}];" >> numlist.h +echo "extern int b[${VALUES}];" >> numlist.h rm -f numlist.c cat numlist1.c >> numlist.c diff --git a/merge/test_threads.sh b/merge/test_threads.sh index 968a7e6..9bc3012 100755 --- a/merge/test_threads.sh +++ b/merge/test_threads.sh @@ -1,13 +1,19 @@ #!/bin/bash -STATFILE=merge.dat +STATFILE=merge -rm $STATFILE -for i in 1 2 4 5 8 10 20 25 40 50 100 125 200 +rm $STATFILE.*.dat +for num in 3 4 5 6 7 do - SORTMSG=`./sort -t $i` - echo "$i:" $SORTMSG - echo $SORTMSG | sed "s/took \([0-9]*\.[0-9]*\) seconds\./${i},\1/" >> $STATFILE + ./generate_random.sh $num + make clean + make + for i in 1 2 4 5 10 20 25 50 100 + do + SORTMSG=`./sort -t $i` + echo "$i:" $SORTMSG + echo $SORTMSG | sed "s/took \([0-9]*\.[0-9]*\) seconds\./${i},\1/" >> $STATFILE.$num.dat + done done if [ $DISPLAY ]; then -- 2.43.0