-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathout_table.sh
More file actions
executable file
·50 lines (46 loc) · 1.42 KB
/
out_table.sh
File metadata and controls
executable file
·50 lines (46 loc) · 1.42 KB
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
#!/bin/bash
in_file=tests.txt # Input file
res_file=table.txt # Temporary file
sep=' ' # Separator character
# Print header
row1=("Benchmark" " " "Bound" " " " " "Timing (s)");
row2=(" " "NumFuzz" "FPTaylor" "Gappa" "NumFuzz" "FPTaylor" "Gappa");
printf '%-20s ' "${row1[@]}" >> $res_file;
printf '%s\n' "" >> $res_file;
printf '%-20s ' "${row2[@]}" >> $res_file;
printf '%s\n' "" >> $res_file;
# Parse and print values
bstr="START BENCHMARK:";
nstr="I [General] : Relative error:";
ntstr="Execution time:";
fstr="Relative error (exact):";
ftstr="Elapsed time:";
gstr="{";
gtstr="real";
while read line; do
if [[ $line =~ "$bstr" ]] ; then
tmpb=${line#*$bstr};
bnch=${tmpb% *}; fi
if [[ $line =~ "$nstr" ]] ; then
nbnd=${line#*error:}; fi
if [[ $line =~ "$ntstr" ]] ; then
tmpnt=${line#*$ntstr};
nt=${tmpnt%s*}; fi
if [[ $line =~ "$fstr" ]] ; then
tmp=${line#*$fstr};
fbnd=${tmp% *};
else if [[ $line =~ "Cannot compute" ]]; then
fbnd="${sp2}-${sp}"; fi ; fi
if [[ $line =~ "$ftstr" ]] ; then
ft=${line#*$ftstr}; fi
if [[ $line =~ "$gstr" ]] ; then
tmpg=${line#*$gstr};
gbnd=${tmpg%,*}; fi
if [[ $line =~ "$gtstr" ]] ; then
tmpgt1=${line#*$gtstr};
tmpgt=${tmpgt1#*0m};
gt=${tmpgt%s*};
row=($bnch $nbnd $fbnd $gbnd $nt $ft $gt);
printf '%-20s ' "${row[@]}" >> $res_file;
printf '%s\n' "" >> $res_file; fi
done < $in_file