From d4da095b12473992821a06fde57b0bd2ac05ec54 Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Mon, 30 Jan 2012 16:24:32 +0100 Subject: [PATCH] optimize merge --- merge/parseDat.py | 2 +- merge/test_threads.sh | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/merge/parseDat.py b/merge/parseDat.py index 9570440..fa97ffa 100755 --- a/merge/parseDat.py +++ b/merge/parseDat.py @@ -8,7 +8,7 @@ def listtofile(listing, file): fd.write(i+"\n") fd.close() -def makeGraphs(graphs, graphtitle = "Title", xlabel = "Size of array", ylabel = "Time needed for calculation"): +def makeGraphs(graphs, graphtitle = "Title", xlabel = "Number of Parts", ylabel = "Time needed for calculation"): gendir = "stats/generated/" subprocess.call(["mkdir", "-p", gendir]) p = subprocess.Popen(['gnuplot'],stdout=subprocess.PIPE,stdin=subprocess.PIPE) diff --git a/merge/test_threads.sh b/merge/test_threads.sh index 7848c5d..fce8f99 100755 --- a/merge/test_threads.sh +++ b/merge/test_threads.sh @@ -4,17 +4,23 @@ STATFILE=merge STARTTS="`date --iso-8601=minutes`" mkdir -p stats/raw/${STARTTS} -EXPO="3 4 5 6 7" +EXPO=$(seq 1000 1000 10000) $(seq 10000 10000 100000) PARTS="1 2 4 5 10 20 25 50 100" +let maxfoo=`expr 10**8` for num in $EXPO do - ./generate_random.sh $num + echo "" + rm -f numlist.h + echo "#define LISTSIZEA ${num}" >> numlist.h + echo "#define LISTSIZEB ${num}" >> numlist.h + echo "extern int a[${maxfoo}];" >> numlist.h + echo "extern int b[${maxfoo}];" >> numlist.h + make clean make for i in $PARTS do - let foo=`expr 10**$num` - ./sort -t $i | sed "s/took \([0-9]*\.[0-9]*\) seconds\./${i};\1/" | tee -a stats/raw/$STARTTS/$STATFILE.$foo.dat + ./sort -t $i | sed "s/took \([0-9]*\.[0-9]*\) seconds\./${i};\1/" | tee -a stats/raw/$STARTTS/$STATFILE.$num.dat done done -- 2.43.0