diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-02-27 17:23:31 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-02-27 17:23:31 +0000 |
commit | f7f6d5a8ea75b488a84b5ed1e550c6ac7ef82724 (patch) | |
tree | 400dd097a717b867c1799f3c72836307c458d0fc | |
parent | e0561f734723672019c1612b202ae2705dadedc9 (diff) | |
download | gnunet-f7f6d5a8ea75b488a84b5ed1e550c6ac7ef82724.tar.gz gnunet-f7f6d5a8ea75b488a84b5ed1e550c6ac7ef82724.zip |
get hosts from loadleveler instead of reading them from hostlist
-rw-r--r-- | src/testbed/gnunet-testbed-profiler.c | 19 | ||||
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 11 |
2 files changed, 26 insertions, 4 deletions
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index ebb82dfcf..5cca55b4b 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c | |||
@@ -226,11 +226,17 @@ static void | |||
226 | run (void *cls, char *const *args, const char *cfgfile, | 226 | run (void *cls, char *const *args, const char *cfgfile, |
227 | const struct GNUNET_CONFIGURATION_Handle *config) | 227 | const struct GNUNET_CONFIGURATION_Handle *config) |
228 | { | 228 | { |
229 | char *hostfile; | ||
230 | |||
231 | hostfile = NULL; | ||
232 | #ifndef WITH_LL | ||
229 | if (NULL == args[0]) | 233 | if (NULL == args[0]) |
230 | { | 234 | { |
231 | fprintf (stderr, _("No hosts-file specified on command line\n")); | 235 | fprintf (stderr, _("No hosts-file specified on command line\n")); |
232 | return; | 236 | return; |
233 | } | 237 | } |
238 | hostfile = args[0]; | ||
239 | #endif | ||
234 | if (0 == num_peers) | 240 | if (0 == num_peers) |
235 | { | 241 | { |
236 | result = GNUNET_OK; | 242 | result = GNUNET_OK; |
@@ -240,7 +246,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
240 | event_mask = 0; | 246 | event_mask = 0; |
241 | event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT); | 247 | event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT); |
242 | event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED); | 248 | event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED); |
243 | GNUNET_TESTBED_run (args[0], cfg, num_peers, event_mask, controller_event_cb, | 249 | GNUNET_TESTBED_run (hostfile, cfg, num_peers, event_mask, controller_event_cb, |
244 | NULL, &test_run, NULL); | 250 | NULL, &test_run, NULL); |
245 | abort_task = | 251 | abort_task = |
246 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_abort, | 252 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_abort, |
@@ -265,15 +271,20 @@ main (int argc, char *const *argv) | |||
265 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_cont_fails}, | 271 | GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_cont_fails}, |
266 | GNUNET_GETOPT_OPTION_END | 272 | GNUNET_GETOPT_OPTION_END |
267 | }; | 273 | }; |
274 | #ifdef WITH_LL | ||
275 | const char *binaryHelp = "gnunet-testbed-profiler [OPTIONS]"; | ||
276 | #else | ||
277 | const char *binaryHelp = "gnunet-testbed-profiler [OPTIONS] hosts-file"; | ||
278 | #endif | ||
279 | |||
268 | int ret; | 280 | int ret; |
269 | 281 | ||
270 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) | 282 | if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) |
271 | return 2; | 283 | return 2; |
272 | result = GNUNET_SYSERR; | 284 | result = GNUNET_SYSERR; |
273 | ret = | 285 | ret = |
274 | GNUNET_PROGRAM_run (argc, argv, | 286 | GNUNET_PROGRAM_run (argc, argv, binaryHelp, _("Profiler for testbed"), |
275 | "gnunet-testbed-profiler [OPTIONS] hosts-file", | 287 | options, &run, NULL); |
276 | _("Profiler for testbed"), options, &run, NULL); | ||
277 | GNUNET_free ((void *) argv); | 288 | GNUNET_free ((void *) argv); |
278 | if (GNUNET_OK != ret) | 289 | if (GNUNET_OK != ret) |
279 | return ret; | 290 | return ret; |
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index d57c3bf4c..bbc89f43f 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -1050,6 +1050,16 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1050 | GNUNET_assert (num_peers > 0); | 1050 | GNUNET_assert (num_peers > 0); |
1051 | rc = GNUNET_malloc (sizeof (struct RunContext)); | 1051 | rc = GNUNET_malloc (sizeof (struct RunContext)); |
1052 | rc->cfg = GNUNET_CONFIGURATION_dup (cfg); | 1052 | rc->cfg = GNUNET_CONFIGURATION_dup (cfg); |
1053 | #ifdef WITH_LL | ||
1054 | rc->num_hosts = GNUNET_TESTBED_hosts_load_from_loadleveler (rc->cfg, | ||
1055 | &rc->hosts); | ||
1056 | if (0 == rc->num_hosts) | ||
1057 | { | ||
1058 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
1059 | _("No hosts loaded from LoadLeveler. Need at least one host\n")); | ||
1060 | goto error_cleanup; | ||
1061 | } | ||
1062 | #else | ||
1053 | if (NULL != host_filename) | 1063 | if (NULL != host_filename) |
1054 | { | 1064 | { |
1055 | rc->num_hosts = | 1065 | rc->num_hosts = |
@@ -1064,6 +1074,7 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1064 | } | 1074 | } |
1065 | else | 1075 | else |
1066 | rc->h = GNUNET_TESTBED_host_create (NULL, NULL, rc->cfg, 0); | 1076 | rc->h = GNUNET_TESTBED_host_create (NULL, NULL, rc->cfg, 0); |
1077 | #endif | ||
1067 | rc->num_peers = num_peers; | 1078 | rc->num_peers = num_peers; |
1068 | rc->event_mask = event_mask; | 1079 | rc->event_mask = event_mask; |
1069 | rc->cc = cc; | 1080 | rc->cc = cc; |