aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-06-15 16:05:26 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-06-15 16:05:26 +0000
commitdab011be0a5a313eddc9180598fffb2fabda3669 (patch)
tree0b240b414c4ce521c6bbf7a9122f0f02f338973d
parentb42dc20d121ceb8d4a90d3024a37ae27c5f371a5 (diff)
downloadgnunet-dab011be0a5a313eddc9180598fffb2fabda3669.tar.gz
gnunet-dab011be0a5a313eddc9180598fffb2fabda3669.zip
improvements
-rw-r--r--src/transport/perf_transport_ats.c56
1 files changed, 46 insertions, 10 deletions
diff --git a/src/transport/perf_transport_ats.c b/src/transport/perf_transport_ats.c
index 48551e89f..10442d212 100644
--- a/src/transport/perf_transport_ats.c
+++ b/src/transport/perf_transport_ats.c
@@ -47,6 +47,7 @@ static glp_prob * prob;
47static struct GNUNET_TIME_Absolute start; 47static struct GNUNET_TIME_Absolute start;
48static struct GNUNET_TIME_Absolute end; 48static struct GNUNET_TIME_Absolute end;
49 49
50static int ret = 0;
50 51
51void solve_mlp(int presolve) 52void solve_mlp(int presolve)
52{ 53{
@@ -108,9 +109,17 @@ void modify_qm(int start, int length, int values_to_change)
108void bench_simplex_optimization(char * file, int executions) 109void bench_simplex_optimization(char * file, int executions)
109{ 110{
110 int c; 111 int c;
112 int res;
111 113
112 prob = glp_create_prob(); 114 prob = glp_create_prob();
113 glp_read_lp(prob, NULL, file); 115 res = glp_read_lp(prob, NULL, file);
116 if (res != 0)
117 {
118 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
119 "Problem file `%s' not found\n", file);
120 ret = 1;
121 return;
122 }
114 123
115 solve_lp(GNUNET_YES); 124 solve_lp(GNUNET_YES);
116 125
@@ -134,9 +143,17 @@ void bench_simplex_optimization(char * file, int executions)
134void bench_simplex_no_optimization(char * file, int executions) 143void bench_simplex_no_optimization(char * file, int executions)
135{ 144{
136 int c; 145 int c;
146 int res;
137 147
138 prob = glp_create_prob(); 148 prob = glp_create_prob();
139 glp_read_lp(prob, NULL, file); 149 res = glp_read_lp(prob, NULL, file);
150 if (res != 0)
151 {
152 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
153 "Problem file `%s' not found\n", file);
154 ret = 1;
155 return;
156 }
140 157
141 for (c=0; c<executions;c++) 158 for (c=0; c<executions;c++)
142 { 159 {
@@ -158,10 +175,17 @@ void bench_simplex_no_optimization(char * file, int executions)
158void bench_mlp_no_optimization(char * file, int executions) 175void bench_mlp_no_optimization(char * file, int executions)
159{ 176{
160 int c; 177 int c;
178 int res;
161 179
162 prob = glp_create_prob(); 180 prob = glp_create_prob();
163 glp_read_lp(prob, NULL, file); 181 res = glp_read_lp(prob, NULL, file);
164 182 if (res != 0)
183 {
184 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
185 "Problem file `%s' not found\n", file);
186 ret = 1;
187 return;
188 }
165 for (c=0; c<executions;c++) 189 for (c=0; c<executions;c++)
166 { 190 {
167 start = GNUNET_TIME_absolute_get(); 191 start = GNUNET_TIME_absolute_get();
@@ -184,8 +208,17 @@ void bench_mlp_no_optimization(char * file, int executions)
184void bench_mlp_with_optimization(char * file, int executions, int changes) 208void bench_mlp_with_optimization(char * file, int executions, int changes)
185{ 209{
186 int c; 210 int c;
211 int res;
212
187 prob = glp_create_prob(); 213 prob = glp_create_prob();
188 glp_read_lp(prob, NULL, file); 214 res = glp_read_lp(prob, NULL, file);
215 if (res != 0)
216 {
217 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
218 "Problem file `%s' not found\n", file);
219 ret = 1;
220 return;
221 }
189 222
190 solve_lp(GNUNET_YES); 223 solve_lp(GNUNET_YES);
191 224
@@ -236,7 +269,7 @@ void modify_cr (int start, int length, int count)
236 269
237int main (int argc, char *argv[]) 270int main (int argc, char *argv[])
238{ 271{
239 int ret = 0; 272
240 GNUNET_log_setup ("perf-transport-ats", 273 GNUNET_log_setup ("perf-transport-ats",
241#if VERBOSE 274#if VERBOSE
242 "DEBUG", 275 "DEBUG",
@@ -268,27 +301,30 @@ int main (int argc, char *argv[])
268 bench_mlp_no_optimization (file, executions); 301 bench_mlp_no_optimization (file, executions);
269 bench_mlp_with_optimization (file, executions, 0); 302 bench_mlp_with_optimization (file, executions, 0);
270 303
304 if (ret != 0)
305 return ret;
306
271 // -> 400 addresses 307 // -> 400 addresses
272 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 308 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
273 "Simplex, no optimization, average per address: %f\n", 309 "Simplex, no optimization, average per address: %f\n",
274 ((double) sim_no_opt_avg / EXECS) / 400); 310 ((double) sim_no_opt_avg / EXECS) / 400);
275 GAUGER ("TRANSPORT","GLPK simplex no optimization", 311 GAUGER ("TRANSPORT","GLPK simplex no optimization",
276 ((double) sim_no_opt_avg / EXECS) / 400, "ms/address"); 312 ((double) sim_no_opt_avg / EXECS) / 400, "ms/address");
277 313
278 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 314 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
279 "Simplex, with optimization, average per address: %f\n", 315 "Simplex, with optimization, average per address: %f\n",
280 ((double) sim_with_opt_avg / EXECS) / 400); 316 ((double) sim_with_opt_avg / EXECS) / 400);
281 GAUGER ("TRANSPORT", 317 GAUGER ("TRANSPORT",
282 "GLPK simplex, 100 peers 400 addresses with optimization", 318 "GLPK simplex, 100 peers 400 addresses with optimization",
283 ((double) sim_with_opt_avg / EXECS) / 400, "ms/address"); 319 ((double) sim_with_opt_avg / EXECS) / 400, "ms/address");
284 320
285 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 321 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
286 "MLP no optimization average per address: %f\n", 322 "MLP no optimization average per address: %f\n",
287 ((double) mlp_no_opt_avg / EXECS) / 400); 323 ((double) mlp_no_opt_avg / EXECS) / 400);
288 GAUGER ("TRANSPORT","GLPK MLP 100 peers 400 addresses no optimization", 324 GAUGER ("TRANSPORT","GLPK MLP 100 peers 400 addresses no optimization",
289 ((double) mlp_no_opt_avg / EXECS) / 400, "ms/address"); 325 ((double) mlp_no_opt_avg / EXECS) / 400, "ms/address");
290 326
291 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 327 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
292 "MLP optimization average per address: %f\n", 328 "MLP optimization average per address: %f\n",
293 ((double) mlp_with_opt_avg/ EXECS) / 400); 329 ((double) mlp_with_opt_avg/ EXECS) / 400);
294 GAUGER ("TRANSPORT", 330 GAUGER ("TRANSPORT",