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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
#!/bin/bash
#NICE="blacktext linewidth 4.0 \"Helvetica\" 16 "
# try thinner lines
NICE="blacktext linewidth 1.0 \"Helvetica\" 16 "
if [ "$1" == "--eps" ]; then
EXT="eps"
# TERMINAL="postscript eps color $NICE"
TERMINAL="postscript eps $NICE"
shift
else
EXT="png"
TERMINAL="png picsize 1024 768"
fi
CSV1=$1
TITLE=$2
OUT=$3
if [ ! -f "$CSV1" ]; then
echo "Usage: plot_sched <data.csv> [<title>] [<out.png>]"
exit 1
fi
HARDSOFT=`basename $CSV1 | sed -e 's/^\([^_]*\).*/\1/'`
KIND=`basename $CSV1 | sed -e 's/^[^_]*_\([^_]*\).*/\1/'`
FDIST=`basename $CSV1 | sed -e 's/^[^_]*_[^_]*_dist=\(.*\).csv/\1/'`
case "$FDIST" in
uni_light)
DIST="uniformly distributed in [0.001, 0.1]"
;;
uni_medium)
DIST="uniformly distributed in [0.1, 0.4]"
;;
uni_heavy)
DIST="uniformly distributed in [0.5, 0.9]"
;;
bimo_light)
DIST="bimodally distributed in [0.001, 0.5] (8/9) and [0.5, 0.9] (1/9)"
;;
bimo_medium)
DIST="bimodally distributed in [0.001, 0.5] (6/9) and [0.5, 0.9] (3/9)"
;;
bimo_heavy)
DIST="bimodally distributed in [0.001, 0.5] (4/9) and [0.5, 0.9] (5/9)"
;;
*)
;;
esac
echo "Hard/Soft : $HARDSOFT"
echo "Study : $KIND"
echo "Distribution: $DIST"
XLABEL="utilization cap"
XRANGE="set xrange [0.5:32.5]; set xtics 0, 2"
STYLE="lines lw 3"
#STYLE=linespoints
LINESTYLE=" \
set style line 1 lt rgb 'blue'; \
set style line 2 lt rgb 'orange-red'; \
"
case "$KIND" in
sched)
YLABEL="schedulability"
YRANGE="set yrange [-0.1:1.1]"
case "$HARDSOFT" in
soft)
PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with $STYLE, \
'$CSV1' using 1:3 title 'C-EDF' with $STYLE, \
'$CSV1' using 1:4 title 'G-EDF' with $STYLE, \
'$CSV1' using 1:5 title 'PFAIR' with $STYLE, \
'$CSV1' using 1:6 title 'S-PFAIR' with $STYLE, \
'$CSV1' using 1:7 title 'G-NP-EDF' with $STYLE
"
if [ "$FDIST" != "uni_light" ]; then
XRANGE="set xrange [21.5:32.5]; set xtics 0, 2"
fi
;;
hard)
PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with $STYLE, \
'$CSV1' using 1:3 title 'C-EDF' with $STYLE, \
'$CSV1' using 1:4 title 'G-EDF' with $STYLE, \
'$CSV1' using 1:5 title 'PFAIR' with $STYLE, \
'$CSV1' using 1:6 title 'S-PFAIR' with $STYLE
"
;;
esac
;;
tard)
YLABEL="tardiness (in ms)"
YRANGE=
PLOT="plot '$CSV1' using 1:2 title 'C-EDF' with $STYLE, \
'$CSV1' using 1:3 title 'G-EDF' with $STYLE, \
'$CSV1' using 1:4 title 'G-NP-EDF' with $STYLE
"
;;
util)
YLABEL="utilization (incl. overheads)"
YRANGE=
case "$HARDSOFT" in
soft)
PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with $STYLE, \
'$CSV1' using 1:3 title 'C-EDF' with $STYLE, \
'$CSV1' using 1:4 title 'G-EDF' with $STYLE, \
'$CSV1' using 1:5 title 'PFAIR' with $STYLE, \
'$CSV1' using 1:6 title 'G-NP-EDF' with $STYLE
"
;;
hard)
PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with $STYLE, \
'$CSV1' using 1:3 title 'C-EDF' with $STYLE, \
'$CSV1' using 1:4 title 'G-EDF' with $STYLE, \
'$CSV1' using 1:5 title 'PFAIR' with $STYLE \
"
;;
esac
;;
gedf)
YLABEL="schedulability"
YRANGE="set yrange [-0.1:1.1]"
PLOT="plot '$CSV1' using 1:2 title 'P-EDF' with $STYLE, \
'$CSV1' using 1:8 title 'G-EDF (all)' with $STYLE, \
'$CSV1' using 1:3 title 'G-EDF [GFB03]' with $STYLE, \
'$CSV1' using 1:4 title 'G-EDF [BAK03]' with $STYLE, \
'$CSV1' using 1:5 title 'G-EDF [BCL05]' with $STYLE, \
'$CSV1' using 1:6 title 'G-EDF [BCL08]' with $STYLE, \
'$CSV1' using 1:7 title 'G-EDF [SKB07]' with $STYLE \
"
;;
*)
YLABEL=""
YRANGE=""
;;
esac
BASE=`basename $CSV1 | sed -e s/.csv//g -e s/dist=//g `
#echo $BASE
if [ "$OUT" == "" ]; then
OUT="${BASE}.${EXT}"
fi
if [ "$TITLE" == "" ]; then
TITLE="$DIST"
fi
# fixup csv file, gnuplot is picky
sed -i -e 's/,\([^ ]\)/, \1/g' $CSV1
gnuplot <<EOM
set terminal $TERMINAL
set out '/dev/null'
$YRANGE
$XRANGE
$PLOT
set ylabel '$YLABEL'
set xlabel '$XLABEL'
set title '$TITLE'
set key below
#set data style $STYLE
set out '$OUT'
set palette defined ( 0 "blue", 3 "green", 6 "yellow", 10 "red" )
replot
set out
EOM
if [ "$EXT" == "eps" ]; then
ps2pdf -dEPSCrop $OUT
fi
|