From 393fa02fd98b0a881b478c3157c436dd61071864 Mon Sep 17 00:00:00 2001 From: Jim Plank Date: Mon, 30 Dec 2013 15:55:37 -0500 Subject: [PATCH] Some wordsmithing. --- tools/gf_methods.c | 15 ++++++++------- tools/time_tool.sh | 17 ++++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/tools/gf_methods.c b/tools/gf_methods.c index 298c1ec..903d8b0 100644 --- a/tools/gf_methods.c +++ b/tools/gf_methods.c @@ -17,10 +17,10 @@ #include "gf_method.h" #include "gf_int.h" -#define BNMULTS (7) +#define BNMULTS (8) static char *BMULTS[BNMULTS] = { "CARRY_FREE", "GROUP48", - "TABLE", "LOG", "SPLIT4", "SPLIT88", "COMPOSITE" }; -#define NMULTS (16) + "TABLE", "LOG", "SPLIT4", "SPLIT8", "SPLIT88", "COMPOSITE" }; +#define NMULTS (15) static char *MULTS[NMULTS] = { "CARRY_FREE", "GROUP44", "GROUP48", "BYTWO_p", "BYTWO_b", "TABLE", "LOG", "LOG_ZERO", "LOG_ZERO_EXT", "SPLIT2", "SPLIT4", "SPLIT8", "SPLIT16", "SPLIT88", "COMPOSITE" }; @@ -39,7 +39,7 @@ static char *divides[NDIVS] = { "MATRIX", "EUCLID" }; void usage(char *s) { - fprintf(stderr, "usage: gf_methods w -BADCM -LUMDRB\n"); + fprintf(stderr, "usage: gf_methods w -BADC -LUMDRB\n"); fprintf(stderr, "\n"); fprintf(stderr, " w can be 1-32, 64, 128\n"); fprintf(stderr, "\n"); @@ -173,6 +173,7 @@ int main(int argc, char *argv[]) } reset = sa; + for (r = 0; r < (1 << nregions); r++) { sa = reset; for (k = 0; k < nregions; k++) { @@ -182,10 +183,10 @@ int main(int argc, char *argv[]) } } gf_argv[sa++] = "-"; - /* - printf("Hmmmm. %s", gf_argv[0]); + + /* printf("Hmmmm. %s", gf_argv[0]); for (j = 0; j < sa; j++) printf(" %s", gf_argv[j]); - printf("\n"); */ + printf("\n"); */ if (create_gf_from_argv(&gf, w, sa, gf_argv, 0) > 0) { printf(w_str, w); diff --git a/tools/time_tool.sh b/tools/time_tool.sh index d2aa591..7b165e1 100644 --- a/tools/time_tool.sh +++ b/tools/time_tool.sh @@ -47,7 +47,7 @@ fi if [ $op = M -o $op = D ]; then iter=1 c1=`./gf_time $w $op -1 $bsize $iter $method` - t=`echo $c1 | awk '{ printf "%d\n", $4*1000 }'` + t=`echo $c1 | awk '{ printf "%d\n", $4*100 }'` s=`echo $c1 | awk '{ print $8 }'` bs=$s @@ -55,11 +55,12 @@ if [ $op = M -o $op = D ]; then bs=$s iter=`echo $iter | awk '{ print $1*2 }'` c1=`./gf_time $w $op -1 $bsize $iter $method` - t=`echo $c1 | awk '{ printf "%d\n", $4*1000 }'` + t=`echo $c1 | awk '{ printf "%d\n", $4*100 }'` s=`echo $c1 | awk '{ print $8 }'` done - echo "$op speed (MB/s): " $bs " W-Method:" $w $method + echo $op $bs | awk '{ printf "%s speed (MB/s): %8.2lf W-Method: ", $1, $2 }' + echo $w $method exit 0 fi @@ -70,7 +71,7 @@ best=0 while [ $bsize -le 4194304 ]; do iter=1 c1=`./gf_time $w G -1 $bsize $iter $method` - t=`echo $c1 | awk '{ printf "%d\n", $6*1000 }'` + t=`echo $c1 | awk '{ printf "%d\n", $6*500 }'` s=`echo $c1 | awk '{ print $10 }'` bs=$s @@ -78,7 +79,7 @@ while [ $bsize -le 4194304 ]; do bs=$s iter=`echo $iter | awk '{ print $1*2 }'` c1=`./gf_time $w G -1 $bsize $iter $method` - t=`echo $c1 | awk '{ printf "%d\n", $6*1000 }'` + t=`echo $c1 | awk '{ printf "%d\n", $6*500 }'` s=`echo $c1 | awk '{ print $10 }'` done if [ $bsize -lt 1048576 ]; then @@ -87,9 +88,11 @@ while [ $bsize -le 4194304 ]; do str=`echo $bsize | awk '{ printf "%3dM\n", $1/1024/1024 }'` fi if [ $op = R ]; then - echo "Region Buffer-Size: $str (MB/s): " $bs " W-Method:" $w $method + echo $str $bs | awk '{ printf "Region Buffer-Size: %4s (MB/s): %8.2lf W-Method: ", $1, $2 }' + echo $w $method fi best=`echo $best $bs | awk '{ print ($1 > $2) ? $1 : $2 }'` bsize=`echo $bsize | awk '{ print $1 * 2 }'` done -echo "Region Best (MB/s): "$best " W-Method:" $w $method +echo $best | awk '{ printf "Region Best (MB/s): %8.2lf W-Method: ", $1 }' +echo $w $method