File: stats2data

package info (click to toggle)
polyorb 2.11~20140418-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 30,012 kB
  • ctags: 465
  • sloc: ada: 273,015; sh: 4,507; makefile: 4,265; python: 1,332; cpp: 1,213; java: 507; ansic: 274; xml: 30; perl: 23; exp: 6
file content (45 lines) | stat: -rwxr-xr-x 939 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/sh

# This outputs elapsed = f(nmax)

# params

# nmax
# ethr
# siz

while getopts t:p: opt; do
  case "$opt" in
    t) tag="$OPTARG" ;;
    p) param="$OPTARG" ;;
    *) echo "Usage: $0 [ -t TAG ] [ -p PARAM ]"; exit 1 ;;
  esac
done

case "x$param" in
  x|xnmax) param=nmax ;;
  xethr|xsiz) param=$param ;;
  *) echo "bad param"; exit 1 ;;
esac

if [ "$tag" != "" ]; then
  tag="_$tag"
fi

tr '=' ' ' | awk '
  BEGIN { param = "'"$param"'" }
  /^nmax/ { nmax=$2 }
  /^moy/  { moy=$2 }
  /^siz/  { siz=$2 }
  /^coun/ { cnt=$2 }
  /^evolutedp_thr/ { ethr=$2 }
  /^ect/  { ect = $2;
     if (ethr == 0) ethr = 4;
     fn = sprintf ("data'"$tag"'_%diter", cnt);
     if (param != "nmax")
       fn = (fn sprintf ("_%dcli", nmax));
     if (param != "ethr")
       fn = (fn sprintf ("_%dthr", ethr));
     if (param != "siz")
       fn = (fn sprintf ("_%dbytes", siz));
     printf "%.12g %.12g %.12g\n", '"$param"', moy, ect >> fn }'