[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r14778 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r14778 - gnunet/src/transport |
Date: |
Wed, 30 Mar 2011 11:32:41 +0200 |
Author: wachs
Date: 2011-03-30 11:32:41 +0200 (Wed, 30 Mar 2011)
New Revision: 14778
Modified:
gnunet/src/transport/gnunet-service-transport.c
Log:
run only when glpk
Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c 2011-03-30 08:39:47 UTC
(rev 14777)
+++ gnunet/src/transport/gnunet-service-transport.c 2011-03-30 09:32:41 UTC
(rev 14778)
@@ -5582,7 +5582,7 @@
{
#if !HAVE_LIBGLPK
if (DEBUG_ATS) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "no glpk
installed\n");
- return;
+ return -1;
#else
if (DEBUG_ATS) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "glpk installed\n");
@@ -5963,6 +5963,7 @@
/* To remove: just for testing */
void ats_benchmark (int peers, int transports, int start_peers, int end_peers)
{
+ static int glpk;
struct GNUNET_TIME_Absolute start;
struct GNUNET_TIME_Relative duration;
/*
@@ -6019,14 +6020,18 @@
*
*/
int c_mechs = 0;
- start = GNUNET_TIME_absolute_get();
- c_mechs = ats_create_problem(5000,5000);
-
- duration =
GNUNET_TIME_absolute_get_difference(start,GNUNET_TIME_absolute_get());
-
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "MLP execution time in [ms] for %i
mechanisms: %llu\n", c_mechs, duration.rel_value);
-
- GNUNET_STATISTICS_set (stats, "ATS execution time 100 peers",
duration.rel_value, GNUNET_NO);
+ if (glpk==GNUNET_YES)
+ {
+ start = GNUNET_TIME_absolute_get();
+ c_mechs = ats_create_problem(5000,5000);
+ if (c_mechs != -1)
+ {
+ duration =
GNUNET_TIME_absolute_get_difference(start,GNUNET_TIME_absolute_get());
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "MLP execution time in
[ms] for %i mechanisms: %llu\n", c_mechs, duration.rel_value);
+ GNUNET_STATISTICS_set (stats, "ATS execution time 100 peers",
duration.rel_value, GNUNET_NO);
+ }
+ else glpk = GNUNET_NO;
+ }
}
void ats_calculate_bandwidth_distribution ()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r14778 - gnunet/src/transport,
gnunet <=