gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r25381 - gnunet/src/ats


From: gnunet
Subject: [GNUnet-SVN] r25381 - gnunet/src/ats
Date: Tue, 11 Dec 2012 10:30:58 +0100

Author: wachs
Date: 2012-12-11 10:30:58 +0100 (Tue, 11 Dec 2012)
New Revision: 25381

Modified:
   gnunet/src/ats/gnunet-service-ats_addresses.c
   gnunet/src/ats/gnunet-service-ats_addresses.h
   gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
   gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c
   gnunet/src/ats/perf_ats_mlp.c
   gnunet/src/ats/test_ats_mlp.c
   gnunet/src/ats/test_ats_mlp_averaging.c
Log:
rename

Modified: gnunet/src/ats/gnunet-service-ats_addresses.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.c       2012-12-11 09:28:19 UTC 
(rev 25380)
+++ gnunet/src/ats/gnunet-service-ats_addresses.c       2012-12-11 09:30:58 UTC 
(rev 25381)
@@ -276,7 +276,7 @@
   aa->plugin = GNUNET_strdup (plugin_name);
   aa->session_id = session_id;
   aa->active = GNUNET_NO;
-  aa->mlp_information = NULL;
+  aa->solver_information = NULL;
   aa->assigned_bw_in = GNUNET_BANDWIDTH_value_init(0);
   aa->assigned_bw_out = GNUNET_BANDWIDTH_value_init(0);
   return aa;
@@ -465,7 +465,7 @@
                        plugin_name,
                        plugin_addr, plugin_addr_len,
                        session_id);
-  aa->mlp_information = NULL;
+  aa->solver_information = NULL;
   if (atsi_count != (ats_res = disassemble_ats_information(atsi, atsi_count, 
aa)))
   {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,

Modified: gnunet/src/ats/gnunet-service-ats_addresses.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses.h       2012-12-11 09:28:19 UTC 
(rev 25380)
+++ gnunet/src/ats/gnunet-service-ats_addresses.h       2012-12-11 09:30:58 UTC 
(rev 25381)
@@ -75,21 +75,10 @@
   char *plugin;
 
   /**
-   * MLP specific information
-   * TODO remove or rename
+   * Solver specific information for this address
    */
-  void *mlp_information;
+  void *solver_information;
 
-  /**
-   * ATS information
-   */
-  //struct GNUNET_ATS_Information *ats;
-
-  /**
-   * Number of ATS information
-   */
-  //uint32_t ats_count;
-
   /* CHECK USAGE */
   struct GNUNET_TIME_Relative atsp_latency;
 

Modified: gnunet/src/ats/gnunet-service-ats_addresses_mlp.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_mlp.c   2012-12-11 09:28:19 UTC 
(rev 25380)
+++ gnunet/src/ats/gnunet-service-ats_addresses_mlp.c   2012-12-11 09:30:58 UTC 
(rev 25381)
@@ -246,8 +246,8 @@
   unsigned int row_index;
   char *name;
 
-  GNUNET_assert (address->mlp_information != NULL);
-  mlpi = (struct MLP_information *) address->mlp_information;
+  GNUNET_assert (address->solver_information != NULL);
+  mlpi = (struct MLP_information *) address->solver_information;
 
   /* c 1) bandwidth capping
    * b_t  + (-M) * n_t <= 0
@@ -560,7 +560,7 @@
     /* For all addresses of this peer */
     while (addr != NULL)
     {
-      mlpi = (struct MLP_information *) addr->mlp_information;
+      mlpi = (struct MLP_information *) addr->solver_information;
 
       /* coefficient for c 2) */
       ia[mlp->ci] = peer->r_c2;
@@ -611,7 +611,7 @@
     for (tp = mlp->peer_head; tp != NULL; tp = tp->next)
       for (ta = tp->head; ta != NULL; ta = ta->next)
         {
-          mlpi = ta->mlp_information;
+          mlpi = ta->solver_information;
           value = mlpi->q_averaged[c];
 
           mlpi->r_q[c] = mlp->r_q[c];
@@ -643,8 +643,8 @@
   unsigned int col;
   char *name;
 
-  GNUNET_assert (address->mlp_information != NULL);
-  mlpi = address->mlp_information;
+  GNUNET_assert (address->solver_information != NULL);
+  mlpi = address->solver_information;
 
   /* Add bandwidth column */
   col = glp_add_cols (mlp->prob, 2);
@@ -1042,7 +1042,7 @@
       double b = 0.0;
       double n = 0.0;
 
-      mlpi = a->mlp_information;
+      mlpi = a->solver_information;
 
       b = glp_mip_col_val(mlp->prob, mlpi->c_b);
       mlpi->b = b;
@@ -1366,10 +1366,10 @@
       GNUNET_i2s (&address->peer));
 
   GNUNET_assert (NULL != address);
-  GNUNET_assert (NULL != address->mlp_information);
+  GNUNET_assert (NULL != address->solver_information);
 //  GNUNET_assert (NULL != address->ats);
 
-  struct MLP_information *mlpi = address->mlp_information;
+  struct MLP_information *mlpi = address->solver_information;
   //struct GNUNET_ATS_Information *ats = address->ats;
   GNUNET_assert (mlpi != NULL);
 
@@ -1559,7 +1559,7 @@
   GNUNET_STATISTICS_update (mlp->stats, "# MLP address updates", 1, GNUNET_NO);
 
   /* We add a new address */
-  if (address->mlp_information == NULL)
+  if (address->solver_information == NULL)
     new = GNUNET_YES;
   else
     new = GNUNET_NO;
@@ -1580,7 +1580,7 @@
       mlpi->q_averaged[c] = 0.0;
     }
 
-    address->mlp_information = mlpi;
+    address->solver_information = mlpi;
     mlp->addr_in_problem ++;
     GNUNET_STATISTICS_update (mlp->stats, "# addresses in MLP", 1, GNUNET_NO);
 
@@ -1660,10 +1660,10 @@
   struct GAS_MLP_SolutionContext ctx;
 
   /* Free resources */
-  if (address->mlp_information != NULL)
+  if (address->solver_information != NULL)
   {
-    GNUNET_free (address->mlp_information);
-    address->mlp_information = NULL;
+    GNUNET_free (address->solver_information);
+    address->solver_information = NULL;
 
     mlp->addr_in_problem --;
     GNUNET_STATISTICS_update (mlp->stats, "# addresses in MLP", -1, GNUNET_NO);
@@ -1709,7 +1709,7 @@
 
   struct ATS_Address *aa = (struct ATS_Address *) cls;
   struct ATS_Address *addr = value;
-  struct MLP_information *mlpi = addr->mlp_information;
+  struct MLP_information *mlpi = addr->solver_information;
   if (mlpi == NULL)
     return GNUNET_YES;
   if (mlpi->n == GNUNET_YES)
@@ -1798,8 +1798,8 @@
     for (addr = peer->head; NULL != addr; addr = peer->head)
     {
       GNUNET_CONTAINER_DLL_remove(peer->head, peer->tail, addr);
-      GNUNET_free (addr->mlp_information);
-      addr->mlp_information = NULL;
+      GNUNET_free (addr->solver_information);
+      addr->solver_information = NULL;
     }
     GNUNET_free (peer);
     peer = mlp->peer_head;

Modified: gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c
===================================================================
--- gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c    2012-12-11 
09:28:19 UTC (rev 25380)
+++ gnunet/src/ats/gnunet-service-ats_addresses_simplistic.c    2012-12-11 
09:30:58 UTC (rev 25381)
@@ -254,6 +254,7 @@
   aw->addr = address;
   GNUNET_CONTAINER_DLL_insert (cur->head, cur->tail, aw);
   cur->active_addresses ++;
+  aw->addr->solver_information = cur;
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
               "Adding new address for network type `%s' (now %u total)\n",
@@ -470,15 +471,9 @@
      return aa;
   }
 
+  aa->active = GNUNET_YES;
+  s->active_addresses++;
 
-  if (GNUNET_NO == aa->active)
-  {
-    aa->active = GNUNET_YES;
-    s->active_addresses++;
-    //update_quota (s, aa->);
-  }
-
-
   return aa;
 }
 

