-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_list.sh
executable file
·131 lines (126 loc) · 3.78 KB
/
run_list.sh
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
#!/bin/zsh -e
cheap=0
if [[ $cheap == 0 ]] ; then
gcs=(ebr rc hp dw jvm)
threads=(1 2 4 8 16 31 32 63 64) # 9
elements=(100 200 400 800 1600) # 5
update=(0 20 40 60 80 100) # 6
iteration=($(seq 1 5))
# unit: ms
runtime=10000
else
gcs=(dw)
threads=(63 64) # 9
elements=(100 200 400 800 1600) # 5
update=(0 20 40 60 80 100) # 6
# unit: ms
runtime=10000
iteration=($(seq 1 5))
fi
make clean
rm -f core
ulimit -c unlimited
cat > db_prg.m << EOF
% all mr algo
ebr=1; rc=2; hp=3; dw=4; jvm=5;
gcs = [$gcs];
threads = [$threads];
elements = [$elements];
update = [$update];
db_prg_total_avg = 0;
db_prg_total_std = 0;
for gc = gcs
for t = threads
for e = elements
for u = update
ans = sscanf(fgetl(0), "%u")';
db_prg_total_avg(...
find(gcs == gc), ...
find(threads == t), ...
find(elements == e), ...
find(update == u) ...
) = ans(1);
db_prg_total_std(...
find(gcs == gc), ...
find(threads == t), ...
find(elements == e), ...
find(update == u) ...
) = ans(2);
endfor
endfor
endfor
endfor
db_prg_footprint_avg = 0;
db_prg_footprint_std = 0;
for gc = gcs
for t = threads
for e = elements
for u = update
ans = sscanf(fgetl(0), "%u")';
db_prg_footprint_avg(...
find(gcs == gc), ...
find(threads == t), ...
find(elements == e), ...
find(update == u) ...
) = ans(1);
db_prg_footprint_std(...
find(gcs == gc), ...
find(threads == t), ...
find(elements == e), ...
find(update == u) ...
) = ans(2);
endfor
endfor
endfor
endfor
% db_prg_total_avg
% db_prg_total_std
% db_prg_footprint_avg
% db_prg_footprint_std
save db_prg.mat db_prg_total_avg db_prg_total_std db_prg_footprint_avg db_prg_footprint_std
EOF
perl -pe 's!prg!list!g' db_prg.m > db_list.m
: > list.total.log
: > list.footprint.log
for gc in $gcs; do
make -s clean
make -s test_list_lf_${gc}
for t in $threads; do
for e in $elements; do
for u in $update; do
echo "$gc $t $e $u"
echo "total = [" > total.m
echo "footprint = [" > footprint.m
for i in $iteration; do
if [[ $gc == "dw" ]]; then
/usr/bin/time -f "%M" -o mem.txt \
./test_list_lf_${gc}.exe --ponythreads $(($t+1)) \
$runtime $u $e $t >> total.m
elif [[ $gc == "jvm" ]]; then
/usr/bin/time -f "%M" -o mem.txt \
java MyList $runtime $u $e $t >> total.m
else
/usr/bin/time -f "%M" -o mem.txt \
./test_list_lf_${gc}.exe $runtime $u $e $t >> total.m
fi
cat mem.txt >> footprint.m
done
rm -f mem.txt
cat >> total.m << EOF
];
printf("%u %u\n", uint32(mean(total)), uint32(std(total)));
EOF
cat >> footprint.m << EOF
];
printf("%u %u\n", uint32(mean(footprint)), uint32(std(footprint)));
EOF
octave -q total.m >> list.total.log
octave -q footprint.m >> list.footprint.log
rm -f total.m
rm -f footprint.m
done
done
done
done
cat list.total.log list.footprint.log | octave -q db_list.m
exit