gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r33259 - gnunet/src/ats
Date: Tue, 13 May 2014 14:47:54 +0200

Author: wachs
Date: 2014-05-13 14:47:54 +0200 (Tue, 13 May 2014)
New Revision: 33259

Modified:
   gnunet/src/ats/perf_ats_solver.c
   gnunet/src/ats/perf_ats_solver.conf
   gnunet/src/ats/plugin_ats_mlp.c
   gnunet/src/ats/plugin_ats_mlp.h
Log:
supporting additional log formats like MPS


Modified: gnunet/src/ats/perf_ats_solver.c
===================================================================
--- gnunet/src/ats/perf_ats_solver.c    2014-05-13 12:08:14 UTC (rev 33258)
+++ gnunet/src/ats/perf_ats_solver.c    2014-05-13 12:47:54 UTC (rev 33259)
@@ -791,7 +791,11 @@
     if (0 == cp)
       continue;
     if (NULL == cur)
+    {
       GNUNET_break (0);
+      fprintf (stderr,
+               "Missing result for %u peers\n", cp);
+    }
 
 
     if (GNUNET_NO == cur->valid)

Modified: gnunet/src/ats/perf_ats_solver.conf
===================================================================
--- gnunet/src/ats/perf_ats_solver.conf 2014-05-13 12:08:14 UTC (rev 33258)
+++ gnunet/src/ats/perf_ats_solver.conf 2014-05-13 12:47:54 UTC (rev 33259)
@@ -1,30 +1,30 @@
 [ats]
 # Network specific inbound/outbound quotas
-UNSPECIFIED_QUOTA_IN = 10000
-UNSPECIFIED_QUOTA_OUT = 10000
+UNSPECIFIED_QUOTA_IN = 1000
+UNSPECIFIED_QUOTA_OUT = 1000
 # LOOPBACK
-LOOPBACK_QUOTA_IN = 10000
-LOOPBACK_QUOTA_OUT = 10000
+LOOPBACK_QUOTA_IN = 100000
+LOOPBACK_QUOTA_OUT = 100000
 # LAN
-LAN_QUOTA_IN = 10000
-LAN_QUOTA_OUT = 10000
+LAN_QUOTA_IN = 100000
+LAN_QUOTA_OUT = 100000
 # WAN
-WAN_QUOTA_IN = 10000
-WAN_QUOTA_OUT = 10000
+WAN_QUOTA_IN = 100000
+WAN_QUOTA_OUT = 100000
 # WLAN
-WLAN_QUOTA_IN = 10000
-WLAN_QUOTA_OUT = 10000
+WLAN_QUOTA_IN = 1000
+WLAN_QUOTA_OUT = 1000
 # BLUETOOTH
-BLUETOOTH_QUOTA_IN = 10000
-BLUETOOTH_QUOTA_OUT = 10000
+BLUETOOTH_QUOTA_IN = 1000
+BLUETOOTH_QUOTA_OUT = 1000
 
 # Proportional specific settings
 # How proportional to preferences is bandwidth distribution in a network
 # 1: Fair with respect to addresses without preferences
-# > 100: The bigger, the more respect is payed to preferences 
+# > 10: The bigger, the more respect is payed to preferences 
 PROP_PROPORTIONALITY_FACTOR = 200
 # Should we stick to existing connections are prefer to switch?
-# [100...200], lower value prefers to switch, bigger value is more tolerant
+# [10...200], lower value prefers to switch, bigger value is more tolerant
 PROP_STABILITY_FACTOR = 125
 
 # MLP specific settings
@@ -38,16 +38,18 @@
 # MLP_COEFFICIENT_D = 1.0
 # MLP_COEFFICIENT_U = 1.0
 # MLP_COEFFICIENT_R = 1.0
-MLP_MIN_BANDWIDTH = 10
+MLP_MIN_BANDWIDTH = 1024
 # MLP_MIN_CONNECTIONS = 4
-MLP_DBG_FEASIBILITY_ONLY = NO
+#MLP_DBG_FEASIBILITY_ONLY = YES
 MLP_DBG_AUTOSCALE_PROBLEM = YES
 # MLP_DBG_INTOPT_PRESOLVE = YES
-#MLP_DBG_GLPK_VERBOSE = YES
+MLP_DBG_GLPK_VERBOSE = YES
 
+MLP_LOG_FORMAT = MPS
+
 # MLP Log settings
 # Dump all problems to disk
