gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 40/164: fixed a bug in perfomance messurement


From: gnunet
Subject: [gnunet] 40/164: fixed a bug in perfomance messurement
Date: Fri, 30 Jul 2021 15:31:46 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

commit 7ec0744351be1f0c7baf8c835865e3265111b976
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Tue Apr 20 09:48:27 2021 +0200

    fixed a bug in perfomance messurement
---
 src/setu/gnunet-service-setu.c | 67 ++++++++++++++++++++++++++++++++----------
 src/setu/perf_setu_api.c       |  5 +++-
 2 files changed, 55 insertions(+), 17 deletions(-)

diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index fda8d968e..a94da2418 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -417,7 +417,7 @@ struct Operation
   * Factor (0-1) defines until which estimated set difference
   * a differential sync is faster
   */
-    float max_set_diff_factor_diff_sync;
+  float max_set_diff_factor_diff_sync;
 
 
    /**
@@ -432,6 +432,19 @@ struct Operation
    */
   float ibf_bucket_number_factor;
 
+  /**
+   *  Defines which site a client is
+   *  0 = Initiating peer
+   *  1 = Receiving peer
+   */
+   unsigned int peer_site;
+
+   /**
+    *  Count active passive switches to generate different salts
+    */
+
+   unsigned int active_passive_switches;
+
 };
 
 
@@ -717,6 +730,9 @@ load_config(struct Operation * op) {
 
     GNUNET_CONFIGURATION_get_value_float(setu_cfg,"PERFORMANCE", 
"MAX_SET_DIFF_FACTOR_DIFFERENTIAL", &fl);
     op->max_set_diff_factor_diff_sync = fl;
+
+    op->peer_site = 0;
+    op->active_passive_switches = 0;
 }
 
 
@@ -762,20 +778,26 @@ calculate_perf_rtt() {
         rtt +=  2.5;
     }
 
