gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r27019 - gnunet/src/regex


From: gnunet
Subject: [GNUnet-SVN] r27019 - gnunet/src/regex
Date: Fri, 3 May 2013 16:38:09 +0200

Author: bartpolot
Date: 2013-05-03 16:38:09 +0200 (Fri, 03 May 2013)
New Revision: 27019

Modified:
   gnunet/src/regex/gnunet-regex-profiler.c
Log:
- move parallelism to config file

Modified: gnunet/src/regex/gnunet-regex-profiler.c
===================================================================
--- gnunet/src/regex/gnunet-regex-profiler.c    2013-05-03 12:41:58 UTC (rev 
27018)
+++ gnunet/src/regex/gnunet-regex-profiler.c    2013-05-03 14:38:09 UTC (rev 
27019)
@@ -38,7 +38,6 @@
 
 #define FIND_TIMEOUT \
         GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 90)
-#define SEARCHES_IN_PARALLEL 5
 
 /**
  * DLL of operations
@@ -281,6 +280,11 @@
 static int num_search_strings;
 
 /**
+ * How many searches are we going to start in parallel
+ */
+static long long unsigned int init_parallel_searches;
+
+/**
  * How many searches are running in parallel
  */
 static unsigned int parallel_searches;
@@ -960,7 +964,7 @@
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting announce.\n");
 
-  for (i = 0; i < SEARCHES_IN_PARALLEL; i++)
+  for (i = 0; i < init_parallel_searches; i++)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "  scheduling announce %u\n",
@@ -1259,6 +1263,16 @@
     return;
   }
   if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (cfg, "REGEXPROFILER",
+                                             "PARALLEL_SEARCHES",
+                                             &init_parallel_searches))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "Configuration option \"PARALLEL_SEARCHES\" missing."
+                " Using default (%d)\n", 10);
+    init_parallel_searches = 10;
+  }
+  if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_time (cfg, "REGEXPROFILER",
                                            "REANNOUNCE_PERIOD_MAX",
                                            &reannounce_period_max))
@@ -1358,7 +1372,7 @@
   event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT);
 //   event_mask |= (1LL << GNUNET_TESTBED_ET_DISCONNECT);
   prof_start_time = GNUNET_TIME_absolute_get ();
-  GNUNET_TESTBED_run (args[0],
+  GNUNET_TESTBED_run (hosts_file,
                       cfg,
                       num_peers,
                       event_mask,




reply via email to

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