gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r8647 - in GNUnet/src: applications/dhtlog_mysql applicatio


From: gnunet
Subject: [GNUnet-SVN] r8647 - in GNUnet/src: applications/dhtlog_mysql applications/dv_dht/module applications/dv_dht/tools applications/testing include
Date: Wed, 8 Jul 2009 17:09:17 -0600

Author: nevans
Date: 2009-07-08 17:09:17 -0600 (Wed, 08 Jul 2009)
New Revision: 8647

Modified:
   GNUnet/src/applications/dhtlog_mysql/dhtlog_mysql.c
   GNUnet/src/applications/dhtlog_mysql/dhtlog_test.c
   GNUnet/src/applications/dv_dht/module/routing.c
   GNUnet/src/applications/dv_dht/module/table.c
   GNUnet/src/applications/dv_dht/tools/dv_dht_driver.c
   GNUnet/src/applications/dv_dht/tools/dv_dht_driver_new.c
   GNUnet/src/applications/dv_dht/tools/dv_dht_multi_topology_test.c
   GNUnet/src/applications/dv_dht/tools/gnunetd_dv.conf
   GNUnet/src/applications/testing/remote.c
   GNUnet/src/applications/testing/remotetest.c
   GNUnet/src/applications/testing/remotetopologies.c
   GNUnet/src/include/dv.h
   GNUnet/src/include/gnunet_dhtlog_service.h
   GNUnet/src/include/gnunet_remote_lib.h
Log:
Logging and minor dht/testing changes

Modified: GNUnet/src/applications/dhtlog_mysql/dhtlog_mysql.c
===================================================================
--- GNUnet/src/applications/dhtlog_mysql/dhtlog_mysql.c 2009-07-08 22:11:46 UTC 
(rev 8646)
+++ GNUnet/src/applications/dhtlog_mysql/dhtlog_mysql.c 2009-07-08 23:09:17 UTC 
(rev 8647)
@@ -61,8 +61,8 @@
                           "VALUES (?, ?)"
 static struct GNUNET_MysqlStatementHandle *insert_node;
 
-#define INSERT_TRIALS_STMT "INSERT INTO trials (starttime, numnodes, topology, 
puts, gets, concurrent) "\
-                          "VALUES (NOW(), ?, ?, ?, ?, ?)"
+#define INSERT_TRIALS_STMT "INSERT INTO trials (starttime, numnodes, topology, 
puts, gets, concurrent, settle_time, message) "\
+                          "VALUES (NOW(), ?, ?, ?, ?, ?, ?, ?)"
 static struct GNUNET_MysqlStatementHandle *insert_trial;
 
 #define INSERT_DHTKEY_STMT "INSERT INTO dhtkeys (dhtkey, trialuid) "\
@@ -72,6 +72,9 @@
 #define UPDATE_TRIALS_STMT "UPDATE trials set endtime=NOW() where trialuid = ?"
 static struct GNUNET_MysqlStatementHandle *update_trial;
 
+#define UPDATE_CONNECTIONS_STMT "UPDATE trials set totalConnections = ? where 
trialuid = ?"
+static struct GNUNET_MysqlStatementHandle *update_connection;
+
 #define GET_TRIAL_STMT "SELECT MAX( trialuid ) FROM trials"
 static struct GNUNET_MysqlStatementHandle *get_trial;
 
@@ -161,6 +164,7 @@
              "`concurrent` int(10) unsigned NOT NULL,"
              "`starttime` datetime NOT NULL,"
              "`endtime` datetime NOT NULL,"
+             "`settle_time` int(10) unsigned NOT NULL,"
              "PRIMARY KEY  (`trialuid`),"
              "UNIQUE KEY `trialuid` (`trialuid`)"
              ") ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1"))
@@ -196,6 +200,7 @@
       PINIT (update_trial, UPDATE_TRIALS_STMT) ||
       PINIT (get_dhtkeyuid, GET_DHTKEYUID_STMT) ||
       PINIT (get_nodeuid, GET_NODEUID_STMT) ||