Modified: gnunet/src/ats/perf_ats_mlp.c
===================================================================
--- gnunet/src/ats/perf_ats_mlp.c       2012-12-11 09:28:19 UTC (rev 25380)
+++ gnunet/src/ats/perf_ats_mlp.c       2012-12-11 09:30:58 UTC (rev 25381)
@@ -335,7 +335,7 @@
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Setting up address %u for peer 
%u\n", c2, c);
       /* Setting required information */
-      a[ca].mlp_information = NULL;
+      a[ca].solver_information = NULL;
       a[ca].prev = NULL;
       a[ca].next = NULL;
 

Modified: gnunet/src/ats/test_ats_mlp.c
===================================================================
--- gnunet/src/ats/test_ats_mlp.c       2012-12-11 09:28:19 UTC (rev 25380)
+++ gnunet/src/ats/test_ats_mlp.c       2012-12-11 09:30:58 UTC (rev 25381)
@@ -46,7 +46,7 @@
 static void
 create_address (struct ATS_Address *addr, char * plugin, int ats_count, struct 
GNUNET_ATS_Information *ats)
 {
-  addr->mlp_information = NULL;
+  addr->solver_information = NULL;
   addr->next = NULL;
   addr->prev = NULL;
   addr->plugin = GNUNET_strdup (plugin);

Modified: gnunet/src/ats/test_ats_mlp_averaging.c
===================================================================
--- gnunet/src/ats/test_ats_mlp_averaging.c     2012-12-11 09:28:19 UTC (rev 
25380)
+++ gnunet/src/ats/test_ats_mlp_averaging.c     2012-12-11 09:30:58 UTC (rev 
25381)
@@ -46,7 +46,7 @@
 static void
 create_address (struct ATS_Address *addr, char * plugin, int ats_count, struct 
GNUNET_ATS_Information *ats)
 {
-  addr->mlp_information = NULL;
+  addr->solver_information = NULL;
   addr->next = NULL;
   addr->prev = NULL;
   addr->plugin = GNUNET_strdup (plugin);




reply via email to

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