From 6e5583f8a1c5e3cf4ade4f1eb6cc0bc9d24b6a65 Mon Sep 17 00:00:00 2001 From: David Kaufmann Date: Fri, 4 Nov 2011 23:16:57 +0100 Subject: [PATCH] update --- openmp/merge/generate_random.sh | 2 +- openmp/merge/sort.c | 4 ++-- openmp/merge/test_threads.sh | 13 +++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/openmp/merge/generate_random.sh b/openmp/merge/generate_random.sh index 706f37c..c63b115 100755 --- a/openmp/merge/generate_random.sh +++ b/openmp/merge/generate_random.sh @@ -8,7 +8,7 @@ function pwait() { } # 10 ^ x values -X=9 +X=6 NULLEN="" PUNKTE="." for i in $(seq `expr $X - 1`); diff --git a/openmp/merge/sort.c b/openmp/merge/sort.c index 6cb9e2b..dcf16b3 100644 --- a/openmp/merge/sort.c +++ b/openmp/merge/sort.c @@ -6,7 +6,7 @@ #include "numlist1.h" #include "numlist2.h" -#define LISTSIZE 10000000 +#define LISTSIZE 100000 void printlist(char * message, int * ptr) { printf (message); @@ -126,7 +126,7 @@ int main ( int argc, char ** argv) { } endTime = omp_get_wtime(); - printf(" took %f seconds.\n", endTime-startTime); + printf("took %f seconds.\n", endTime-startTime); //printlist("Sorted List:", c); free(c); diff --git a/openmp/merge/test_threads.sh b/openmp/merge/test_threads.sh index 68ef763..597c43e 100755 --- a/openmp/merge/test_threads.sh +++ b/openmp/merge/test_threads.sh @@ -1,5 +1,10 @@ #!/bin/bash -#for i in 1 2 5 10; do ./sort -t $i | grep "Sorted List:" | sed "s/Sorted List:/$i:/"; done; -#for i in 1 2 5 10; do time ./sort -t $i | sed "s/Sorted List:/$i:/"; done; -#for i in 1 2 5 10; do echo $i; time ./sort -t $i; done; -for i in 1 2 4 5 8 10 20 25 40 50 100 125 200 250 500 1000; do echo -n "$i: "; /usr/bin/time -f "%E" ./sort -t $i; done; + +STATFILE=../stat/merge.dat + +rm $STATFILE +for i in 1 2 4 5 8 10 20 25 40 50 100 125 200 250 500 1000 +do + echo -n "$i," >> $STATFILE + ./sort -t $i | sed 's/took \([0-9]*\.[0-9]*\) seconds\./\1/' >> $STATFILE +done -- 2.43.0