+      PINIT (update_connection, UPDATE_CONNECTIONS_STMT) ||
       PINIT (get_trial, GET_TRIAL_STMT))
     {
       GNUNET_MYSQL_database_close (db);
@@ -241,9 +246,11 @@
  */
 int
 add_trial (unsigned long long *trialuid, int num_nodes, int topology,
-           int puts, int gets, int concurrent)
+           int puts, int gets, int concurrent, int settle_time, char *message)
 {
   int ret;
+  unsigned long long m_len;
+  m_len = strlen (message);
   if (GNUNET_OK !=
       (ret = GNUNET_MYSQL_prepared_statement_run (insert_trial,
                                                   trialuid,
@@ -261,7 +268,15 @@
                                                   GNUNET_YES,
                                                   MYSQL_TYPE_LONG,
                                                   &concurrent,
-                                                  GNUNET_YES, -1)))
+                                                  GNUNET_YES,
+                                                  MYSQL_TYPE_LONG,
+                                                  &settle_time,
+                                                  GNUNET_YES,
+                                                  MYSQL_TYPE_BLOB,
+                                                  message,
+                                                  max_varchar_len +
+                                                  max_varchar_len, &m_len,
+                                                  -1)))
     {
       if (ret == GNUNET_SYSERR)
         {
@@ -447,7 +462,42 @@
     return GNUNET_SYSERR;
 }
 
+
 /*
+ * Update dhttests.trials table with total connections information
+ */
+int
+add_connections (unsigned long long trialuid, unsigned int totalConnections)
+{
+  int ret;
+#if DEBUG_DHTLOG
+  if (trialuid != current_trial)
+    {
+      fprintf (stderr,
+               _("Trialuid to update is not equal to current_trial(!)(?)\n"));
+    }
+#endif
+  if (GNUNET_OK !=
+      (ret = GNUNET_MYSQL_prepared_statement_run (update_connection,
+                                                  NULL,
+                                                  MYSQL_TYPE_LONG,
+                                                  &totalConnections,
+                                                  GNUNET_YES,
+                                                  MYSQL_TYPE_LONGLONG,
+                                                  &trialuid, GNUNET_YES, -1)))
+    {
+      if (ret == GNUNET_SYSERR)
+        {
+          return GNUNET_SYSERR;
+        }
+    }
+  if (ret > 0)
+    return GNUNET_OK;
+  else
+    return GNUNET_SYSERR;
+}
+
+/*
  * Inserts the specified query into the dhttests.queries table
  */
 int
@@ -694,6 +744,7 @@
   api.insert_route = &add_route;
   api.insert_node = &add_node;
   api.insert_dhtkey = &add_dhtkey;
+  api.update_connections = &add_connections;
   get_current_trial (&current_trial);
   GNUNET_GE_LOG (coreAPI->ectx,
                  GNUNET_GE_WARNING | GNUNET_GE_ADMIN | GNUNET_GE_USER |

Modified: GNUnet/src/applications/dhtlog_mysql/dhtlog_test.c
===================================================================
--- GNUnet/src/applications/dhtlog_mysql/dhtlog_test.c  2009-07-08 22:11:46 UTC 
(rev 8646)
+++ GNUnet/src/applications/dhtlog_mysql/dhtlog_test.c  2009-07-08 23:09:17 UTC 
(rev 8647)
@@ -63,7 +63,7 @@
   memset (&k1, 0, sizeof (GNUNET_HashCode));
   memset (&k2, 1, sizeof (GNUNET_HashCode));
 
-  ret = api->insert_trial (&trialuid, i, 5, 0, 0, 0);
+  ret = api->insert_trial (&trialuid, i, 5, 0, 0, 0, 0);
   fprintf (stderr, "Trial uid is %llu\n", trialuid);
 
   if (ret != GNUNET_OK)

Modified: GNUnet/src/applications/dv_dht/module/routing.c
===================================================================
--- GNUnet/src/applications/dv_dht/module/routing.c     2009-07-08 22:11:46 UTC 
(rev 8646)
+++ GNUnet/src/applications/dv_dht/module/routing.c     2009-07-08 23:09:17 UTC 
(rev 8647)
@@ -699,6 +699,18 @@
   total = dstore->get (&get->key, ntohl (get->type), &route_result, NULL);
 #endif
 
+  if (total > 0)
+    {
+      if ((debug_routes) && (dhtlog != NULL))
+        {
+          queryuid = ntohl (get->queryuid);
+          hop_count = ntohl (get->hop_count);
+          dhtlog->insert_query (NULL, queryuid, DHTLOG_GET,
+                                hop_count, GNUNET_YES, coreAPI->my_identity,
+                                &get->key);
+        }
+    }
+
   if (total > MAX_RESULTS)
     {
 #if DEBUG_ROUTING

Modified: GNUnet/src/applications/dv_dht/module/table.c
===================================================================
--- GNUnet/src/applications/dv_dht/module/table.c       2009-07-08 22:11:46 UTC 
(rev 8646)
+++ GNUnet/src/applications/dv_dht/module/table.c       2009-07-08 23:09:17 UTC 
(rev 8647)
@@ -73,8 +73,8 @@
  * What is the chance (1 in XXX) that we send DISCOVERY messages
  * to another peer?
  */
-#define MAINTAIN_CHANCE (10 + 100 * total_peers)
-/*#define MAINTAIN_CHANCE (1 + total_peers)*/
+#define MAINTAIN_CHANCE (10 + 25 * total_peers)
+/*#define MAINTAIN_CHANCE (10 + 100 * total_peers)*/
 
 /**
  * How long can a peer be inactive before we time it out?
@@ -90,7 +90,7 @@
 /**
  * Target number of peers per bucket
  */
-#define MAINTAIN_BUCKET_SIZE 4
+#define MAINTAIN_BUCKET_SIZE 8  /* Previously 4, trying different values... */
 
 
 /**

Modified: GNUnet/src/applications/dv_dht/tools/dv_dht_driver.c
===================================================================
--- GNUnet/src/applications/dv_dht/tools/dv_dht_driver.c        2009-07-08 
22:11:46 UTC (rev 8646)
+++ GNUnet/src/applications/dv_dht/tools/dv_dht_driver.c        2009-07-08 
23:09:17 UTC (rev 8647)
@@ -178,8 +178,10 @@
   int key_count;
   int random_peer;
   unsigned long long trialuid;
+  int totalConnections;
 
   key_count = 0;
+
   if (sqlapi == NULL)
     {
       return GNUNET_SYSERR;
@@ -188,19 +190,27 @@
     {
       ret =
         sqlapi->insert_trial (&trialuid, num_peers, topology, put_items,
-                              get_requests, 1);
+                              get_requests, 1, settle_time, "");
     }
-
   if (ret != GNUNET_OK)
     return GNUNET_SYSERR;
+
   printf ("Starting %u peers for trial %llu...\n", (unsigned int) num_peers,
           trialuid);
-  peers = GNUNET_REMOTE_start_daemons (cfg, num_peers);
+  ret = GNUNET_REMOTE_start_daemons (&peers, cfg, num_peers);
+
+  if (ret != GNUNET_SYSERR)
+    totalConnections = ret;
+  else
+    return ret;
+
+  sqlapi->update_connections (trialuid, totalConnections);
   if (peers == NULL)
     {
       GNUNET_GC_free (cfg);
       return -1;
     }
+
   pos = peers;
   for (i = 0; i < num_peers; i++)
     {

Modified: GNUnet/src/applications/dv_dht/tools/dv_dht_driver_new.c
===================================================================
--- GNUnet/src/applications/dv_dht/tools/dv_dht_driver_new.c    2009-07-08 
22:11:46 UTC (rev 8646)
+++ GNUnet/src/applications/dv_dht/tools/dv_dht_driver_new.c    2009-07-08 
23:09:17 UTC (rev 8647)
@@ -62,6 +62,7 @@
 static unsigned long long requests_wait_time;
 
 static char *dotOutFileName = NULL;
+static char *trialmessage = NULL;
 
 static struct GNUNET_CommandLineOption gnunetDHTDriverOptions[] = {
   GNUNET_COMMAND_LINE_OPTION_CFG_FILE (&configFile),    /* -c */
@@ -71,6 +72,9 @@
    gettext_noop
    ("set output file for a dot input file which represents the graph of the 
connected nodes"),
    1, &GNUNET_getopt_configure_set_string, &dotOutFileName},
+  {'m', "mesage", "LOG_MESSAGE",
+   gettext_noop ("log a message along with this trial in the database"),
+   1, &GNUNET_getopt_configure_set_string, &trialmessage},
   GNUNET_COMMAND_LINE_OPTION_VERBOSE,
   GNUNET_COMMAND_LINE_OPTION_END,
 };
@@ -178,9 +182,15 @@
   int random_peers[concurrent_requests];
   int random_peer;
   int random_key;
+  unsigned int totalConnections;
   unsigned long long trialuid;
 
   key_count = 0;
+
+
+  printf ("Starting %u peers\n", (unsigned int) num_peers);
+  printf ("Trial message is %s, strlen is %d\n", trialmessage,
+          strlen (trialmessage));
   if (sqlapi == NULL)
     {
       return GNUNET_SYSERR;
@@ -189,14 +199,21 @@
     {
       ret =
         sqlapi->insert_trial (&trialuid, num_peers, topology, put_items,
-                              get_requests, concurrent_requests);
+                              get_requests, concurrent_requests, settle_time,
+                              trialmessage);
     }
-
   if (ret != GNUNET_OK)
     return GNUNET_SYSERR;
-  printf ("Starting %u peers for trial %llu...\n", (unsigned int) num_peers,
-          trialuid);
-  peers = GNUNET_REMOTE_start_daemons (cfg, num_peers);
+
+  ret = GNUNET_REMOTE_start_daemons (&peers, cfg, num_peers);
+  if (ret != GNUNET_SYSERR)
+    totalConnections = (unsigned int) ret;
+  else
+    return ret;
+
+  sqlapi->update_connections (trialuid, totalConnections);
+  printf ("Topology created, %d total connections, Trial uid %llu\n",
+          totalConnections, trialuid);
   if (peers == NULL)
     {
       GNUNET_GC_free (cfg);

Modified: GNUnet/src/applications/dv_dht/tools/dv_dht_multi_topology_test.c
===================================================================
--- GNUnet/src/applications/dv_dht/tools/dv_dht_multi_topology_test.c   
2009-07-08 22:11:46 UTC (rev 8646)
+++ GNUnet/src/applications/dv_dht/tools/dv_dht_multi_topology_test.c   
2009-07-08 23:09:17 UTC (rev 8647)
@@ -142,7 +142,7 @@
                                             "MULTIPLE_SERVER_TESTING",
                                             "DOT_OUTPUT", "topology.dot");
   printf ("Starting %u peers...\n", NUM_PEERS);
-  peers = GNUNET_REMOTE_start_daemons (cfg, NUM_PEERS);
+  GNUNET_REMOTE_start_daemons (&peers, cfg, NUM_PEERS);
   if (peers == NULL)
     {
       GNUNET_GC_free (cfg);

Modified: GNUnet/src/applications/dv_dht/tools/gnunetd_dv.conf
===================================================================
--- GNUnet/src/applications/dv_dht/tools/gnunetd_dv.conf        2009-07-08 
22:11:46 UTC (rev 8646)
+++ GNUnet/src/applications/dv_dht/tools/gnunetd_dv.conf        2009-07-08 
23:09:17 UTC (rev 8647)
@@ -53,8 +53,8 @@
 USER-LEVEL = DEBUG
 
 [LOAD]
-MAXNETDOWNBPSTOTAL = 50000
-MAXNETUPBPSTOTAL = 50000
+MAXNETDOWNBPSTOTAL = 500000
+MAXNETUPBPSTOTAL = 500000
 HARDUPLIMIT = 0
 MAXCPULOAD = 100
 MAXIOLOAD = 50

Modified: GNUnet/src/applications/testing/remote.c
===================================================================
--- GNUnet/src/applications/testing/remote.c    2009-07-08 22:11:46 UTC (rev 
8646)
+++ GNUnet/src/applications/testing/remote.c    2009-07-08 23:09:17 UTC (rev 
8647)
@@ -218,8 +218,10 @@
 }
 
 
-struct GNUNET_REMOTE_TESTING_DaemonContext *
-GNUNET_REMOTE_start_daemons (struct GNUNET_GC_Configuration *newcfg,
+int
+GNUNET_REMOTE_start_daemons (struct GNUNET_REMOTE_TESTING_DaemonContext
+                             **ret_peers,
+                             struct GNUNET_GC_Configuration *newcfg,
                              unsigned long long number_of_daemons)
 {
   struct GNUNET_GC_Configuration *basecfg;
@@ -227,10 +229,10 @@
   struct GNUNET_REMOTE_host_list *array_of_pointers[number_of_daemons];
   struct GNUNET_REMOTE_host_list *temp_pos;
   GNUNET_REMOTE_TOPOLOGIES type_of_topology;
-  struct GNUNET_REMOTE_TESTING_DaemonContext *ret_peers;
+  struct GNUNET_REMOTE_TESTING_DaemonContext *new_ret_peers;
   struct GNUNET_REMOTE_TESTING_DaemonContext *next_peer;
 
-  ret_peers = NULL;
+  new_ret_peers = NULL;
   list_as_array = &array_of_pointers[0];
   FILE *dotOutFile;
 
@@ -514,7 +516,7 @@
               next_peer =
                 GNUNET_malloc (sizeof
                                (struct GNUNET_REMOTE_TESTING_DaemonContext));
-              next_peer->next = ret_peers;
+              next_peer->next = new_ret_peers;
               next_peer->hostname = GNUNET_strdup (curr_host);
               next_peer->username = GNUNET_strdup (ssh_username);
               next_peer->port = starting_port + (j * port_increment);
@@ -530,7 +532,7 @@
                 GNUNET_REMOTE_get_daemon_information (next_peer->hostname,
                                                       next_peer->port);
 
-              ret_peers = next_peer;
+              new_ret_peers = next_peer;
 
               GNUNET_GC_get_configuration_value_number (basecfg,
                                                         "NETWORK",
@@ -667,7 +669,7 @@
                     GNUNET_malloc (sizeof
                                    (struct
                                     GNUNET_REMOTE_TESTING_DaemonContext));
-                  next_peer->next = ret_peers;
+                  next_peer->next = new_ret_peers;
                   next_peer->hostname = GNUNET_strdup (curr_host);
                   next_peer->port =
                     starting_port + ((j + 1) * port_increment);
@@ -683,7 +685,7 @@
                   next_peer->peer =
                     GNUNET_REMOTE_get_daemon_information (next_peer->hostname,
                                                           next_peer->port);
-                  ret_peers = next_peer;
+                  new_ret_peers = next_peer;
 
                   GNUNET_GC_get_configuration_value_number (basecfg,
                                                             "NETWORK",
@@ -728,8 +730,8 @@
   GNUNET_free (hostnames);
   GNUNET_free (remote_config_path);
   GNUNET_free (remote_gnunetd_path);
-
-  return ret_peers;
+  *ret_peers = new_ret_peers;
+  return ret;
 }
 
 int
@@ -744,6 +746,7 @@
   int unused;
   char *cmd;
   int length;
+  int totalConnections;
 
   ret = GNUNET_OK;
   switch (type)
@@ -782,6 +785,14 @@
 #endif
       ret = GNUNET_REMOTE_connect_erdos_renyi (percentage, head, dotOutFile);
       break;
+    case GNUNET_REMOTE_INTERNAT:
+#if VERBOSE
+      fprintf (stderr, _("Creating Erdos-Renyi topology\n"));
+#endif
+      ret =
+        GNUNET_REMOTE_connect_nated_internet (percentage, number_of_daemons,
+                                              head, dotOutFile);
+      break;
     case GNUNET_REMOTE_NONE:
       return ret;
       break;
@@ -789,9 +800,10 @@
       ret = GNUNET_SYSERR;
       break;
     }
-
+  totalConnections = 0;
   if (ret == GNUNET_OK)
     {
+
       pos = head;
       while (pos != NULL)
         {
@@ -810,6 +822,7 @@
               fprintf (temp_friend_handle, "%s\n",
                        (const char *) friend_pos->nodeid);
               friend_pos = friend_pos->next;
+              totalConnections++;
             }
 
           fclose (temp_friend_handle);
@@ -883,8 +896,13 @@
 #endif
     }
 
-
-  return ret;
+#if VERBOSE
+  fprintf (stderr, _("Total connections: %d!\n"), totalConnections);
+#endif
+  if (ret != GNUNET_OK)
+    return ret;
+  else
+    return totalConnections;
 }
 
 /* end of remote.c */

Modified: GNUnet/src/applications/testing/remotetest.c
===================================================================
--- GNUnet/src/applications/testing/remotetest.c        2009-07-08 22:11:46 UTC 
(rev 8646)
+++ GNUnet/src/applications/testing/remotetest.c        2009-07-08 23:09:17 UTC 
(rev 8647)
@@ -56,7 +56,7 @@
 main (int argc, char *const *argv)
 {
   int res;
-
+  struct GNUNET_REMOTE_TESTING_DaemonContext *peers;
   struct GNUNET_GC_Configuration *cfg;
   struct GNUNET_GE_Context *ectx;
   struct GNUNET_GC_Configuration *hostConfig;
@@ -86,7 +86,7 @@
                                                 "DOT_OUTPUT", dotOutFileName);
     }
 
-  GNUNET_REMOTE_start_daemons (hostConfig, number_of_daemons);
+  GNUNET_REMOTE_start_daemons (&peers, hostConfig, number_of_daemons);
 
   GNUNET_GC_free (hostConfig);
   GNUNET_fini (ectx, cfg);

Modified: GNUnet/src/applications/testing/remotetopologies.c
===================================================================
--- GNUnet/src/applications/testing/remotetopologies.c  2009-07-08 22:11:46 UTC 
(rev 8646)
+++ GNUnet/src/applications/testing/remotetopologies.c  2009-07-08 23:09:17 UTC 
(rev 8647)
@@ -53,7 +53,7 @@
 
   struct GNUNET_REMOTE_friends_list *node1iter;
   struct GNUNET_REMOTE_friends_list *node2iter;
-
+  int added;
   int addNode1 = 1;
   int addNode2 = 1;
 
@@ -73,28 +73,30 @@
         addNode1 = 0;
       node1iter = node1iter->next;
     }
-
+  added = 0;
   if (addNode1)
-  {
-    node1temp = GNUNET_malloc (sizeof (struct GNUNET_REMOTE_friends_list));
-    node1temp->nodeid = GNUNET_malloc (sizeof (GNUNET_EncName));
-    memcpy (node1temp->nodeid, node2enc, sizeof (GNUNET_EncName));
-    node1temp->next = node1pos->friend_entries;
-    node1temp->hostentry = node2pos;
-    node1pos->friend_entries = node1temp;
-  }
+    {
+      node1temp = GNUNET_malloc (sizeof (struct GNUNET_REMOTE_friends_list));
+      node1temp->nodeid = GNUNET_malloc (sizeof (GNUNET_EncName));
+      memcpy (node1temp->nodeid, node2enc, sizeof (GNUNET_EncName));
+      node1temp->next = node1pos->friend_entries;
+      node1temp->hostentry = node2pos;
+      node1pos->friend_entries = node1temp;
+      added++;
+    }
 
   if (addNode2)
-  {
-    node2temp = GNUNET_malloc (sizeof (struct GNUNET_REMOTE_friends_list));
-    node2temp->hostentry = node1pos;
-    node2temp->nodeid = GNUNET_malloc (sizeof (GNUNET_EncName));
-    memcpy (node2temp->nodeid, node1enc, sizeof (GNUNET_EncName));
-    node2temp->next = node2pos->friend_entries;
-    node2pos->friend_entries = node2temp;
-  }
+    {
+      node2temp = GNUNET_malloc (sizeof (struct GNUNET_REMOTE_friends_list));
+      node2temp->hostentry = node1pos;
+      node2temp->nodeid = GNUNET_malloc (sizeof (GNUNET_EncName));
+      memcpy (node2temp->nodeid, node1enc, sizeof (GNUNET_EncName));
+      node2temp->next = node2pos->friend_entries;
+      node2pos->friend_entries = node2temp;
+      added++;
+    }
 
-  return GNUNET_OK;
+  return added;
 }
 
 int
