gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r26484 - gnunet/src/nse


From: gnunet
Subject: [GNUnet-SVN] r26484 - gnunet/src/nse
Date: Tue, 19 Mar 2013 10:58:55 +0100

Author: harsha
Date: 2013-03-19 10:58:55 +0100 (Tue, 19 Mar 2013)
New Revision: 26484

Modified:
   gnunet/src/nse/gnunet-nse-profiler.c
   gnunet/src/nse/nse_profiler_test.conf
Log:
- working version of NSE profiler

Modified: gnunet/src/nse/gnunet-nse-profiler.c
===================================================================
--- gnunet/src/nse/gnunet-nse-profiler.c        2013-03-19 09:33:06 UTC (rev 
26483)
+++ gnunet/src/nse/gnunet-nse-profiler.c        2013-03-19 09:58:55 UTC (rev 
26484)
@@ -382,13 +382,16 @@
 {
   struct NSEPeer *current_peer;
   unsigned int i;
+  unsigned int connections;
 
+  if (0 == connection_limit)
+    return;  
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to nse service of peers\n");
-  for (i = 0; i < num_peers; i++)
+  connections = 0;
+  for (i = 0; i < num_peers_in_round[current_round]; i++)
   {
-    if ((connection_limit > 0) &&
-       (num_peers > connection_limit) && 
-       (0 != (i % (num_peers / connection_limit))))
+    if ((num_peers_in_round[current_round] > connection_limit) && 
+       (0 != (i % (num_peers_in_round[current_round] / connection_limit))))
       continue;
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "nse-profiler: connecting to nse service of peer %d\n", i);
@@ -401,8 +404,10 @@
                                           NULL, NULL,
                                           &nse_connect_adapter,
                                           &nse_disconnect_adapter,
-                                          current_peer);       
+                                          current_peer);
     GNUNET_CONTAINER_DLL_insert (peer_head, peer_tail, current_peer);
+    if (++connections == connection_limit)
+      break;
   }
 }
 
@@ -448,6 +453,7 @@
       GNUNET_free (stats_context);
       return;
     }
+  LOG_DEBUG ("Finished collecting statistics\n");
   if (NULL != data_file)
     {
       /* Stats lookup successful, write out data */
@@ -589,9 +595,7 @@
   char buf[1024];
   size_t buf_len;
 
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, 
-             "Have %u connections\n",
-              total_connections);
+  LOG (GNUNET_ERROR_TYPE_INFO, "Have %u connections\n", total_connections);
   if (NULL != data_file)
     {
       buf_len = GNUNET_snprintf (buf, sizeof (buf),
@@ -655,6 +659,8 @@
   GNUNET_TESTBED_operation_done (entry->op);
   GNUNET_CONTAINER_DLL_remove (oplist_head, oplist_tail, entry);
   GNUNET_free (entry);
+  if (num_peers_in_round[current_round] == peers_running)
+    run_round ();
 }
 
 
@@ -707,6 +713,7 @@
   if (current_round == num_rounds)
     {
       /* this was the last round, terminate */
+      ok = 0;
       GNUNET_SCHEDULER_shutdown ();
       return;
     }
@@ -735,13 +742,9 @@
     {
     case GNUNET_TESTBED_ET_PEER_START:
       peers_running++;
-      if (num_peers_in_round[current_round] == peers_running)
-       run_round ();
       break;
     case GNUNET_TESTBED_ET_PEER_STOP:
       peers_running--;
-      if (num_peers_in_round[current_round] == peers_running)
-       run_round ();
       break;
     case GNUNET_TESTBED_ET_CONNECT:
       total_connections++;
@@ -817,7 +820,7 @@
          fprintf (stderr, "Refusing to run a round with 0 peers\n");
          return;
        }
-      GNUNET_array_grow (num_peers_in_round, num_rounds, num);
+      GNUNET_array_append (num_peers_in_round, num_rounds, num);
       num_peers = GNUNET_MAX (num_peers, num);
     }
   if (0 == num_peers)