-MLP_DUMP_PROBLEM_ALL = NO
+MLP_DUMP_PROBLEM_ALL = YES
 # Dump all solution to disk
 MLP_DUMP_SOLUTION_ALL = NO
 # Print GLPK output

Modified: gnunet/src/ats/plugin_ats_mlp.c
===================================================================
--- gnunet/src/ats/plugin_ats_mlp.c     2014-05-13 12:08:14 UTC (rev 33258)
+++ gnunet/src/ats/plugin_ats_mlp.c     2014-05-13 12:47:54 UTC (rev 33259)
@@ -1331,10 +1331,28 @@
       (mlp->opt_dump_problem_on_fail && ((GNUNET_OK != res_lp) || (GNUNET_OK 
!= res_mip))) )
     {
       /* Write problem to disk */
-      GNUNET_asprintf(&filename, "problem_p_%u_a%u_%llu.lp", mlp->p.num_peers,
-          mlp->p.num_addresses, time.abs_value_us);
+      switch (mlp->opt_log_format) {
+        case MLP_CPLEX:
+          GNUNET_asprintf(&filename, "problem_p_%u_a%u_%llu.cplex", 
mlp->p.num_peers,
+              mlp->p.num_addresses, time.abs_value_us);
+          glp_write_lp (mlp->p.prob, NULL, filename);
+          break;
+        case MLP_GLPK:
+          GNUNET_asprintf(&filename, "problem_p_%u_a%u_%llu.glpk", 
mlp->p.num_peers,
+              mlp->p.num_addresses, time.abs_value_us);
+          glp_write_prob (mlp->p.prob, 0, filename);
+          break;
+        case MLP_MPS:
+          GNUNET_asprintf(&filename, "problem_p_%u_a%u_%llu.mps", 
mlp->p.num_peers,
+              mlp->p.num_addresses, time.abs_value_us);
+          glp_write_mps (mlp->p.prob, GLP_MPS_FILE, NULL, filename);
+          break;
+        default:
+          break;
+      }
+
+
       LOG(GNUNET_ERROR_TYPE_ERROR, "Dumped problem to file: `%s' \n", 
filename);
-      glp_write_lp (mlp->p.prob, NULL, filename);
       GNUNET_free(filename);
     }
   if ( (mlp->opt_dump_solution_all) ||
@@ -2022,6 +2040,7 @@
   int c;
   int c2;
   int found;
+  char *outputformat;
 
   struct GNUNET_TIME_Relative max_duration;
   long long unsigned int max_iterations;
@@ -2111,6 +2130,34 @@
     LOG (GNUNET_ERROR_TYPE_WARNING,
         "MLP solver is configured use the mlp presolver\n");
 
+  if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (env->cfg,
+     "ats", "MLP_LOG_FORMAT", &outputformat))
+   mlp->opt_log_format = MLP_CPLEX;
+  else
+  {
+    GNUNET_STRINGS_utf8_toupper(outputformat, outputformat);
+    if (0 == strcmp (outputformat, "MPS"))
+    {
+      mlp->opt_log_format = MLP_MPS;
+    }
+    else if (0 == strcmp (outputformat, "CPLEX"))
+    {
+      mlp->opt_log_format = MLP_CPLEX;
+    }
+    else if (0 == strcmp (outputformat, "GLPK"))
+    {
+      mlp->opt_log_format = MLP_GLPK;
+    }
+    else
+    {
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+          "Invalid log format `%s' in configuration, using CPLEX!\n",
+          outputformat);
+      mlp->opt_log_format = MLP_CPLEX;
+    }
+    GNUNET_free (outputformat);
+  }
+
   mlp->pv.BIG_M = (double) BIG_M_VALUE;
 
   /* Get timeout for iterations */

Modified: gnunet/src/ats/plugin_ats_mlp.h
===================================================================
--- gnunet/src/ats/plugin_ats_mlp.h     2014-05-13 12:08:14 UTC (rev 33258)
+++ gnunet/src/ats/plugin_ats_mlp.h     2014-05-13 12:47:54 UTC (rev 33259)
@@ -56,6 +56,14 @@
 #define GLP_YES 1.0
 #define GLP_NO  0.0
 
+enum MLP_Output_Format
+{
+  MLP_MPS,
+  MLP_CPLEX,
+  MLP_GLPK
+};
+
+
 struct MLP_Solution
 {
   int lp_res;
@@ -356,6 +364,7 @@
    */
   int opt_dbg_glpk_verbose;
 
+  enum MLP_Output_Format opt_log_format;
 };
 
 /**




reply via email to

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