diff options
Diffstat (limited to 'src/ats/gnunet-service-ats-solver_mlp.c')
-rw-r--r-- | src/ats/gnunet-service-ats-solver_mlp.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/ats/gnunet-service-ats-solver_mlp.c b/src/ats/gnunet-service-ats-solver_mlp.c index 84cacd017..93c6839f8 100644 --- a/src/ats/gnunet-service-ats-solver_mlp.c +++ b/src/ats/gnunet-service-ats-solver_mlp.c | |||
@@ -1078,7 +1078,7 @@ GAS_mlp_solve_problem (void *solver) | |||
1078 | else | 1078 | else |
1079 | { | 1079 | { |
1080 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Problem was updated, resolving\n"); | 1080 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Problem was updated, resolving\n"); |
1081 | duration_build.rel_value = 0; | 1081 | duration_build.rel_value_us = 0; |
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | /* Run LP solver */ | 1084 | /* Run LP solver */ |
@@ -1107,10 +1107,15 @@ GAS_mlp_solve_problem (void *solver) | |||
1107 | mlp->ps.p_rows = glp_get_num_rows (mlp->p.prob); | 1107 | mlp->ps.p_rows = glp_get_num_rows (mlp->p.prob); |
1108 | mlp->ps.p_elements = mlp->p.num_elements; | 1108 | mlp->ps.p_elements = mlp->p.num_elements; |
1109 | 1109 | ||
1110 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Execution time: Build %llu ms, LP %llu ms, MLP %llu ms\n", | 1110 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1111 | (unsigned long long) duration_build.rel_value, | 1111 | "Execution time: Build %s\n", |
1112 | (unsigned long long) duration_lp.rel_value, | 1112 | GNUNET_STRINGS_relative_time_to_string (duration_build, GNUNET_NO)); |
1113 | (unsigned long long) duration_mlp.rel_value); | 1113 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1114 | "Execution time: LP %s\n", | ||
1115 | GNUNET_STRINGS_relative_time_to_string (duration_lp, GNUNET_NO)); | ||
1116 | LOG (GNUNET_ERROR_TYPE_DEBUG, | ||
1117 | "Execution time: MLP %s\n", | ||
1118 | GNUNET_STRINGS_relative_time_to_string (duration_mlp, GNUNET_NO)); | ||
1114 | 1119 | ||
1115 | /* Propagate result*/ | 1120 | /* Propagate result*/ |
1116 | if ((GNUNET_OK == res_lp) && (GNUNET_OK == res_mip)) | 1121 | if ((GNUNET_OK == res_lp) && (GNUNET_OK == res_mip)) |
@@ -1120,7 +1125,7 @@ GAS_mlp_solve_problem (void *solver) | |||
1120 | if (GNUNET_YES == mlp->write_mip_mps) | 1125 | if (GNUNET_YES == mlp->write_mip_mps) |
1121 | { | 1126 | { |
1122 | /* Write problem to disk */ | 1127 | /* Write problem to disk */ |
1123 | GNUNET_asprintf (&filename, "problem_p_%u_a%u_%llu.mps", mlp->p.num_peers, mlp->p.num_addresses, time.abs_value); | 1128 | GNUNET_asprintf (&filename, "problem_p_%u_a%u_%llu.mps", mlp->p.num_peers, mlp->p.num_addresses, time.abs_value_us); |
1124 | LOG (GNUNET_ERROR_TYPE_ERROR, "DUMP: %s \n", filename); | 1129 | LOG (GNUNET_ERROR_TYPE_ERROR, "DUMP: %s \n", filename); |
1125 | glp_write_lp(mlp->p.prob, NULL, filename); | 1130 | glp_write_lp(mlp->p.prob, NULL, filename); |
1126 | GNUNET_free (filename); | 1131 | GNUNET_free (filename); |
@@ -1128,7 +1133,7 @@ GAS_mlp_solve_problem (void *solver) | |||
1128 | if (GNUNET_YES == mlp->write_mip_sol) | 1133 | if (GNUNET_YES == mlp->write_mip_sol) |
1129 | { | 1134 | { |
1130 | /* Write solution to disk */ | 1135 | /* Write solution to disk */ |
1131 | GNUNET_asprintf (&filename, "problem_p_%u_a%u_%llu.sol", mlp->p.num_peers, mlp->p.num_addresses, time.abs_value); | 1136 | GNUNET_asprintf (&filename, "problem_p_%u_a%u_%llu.sol", mlp->p.num_peers, mlp->p.num_addresses, time.abs_value_us); |
1132 | glp_print_mip (mlp->p.prob, filename ); | 1137 | glp_print_mip (mlp->p.prob, filename ); |
1133 | LOG (GNUNET_ERROR_TYPE_ERROR, "DUMP: %s \n", filename); | 1138 | LOG (GNUNET_ERROR_TYPE_ERROR, "DUMP: %s \n", filename); |
1134 | GNUNET_free (filename); | 1139 | GNUNET_free (filename); |
@@ -1965,7 +1970,7 @@ GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1965 | mlp->control_param_lp.msg_lev = GLP_MSG_ALL; | 1970 | mlp->control_param_lp.msg_lev = GLP_MSG_ALL; |
1966 | #endif | 1971 | #endif |
1967 | mlp->control_param_lp.it_lim = max_iterations; | 1972 | mlp->control_param_lp.it_lim = max_iterations; |
1968 | mlp->control_param_lp.tm_lim = max_duration.rel_value; | 1973 | mlp->control_param_lp.tm_lim = max_duration.rel_value_us / 1000LL; |
1969 | 1974 | ||
1970 | /* Init MLP solving parameters */ | 1975 | /* Init MLP solving parameters */ |
1971 | glp_init_iocp(&mlp->control_param_mlp); | 1976 | glp_init_iocp(&mlp->control_param_mlp); |
@@ -1973,7 +1978,7 @@ GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1973 | #if VERBOSE_GLPK | 1978 | #if VERBOSE_GLPK |
1974 | mlp->control_param_mlp.msg_lev = GLP_MSG_ALL; | 1979 | mlp->control_param_mlp.msg_lev = GLP_MSG_ALL; |
1975 | #endif | 1980 | #endif |
1976 | mlp->control_param_mlp.tm_lim = max_duration.rel_value; | 1981 | mlp->control_param_mlp.tm_lim = max_duration.rel_value_us / 1000LL; |
1977 | 1982 | ||
1978 | LOG (GNUNET_ERROR_TYPE_DEBUG, "solver ready\n"); | 1983 | LOG (GNUNET_ERROR_TYPE_DEBUG, "solver ready\n"); |
1979 | 1984 | ||