diff options
Diffstat (limited to 'src/ats/gnunet-service-ats_addresses_mlp.c')
-rw-r--r-- | src/ats/gnunet-service-ats_addresses_mlp.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/ats/gnunet-service-ats_addresses_mlp.c b/src/ats/gnunet-service-ats_addresses_mlp.c index f16832ecf..dfb62e665 100644 --- a/src/ats/gnunet-service-ats_addresses_mlp.c +++ b/src/ats/gnunet-service-ats_addresses_mlp.c | |||
@@ -883,9 +883,6 @@ lp_solv: | |||
883 | GNUNET_STATISTICS_set (mlp->stats,"# LP execution time average (ms)", | 883 | GNUNET_STATISTICS_set (mlp->stats,"# LP execution time average (ms)", |
884 | mlp->lp_total_duration / mlp->lp_solved, GNUNET_NO); | 884 | mlp->lp_total_duration / mlp->lp_solved, GNUNET_NO); |
885 | 885 | ||
886 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, | ||
887 | "ats-mlp", | ||
888 | "%llu %llu \n", duration.rel_value, mlp->lp_total_duration / mlp->lp_solved); | ||
889 | /* Analyze problem status */ | 886 | /* Analyze problem status */ |
890 | res = glp_get_status (mlp->prob); | 887 | res = glp_get_status (mlp->prob); |
891 | switch (res) { | 888 | switch (res) { |
@@ -1121,12 +1118,30 @@ GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1121 | char * quota_in_str; | 1118 | char * quota_in_str; |
1122 | 1119 | ||
1123 | /* Init GLPK environment */ | 1120 | /* Init GLPK environment */ |
1124 | int res = 0; | 1121 | int res = glp_init_env(); |
1125 | if (0 != (res = glp_init_env())) | 1122 | switch (res) { |
1126 | { | 1123 | case 0: |
1127 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not init GLPK %u\n", res); | 1124 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "GLPK: `%s'\n", |
1128 | GNUNET_free(mlp); | 1125 | "initialization successful"); |
1129 | return NULL; | 1126 | break; |
1127 | case 1: | ||
1128 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "GLPK: `%s'\n", | ||
1129 | "environment is already initialized"); | ||
1130 | break; | ||
1131 | case 2: | ||
1132 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not init GLPK: `%s'\n", | ||
1133 | "initialization failed (insufficient memory)"); | ||
1134 | GNUNET_free(mlp); | ||
1135 | return NULL; | ||
1136 | break; | ||
1137 | case 3: | ||
1138 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not init GLPK: `%s'\n", | ||
1139 | "initialization failed (unsupported programming model)"); | ||
1140 | GNUNET_free(mlp); | ||
1141 | return NULL; | ||
1142 | break; | ||
1143 | default: | ||
1144 | break; | ||
1130 | } | 1145 | } |
1131 | 1146 | ||
1132 | /* Create initial MLP problem */ | 1147 | /* Create initial MLP problem */ |