diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-15 10:03:38 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-05-15 10:03:38 +0000 |
commit | 39856c647019b719fb32fd98f3301ed21afdd088 (patch) | |
tree | 69c9b79b8a5a64d9a99767015ec74340d45d04ef /src/testbed/testbed_api_hosts.c | |
parent | 68239c2fb5ace698568fe16705804e842cba6e70 (diff) | |
download | gnunet-39856c647019b719fb32fd98f3301ed21afdd088.tar.gz gnunet-39856c647019b719fb32fd98f3301ed21afdd088.zip |
- distribute peers equally among island nodes on SuperMUC
Diffstat (limited to 'src/testbed/testbed_api_hosts.c')
-rw-r--r-- | src/testbed/testbed_api_hosts.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index 0888a9032..99625cba0 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c | |||
@@ -561,6 +561,17 @@ simple_resolve (const char *host) | |||
561 | return hostip; | 561 | return hostip; |
562 | } | 562 | } |
563 | 563 | ||
564 | #if ENABLE_LL | ||
565 | static int | ||
566 | cmpstringp(const void *p1, const void *p2) | ||
567 | { | ||
568 | /* The actual arguments to this function are "pointers to | ||
569 | pointers to char", but strcmp(3) arguments are "pointers | ||
570 | to char", hence the following cast plus dereference */ | ||
571 | |||
572 | return strcmp(* (char * const *) p1, * (char * const *) p2); | ||
573 | } | ||
574 | #endif | ||
564 | 575 | ||
565 | /** | 576 | /** |
566 | * Loads the set of host allocated by the LoadLeveler Job Scheduler. This | 577 | * Loads the set of host allocated by the LoadLeveler Job Scheduler. This |
@@ -689,8 +700,7 @@ GNUNET_TESTBED_hosts_load_from_loadleveler (const struct | |||
689 | return 0; | 700 | return 0; |
690 | if (NULL == hosts) | 701 | if (NULL == hosts) |
691 | goto cleanup; | 702 | goto cleanup; |
692 | qsort (hostnames, nhosts, sizeof (hostnames[0]), | 703 | qsort (hostnames, nhosts, sizeof (hostnames[0]), cmpstringp); |
693 | (int (*)(const void *, const void *))&strcmp); | ||
694 | host_list = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host *) * nhosts); | 704 | host_list = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host *) * nhosts); |
695 | for (host = 0; host < nhosts; host++) | 705 | for (host = 0; host < nhosts; host++) |
696 | host_list[host] = GNUNET_TESTBED_host_create (hostnames[host], NULL, cfg, 0); | 706 | host_list[host] = GNUNET_TESTBED_host_create (hostnames[host], NULL, cfg, 0); |