diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-10-31 09:40:24 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-10-31 09:40:24 +0000 |
commit | ecb3d401547e9db3fabe6762ef7bf1c6f4ac8a3f (patch) | |
tree | 395a97d63de490d9eda4bfe24e42f7a8a0005fbc | |
parent | 6040d3ae4058fb87a8ffc62c9be9a60e1eefb15f (diff) | |
download | gnunet-ecb3d401547e9db3fabe6762ef7bf1c6f4ac8a3f.tar.gz gnunet-ecb3d401547e9db3fabe6762ef7bf1c6f4ac8a3f.zip |
writing data files
-rw-r--r-- | src/ats/perf_ats_solver.c | 316 |
1 files changed, 189 insertions, 127 deletions
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c index 3be4c9775..845326bcd 100644 --- a/src/ats/perf_ats_solver.c +++ b/src/ats/perf_ats_solver.c | |||
@@ -382,132 +382,130 @@ solver_info_cb (void *cls, enum GAS_Solver_Operation op, | |||
382 | struct Result *tmp; | 382 | struct Result *tmp; |
383 | switch (op) | 383 | switch (op) |
384 | { | 384 | { |
385 | 385 | case GAS_OP_SOLVE_START: | |
386 | case GAS_OP_SOLVE_START: | 386 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, |
387 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | 387 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_START", |
388 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_START", | 388 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); |
389 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | 389 | if (GNUNET_NO == ph.expecting_solution) |
390 | if (GNUNET_NO == ph.expecting_solution) | 390 | { |
391 | { | 391 | /* We do not expect a solution at the moment */ |
392 | GNUNET_break(0); | 392 | GNUNET_break (0); |
393 | return; | ||
394 | } | ||
395 | if ((GAS_STAT_SUCCESS == stat) && (NULL == ph.current_result)) | ||
396 | { | ||
397 | /* Create new result */ | ||
398 | tmp = GNUNET_malloc (sizeof (struct Result)); | ||
399 | ph.current_result = tmp; | ||
400 | GNUNET_CONTAINER_DLL_insert_tail(ph.head, ph.tail, tmp); | ||
401 | ph.current_result->addresses = ph.current_a; | ||
402 | ph.current_result->peers = ph.current_p; | ||
403 | ph.current_result->s_total = GNUNET_TIME_absolute_get (); | ||
404 | ph.current_result->d_total = GNUNET_TIME_relative_get_forever_ (); | ||
405 | ph.current_result->d_setup = GNUNET_TIME_relative_get_forever_ (); | ||
406 | ph.current_result->d_lp = GNUNET_TIME_relative_get_forever_ (); | ||
407 | ph.current_result->d_mlp = GNUNET_TIME_relative_get_forever_ (); | ||
408 | } | ||
393 | return; | 409 | return; |
394 | } | 410 | case GAS_OP_SOLVE_STOP: |
395 | if ((GAS_STAT_SUCCESS == stat) && (NULL == ph.current_result)) | 411 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, |
396 | { | 412 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_STOP", |
397 | /* Create new result */ | 413 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); |
398 | tmp = GNUNET_malloc (sizeof (struct Result)); | 414 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) |
399 | ph.current_result = tmp; | 415 | { |
400 | GNUNET_CONTAINER_DLL_insert_tail(ph.head, ph.tail, tmp); | 416 | /* We do not expect a solution at the moment */ |
401 | ph.current_result->addresses = ph.current_a; | 417 | GNUNET_break (0); |
402 | ph.current_result->peers = ph.current_p; | 418 | return; |
403 | ph.current_result->s_total = GNUNET_TIME_absolute_get (); | 419 | } |
404 | ph.current_result->d_total = GNUNET_TIME_relative_get_forever_ (); | 420 | if (NULL != ph.current_result) |
405 | ph.current_result->d_setup = GNUNET_TIME_relative_get_forever_ (); | 421 | { |
406 | ph.current_result->d_lp = GNUNET_TIME_relative_get_forever_ (); | 422 | /* Finalize result */ |
407 | ph.current_result->d_mlp = GNUNET_TIME_relative_get_forever_ (); | 423 | ph.current_result->e_total = GNUNET_TIME_absolute_get (); |
408 | } | 424 | ph.current_result->d_total = GNUNET_TIME_absolute_get_difference ( |
409 | 425 | ph.current_result->s_total, ph.current_result->e_total); | |
410 | break; | 426 | } |
411 | 427 | ph.current_result = NULL; | |
412 | case GAS_OP_SOLVE_STOP: | ||
413 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | ||
414 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_STOP", | ||
415 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | ||
416 | |||
417 | if (NULL != ph.current_result) | ||
418 | { | ||
419 | /* Finalize result */ | ||
420 | ph.current_result->e_total = GNUNET_TIME_absolute_get (); | ||
421 | ph.current_result->d_total = GNUNET_TIME_absolute_get_difference ( | ||
422 | ph.current_result->s_total, ph.current_result->e_total); | ||
423 | } | ||
424 | ph.current_result = NULL; | ||
425 | break; | ||
426 | |||
427 | case GAS_OP_SOLVE_SETUP_START: | ||
428 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | ||
429 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_SETUP_START", | ||
430 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | ||
431 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) | ||
432 | { | ||
433 | GNUNET_break(0); | ||
434 | return; | 428 | return; |
435 | } | ||
436 | ph.current_result->s_setup = GNUNET_TIME_absolute_get (); | ||
437 | break; | ||
438 | |||
439 | case GAS_OP_SOLVE_SETUP_STOP: | ||
440 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | ||
441 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_SETUP_STOP", | ||
442 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | ||
443 | 429 | ||
444 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) | 430 | case GAS_OP_SOLVE_SETUP_START: |
445 | { | 431 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, |
446 | GNUNET_break(0); | 432 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_SETUP_START", |
433 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | ||
434 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) | ||
435 | { | ||
436 | GNUNET_break(0); | ||
437 | return; | ||
438 | } | ||
439 | ph.current_result->s_setup = GNUNET_TIME_absolute_get (); | ||
447 | return; | 440 | return; |
448 | } | ||
449 | ph.current_result->e_setup = GNUNET_TIME_absolute_get (); | ||
450 | ph.current_result->d_setup = GNUNET_TIME_absolute_get_difference ( | ||
451 | ph.current_result->s_setup, ph.current_result->e_setup); | ||
452 | break; | ||
453 | |||
454 | case GAS_OP_SOLVE_LP_START: | ||
455 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | ||
456 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_LP_START", | ||
457 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | ||
458 | 441 | ||
459 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) | 442 | case GAS_OP_SOLVE_SETUP_STOP: |
460 | { | 443 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, |
461 | GNUNET_break(0); | 444 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_SETUP_STOP", |
445 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | ||
446 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) | ||
447 | { | ||
448 | GNUNET_break(0); | ||
449 | return; | ||
450 | } | ||
451 | ph.current_result->e_setup = GNUNET_TIME_absolute_get (); | ||
452 | ph.current_result->d_setup = GNUNET_TIME_absolute_get_difference ( | ||
453 | ph.current_result->s_setup, ph.current_result->e_setup); | ||
462 | return; | 454 | return; |
463 | } | ||
464 | ph.current_result->s_lp = GNUNET_TIME_absolute_get (); | ||
465 | break; | ||
466 | 455 | ||
467 | case GAS_OP_SOLVE_LP_STOP: | 456 | case GAS_OP_SOLVE_LP_START: |
468 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | 457 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, |
469 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_LP_STOP", | 458 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_LP_START", |
470 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | 459 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); |
471 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) | 460 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) |
472 | { | 461 | { |
473 | GNUNET_break(0); | 462 | GNUNET_break(0); |
463 | return; | ||
464 | } | ||
465 | ph.current_result->s_lp = GNUNET_TIME_absolute_get (); | ||
474 | return; | 466 | return; |
475 | } | 467 | case GAS_OP_SOLVE_LP_STOP: |
476 | ph.current_result->e_lp = GNUNET_TIME_absolute_get (); | 468 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, |
477 | ph.current_result->d_lp = GNUNET_TIME_absolute_get_difference ( | 469 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_LP_STOP", |
478 | ph.current_result->s_lp, ph.current_result->e_lp); | 470 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); |
479 | break; | 471 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) |
480 | 472 | { | |
481 | break; | 473 | GNUNET_break(0); |
482 | 474 | return; | |
483 | case GAS_OP_SOLVE_MLP_START: | 475 | } |
484 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | 476 | ph.current_result->e_lp = GNUNET_TIME_absolute_get (); |
485 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_MLP_START", | 477 | ph.current_result->d_lp = GNUNET_TIME_absolute_get_difference ( |
486 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | 478 | ph.current_result->s_lp, ph.current_result->e_lp); |
487 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) | ||
488 | { | ||
489 | GNUNET_break(0); | ||
490 | return; | 479 | return; |
491 | } | ||
492 | ph.current_result->s_mlp = GNUNET_TIME_absolute_get (); | ||
493 | break; | ||
494 | 480 | ||
495 | case GAS_OP_SOLVE_MLP_STOP: | 481 | case GAS_OP_SOLVE_MLP_START: |
496 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | 482 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, |
497 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_MLP_STOP", | 483 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_MLP_START", |
498 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | 484 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); |
499 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) | 485 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) |
500 | { | 486 | { |
501 | GNUNET_break(0); | 487 | GNUNET_break(0); |
488 | return; | ||
489 | } | ||
490 | ph.current_result->s_mlp = GNUNET_TIME_absolute_get (); | ||
502 | return; | 491 | return; |
492 | case GAS_OP_SOLVE_MLP_STOP: | ||
493 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | ||
494 | "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_MLP_STOP", | ||
495 | (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); | ||
496 | if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) | ||
497 | { | ||
498 | GNUNET_break(0); | ||
499 | return; | ||
500 | } | ||
501 | ph.current_result->e_mlp = GNUNET_TIME_absolute_get (); | ||
502 | ph.current_result->d_mlp = GNUNET_TIME_absolute_get_difference ( | ||
503 | ph.current_result->s_mlp, ph.current_result->e_mlp); | ||
504 | return; | ||
505 | |||
506 | default: | ||
507 | break; | ||
503 | } | 508 | } |
504 | ph.current_result->e_mlp = GNUNET_TIME_absolute_get (); | ||
505 | ph.current_result->d_mlp = GNUNET_TIME_absolute_get_difference ( | ||
506 | ph.current_result->s_mlp, ph.current_result->e_mlp); | ||
507 | break; | ||
508 | default: | ||
509 | break; | ||
510 | } | ||
511 | } | 509 | } |
512 | 510 | ||
513 | static void | 511 | static void |
@@ -557,16 +555,16 @@ write_gnuplot_script () | |||
557 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn); | 555 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to plot file `%s'\n", gfn); |
558 | #if 0 | 556 | #if 0 |
559 | cur = ph.head->d_total; | 557 | cur = ph.head->d_total; |
560 | if (cur->d_total != GNUNET_TIME_relative_get_forever_().rel_value_us) | 558 | if (cur->d_total != GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
561 | plot_d_total = GNUNET_YES; | 559 | plot_d_total = GNUNET_YES; |
562 | 560 | ||
563 | if (cur->d_total != GNUNET_TIME_relative_get_forever_().rel_value_us) | 561 | if (cur->d_total != GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
564 | plot_d_total = GNUNET_YES; | 562 | plot_d_total = GNUNET_YES; |
565 | if (cur->d_setup != GNUNET_TIME_relative_get_forever_().rel_value_us) | 563 | if (cur->d_setup != GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
566 | plot_d_setup = GNUNET_YES; | 564 | plot_d_setup = GNUNET_YES; |
567 | if (cur->d_lp != GNUNET_TIME_relative_get_forever_().rel_value_us) | 565 | if (cur->d_lp != GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
568 | plot_d_lp = GNUNET_YES; | 566 | plot_d_lp = GNUNET_YES; |
569 | if (cur->d_mlp != GNUNET_TIME_relative_get_forever_().rel_value_us) | 567 | if (cur->d_mlp != GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) |
570 | plot_d_mlp = GNUNET_YES; | 568 | plot_d_mlp = GNUNET_YES; |
571 | 569 | ||
572 | 570 | ||
@@ -614,11 +612,32 @@ write_gnuplot_script () | |||
614 | static void | 612 | static void |
615 | evaluate () | 613 | evaluate () |
616 | { | 614 | { |
615 | struct GNUNET_DISK_FileHandle *f; | ||
616 | char * data_fn; | ||
617 | char * data; | ||
617 | struct Result *cur; | 618 | struct Result *cur; |
618 | struct Result *next; | 619 | struct Result *next; |
620 | char * str_d_total; | ||
621 | char * str_d_setup; | ||
622 | char * str_d_lp; | ||
623 | char * str_d_mlp; | ||
619 | 624 | ||
620 | if (ph.create_plot) | 625 | if (ph.create_plot) |
621 | { | 626 | { |
627 | GNUNET_asprintf (&data_fn, "perf_%s_%u_%u_%u_data", ph.ats_string, ph.N_peers_start, ph.N_peers_end, ph.N_address); | ||
628 | f = GNUNET_DISK_file_open (data_fn, | ||
629 | GNUNET_DISK_OPEN_WRITE | GNUNET_DISK_OPEN_CREATE, | ||
630 | GNUNET_DISK_PERM_USER_EXEC | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); | ||
631 | if (NULL == f) | ||
632 | { | ||
633 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot open gnuplot file `%s'\n", data_fn); | ||
634 | GNUNET_free (data_fn); | ||
635 | return; | ||
636 | } | ||
637 | data = "#peers;addresses;time total in us;#time setup in us;#time lp in us;#time mlp in us;\n"; | ||
638 | if (GNUNET_SYSERR == GNUNET_DISK_file_write(f, data, strlen(data))) | ||
639 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to log file `%s'\n", data_fn); | ||
640 | |||
622 | write_gnuplot_script (); | 641 | write_gnuplot_script (); |
623 | } | 642 | } |
624 | 643 | ||
@@ -627,30 +646,73 @@ evaluate () | |||
627 | { | 646 | { |
628 | next = cur->next; | 647 | next = cur->next; |
629 | 648 | ||
630 | if (GNUNET_TIME_relative_get_forever_().rel_value_us != cur->d_total.rel_value_us) | 649 | /* Print log */ |
650 | if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_total.rel_value_us) | ||
631 | { | 651 | { |
632 | fprintf (stderr, "Total time to solve for %u peers %u addresses: %llu us\n", | 652 | fprintf (stderr, "Total time to solve for %u peers %u addresses: %llu us\n", |
633 | cur->peers, cur->addresses, (unsigned long long )cur->d_total.rel_value_us); | 653 | cur->peers, cur->addresses, (unsigned long long )cur->d_total.rel_value_us); |
654 | GNUNET_asprintf(&str_d_total, "%llu", (unsigned long long )cur->d_total.rel_value_us); | ||
634 | } | 655 | } |
635 | if (GNUNET_TIME_relative_get_forever_().rel_value_us != cur->d_setup.rel_value_us) | 656 | else |
657 | GNUNET_asprintf(&str_d_total, "-1"); | ||
658 | if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_setup.rel_value_us) | ||
636 | { | 659 | { |
637 | fprintf (stderr, "Total time to setup %u peers %u addresses: %llu us\n", | 660 | fprintf (stderr, "Total time to setup %u peers %u addresses: %llu us\n", |
638 | cur->peers, cur->addresses, (unsigned long long )cur->d_setup.rel_value_us); | 661 | cur->peers, cur->addresses, (unsigned long long )cur->d_setup.rel_value_us); |
662 | GNUNET_asprintf(&str_d_setup, "%llu", (unsigned long long )cur->d_setup.rel_value_us); | ||
639 | } | 663 | } |
640 | if (GNUNET_TIME_relative_get_forever_().rel_value_us != cur->d_lp.rel_value_us) | 664 | else |
665 | GNUNET_asprintf(&str_d_setup, "-1"); | ||
666 | if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_lp.rel_value_us) | ||
641 | { | 667 | { |
642 | fprintf (stderr, "Total time to solve LP for %u peers %u addresses: %llu us\n", | 668 | fprintf (stderr, "Total time to solve LP for %u peers %u addresses: %llu us\n", |
643 | cur->peers, cur->addresses, (unsigned long long )cur->d_mlp.rel_value_us); | 669 | cur->peers, cur->addresses, (unsigned long long )cur->d_lp.rel_value_us); |
670 | GNUNET_asprintf(&str_d_lp, "%llu", (unsigned long long )cur->d_lp.rel_value_us); | ||
644 | } | 671 | } |
645 | if (GNUNET_TIME_relative_get_forever_().rel_value_us != cur->d_mlp.rel_value_us) | 672 | else |
673 | GNUNET_asprintf(&str_d_lp, "-1"); | ||
674 | if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_mlp.rel_value_us) | ||
646 | { | 675 | { |
647 | fprintf (stderr, "Total time to solve MLP for %u peers %u addresses: %llu us\n", | 676 | fprintf (stderr, "Total time to solve MLP for %u peers %u addresses: %llu us\n", |
648 | cur->peers, cur->addresses, (unsigned long long )cur->d_lp.rel_value_us); | 677 | cur->peers, cur->addresses, (unsigned long long )cur->d_mlp.rel_value_us); |
678 | GNUNET_asprintf(&str_d_mlp, "%llu", (unsigned long long )cur->d_mlp.rel_value_us); | ||
679 | } | ||
680 | else | ||
681 | GNUNET_asprintf(&str_d_mlp, "-1"); | ||
682 | |||
683 | if (GNUNET_YES == ph.create_plot) | ||
684 | { | ||
685 | |||
686 | GNUNET_asprintf(&data,"%u;%u;%s;%s;%s;%s\n", | ||
687 | cur->peers, cur->addresses, | ||
688 | str_d_total, | ||
689 | str_d_setup, | ||
690 | str_d_lp, | ||
691 | str_d_mlp); | ||
692 | |||
693 | if (GNUNET_SYSERR == GNUNET_DISK_file_write(f, data, strlen(data))) | ||
694 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to log file `%s'\n", data_fn); | ||
695 | GNUNET_free (str_d_total); | ||
696 | GNUNET_free (str_d_setup); | ||
697 | GNUNET_free (str_d_lp); | ||
698 | GNUNET_free (str_d_mlp); | ||
699 | GNUNET_free (data); | ||
700 | |||
649 | } | 701 | } |
650 | 702 | ||
651 | GNUNET_CONTAINER_DLL_remove (ph.head, ph.tail, cur); | 703 | GNUNET_CONTAINER_DLL_remove (ph.head, ph.tail, cur); |
652 | GNUNET_free (cur); | 704 | GNUNET_free (cur); |
653 | } | 705 | } |
706 | |||
707 | if (GNUNET_YES == ph.create_plot) | ||
708 | { | ||
709 | if (GNUNET_SYSERR == GNUNET_DISK_file_close(f)) | ||
710 | { | ||
711 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot close log file `%s'\n", data_fn); | ||
712 | GNUNET_free (data_fn); | ||
713 | } | ||
714 | |||
715 | } | ||
654 | } | 716 | } |
655 | 717 | ||
656 | static void | 718 | static void |
@@ -678,11 +740,13 @@ perf_run () | |||
678 | 740 | ||
679 | for (cp = 0; cp < count_p; cp++) | 741 | for (cp = 0; cp < count_p; cp++) |
680 | { | 742 | { |
743 | ph.current_p = cp + 1; | ||
681 | for (ca = 0; ca < count_a; ca++) | 744 | for (ca = 0; ca < count_a; ca++) |
682 | { | 745 | { |
683 | cur_addr = perf_create_address (cp, ca); | 746 | cur_addr = perf_create_address (cp, ca); |
684 | /* Add address */ | 747 | /* Add address */ |
685 | ph.env.sf.s_add (ph.solver, cur_addr, GNUNET_ATS_NET_LAN); | 748 | ph.env.sf.s_add (ph.solver, cur_addr, GNUNET_ATS_NET_LAN); |
749 | ph.current_a = ca + 1; | ||
686 | perf_address_initial_update (ph.solver, ph.addresses, cur_addr); | 750 | perf_address_initial_update (ph.solver, ph.addresses, cur_addr); |
687 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, | 751 | GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, |
688 | "Adding address for peer %u address %u\n", cp, ca); | 752 | "Adding address for peer %u address %u\n", cp, ca); |
@@ -697,8 +761,6 @@ perf_run () | |||
697 | { | 761 | { |
698 | ph.bulk_running = GNUNET_NO; | 762 | ph.bulk_running = GNUNET_NO; |
699 | ph.expecting_solution = GNUNET_YES; | 763 | ph.expecting_solution = GNUNET_YES; |
700 | ph.current_p = cp + 1; | ||
701 | ph.current_a = ca; | ||
702 | ph.env.sf.s_bulk_stop (ph.solver); | 764 | ph.env.sf.s_bulk_stop (ph.solver); |
703 | } | 765 | } |
704 | else | 766 | else |