aboutsummaryrefslogtreecommitdiff
path: root/src/ats/perf_ats_solver.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-01-27 16:41:08 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-01-27 16:41:08 +0000
commitec74d01c6063f839e8b75eb02dbf5a6159783792 (patch)
tree0143ea178c3d5fbb67a40bbcbabea3bf02a39f87 /src/ats/perf_ats_solver.c
parentf23d6e3aa72999d08f4660c5ab3bbe1cc2d242c1 (diff)
downloadgnunet-ec74d01c6063f839e8b75eb02dbf5a6159783792.tar.gz
gnunet-ec74d01c6063f839e8b75eb02dbf5a6159783792.zip
separate update and full results
Diffstat (limited to 'src/ats/perf_ats_solver.c')
-rw-r--r--src/ats/perf_ats_solver.c193
1 files changed, 144 insertions, 49 deletions
diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c
index 8d8b07739..7440f6ec3 100644
--- a/src/ats/perf_ats_solver.c
+++ b/src/ats/perf_ats_solver.c
@@ -118,8 +118,13 @@ struct PerfHandle
118 /** 118 /**
119 * Array to store averaged result with length #peers 119 * Array to store averaged result with length #peers
120 */ 120 */
121 struct Result *averaged_result; 121 struct Result *averaged_full_result;
122 122
123 struct Result *averaged_update_result;
124
125 /**
126 * The current result
127 */
123 struct Result *current_result; 128 struct Result *current_result;
124 129
125 int current_p; 130 int current_p;
@@ -201,6 +206,7 @@ struct Result
201 int peers; 206 int peers;
202 int addresses; 207 int addresses;
203 int update; 208 int update;
209 int valid;
204 210
205 enum GAS_Solver_Additional_Information info; 211 enum GAS_Solver_Additional_Information info;
206 212
@@ -467,9 +473,9 @@ solver_info_cb (void *cls,
467 switch (op) 473 switch (op)
468 { 474 {
469 case GAS_OP_SOLVE_START: 475 case GAS_OP_SOLVE_START:
470 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 476 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
471 "Solver notifies `%s' with result `%s' `%s' in iteration %u \n", "GAS_OP_SOLVE_START", 477 "Solver notifies `%s' with result `%s' `%s'\n", "GAS_OP_SOLVE_START",
472 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL", add_info, ph.current_iteration); 478 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL", add_info);
473 if (GNUNET_NO == ph.expecting_solution) 479 if (GNUNET_NO == ph.expecting_solution)
474 { 480 {
475 /* We do not expect a solution at the moment */ 481 /* We do not expect a solution at the moment */
@@ -499,7 +505,7 @@ solver_info_cb (void *cls,
499 } 505 }
500 return; 506 return;
501 case GAS_OP_SOLVE_STOP: 507 case GAS_OP_SOLVE_STOP:
502 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 508 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
503 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_STOP", 509 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_STOP",
504 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL", add_info); 510 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL", add_info);
505 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) 511 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result))
@@ -508,6 +514,12 @@ solver_info_cb (void *cls,
508 GNUNET_break (0); 514 GNUNET_break (0);
509 return; 515 return;
510 } 516 }
517
518 if (GAS_STAT_SUCCESS == stat)
519 ph.current_result->valid = GNUNET_YES;
520 else
521 ph.current_result->valid = GNUNET_NO;
522
511 if (NULL != ph.current_result) 523 if (NULL != ph.current_result)
512 { 524 {
513 /* Finalize result */ 525 /* Finalize result */
@@ -519,7 +531,7 @@ solver_info_cb (void *cls,
519 return; 531 return;
520 532
521 case GAS_OP_SOLVE_SETUP_START: 533 case GAS_OP_SOLVE_SETUP_START:
522 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 534 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
523 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_SETUP_START", 535 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_SETUP_START",
524 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); 536 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL");
525 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) 537 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result))
@@ -527,11 +539,17 @@ solver_info_cb (void *cls,
527 GNUNET_break(0); 539 GNUNET_break(0);
528 return; 540 return;
529 } 541 }
542
543 if (GAS_STAT_SUCCESS == stat)
544 ph.current_result->valid = GNUNET_YES;
545 else
546 ph.current_result->valid = GNUNET_NO;
547
530 ph.current_result->s_setup = GNUNET_TIME_absolute_get (); 548 ph.current_result->s_setup = GNUNET_TIME_absolute_get ();
531 return; 549 return;
532 550
533 case GAS_OP_SOLVE_SETUP_STOP: 551 case GAS_OP_SOLVE_SETUP_STOP:
534 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 552 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
535 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_SETUP_STOP", 553 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_SETUP_STOP",
536 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); 554 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL");
537 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) 555 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result))
@@ -539,13 +557,19 @@ solver_info_cb (void *cls,
539 GNUNET_break(0); 557 GNUNET_break(0);
540 return; 558 return;
541 } 559 }
560
561 if (GAS_STAT_SUCCESS == stat)
562 ph.current_result->valid = GNUNET_YES;
563 else
564 ph.current_result->valid = GNUNET_NO;
565
542 ph.current_result->e_setup = GNUNET_TIME_absolute_get (); 566 ph.current_result->e_setup = GNUNET_TIME_absolute_get ();
543 ph.current_result->d_setup = GNUNET_TIME_absolute_get_difference ( 567 ph.current_result->d_setup = GNUNET_TIME_absolute_get_difference (
544 ph.current_result->s_setup, ph.current_result->e_setup); 568 ph.current_result->s_setup, ph.current_result->e_setup);
545 return; 569 return;
546 570
547 case GAS_OP_SOLVE_MLP_LP_START: 571 case GAS_OP_SOLVE_MLP_LP_START:
548 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 572 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
549 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_LP_START", 573 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_LP_START",
550 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); 574 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL");
551 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) 575 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result))
@@ -553,10 +577,16 @@ solver_info_cb (void *cls,
553 GNUNET_break(0); 577 GNUNET_break(0);
554 return; 578 return;
555 } 579 }
580
581 if (GAS_STAT_SUCCESS == stat)
582 ph.current_result->valid = GNUNET_YES;
583 else
584 ph.current_result->valid = GNUNET_NO;
585
556 ph.current_result->s_lp = GNUNET_TIME_absolute_get (); 586 ph.current_result->s_lp = GNUNET_TIME_absolute_get ();
557 return; 587 return;
558 case GAS_OP_SOLVE_MLP_LP_STOP: 588 case GAS_OP_SOLVE_MLP_LP_STOP:
559 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 589 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
560 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_LP_STOP", 590 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_LP_STOP",
561 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); 591 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL");
562 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) 592 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result))
@@ -564,13 +594,19 @@ solver_info_cb (void *cls,
564 GNUNET_break(0); 594 GNUNET_break(0);
565 return; 595 return;
566 } 596 }
597
598 if (GAS_STAT_SUCCESS == stat)
599 ph.current_result->valid = GNUNET_YES;
600 else
601 ph.current_result->valid = GNUNET_NO;
602
567 ph.current_result->e_lp = GNUNET_TIME_absolute_get (); 603 ph.current_result->e_lp = GNUNET_TIME_absolute_get ();
568 ph.current_result->d_lp = GNUNET_TIME_absolute_get_difference ( 604 ph.current_result->d_lp = GNUNET_TIME_absolute_get_difference (
569 ph.current_result->s_lp, ph.current_result->e_lp); 605 ph.current_result->s_lp, ph.current_result->e_lp);
570 return; 606 return;
571 607
572 case GAS_OP_SOLVE_MLP_MLP_START: 608 case GAS_OP_SOLVE_MLP_MLP_START:
573 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 609 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
574 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_MLP_START", 610 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_MLP_START",
575 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); 611 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL");
576 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) 612 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result))
@@ -578,10 +614,16 @@ solver_info_cb (void *cls,
578 GNUNET_break(0); 614 GNUNET_break(0);
579 return; 615 return;
580 } 616 }
617
618 if (GAS_STAT_SUCCESS == stat)
619 ph.current_result->valid = GNUNET_YES;
620 else
621 ph.current_result->valid = GNUNET_NO;
622
581 ph.current_result->s_mlp = GNUNET_TIME_absolute_get (); 623 ph.current_result->s_mlp = GNUNET_TIME_absolute_get ();
582 return; 624 return;
583 case GAS_OP_SOLVE_MLP_MLP_STOP: 625 case GAS_OP_SOLVE_MLP_MLP_STOP:
584 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 626 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
585 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_MLP_STOP", 627 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_MLP_STOP",
586 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); 628 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL");
587 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result)) 629 if ((GNUNET_NO == ph.expecting_solution) || (NULL == ph.current_result))
@@ -589,19 +631,32 @@ solver_info_cb (void *cls,
589 GNUNET_break(0); 631 GNUNET_break(0);
590 return; 632 return;
591 } 633 }
634
635 if (GAS_STAT_SUCCESS == stat)
636 ph.current_result->valid = GNUNET_YES;
637 else
638 ph.current_result->valid = GNUNET_NO;
639
592 ph.current_result->e_mlp = GNUNET_TIME_absolute_get (); 640 ph.current_result->e_mlp = GNUNET_TIME_absolute_get ();
593 ph.current_result->d_mlp = GNUNET_TIME_absolute_get_difference ( 641 ph.current_result->d_mlp = GNUNET_TIME_absolute_get_difference (
594 ph.current_result->s_mlp, ph.current_result->e_mlp); 642 ph.current_result->s_mlp, ph.current_result->e_mlp);
595 return; 643 return;
596 case GAS_OP_SOLVE_UPDATE_NOTIFICATION_START: 644 case GAS_OP_SOLVE_UPDATE_NOTIFICATION_START:
597 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 645 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
598 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_UPDATE_NOTIFICATION_START", 646 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_UPDATE_NOTIFICATION_START",
599 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); 647 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL");
600 return; 648 return;
601 case GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP: 649 case GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP:
602 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 650 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
603 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP", 651 "Solver notifies `%s' with result `%s'\n", "GAS_OP_SOLVE_UPDATE_NOTIFICATION_STOP",
604 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL"); 652 (GAS_STAT_SUCCESS == stat) ? "SUCCESS" : "FAIL");
653 if (GAS_STAT_SUCCESS != stat)
654 {
655 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
656 "Solver `%s' failed to update problem with %u peers and %u address!\n",
657 ph.ats_string, ph.current_p, ph.current_a);
658 }
659
605 return; 660 return;
606 default: 661 default:
607 break; 662 break;
@@ -740,6 +795,7 @@ evaluate (int iteration)
740 char * data; 795 char * data;
741 struct Result *cur; 796 struct Result *cur;
742 struct Result *next; 797 struct Result *next;
798 struct Result *cur_res;
743 char * str_d_total; 799 char * str_d_total;
744 char * str_d_setup; 800 char * str_d_setup;
745 char * str_d_lp; 801 char * str_d_lp;
@@ -829,15 +885,32 @@ evaluate (int iteration)
829 str_d_mlp = NULL; 885 str_d_mlp = NULL;
830 886
831 /* Print log */ 887 /* Print log */
832 ph.averaged_result[cur->peers - ph.N_peers_start].peers = cur->peers; 888 if (GNUNET_NO == cur->update)
833 ph.averaged_result[cur->peers - ph.N_peers_start].addresses = cur->addresses; 889 cur_res = &ph.averaged_full_result[cur->peers - ph.N_peers_start];
834 ph.averaged_result[cur->peers - ph.N_peers_start].update = cur->update; 890 else
891 cur_res = &ph.averaged_update_result[cur->peers - ph.N_peers_start];
892
893 cur_res->peers = cur->peers;
894 cur_res->addresses = cur->addresses;
895 cur_res->update = cur->update;
896
897 if (GNUNET_NO == cur->valid)
898 {
899 fprintf (stderr,
900 "Total time to solve %s for %u peers %u addresses: %s\n",
901 (GNUNET_YES == cur->update) ? "updated" : "full",
902 cur->peers, cur->addresses, "Failed to solve!");
903 continue;
904 }
905 else
906 cur_res->valid ++;
835 907
836 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_total.rel_value_us) 908 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_total.rel_value_us)
837 { 909 {
838 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == ph.averaged_result[cur->peers - ph.N_peers_start].d_total.rel_value_us) 910 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == cur_res->d_total.rel_value_us)
839 ph.averaged_result[cur->peers - ph.N_peers_start].d_total.rel_value_us = 0; 911 cur_res->d_total.rel_value_us = 0;
840 ph.averaged_result[cur->peers - ph.N_peers_start].d_total.rel_value_us += cur->d_total.rel_value_us; 912 if (GNUNET_YES == cur->valid)
913 cur_res->d_total.rel_value_us += cur->d_total.rel_value_us;
841 fprintf (stderr, 914 fprintf (stderr,
842 "Total time to solve %s for %u peers %u addresses: %llu us\n", 915 "Total time to solve %s for %u peers %u addresses: %llu us\n",
843 (GNUNET_YES == cur->update) ? "updated" : "full", 916 (GNUNET_YES == cur->update) ? "updated" : "full",
@@ -850,9 +923,10 @@ evaluate (int iteration)
850 GNUNET_asprintf(&str_d_total, "-1"); 923 GNUNET_asprintf(&str_d_total, "-1");
851 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_setup.rel_value_us) 924 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_setup.rel_value_us)
852 { 925 {
853 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == ph.averaged_result[cur->peers - ph.N_peers_start].d_setup.rel_value_us) 926 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == cur_res->d_setup.rel_value_us)
854 ph.averaged_result[cur->peers - ph.N_peers_start].d_setup.rel_value_us = 0; 927 cur_res->d_setup.rel_value_us = 0;
855 ph.averaged_result[cur->peers - ph.N_peers_start].d_setup.rel_value_us += cur->d_setup.rel_value_us; 928 if (GNUNET_YES == cur->valid)
929 cur_res->d_setup.rel_value_us += cur->d_setup.rel_value_us;
856 fprintf (stderr, "Total time to setup %s %u peers %u addresses: %llu us\n", 930 fprintf (stderr, "Total time to setup %s %u peers %u addresses: %llu us\n",
857 (GNUNET_YES == cur->update) ? "updated" : "full", 931 (GNUNET_YES == cur->update) ? "updated" : "full",
858 cur->peers, cur->addresses, (unsigned long long )cur->d_setup.rel_value_us); 932 cur->peers, cur->addresses, (unsigned long long )cur->d_setup.rel_value_us);
@@ -862,9 +936,10 @@ evaluate (int iteration)
862 GNUNET_asprintf(&str_d_setup, "-1"); 936 GNUNET_asprintf(&str_d_setup, "-1");
863 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_lp.rel_value_us) 937 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_lp.rel_value_us)
864 { 938 {
865 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == ph.averaged_result[cur->peers - ph.N_peers_start].d_lp.rel_value_us) 939 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == cur_res->d_lp.rel_value_us)
866 ph.averaged_result[cur->peers - ph.N_peers_start].d_lp.rel_value_us = 0; 940 cur_res->d_lp.rel_value_us = 0;
867 ph.averaged_result[cur->peers - ph.N_peers_start].d_lp.rel_value_us += cur->d_lp.rel_value_us; 941 if (GNUNET_YES == cur->valid)
942 cur_res->d_lp.rel_value_us += cur->d_lp.rel_value_us;
868 fprintf (stderr, 943 fprintf (stderr,
869 "Total time to solve %s LP for %u peers %u addresses: %llu us\n", 944 "Total time to solve %s LP for %u peers %u addresses: %llu us\n",
870 (GNUNET_YES == cur->update) ? "updated" : "full", 945 (GNUNET_YES == cur->update) ? "updated" : "full",
@@ -879,9 +954,11 @@ evaluate (int iteration)
879 GNUNET_asprintf (&str_d_lp, "-1"); 954 GNUNET_asprintf (&str_d_lp, "-1");
880 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_mlp.rel_value_us) 955 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_mlp.rel_value_us)
881 { 956 {
882 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == ph.averaged_result[cur->peers - ph.N_peers_start].d_mlp.rel_value_us) 957 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us == cur_res->d_mlp.rel_value_us)
883 ph.averaged_result[cur->peers - ph.N_peers_start].d_mlp.rel_value_us = 0; 958 cur_res->d_mlp.rel_value_us = 0;
884 ph.averaged_result[cur->peers - ph.N_peers_start].d_mlp.rel_value_us += cur->d_mlp.rel_value_us; 959 if (GNUNET_YES == cur->valid)
960 cur_res->d_mlp.rel_value_us += cur->d_mlp.rel_value_us;
961
885 fprintf (stderr, "Total time to solve %s MLP for %u peers %u addresses: %llu us\n", 962 fprintf (stderr, "Total time to solve %s MLP for %u peers %u addresses: %llu us\n",
886 (GNUNET_YES == cur->update) ? "updated" : "full", 963 (GNUNET_YES == cur->update) ? "updated" : "full",
887 cur->peers, cur->addresses, (unsigned long long )cur->d_mlp.rel_value_us); 964 cur->peers, cur->addresses, (unsigned long long )cur->d_mlp.rel_value_us);
@@ -1021,22 +1098,34 @@ evaluate_average (void)
1021 1098
1022 for (c = 0; c <= ph.N_peers_end - ph.N_peers_start; c++) 1099 for (c = 0; c <= ph.N_peers_end - ph.N_peers_start; c++)
1023 { 1100 {
1024 struct Result *cur = &ph.averaged_result[c]; 1101 struct Result *cur = &ph.averaged_full_result[c];
1025 1102
1026 str_d_total = NULL; 1103 str_d_total = NULL;
1027 str_d_setup = NULL; 1104 str_d_setup = NULL;
1028 str_d_lp = NULL; 1105 str_d_lp = NULL;
1029 str_d_mlp = NULL; 1106 str_d_mlp = NULL;
1030 1107
1108 if (0 >= cur->valid)
1109 {
1110 fprintf (stderr,
1111 "No valid results for %s for %u peers %u addresses!\n",
1112 (GNUNET_YES == cur->update) ? "updated" : "full",
1113 cur->peers, cur->addresses);
1114
1115 continue;
1116 }
1117
1118
1031 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_total.rel_value_us) 1119 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_total.rel_value_us)
1032 { 1120 {
1033 fprintf (stderr, 1121 fprintf (stderr,
1034 "Average total time to solve %s for %u peers %u addresses: %llu us\n", 1122 "Average total time from %u iterations to solve %s for %u peers %u addresses: %llu us\n",
1123 cur->valid,
1035 (GNUNET_YES == cur->update) ? "updated" : "full", 1124 (GNUNET_YES == cur->update) ? "updated" : "full",
1036 cur->peers, cur->addresses, 1125 cur->peers, cur->addresses,
1037 (unsigned long long) cur->d_total.rel_value_us / ph.iterations); 1126 (unsigned long long) cur->d_total.rel_value_us / cur->valid);
1038 GNUNET_asprintf(&str_d_total, "%llu", 1127 GNUNET_asprintf(&str_d_total, "%llu",
1039 (unsigned long long) cur->d_total.rel_value_us / ph.iterations); 1128 (unsigned long long) cur->d_total.rel_value_us / cur->valid);
1040 } 1129 }
1041 else 1130 else
1042 GNUNET_asprintf (&str_d_total, "-1"); 1131 GNUNET_asprintf (&str_d_total, "-1");
@@ -1044,11 +1133,11 @@ evaluate_average (void)
1044 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_setup.rel_value_us) 1133 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_setup.rel_value_us)
1045 { 1134 {
1046 fprintf (stderr, 1135 fprintf (stderr,
1047 "Average total time to setup for %u peers %u addresses: %llu us\n", 1136 "Average total time from %u iterations to setup for %u peers %u addresses: %llu us\n",
1048 cur->peers, cur->addresses, 1137 cur->valid, cur->peers, cur->addresses,
1049 (unsigned long long) cur->d_setup.rel_value_us / ph.iterations); 1138 (unsigned long long) cur->d_setup.rel_value_us / cur->valid);
1050 GNUNET_asprintf(&str_d_setup, "%llu", 1139 GNUNET_asprintf(&str_d_setup, "%llu",
1051 (unsigned long long) cur->d_setup.rel_value_us / ph.iterations); 1140 (unsigned long long) cur->d_setup.rel_value_us / cur->valid);
1052 1141
1053 } 1142 }
1054 else 1143 else
@@ -1057,10 +1146,11 @@ evaluate_average (void)
1057 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_lp.rel_value_us) 1146 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_lp.rel_value_us)
1058 { 1147 {
1059 fprintf (stderr, 1148 fprintf (stderr,
1060 "Average total time to solve lp %s for %u peers %u addresses: %llu us\n", 1149 "Average total time from %u iterations to solve lp %s for %u peers %u addresses: %llu us\n",
1150 cur->valid,
1061 (GNUNET_YES == cur->update) ? "updated" : "full", 1151 (GNUNET_YES == cur->update) ? "updated" : "full",
1062 cur->peers, cur->addresses, 1152 cur->peers, cur->addresses,
1063 (unsigned long long) cur->d_lp.rel_value_us / ph.iterations); 1153 (unsigned long long) cur->d_lp.rel_value_us / cur->valid);
1064 GNUNET_asprintf(&str_d_lp, "%llu", 1154 GNUNET_asprintf(&str_d_lp, "%llu",
1065 (unsigned long long) cur->d_lp.rel_value_us / ph.iterations); 1155 (unsigned long long) cur->d_lp.rel_value_us / ph.iterations);
1066 } 1156 }
@@ -1070,12 +1160,13 @@ evaluate_average (void)
1070 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_mlp.rel_value_us) 1160 if (GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != cur->d_mlp.rel_value_us)
1071 { 1161 {
1072 fprintf (stderr, 1162 fprintf (stderr,
1073 "Average total time to solve mlp %s for %u peers %u addresses: %llu us\n", 1163 "Average total time from %u iterations to solve mlp %s for %u peers %u addresses: %llu us\n",
1164 cur->valid,
1074 (GNUNET_YES == cur->update) ? "updated" : "full", 1165 (GNUNET_YES == cur->update) ? "updated" : "full",
1075 cur->peers, cur->addresses, 1166 cur->peers, cur->addresses,
1076 (unsigned long long) cur->d_mlp.rel_value_us / ph.iterations); 1167 (unsigned long long) cur->d_mlp.rel_value_us / cur->valid);
1077 GNUNET_asprintf(&str_d_mlp, "%llu", 1168 GNUNET_asprintf(&str_d_mlp, "%llu",
1078 (unsigned long long) cur->d_mlp.rel_value_us / ph.iterations); 1169 (unsigned long long) cur->d_mlp.rel_value_us / cur->valid);
1079 } 1170 }
1080 else 1171 else
1081 GNUNET_asprintf (&str_d_mlp, "-1"); 1172 GNUNET_asprintf (&str_d_mlp, "-1");
@@ -1224,8 +1315,10 @@ perf_run (void)
1224 GNUNET_CONTAINER_DLL_remove(ph.peers[cp].head, ph.peers[cp].tail, cur); 1315 GNUNET_CONTAINER_DLL_remove(ph.peers[cp].head, ph.peers[cp].tail, cur);
1225 GNUNET_free(cur); 1316 GNUNET_free(cur);
1226 } 1317 }
1227
1228 } 1318 }
1319
1320 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
1321 "Iteration done\n");
1229 GNUNET_free(ph.peers); 1322 GNUNET_free(ph.peers);
1230} 1323}
1231 1324
@@ -1328,13 +1421,14 @@ run (void *cls, char * const *args, const char *cfgfile,
1328 1421
1329 /* Create array of DLL to store results for iterations */ 1422 /* Create array of DLL to store results for iterations */
1330 ph.iterations_results = GNUNET_malloc (sizeof (struct Iteration) * ph.iterations); 1423 ph.iterations_results = GNUNET_malloc (sizeof (struct Iteration) * ph.iterations);
1331 ph.averaged_result = GNUNET_malloc (sizeof (struct Result) * ((ph.N_peers_end + 1) - ph.N_peers_start)); 1424 ph.averaged_full_result = GNUNET_malloc (sizeof (struct Result) * ((ph.N_peers_end + 1) - ph.N_peers_start));
1425 ph.averaged_update_result = GNUNET_malloc (sizeof (struct Result) * ((ph.N_peers_end + 1) - ph.N_peers_start));
1332 for (c = 0; c <= ph.N_peers_end - ph.N_peers_start; c++) 1426 for (c = 0; c <= ph.N_peers_end - ph.N_peers_start; c++)
1333 { 1427 {
1334 ph.averaged_result[c].d_setup = GNUNET_TIME_UNIT_FOREVER_REL; 1428 ph.averaged_full_result[c].d_setup = GNUNET_TIME_UNIT_FOREVER_REL;
1335 ph.averaged_result[c].d_total = GNUNET_TIME_UNIT_FOREVER_REL; 1429 ph.averaged_full_result[c].d_total = GNUNET_TIME_UNIT_FOREVER_REL;
1336 ph.averaged_result[c].d_lp = GNUNET_TIME_UNIT_FOREVER_REL; 1430 ph.averaged_full_result[c].d_lp = GNUNET_TIME_UNIT_FOREVER_REL;
1337 ph.averaged_result[c].d_mlp = GNUNET_TIME_UNIT_FOREVER_REL; 1431 ph.averaged_full_result[c].d_mlp = GNUNET_TIME_UNIT_FOREVER_REL;
1338 } 1432 }
1339 1433
1340 /* Load solver */ 1434 /* Load solver */
@@ -1385,7 +1479,8 @@ run (void *cls, char * const *args, const char *cfgfile,
1385 GNUNET_PLUGIN_unload (plugin, ph.solver); 1479 GNUNET_PLUGIN_unload (plugin, ph.solver);
1386 GNUNET_free (plugin); 1480 GNUNET_free (plugin);
1387 GNUNET_free (ph.iterations_results); 1481 GNUNET_free (ph.iterations_results);
1388 GNUNET_free (ph.averaged_result); 1482 GNUNET_free (ph.averaged_full_result);
1483 GNUNET_free (ph.averaged_update_result);
1389 GNUNET_CONFIGURATION_destroy (solver_cfg); 1484 GNUNET_CONFIGURATION_destroy (solver_cfg);
1390 GNUNET_STATISTICS_destroy (ph.stat, GNUNET_NO); 1485 GNUNET_STATISTICS_destroy (ph.stat, GNUNET_NO);
1391 ph.solver = NULL; 1486 ph.solver = NULL;