aboutsummaryrefslogtreecommitdiff
path: root/src/regex
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-05-03 14:38:09 +0000
committerBart Polot <bart@net.in.tum.de>2013-05-03 14:38:09 +0000
commit473b4f3851fb82e5901df40c9381823419265d65 (patch)
tree78992fe8125c2a4c554667c9b4d6a2a0a7af3b7c /src/regex
parente5853128ecf0bd76956f54175ae755006aa56682 (diff)
downloadgnunet-473b4f3851fb82e5901df40c9381823419265d65.tar.gz
gnunet-473b4f3851fb82e5901df40c9381823419265d65.zip
- move parallelism to config file
Diffstat (limited to 'src/regex')
-rw-r--r--src/regex/gnunet-regex-profiler.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c
index 28c9afcd3..d619937bb 100644
--- a/src/regex/gnunet-regex-profiler.c
+++ b/src/regex/gnunet-regex-profiler.c
@@ -38,7 +38,6 @@
38 38
39#define FIND_TIMEOUT \ 39#define FIND_TIMEOUT \
40 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 90) 40 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 90)
41#define SEARCHES_IN_PARALLEL 5
42 41
43/** 42/**
44 * DLL of operations 43 * DLL of operations
@@ -281,6 +280,11 @@ static char **search_strings;
281static int num_search_strings; 280static int num_search_strings;
282 281
283/** 282/**
283 * How many searches are we going to start in parallel
284 */
285static long long unsigned int init_parallel_searches;
286
287/**
284 * How many searches are running in parallel 288 * How many searches are running in parallel
285 */ 289 */
286static unsigned int parallel_searches; 290static unsigned int parallel_searches;
@@ -960,7 +964,7 @@ do_announce (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
960 964
961 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting announce.\n"); 965 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Starting announce.\n");
962 966
963 for (i = 0; i < SEARCHES_IN_PARALLEL; i++) 967 for (i = 0; i < init_parallel_searches; i++)
964 { 968 {
965 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 969 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
966 " scheduling announce %u\n", 970 " scheduling announce %u\n",
@@ -1259,6 +1263,16 @@ run (void *cls, char *const *args, const char *cfgfile,
1259 return; 1263 return;
1260 } 1264 }
1261 if (GNUNET_OK != 1265 if (GNUNET_OK !=
1266 GNUNET_CONFIGURATION_get_value_number (cfg, "REGEXPROFILER",
1267 "PARALLEL_SEARCHES",
1268 &init_parallel_searches))
1269 {
1270 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1271 "Configuration option \"PARALLEL_SEARCHES\" missing."
1272 " Using default (%d)\n", 10);
1273 init_parallel_searches = 10;
1274 }
1275 if (GNUNET_OK !=
1262 GNUNET_CONFIGURATION_get_value_time (cfg, "REGEXPROFILER", 1276 GNUNET_CONFIGURATION_get_value_time (cfg, "REGEXPROFILER",
1263 "REANNOUNCE_PERIOD_MAX", 1277 "REANNOUNCE_PERIOD_MAX",
1264 &reannounce_period_max)) 1278 &reannounce_period_max))
@@ -1358,7 +1372,7 @@ run (void *cls, char *const *args, const char *cfgfile,
1358 event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT); 1372 event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT);
1359// event_mask |= (1LL << GNUNET_TESTBED_ET_DISCONNECT); 1373// event_mask |= (1LL << GNUNET_TESTBED_ET_DISCONNECT);
1360 prof_start_time = GNUNET_TIME_absolute_get (); 1374 prof_start_time = GNUNET_TIME_absolute_get ();
1361 GNUNET_TESTBED_run (args[0], 1375 GNUNET_TESTBED_run (hosts_file,
1362 cfg, 1376 cfg,
1363 num_peers, 1377 num_peers,
1364 event_mask, 1378 event_mask,