Skip to content

Commit 5ec76ca

Browse files
committed
Identified use of highs_debug_level as cause of error - due to info_ not being defined when using IPM/PDLP before the call to debugHighsLpSolution in HighsSolve.cpp
1 parent 3d36291 commit 5ec76ca

File tree

4 files changed

+46
-29
lines changed

4 files changed

+46
-29
lines changed

check/TestLpSolvers.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,3 +500,22 @@ TEST_CASE("highs-files-mip", "[highs_lp_solver]") {
500500

501501
h.resetGlobalScheduler(true);
502502
}
503+
504+
/*
505+
TEST_CASE("highs-debug-level", "[highs_lp_solver]") {
506+
Highs h;
507+
h.setOptionValue("output_flag", dev_run);
508+
std::string model_file =
509+
std::string(HIGHS_DIR) + "/check/instances/avgas.mps";
510+
511+
h.readModel(model_file);
512+
h.setOptionValue("solver", kIpmString);
513+
h.setOptionValue("highs_debug_level", 1);
514+
h.run();
515+
h.setOptionValue("highs_debug_level", 2);
516+
h.run();
517+
h.setOptionValue("highs_debug_level", 3);
518+
h.run();
519+
h.resetGlobalScheduler(true);
520+
}
521+
*/

highs/io/FilereaderEms.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,6 @@ FilereaderRetcode FilereaderEms::readModelFromFile(const HighsOptions& options,
195195
std::getline(f, line);
196196
lp.row_names_[i] = trim(line);
197197
}
198-
} else {
199-
// OK if file just ends after the integer_columns section without
200-
// end_linear
201-
if (!f) lp.ensureColwise();
202-
highsLogUser(options.log_options, HighsLogType::kError,
203-
"names not found in EMS file\n");
204-
return FilereaderRetcode::kParserError;
205198
}
206199
f.close();
207200
} else {

highs/lp_data/Highs.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4417,11 +4417,11 @@ HighsStatus Highs::returnFromOptimizeModel(const HighsStatus run_return_status,
44174417
assert(!called_return_from_optimize_model);
44184418
HighsStatus return_status = highsStatusFromHighsModelStatus(model_status_);
44194419
if (return_status != run_return_status) {
4420-
printf(
4421-
"Highs::returnFromOptimizeModel: return_status = %d != %d = "
4422-
"run_return_status "
4423-
"For model_status_ = %s\n",
4424-
int(return_status), int(run_return_status),
4420+
highsLogDev(
4421+
options_.log_options, HighsLogType::kError,
4422+
"Highs::returnFromOptimizeModel: run_return_status = %d != %d = "
4423+
"return_status = highsStatusFromHighsModelStatus(model_status_ = %s)\n",
4424+
int(run_return_status), int(return_status),
44254425
modelStatusToString(model_status_).c_str());
44264426
}
44274427
assert(return_status == run_return_status);

highs/lp_data/HighsSolution.cpp

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -478,41 +478,46 @@ void getKktFailures(const HighsOptions& options, const bool is_qp,
478478
}
479479

480480
if (printf_kkt || options.log_dev_level > 0) {
481-
printf("getKktFailures:: cost norm = %8.3g; bound norm = %8.3g\n",
482-
highs_norm_costs, highs_norm_bounds);
483-
printf(
484-
"getKktFailures: LP (abs / rel) "
485-
" Col (abs / rel) Row (abs / rel)\n");
486-
487-
printf(
481+
highsLogDev(options.log_options, HighsLogType::kInfo,
482+
"getKktFailures:: cost norm = %8.3g; bound norm = %8.3g\n",
483+
highs_norm_costs, highs_norm_bounds);
484+
highsLogDev(options.log_options, HighsLogType::kInfo,
485+
"getKktFailures: LP (abs / rel) "
486+
" Col (abs / rel) Row (abs / rel)\n");
487+
488+
highsLogDev(
489+
options.log_options, HighsLogType::kInfo,
488490
"getKktFailures: primal infeasibility %8.3g / %8.3g %8.3g / "
489491
"%8.3g %8.3g / %8.3g\n",
490492
highs_info.max_primal_infeasibility,
491493
highs_info.max_relative_primal_infeasibility,
492494
max_col_primal_infeasibility, max_relative_col_primal_infeasibility,
493495
max_row_primal_infeasibility, max_relative_row_primal_infeasibility);
494496
if (have_dual_solution)
495-
printf(
497+
highsLogDev(
498+
options.log_options, HighsLogType::kInfo,
496499
"getKktFailures: dual infeasibility %8.3g / %8.3g %8.3g / "
497500
"%8.3g %8.3g / %8.3g\n",
498501
highs_info.max_dual_infeasibility,
499502
highs_info.max_relative_dual_infeasibility,
500503
max_col_dual_infeasibility, max_relative_col_dual_infeasibility,
501504
max_row_dual_infeasibility, max_relative_row_dual_infeasibility);
502505
if (get_residuals) {
503-
printf("getKktFailures: primal residual %8.3g / %8.3g\n",
504-
highs_info.max_primal_residual_error,
505-
highs_info.max_relative_primal_residual_error);
506+
highsLogDev(options.log_options, HighsLogType::kInfo,
507+
"getKktFailures: primal residual %8.3g / %8.3g\n",
508+
highs_info.max_primal_residual_error,
509+
highs_info.max_relative_primal_residual_error);
506510
if (have_dual_solution)
507-
printf("getKktFailures: dual residual %8.3g / %8.3g\n",
508-
highs_info.max_dual_residual_error,
509-
highs_info.max_relative_dual_residual_error);
511+
highsLogDev(options.log_options, HighsLogType::kInfo,
512+
"getKktFailures: dual residual %8.3g / %8.3g\n",
513+
highs_info.max_dual_residual_error,
514+
highs_info.max_relative_dual_residual_error);
510515
}
511516
if (!is_qp && have_dual_solution)
512-
printf("getKktFailures: objective gap %8.3g\n",
513-
highs_info.primal_dual_objective_error);
517+
highsLogDev(options.log_options, HighsLogType::kInfo,
518+
"getKktFailures: objective gap %8.3g\n",
519+
highs_info.primal_dual_objective_error);
514520
}
515-
516521
// Assign primal (and possibly dual) solution status according to
517522
// existence of primal and dual feasibilities
518523
//

0 commit comments

Comments
 (0)