gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 28/164: Added heuristic to imporve size increasement of ibf in


From: gnunet
Subject: [gnunet] 28/164: Added heuristic to imporve size increasement of ibf in case of failure
Date: Fri, 30 Jul 2021 15:31:34 +0200

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

grothoff pushed a commit to branch master
in repository gnunet.

commit 869ca52840c5268ec1e705f43fef31db3d989106
Author: Elias Summermatter <elias.summermatter@seccom.ch>
AuthorDate: Thu Apr 15 22:55:41 2021 +0200

    Added heuristic to imporve size increasement of ibf in case of failure
---
 src/setu/gnunet-service-setu.c | 17 ++++++++++++++++-
 src/setu/perf_setu_api.c       |  6 +++---
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index 941c948b3..43eadf09b 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -79,6 +79,12 @@
 #define IBF_ALPHA 4
 
 
+/**
+ * Minimal size of an ibf
+ */
+#define IBF_MIN_SIZE 32
+
+
 /**
  * Current phase we are in for a union operation.
  */
@@ -1447,6 +1453,15 @@ get_size_from_difference (unsigned int diff, int 
number_buckets_per_element, flo
   return ibf_order + 1;
 }
 
+static unsigned int
+get_next_ibf_size(float ibf_bucket_number_factor, unsigned int 
decoded_elements, unsigned int last_ibf_size )
+{
+    unsigned int next_size = (unsigned int) ((last_ibf_size * 2) - ( 
ibf_bucket_number_factor * decoded_elements ));
+
+    if(next_size < IBF_MIN_SIZE)
+        next_size = IBF_MIN_SIZE;
+    return next_size | 1;
+}
 
 /**
  * Send a set element.
@@ -1822,7 +1837,7 @@ decode_and_send (struct Operation *op)
       /** Enforce odd ibf size **/
 
 
-      next_size = ( diff_ibf->size * 2) | 1;
+      next_size = get_next_ibf_size(op->ibf_bucket_number_factor, num_decoded, 
diff_ibf->size);
 
       if (next_size > diff_ibf->size) /** FIXME: ADD HERA A MAX LIMIT! if 
(next_order <= MAX_IBF_ORDER) **/
       {
diff --git a/src/setu/perf_setu_api.c b/src/setu/perf_setu_api.c
index c2b865824..a44825ce4 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(450,5000,5000,32);
+    initRandomSets(450,500,500,32);
 }
 
 void perf_thread() {
@@ -447,9 +447,9 @@ static void execute_perf() {
     //FILE *out = fopen("perfstats.log", "w");
     //fprintf(out, "se_diff,active_passive_switches,bytes_transmitted,rtt\n");
 
-    for (int out_out_ctr = 2; out_out_ctr <= 6; out_out_ctr++) {
+    for (int out_out_ctr = 3; out_out_ctr <= 3; out_out_ctr++) {
 
-        for (int out_ctr = 5; out_ctr <= 50; out_ctr++) {
+        for (int out_ctr = 1; out_ctr <= 100; out_ctr++) {
 
             float base = 0.1;
             float x = out_ctr * base;

-- 
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]