From dab011be0a5a313eddc9180598fffb2fabda3669 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 15 Jun 2011 16:05:26 +0000 Subject: [PATCH] improvements --- src/transport/perf_transport_ats.c | 56 ++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/src/transport/perf_transport_ats.c b/src/transport/perf_transport_ats.c index 48551e89f..10442d212 100644 --- a/src/transport/perf_transport_ats.c +++ b/src/transport/perf_transport_ats.c @@ -47,6 +47,7 @@ static glp_prob * prob; static struct GNUNET_TIME_Absolute start; static struct GNUNET_TIME_Absolute end; +static int ret = 0; void solve_mlp(int presolve) { @@ -108,9 +109,17 @@ void modify_qm(int start, int length, int values_to_change) void bench_simplex_optimization(char * file, int executions) { int c; + int res; prob = glp_create_prob(); - glp_read_lp(prob, NULL, file); + res = glp_read_lp(prob, NULL, file); + if (res != 0) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Problem file `%s' not found\n", file); + ret = 1; + return; + } solve_lp(GNUNET_YES); @@ -134,9 +143,17 @@ void bench_simplex_optimization(char * file, int executions) void bench_simplex_no_optimization(char * file, int executions) { int c; + int res; prob = glp_create_prob(); - glp_read_lp(prob, NULL, file); + res = glp_read_lp(prob, NULL, file); + if (res != 0) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Problem file `%s' not found\n", file); + ret = 1; + return; + } for (c=0; c 400 addresses - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Simplex, no optimization, average per address: %f\n", ((double) sim_no_opt_avg / EXECS) / 400); GAUGER ("TRANSPORT","GLPK simplex no optimization", ((double) sim_no_opt_avg / EXECS) / 400, "ms/address"); - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Simplex, with optimization, average per address: %f\n", ((double) sim_with_opt_avg / EXECS) / 400); GAUGER ("TRANSPORT", "GLPK simplex, 100 peers 400 addresses with optimization", ((double) sim_with_opt_avg / EXECS) / 400, "ms/address"); - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "MLP no optimization average per address: %f\n", ((double) mlp_no_opt_avg / EXECS) / 400); GAUGER ("TRANSPORT","GLPK MLP 100 peers 400 addresses no optimization", ((double) mlp_no_opt_avg / EXECS) / 400, "ms/address"); - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "MLP optimization average per address: %f\n", ((double) mlp_with_opt_avg/ EXECS) / 400); GAUGER ("TRANSPORT", -- 2.25.1