@@ -400,6 +402,7 @@
   unsigned int node2Col;
   unsigned int distance;
   double probability, random;
+  unsigned int totalConnections, smallWorldConnections;
 
   GNUNET_EncName *node1;
   GNUNET_EncName *node2;
@@ -428,6 +431,8 @@
            _("Connecting nodes in 2d torus topology: %u rows %u columns\n"),
            rows, cols);
 #endif
+
+  totalConnections = 0;
   /* Rows and columns are all sorted out, now iterate over all nodes and 
connect each
    * to the node to its right and above.  Once this is over, we'll have our 
torus!
    * Special case for the last node (if the rows and columns are not equal), 
connect
@@ -452,8 +457,8 @@
                                              list_as_array
                                              [nodeToConnect]->port, &node1,
                                              &node2);
-      addNodeRefs (node1, node2, list_as_array[i],
-                   list_as_array[nodeToConnect]);
+      totalConnections += addNodeRefs (node1, node2, list_as_array[i],
+                                       list_as_array[nodeToConnect]);
 
       if (i < cols)
         nodeToConnect = (rows * cols) - cols + i;
@@ -472,14 +477,17 @@
                                                  list_as_array
                                                  [nodeToConnect]->port,
                                                  &node1, &node2);
-          addNodeRefs (node1, node2, list_as_array[i],
-                       list_as_array[nodeToConnect]);
+          totalConnections += addNodeRefs (node1, node2, list_as_array[i],
+                                           list_as_array[nodeToConnect]);
         }
 
     }
 
   natLog = log (number_of_daemons);
-
+#if VERBOSE
+  fprintf (stderr, _("natural log of %d is %d\n"), number_of_daemons, natLog);
+#endif
+  smallWorldConnections = 0;
   for (i = 0; i < natLog; i++)
     {
       for (j = 0; j < number_of_daemons; j++)
@@ -514,14 +522,19 @@
                                                              [k]->port,
                                                              &node1, &node2);
 
-                      addNodeRefs (node1, node2, list_as_array[j],
-                                   list_as_array[k]);
+                      smallWorldConnections +=
+                        addNodeRefs (node1, node2, list_as_array[j],
+                                     list_as_array[k]);
                     }
                 }
             }
         }
     }
-
+  totalConnections += smallWorldConnections;
+#if VERBOSE
+  fprintf (stderr, _("Total connections added for small world: %d!\n"),
+           smallWorldConnections);
+#endif
   GNUNET_free (node1);
   GNUNET_free (node2);
   return GNUNET_OK;

Modified: GNUnet/src/include/dv.h
===================================================================
--- GNUnet/src/include/dv.h     2009-07-08 22:11:46 UTC (rev 8646)
+++ GNUnet/src/include/dv.h     2009-07-08 23:09:17 UTC (rev 8647)
@@ -33,8 +33,8 @@
 #define GNUNET_DV_MAX_COST -1
 #define GNUNET_DV_MAX_TABLE_SIZE -1
 #define GNUNET_DV_DEFAULT_SEND_INTERVAL 2000
-#define GNUNET_DV_PEER_EXPIRATION_TIME 60 * GNUNET_CRON_SECONDS
-#define GNUNET_DV_MAINTAIN_FREQUENCY 20 * GNUNET_CRON_SECONDS
+#define GNUNET_DV_PEER_EXPIRATION_TIME 600 * GNUNET_CRON_SECONDS
+#define GNUNET_DV_MAINTAIN_FREQUENCY 60 * GNUNET_CRON_SECONDS
 
 /**
  * Message that gets sent between nodes updating dv infos

Modified: GNUnet/src/include/gnunet_dhtlog_service.h
===================================================================
--- GNUnet/src/include/gnunet_dhtlog_service.h  2009-07-08 22:11:46 UTC (rev 
8646)
+++ GNUnet/src/include/gnunet_dhtlog_service.h  2009-07-08 23:09:17 UTC (rev 
8647)
@@ -82,7 +82,8 @@
    * Inserts the trial information into the database
    */
   int (*insert_trial) (unsigned long long *trialuid, int num_nodes,
-                       int topology, int puts, int gets, int concurrent);
+                       int topology, int puts, int gets, int concurrent,
+                       int settle_time, char *message);
 
   /*
    * Update the trial information with the ending time
@@ -90,6 +91,12 @@
   int (*update_trial) (unsigned long long trialuid);
 
   /*
+   * Update the trial information with the total connections
+   */
+  int (*update_connections) (unsigned long long trialuid,
+                             unsigned int totalConnections);
+
+  /*
    * Insert the query information from a single hop into the database
    *
    * @param sqlqueryuid return value for the sql uid for this query

Modified: GNUnet/src/include/gnunet_remote_lib.h
===================================================================
--- GNUnet/src/include/gnunet_remote_lib.h      2009-07-08 22:11:46 UTC (rev 
8646)
+++ GNUnet/src/include/gnunet_remote_lib.h      2009-07-08 23:09:17 UTC (rev 
8647)
@@ -44,6 +44,7 @@
   GNUNET_REMOTE_RING,
   GNUNET_REMOTE_2D_TORUS,
   GNUNET_REMOTE_ERDOS_RENYI,
+  GNUNET_REMOTE_INTERNAT,
   GNUNET_REMOTE_NONE,
 
 } GNUNET_REMOTE_TOPOLOGIES;
@@ -81,11 +82,14 @@
 /**
  * Main start function to be called.  Needs a remote config specified, as well
  * as the number of daemons to start and the type of topology.  Available 
topology
- * types are defined in gnunet_remote_lib.h  Returns a linked list of hosts 
started
+ * types are defined in gnunet_remote_lib.h  ret_peers hold a linked list of 
the
+ * hosts started.  Returns the total number of connections in the topology.
  */
-struct GNUNET_REMOTE_TESTING_DaemonContext
-  *GNUNET_REMOTE_start_daemons (struct GNUNET_GC_Configuration *newcfg,
-                                unsigned long long number_of_daemons);
+int
+GNUNET_REMOTE_start_daemons (struct GNUNET_REMOTE_TESTING_DaemonContext
+                             **ret_peers,
+                             struct GNUNET_GC_Configuration *newcfg,
+                             unsigned long long number_of_daemons);
 
 int
 GNUNET_REMOTE_kill_daemon (struct GNUNET_REMOTE_TESTING_DaemonContext





reply via email to

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