@@ -875,7 +878,7 @@
   static struct GNUNET_GETOPT_CommandLineOption options[] = {
     {'C', "connections", "COUNT",
      gettext_noop ("limit to the number of connections to NSE services, 0 for 
none"),
-     1, &GNUNET_GETOPT_set_string, &num_peer_spec},
+     1, &GNUNET_GETOPT_set_uint, &connection_limit},
     {'d', "details", "FILENAME",
      gettext_noop ("name of the file for writing connection information and 
statistics"),
      1, &GNUNET_GETOPT_set_string, &data_filename},

Modified: gnunet/src/nse/nse_profiler_test.conf
===================================================================
--- gnunet/src/nse/nse_profiler_test.conf       2013-03-19 09:33:06 UTC (rev 
26483)
+++ gnunet/src/nse/nse_profiler_test.conf       2013-03-19 09:58:55 UTC (rev 
26484)
@@ -1,8 +1,18 @@
 [PATHS]
 SERVICEHOME = /tmp/nse-profiler/
 
+[testbed]
+AUTOSTART = NO
+PORT = 12113
+ACCEPT_FROM = 127.0.0.1; 10.6.0.0/16;
+HOSTNAME = localhost
+MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 5
+OVERLAY_TOPOLOGY = RANDOM
+OVERLAY_RANDOM_LINKS = 10
+OPERATION_TIMEOUT = 45 s
+
 [nse]
-PORT = 0
+PORT = 12114
 UNIXPATH = /tmp/test-nse-service-nse.unix
 BINARY = gnunet-service-nse
 #BINARY = 
/home/mrwiggles/documents/research/gnunet/gnunet-ng/src/nse/.libs/gnunet-service-nse
@@ -16,28 +26,24 @@
 PROOFFILE = $SERVICEHOME/nse.proof
 
 [arm]
-PORT = 0
-DEFAULTSERVICES = core
+DEFAULTSERVICES = core nse
 UNIXPATH = /tmp/test-nse-service-arm.unix
 
 [statistics]
 AUTOSTART = YES
-PORT=0
+PORT = 12115
 
 [fs]
 AUTOSTART = NO
-PORT=0
 
 [datastore]
 AUTOSTART = NO
-PORT = 0
 
 [dht]
 AUTOSTART = NO
-PORT = 0
 
 [nat]
-DISABLEV6 = YES 
+DISABLEV6 = YES
 BINDTO = 127.0.0.1
 ENABLE_UPNP = NO
 BEHIND_NAT = NO
@@ -46,31 +52,16 @@
 EXTERNAL_ADDRESS = 127.0.0.1
 
 [transport]
-PORT = 0
-plugins = unix
+plugins = udp
 
-[transport-unix]
-PORT = 1
-
-[transport-tcp]
-PORT = 0
-
 [transport-udp]
-PORT = 0
+PORT = 12116
 
-[transport-http]
-PORT = 0
-
-[transport-https]
-PORT = 0
-
 [core]
 AUTOSTART = YES
-PORT = 0
 
 [peerinfo]
 AUTOSTART = YES
-PORT = 0
 
 [dns]
 AUTOSTART = NO
@@ -82,11 +73,8 @@
 AUTOSTART = NO
 
 [resolver]
-PORT = 0
+AUTOSTART = YES
 
-[ats]
-PORT = 0
-
 [mesh]
 AUTOSTART = NO
 
@@ -99,35 +87,6 @@
 [vpn]
 AUTOSTART = NO
 
-[testing]
-WEAKRANDOM = YES
-
-[testing_old]
-NUM_PEERS = 2000
-TOPOLOGY = NONE
-#CONNECT_TOPOLOGY = SMALL_WORLD_RING
-CONNECT_TOPOLOGY = ERDOS_RENYI
-CONNECT_TOPOLOGY_OPTION = CONNECT_MINIMUM
-CONNECT_TOPOLOGY_OPTION_MODIFIER = 5
-# PERCENTAGE = 3
-PROBABILITY = .1
-F2F = NO
-CONNECT_TIMEOUT = 360 s
-CONNECT_ATTEMPTS = 3
-#HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat
-HOSTKEYSFILE = hostkeys.dat
-MAX_CONCURRENT_SSH = 20
-USE_PROGRESSBARS = YES
-PEERGROUP_TIMEOUT = 1000 s
-TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers_initial
-MAX_OUTSTANDING_CONNECTIONS = 100
-#SINGLE_PEERINFO_PER_HOST = YES
-#NUM_PEERINFO_PER_HOST = 10
-#SINGLE_STATISTICS_PER_HOST = YES
-#NUM_STATISTICS_PER_HOST = 10
-DELETE_FILES = NO
-#SKEW_VARIANCE = 30000
-
 [nse-profiler]
 OUTPUT_FILE = nse_output_2000_peers.dat
 TOPOLOGY_OUTPUT_FILE = nse_topo_2000_peers




reply via email to

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