Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cpp/include/cuopt/linear_programming/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#define CUOPT_NUM_CPU_THREADS "num_cpu_threads"
#define CUOPT_NUM_GPUS "num_gpus"
#define CUOPT_USER_PROBLEM_FILE "user_problem_file"
#define CUOPT_PRESOLVE_FILE "presolve_file"
#define CUOPT_RANDOM_SEED "random_seed"
#define CUOPT_PDLP_PRECISION "pdlp_precision"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class mip_solver_settings_t {
std::string log_file;
std::string sol_file;
std::string user_problem_file;
std::string presolve_file;

/** Initial primal solutions */
std::vector<std::shared_ptr<rmm::device_uvector<f_t>>> initial_solutions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ class pdlp_solver_settings_t {
std::string log_file{""};
std::string sol_file{""};
std::string user_problem_file{""};
std::string presolve_file{""};
bool per_constraint_residual{false};
bool crossover{false};
bool cudss_deterministic{false};
Expand Down
4 changes: 3 additions & 1 deletion cpp/src/math_optimization/solver_settings.cu
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ solver_settings_t<i_t, f_t>::solver_settings_t() : pdlp_settings(), mip_settings
{CUOPT_SOLUTION_FILE, &mip_settings.sol_file, ""},
{CUOPT_SOLUTION_FILE, &pdlp_settings.sol_file, ""},
{CUOPT_USER_PROBLEM_FILE, &mip_settings.user_problem_file, ""},
{CUOPT_USER_PROBLEM_FILE, &pdlp_settings.user_problem_file, ""}
{CUOPT_USER_PROBLEM_FILE, &pdlp_settings.user_problem_file, ""},
{CUOPT_PRESOLVE_FILE, &mip_settings.presolve_file, ""},
{CUOPT_PRESOLVE_FILE, &pdlp_settings.presolve_file, ""}
};
// clang-format on
}
Expand Down
5 changes: 5 additions & 0 deletions cpp/src/mip_heuristics/solve.cu
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ mip_solution_t<i_t, f_t> solve_mip(optimization_problem_t<i_t, f_t>& op_problem,
settings.tolerances.relative_tolerance,
presolve_time_limit,
settings.num_cpu_threads);

if (!result.has_value()) {
return mip_solution_t<i_t, f_t>(mip_termination_status_t::Infeasible,
solver_stats_t<i_t, f_t>{},
Expand All @@ -306,6 +307,10 @@ mip_solution_t<i_t, f_t> solve_mip(optimization_problem_t<i_t, f_t>& op_problem,
CUOPT_LOG_INFO("Writing user problem to file: %s", settings.user_problem_file.c_str());
op_problem.write_to_mps(settings.user_problem_file);
}
if (run_presolve && settings.presolve_file != "") {
CUOPT_LOG_INFO("Writing presolved problem to file: %s", settings.presolve_file.c_str());
presolve_result->reduced_problem.write_to_mps(settings.presolve_file);
}

auto sol = run_mip(problem, settings, timer);

Expand Down
4 changes: 4 additions & 0 deletions cpp/src/pdlp/solve.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,10 @@ optimization_problem_solution_t<i_t, f_t> solve_lp(
CUOPT_LOG_INFO("Writing user problem to file: %s", settings.user_problem_file.c_str());
op_problem.write_to_mps(settings.user_problem_file);
}
if (run_presolve && settings.presolve_file != "") {
CUOPT_LOG_INFO("Writing presolved problem to file: %s", settings.presolve_file.c_str());
result->reduced_problem.write_to_mps(settings.presolve_file);
}

// Set the hyper-parameters based on the solver_settings
if (use_pdlp_solver_mode) { set_pdlp_solver_mode(settings); }
Expand Down
Loading