+
+    LOG (GNUNET_ERROR_TYPE_ERROR,
+         "SIZE OF FULL ELEMENT: %d -> %f \n", 
perf_rtt.active_passive_switches, rtt );
+
     /**
      * Calculate data sended size
      */
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_REQUEST_FULL), 
perf_rtt.request_full);
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_FULL_ELEMENT), 
perf_rtt.element_full);
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_ELEMENTS), 
perf_rtt.element);
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_OPERATION_REQUEST), 
perf_rtt.operation_request);
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_SE), perf_rtt.se);
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_FULL_DONE), 
perf_rtt.full_done);
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_IBF), perf_rtt.ibf);
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_INQUIRY), 
perf_rtt.inquery);
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_DEMAND), 
perf_rtt.demand);
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_OFFER), 
perf_rtt.offer);
-    bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_DONE), 
perf_rtt.done);
+    bytes_transmitted += sum_sent_received_bytes(4, perf_rtt.request_full);
+
+    bytes_transmitted += sum_sent_received_bytes(sizeof(struct 
GNUNET_SETU_ElementMessage), perf_rtt.element_full);
+    bytes_transmitted += sum_sent_received_bytes(sizeof(struct 
GNUNET_SETU_ElementMessage), perf_rtt.element);
+    // bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_OPERATION_REQUEST), 
perf_rtt.operation_request);
+    // bytes_transmitted += 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_SE), perf_rtt.se);
+    bytes_transmitted += sum_sent_received_bytes(4, perf_rtt.full_done);
+    bytes_transmitted += sum_sent_received_bytes(sizeof(struct IBFMessage), 
perf_rtt.ibf);
+    bytes_transmitted += sum_sent_received_bytes(sizeof(struct 
InquiryMessage), perf_rtt.inquery);
+    bytes_transmitted += sum_sent_received_bytes(sizeof(struct 
GNUNET_MessageHeader), perf_rtt.demand);
+    bytes_transmitted += sum_sent_received_bytes(sizeof(struct 
GNUNET_MessageHeader), perf_rtt.offer);
+    bytes_transmitted += sum_sent_received_bytes(4, perf_rtt.done);
+
 
 
     /*
@@ -790,7 +812,7 @@ calculate_perf_rtt() {
     int decoded = 0;
     if(perf_rtt.active_passive_switches == 0)
         decoded = 1;
-    int ibf_bytes_transmitted = 
sum_sent_received_bytes(sizeof(GNUNET_MESSAGE_TYPE_SETU_P2P_IBF), perf_rtt.ibf);
+    int ibf_bytes_transmitted = sum_sent_received_bytes(sizeof(struct 
IBFMessage), perf_rtt.ibf);
 
 
     FILE *out1 = fopen("perf_failure_bucket_number_factor.csv", "a");
@@ -1570,6 +1592,9 @@ handle_union_p2p_strata_estimator (void *cls,
   size_t len;
   int is_compressed;
 
+  // Setting peer site to receiving peer
+  op->peer_site = 1;
+
   is_compressed = (GNUNET_MESSAGE_TYPE_SETU_P2P_SEC == htons (
                      msg->header.type));
   GNUNET_STATISTICS_update (_GSS_statistics,
@@ -1772,6 +1797,10 @@ decode_and_send (struct Operation *op)
   unsigned int num_decoded;
   struct InvertibleBloomFilter *diff_ibf;
 
+    LOG (GNUNET_ERROR_TYPE_ERROR,
+         "OLD SALT: %u, %d\n",
+         op->salt_receive, op->peer_site);
+
   GNUNET_assert (PHASE_ACTIVE_DECODING == op->phase);
 
   if (GNUNET_OK !=
@@ -1842,8 +1871,13 @@ decode_and_send (struct Operation *op)
                                   1,
                                   GNUNET_NO);
         perf_rtt.active_passive_switches += 1;
+        op->active_passive_switches += 1;
+
+        op->salt_send = (op->peer_site * 32) + op->active_passive_switches;
+          LOG (GNUNET_ERROR_TYPE_ERROR,
+               "NEW SALT: %u, %d\n",
+               op->salt_send, op->peer_site);
 
-          op->salt_send += 1;
 
         if (GNUNET_OK !=
             send_ibf (op, next_size))
@@ -1890,6 +1924,7 @@ decode_and_send (struct Operation *op)
     {
       struct IBF_Key unsalted_key;
 
+
       unsalt_key (&key,
                   op->salt_receive,
                   &unsalted_key);
@@ -3665,7 +3700,7 @@ handle_client_evaluate (void *cls,
     op->se = strata_estimator_dup (op->set->se);
     /* we started the operation, thus we have to send the operation request */
     op->phase = PHASE_EXPECT_SE;
-    op->salt_receive = op->salt_send = 42; // FIXME?????
+    op->salt_receive = op->salt_send = (op->peer_site * 32); // FIXME?????
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Initiating union operation evaluation\n");
     GNUNET_STATISTICS_update (_GSS_statistics,
@@ -3840,7 +3875,7 @@ handle_client_accept (void *cls,
     op->se = strata_estimator_dup (op->set->se);
     op->demanded_hashes = GNUNET_CONTAINER_multihashmap_create (32,
                                                                 GNUNET_NO);
-    op->salt_receive = op->salt_send = 42; // FIXME?????
+    op->salt_receive = op->salt_send = (op->peer_site * 32); // FIXME?????
     initialize_key_to_element (op);
     op->initial_size = GNUNET_CONTAINER_multihashmap32_size (
       op->key_to_element);
diff --git a/src/setu/perf_setu_api.c b/src/setu/perf_setu_api.c
index e93229d4f..9b520d899 100644
--- a/src/setu/perf_setu_api.c
+++ b/src/setu/perf_setu_api.c
@@ -404,7 +404,7 @@ run (void *cls,
                 "Running real set-reconciliation\n");
     //init_set1 ();
     // limit ~23800 element total
-    initRandomSets(0,5000,5000,32);
+    initRandomSets(450,500,500,32);
 }
 
 void perf_thread() {
@@ -425,6 +425,9 @@ static void run_petf_thread(int total_runs) {
 //Father code (before child processes start)
     for (int processed = 0; processed < total_runs;) {
         for (int id = 0; id < core_count; id++) {
+            perf_thread();
+        }
+
             if(processed >= total_runs) break;
 
             if ((child_pid = fork()) == 0) {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]