diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-03-11 16:02:57 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-03-11 16:02:57 +0000 |
commit | 62a31bd538959fc4defa7548a92ce25de6a07a19 (patch) | |
tree | c8250818cb05f288a25c4ecef70ce8994590e762 /src/ats | |
parent | ce686a9d156f2509bc0bcc103869a4de9d4f2b5d (diff) | |
download | gnunet-62a31bd538959fc4defa7548a92ce25de6a07a19.tar.gz gnunet-62a31bd538959fc4defa7548a92ce25de6a07a19.zip |
perf test done /w update
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/perf_ats_mlp.c | 118 |
1 files changed, 72 insertions, 46 deletions
diff --git a/src/ats/perf_ats_mlp.c b/src/ats/perf_ats_mlp.c index 0da00ea10..0959cefff 100644 --- a/src/ats/perf_ats_mlp.c +++ b/src/ats/perf_ats_mlp.c | |||
@@ -250,6 +250,22 @@ check (void *cls, char *const *args, const char *cfgfile, | |||
250 | int ca; | 250 | int ca; |
251 | struct ATS_Address * cur_addr; | 251 | struct ATS_Address * cur_addr; |
252 | 252 | ||
253 | int full_lp_res; | ||
254 | int full_mip_res; | ||
255 | int full_lp_presolv; | ||
256 | int full_mip_presolv; | ||
257 | struct GNUNET_TIME_Relative full_build_dur; | ||
258 | struct GNUNET_TIME_Relative full_lp_dur; | ||
259 | struct GNUNET_TIME_Relative full_mip_dur; | ||
260 | |||
261 | int update_lp_res; | ||
262 | int update_mip_res; | ||
263 | int update_lp_presolv; | ||
264 | int update_mip_presolv; | ||
265 | struct GNUNET_TIME_Relative update_build_dur; | ||
266 | struct GNUNET_TIME_Relative update_lp_dur; | ||
267 | struct GNUNET_TIME_Relative update_mip_dur; | ||
268 | |||
253 | stats = GNUNET_STATISTICS_create("ats", cfg); | 269 | stats = GNUNET_STATISTICS_create("ats", cfg); |
254 | if (NULL == stats) | 270 | if (NULL == stats) |
255 | { | 271 | { |
@@ -312,58 +328,68 @@ check (void *cls, char *const *args, const char *cfgfile, | |||
312 | /* solve */ | 328 | /* solve */ |
313 | if (cp + 1 >= N_peers_start) | 329 | if (cp + 1 >= N_peers_start) |
314 | { | 330 | { |
331 | /* Solve the full problem */ | ||
315 | GAS_mlp_solve_problem (mlp, addresses); | 332 | GAS_mlp_solve_problem (mlp, addresses); |
316 | if (GNUNET_NO == opt_numeric) | 333 | full_lp_res = mlp->ps.lp_res; |
317 | fprintf (stderr, "%u peers each %u addresses; LP/MIP state [%s/%s] presolv [%s/%s], (build/LP/MIP in ms): %04llu %04llu %04llu; size (cols x rows, nonzero elements): [%u x %u] = %u\n", | 334 | full_mip_res = mlp->ps.mip_res; |
318 | cp + 1, ca, | 335 | full_lp_presolv = mlp->ps.lp_presolv; |
319 | (GNUNET_OK == mlp->ps.lp_res) ? "OK" : "FAIL", | 336 | full_mip_presolv = mlp->ps.mip_presolv; |
320 | (GNUNET_OK == mlp->ps.mip_res) ? "OK" : "FAIL", | 337 | full_build_dur = mlp->ps.build_dur; |
321 | (GLP_YES == mlp->ps.lp_presolv) ? "YES" : "NO", | 338 | full_lp_dur = mlp->ps.lp_dur; |
322 | (GNUNET_OK == mlp->ps.mip_presolv) ? "YES" : "NO", | 339 | full_mip_dur = mlp->ps.mip_dur; |
323 | (unsigned long long) mlp->ps.build_dur.rel_value, | 340 | |
324 | (unsigned long long) mlp->ps.lp_dur.rel_value, | 341 | /* Update and solve the problem */ |
325 | (unsigned long long) mlp->ps.mip_dur.rel_value, | ||
326 | mlp->ps.p_cols, mlp->ps.p_rows, mlp->ps.p_elements); | ||
327 | else | ||
328 | fprintf (stderr, "%u;%u;%s;%s;%s;%s;%04llu;%04llu;%04llu;%u;%u;%u\n", | ||
329 | cp + 1, ca, | ||
330 | (GNUNET_OK == mlp->ps.lp_res) ? "OK" : "FAIL", | ||
331 | (GNUNET_OK == mlp->ps.mip_res) ? "OK" : "FAIL", | ||
332 | (GLP_YES == mlp->ps.lp_presolv) ? "YES" : "NO", | ||
333 | (GNUNET_OK == mlp->ps.mip_presolv) ? "YES" : "NO", | ||
334 | (unsigned long long) mlp->ps.build_dur.rel_value, | ||
335 | (unsigned long long) mlp->ps.lp_dur.rel_value, | ||
336 | (unsigned long long) mlp->ps.mip_dur.rel_value, | ||
337 | mlp->ps.p_cols, mlp->ps.p_rows, mlp->ps.p_elements); | ||
338 | if ((0 < opt_update_quantity) || (0 < opt_update_percent)) | 342 | if ((0 < opt_update_quantity) || (0 < opt_update_percent)) |
339 | { | 343 | { |
340 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Updating problem with %u peers and %u addresses\n", cp + 1, ca); | 344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Updating problem with %u peers and %u addresses\n", cp + 1, ca); |
341 | update_addresses (cp + 1, ca, opt_update_quantity); | 345 | update_addresses (cp + 1, ca, opt_update_quantity); |
342 | GAS_mlp_solve_problem (mlp, addresses); | 346 | GAS_mlp_solve_problem (mlp, addresses); |
343 | if (GNUNET_NO == opt_numeric) | 347 | GAS_mlp_solve_problem (mlp, addresses); |
344 | fprintf (stderr, "%u peers each %u addresses; LP/MIP state [%s/%s] presolv [%s/%s], (build/LP/MIP in ms): %04llu %04llu %04llu; size (cols x rows, nonzero elements): [%u x %u] = %u\n", | 348 | update_lp_res = mlp->ps.lp_res; |
345 | cp + 1, ca, | 349 | update_mip_res = mlp->ps.mip_res; |
346 | (GNUNET_OK == mlp->ps.lp_res) ? "OK" : "FAIL", | 350 | update_lp_presolv = mlp->ps.lp_presolv; |
347 | (GNUNET_OK == mlp->ps.mip_res) ? "OK" : "FAIL", | 351 | update_mip_presolv = mlp->ps.mip_presolv; |
348 | (GLP_YES == mlp->ps.lp_presolv) ? "YES" : "NO", | 352 | update_build_dur = mlp->ps.build_dur; |
349 | (GNUNET_OK == mlp->ps.mip_presolv) ? "YES" : "NO", | 353 | update_lp_dur = mlp->ps.lp_dur; |
350 | (unsigned long long) mlp->ps.build_dur.rel_value, | 354 | update_mip_dur = mlp->ps.mip_dur; |
351 | (unsigned long long) mlp->ps.lp_dur.rel_value, | 355 | |
352 | (unsigned long long) mlp->ps.mip_dur.rel_value, | 356 | } |
353 | mlp->ps.p_cols, mlp->ps.p_rows, mlp->ps.p_elements); | 357 | if (GNUNET_NO == opt_numeric) |
354 | else | 358 | { |
355 | fprintf (stderr, "%u;%u;%s;%s;%s;%s;%04llu;%04llu;%04llu;%u;%u;%u\n", | 359 | fprintf (stderr, "Rebuild: %03u peers each %02u addresses; rebuild: LP/MIP state [%3s/%3s] presolv [%3s/%3s], (build/LP/MIP in ms) %04llu / %04llu / %04llu\n", |
360 | cp + 1, ca, | ||
361 | (GNUNET_OK == full_lp_res) ? "OK" : "FAIL", | ||
362 | (GNUNET_OK == full_mip_res) ? "OK" : "FAIL", | ||
363 | (GLP_YES == full_lp_presolv) ? "YES" : "NO", | ||
364 | (GNUNET_OK == full_mip_presolv) ? "YES" : "NO", | ||
365 | (unsigned long long) full_build_dur.rel_value, (unsigned long long) full_lp_dur.rel_value, (unsigned long long) full_mip_dur.rel_value); | ||
366 | if ((0 < opt_update_quantity) || (0 < opt_update_percent)) | ||
367 | fprintf (stderr, "Update : %03u peers each %02u addresses; rebuild: LP/MIP state [%3s/%3s] presolv [%3s/%3s], (build/LP/MIP in ms) %04llu / %04llu / %04llu\n", | ||
368 | cp + 1, ca, | ||
369 | (GNUNET_OK == update_lp_res) ? "OK" : "FAIL", | ||
370 | (GNUNET_OK == update_mip_res) ? "OK" : "FAIL", | ||
371 | (GLP_YES == update_lp_presolv) ? "YES" : "NO", | ||
372 | (GNUNET_OK == update_mip_presolv) ? "YES" : "NO", | ||
373 | (unsigned long long) update_build_dur.rel_value, (unsigned long long) update_lp_dur.rel_value, (unsigned long long) update_mip_dur.rel_value); | ||
374 | } | ||
375 | else | ||
376 | { | ||
377 | fprintf (stderr, "Rebuild;%u;%u;%s;%s;%s;%s;%04llu;%04llu;%04llu\n", | ||
356 | cp + 1, ca, | 378 | cp + 1, ca, |
357 | (GNUNET_OK == mlp->ps.lp_res) ? "OK" : "FAIL", | 379 | (GNUNET_OK == full_lp_res) ? "OK" : "FAIL", |
358 | (GNUNET_OK == mlp->ps.mip_res) ? "OK" : "FAIL", | 380 | (GNUNET_OK == full_mip_res) ? "OK" : "FAIL", |
359 | (GLP_YES == mlp->ps.lp_presolv) ? "YES" : "NO", | 381 | (GLP_YES == full_lp_presolv) ? "YES" : "NO", |
360 | (GNUNET_OK == mlp->ps.mip_presolv) ? "YES" : "NO", | 382 | (GNUNET_OK == full_mip_presolv) ? "YES" : "NO", |
361 | (unsigned long long) mlp->ps.build_dur.rel_value, | 383 | (unsigned long long) full_build_dur.rel_value, (unsigned long long) full_lp_dur.rel_value, (unsigned long long) full_mip_dur.rel_value); |
362 | (unsigned long long) mlp->ps.lp_dur.rel_value, | 384 | if ((0 < opt_update_quantity) || (0 < opt_update_percent)) |
363 | (unsigned long long) mlp->ps.mip_dur.rel_value, | 385 | fprintf (stderr, "Update;%u;%u;%s;%s;%s;%s;%04llu;%04llu;%04llu\n", |
364 | mlp->ps.p_cols, mlp->ps.p_rows, mlp->ps.p_elements); | 386 | cp + 1, ca, |
387 | (GNUNET_OK == update_lp_res) ? "OK" : "FAIL", | ||
388 | (GNUNET_OK == update_mip_res) ? "OK" : "FAIL", | ||
389 | (GLP_YES == update_lp_presolv) ? "YES" : "NO", | ||
390 | (GNUNET_OK == update_mip_presolv) ? "YES" : "NO", | ||
391 | (unsigned long long) update_build_dur.rel_value, (unsigned long long) update_lp_dur.rel_value, (unsigned long long) update_mip_dur.rel_value); | ||
365 | } | 392 | } |
366 | fprintf (stderr, "\n"); | ||
367 | } | 393 | } |
368 | } | 394 | } |
369 | 395 | ||
@@ -428,7 +454,7 @@ main (int argc, char *argv[]) | |||
428 | N_address = atoi(argv[c+1]); | 454 | N_address = atoi(argv[c+1]); |
429 | } | 455 | } |
430 | } | 456 | } |
431 | if ((0 == strcmp (argv[c], "-v"))) | 457 | if ((0 == strcmp (argv[c], "-n"))) |
432 | { | 458 | { |
433 | opt_numeric = GNUNET_YES; | 459 | opt_numeric = GNUNET_YES; |
434 | } | 460 | } |