2 ##############################################################################
3 # Last modified: Time-stamp: <95/08/01 02:21:56 hwloidl>
5 # Usage: gr2gran [options] <sim-file>
7 # Create granularity graphs for the GrAnSim profile <sim-file>. This creates
8 # a bucket statistics and a cumulative runtimes graph.
9 # This script is derived from the much more complex gran-extr script, which
10 # also produces such graphs and much more information, too.
13 # -t <file> ... use <file> as template file (<,> global <.> local template)
14 # -p <file> ... use <file> as gnuplot .gp file (default: gran.gp)
15 # -x <x-size> ... of gnuplot graph
16 # -y <y-size> ... of gnuplot graph
17 # -n <n> ... use <n> as number of PEs in title
18 # -o <file> ... keep the intermediate <file> (sorted list of all runtimes)
19 # -h ... help; print this text.
20 # -v ... verbose mode.
22 ##############################################################################
24 progname="`basename $0`"
37 getopts "hvt:p:x:y:n:o:" name
38 while [ "$name" != "?" ] ; do
42 t) template="-t $OPTARG";;
43 p) plotfile="-p $OPTARG";;
47 o) rtsfile="$OPTARG";;
49 getopts "hvt:p:x:y:n:o:" name
52 shift $[ $OPTIND - 1 ]
55 then no_of_lines=`cat $0 | awk 'BEGIN { n = 0; } \
59 echo "`head -$no_of_lines $0`"
64 then echo "Usage: $progname [options] file[.gr]"
65 echo "Use -h option for details"
72 then rtsfile="${f}.rts"
74 else rtsopt="-o $rtsfile"
79 opts_ps="$template $plotfile $x $y $n "
82 then echo "Input file: $grfile"
83 if [ ${keep_rts} -eq 1 ]
84 then echo "Intermediate file: $rtsfile (kept after termination)"
85 else echo "Intermediate file: $rtsfile (discarded at end)"
88 opts_RTS="${opts_RTS} $verb_opt "
89 opts_ps="${opts_ps} $verb_opt "
90 echo "Options for gr2RTS: ${opts_RTS}"
91 echo "Options for RTS2gran: ${opts_ps}"
98 echo "$grfile does not exist"
103 then echo "gr2RTS ..."
105 gr2RTS ${opts_RTS} $grfile
107 then echo "RTS2gran ..."
109 RTS2gran ${opts_ps} $rtsfile
110 if [ ${keep_rts} -ne 1 ]