Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c3971ab
fixed typo. updated api to indicate which solver was used for solving…
nguidotti Feb 3, 2026
363b71e
updated root relaxation to show the method used
nguidotti Feb 3, 2026
2758461
adjusting logs
nguidotti Feb 3, 2026
956d185
replaced lp_solver_type_t with existent method_t
nguidotti Feb 3, 2026
d73e782
Merge remote-tracking branch 'cuopt/main' into update-lp-api
nguidotti Feb 6, 2026
8d7ddfb
updated solved_by for python/cython
Iroy30 Feb 8, 2026
3651a71
Merged with the main branch
nguidotti Mar 23, 2026
fa9828c
revert all Python changes
nguidotti Mar 23, 2026
95874f7
fixed compilation
nguidotti Mar 23, 2026
e60524d
Merge branch 'release/26.04' into update-lp-api
nguidotti Mar 23, 2026
6affed1
small fixes
nguidotti Mar 23, 2026
ae0d86e
fixed compilation for tests
nguidotti Mar 23, 2026
fec19e1
fix conflicts
Iroy30 Mar 23, 2026
48bb0ef
update python
Iroy30 Mar 24, 2026
ce0917c
formatting
Iroy30 Mar 24, 2026
fc0a39d
Merge branch 'release/26.04' into update-lp-api
Iroy30 Mar 24, 2026
d294b10
update cuopt server
Iroy30 Mar 24, 2026
9c00324
Merge remote-tracking branch 'origin/update-lp-api' into update-lp-api
Iroy30 Mar 24, 2026
82b3d0c
improve docs for the solve_by parameter
nguidotti Mar 31, 2026
cc5844b
added deprecation notice
nguidotti Mar 31, 2026
dd24b5a
merged with remote execution PR
nguidotti Mar 31, 2026
0353237
Merge branch 'release/26.04' into update-lp-api
nguidotti Apr 1, 2026
f7bf8ad
Merge remote-tracking branch 'cuopt/release/26.04' into update-lp-api
nguidotti Apr 2, 2026
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 @@ -129,6 +129,7 @@
#define CUOPT_METHOD_PDLP 1
#define CUOPT_METHOD_DUAL_SIMPLEX 2
#define CUOPT_METHOD_BARRIER 3
#define CUOPT_METHOD_UNSET 4

/* @brief PDLP precision mode constants */
#define CUOPT_PDLP_DEFAULT_PRECISION -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class cpu_lp_solution_t : public lp_solution_interface_t<i_t, f_t> {
l2_dual_residual_(std::numeric_limits<f_t>::signaling_NaN()),
gap_(std::numeric_limits<f_t>::signaling_NaN()),
num_iterations_(0),
solved_by_pdlp_(false)
solved_by_(Unset)
{
}

Expand All @@ -65,7 +65,7 @@ class cpu_lp_solution_t : public lp_solution_interface_t<i_t, f_t> {
f_t l2_dual_residual,
f_t gap,
i_t num_iterations,
bool solved_by_pdlp)
method_t solved_by)
: primal_solution_(std::move(primal_solution)),
dual_solution_(std::move(dual_solution)),
reduced_cost_(std::move(reduced_cost)),
Expand All @@ -78,7 +78,7 @@ class cpu_lp_solution_t : public lp_solution_interface_t<i_t, f_t> {
l2_dual_residual_(l2_dual_residual),
gap_(gap),
num_iterations_(num_iterations),
solved_by_pdlp_(solved_by_pdlp)
solved_by_(solved_by)
{
}

Expand All @@ -97,7 +97,7 @@ class cpu_lp_solution_t : public lp_solution_interface_t<i_t, f_t> {
f_t l2_dual_residual,
f_t gap,
i_t num_iterations,
bool solved_by_pdlp,
method_t solved_by,
cpu_pdlp_warm_start_data_t<i_t, f_t>&& warmstart_data)
: primal_solution_(std::move(primal_solution)),
dual_solution_(std::move(dual_solution)),
Expand All @@ -111,7 +111,7 @@ class cpu_lp_solution_t : public lp_solution_interface_t<i_t, f_t> {
l2_dual_residual_(l2_dual_residual),
gap_(gap),
num_iterations_(num_iterations),
solved_by_pdlp_(solved_by_pdlp),
solved_by_(solved_by),
pdlp_warm_start_data_(std::move(warmstart_data))
{
}
Expand Down Expand Up @@ -149,7 +149,7 @@ class cpu_lp_solution_t : public lp_solution_interface_t<i_t, f_t> {

i_t get_num_iterations(i_t = 0) const override { return num_iterations_; }

bool is_solved_by_pdlp(i_t = 0) const override { return solved_by_pdlp_; }
method_t solved_by(i_t = 0) const override { return solved_by_; }

const pdlp_warm_start_data_t<i_t, f_t>& get_pdlp_warm_start_data() const override
{
Expand Down Expand Up @@ -266,7 +266,7 @@ class cpu_lp_solution_t : public lp_solution_interface_t<i_t, f_t> {
f_t l2_dual_residual_;
f_t gap_;
i_t num_iterations_;
bool solved_by_pdlp_;
method_t solved_by_;

// PDLP warm start data (embedded struct, CPU-backed using std::vector)
cpu_pdlp_warm_start_data_t<i_t, f_t> pdlp_warm_start_data_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ class gpu_lp_solution_t : public lp_solution_interface_t<i_t, f_t> {
return solution_.get_additional_termination_information(id).number_of_steps_taken;
}

bool is_solved_by_pdlp(i_t id = 0) const override
method_t solved_by(i_t id = 0) const override
{
return solution_.get_additional_termination_information(id).solved_by_pdlp;
return solution_.get_additional_termination_information(id).solved_by;
}

const pdlp_warm_start_data_t<i_t, f_t>& get_pdlp_warm_start_data() const override
Expand Down Expand Up @@ -338,7 +338,7 @@ class gpu_lp_solution_t : public lp_solution_interface_t<i_t, f_t> {
get_l2_dual_residual(),
get_gap(),
get_num_iterations(),
is_solved_by_pdlp(),
solved_by(),
std::move(cpu_ws));
}

Expand All @@ -353,7 +353,7 @@ class gpu_lp_solution_t : public lp_solution_interface_t<i_t, f_t> {
get_l2_dual_residual(),
get_gap(),
get_num_iterations(),
is_solved_by_pdlp());
solved_by());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ class lp_solution_interface_t : public optimization_problem_solution_interface_t
virtual i_t get_num_iterations(i_t id = 0) const = 0;

/**
* @brief Check if solved by PDLP
* @return true if solved by PDLP
* @brief Method used for solving the LP.
* @return the method used for solving the LP.
*/
virtual bool is_solved_by_pdlp(i_t id = 0) const = 0;
virtual method_t solved_by(i_t id = 0) const = 0;

/**
* @brief Get PDLP warm start data (GPU solutions only)
Expand Down
19 changes: 17 additions & 2 deletions cpp/include/cuopt/linear_programming/pdlp/solver_settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,34 @@ enum pdlp_solver_mode_t : int {
* @brief Enum representing the different methods that can be used to solve the
* linear programming problem.
*
* Concurrent: Use both PDLP and DualSimplex in parallel.
* Concurrent: Use PDLP, Barrier and DualSimplex in parallel.
* PDLP: Use the PDLP method.
* DualSimplex: Use the dual simplex method.
* Barrier: Use the barrier method
* Unset: The value was not set.
*
* @note Default method is Concurrent.
*/
enum method_t : int {
Concurrent = CUOPT_METHOD_CONCURRENT,
PDLP = CUOPT_METHOD_PDLP,
DualSimplex = CUOPT_METHOD_DUAL_SIMPLEX,
Barrier = CUOPT_METHOD_BARRIER
Barrier = CUOPT_METHOD_BARRIER,
Unset = CUOPT_METHOD_UNSET
};

/// Returns the corresponding string from the enum `method_t`.
inline std::string method_to_string(method_t method)
{
switch (method) {
case method_t::DualSimplex: return "Dual Simplex";
case method_t::PDLP: return "PDLP";
case method_t::Barrier: return "Barrier";
case method_t::Concurrent: return "Concurrent";
default: return "Unset";
}
}

/**
* @brief Enum representing the PDLP precision modes.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <cuopt/linear_programming/constants.h>
#include <cuopt/error.hpp>
#include <cuopt/linear_programming/pdlp/pdlp_warm_start_data.hpp>
#include <cuopt/linear_programming/pdlp/solver_settings.hpp>
#include <cuopt/linear_programming/utilities/internals.hpp>

#include <rmm/cuda_stream_view.hpp>
Expand Down Expand Up @@ -89,8 +90,8 @@ class optimization_problem_solution_t : public base_solution_t {
/** Solve time in seconds */
double solve_time{std::numeric_limits<double>::signaling_NaN()};

/** Whether the problem was solved by PDLP or Dual Simplex */
bool solved_by_pdlp{false};
/** Whether the problem was solved by PDLP, Barrier or Dual Simplex */
method_t solved_by = method_t::Unset;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct linear_programming_ret_t {
double gap_{};
int nb_iterations_{};
double solve_time_{};
bool solved_by_pdlp_{};
linear_programming::method_t solved_by_{};
Comment thread
coderabbitai[bot] marked this conversation as resolved.

bool is_gpu() const { return std::holds_alternative<gpu_solutions_t>(solutions_); }
};
Expand Down
21 changes: 12 additions & 9 deletions cpp/src/branch_and_bound/branch_and_bound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1974,18 +1974,21 @@ lp_status_t branch_and_bound_t<i_t, f_t>::solve_root_relaxation(
set_uninitialized_steepest_edge_norms<i_t, f_t>(original_lp_, basic_list, edge_norms);
user_objective = root_crossover_soln_.user_objective;
iter = root_crossover_soln_.iterations;
solver_name = "Barrier/PDLP and Crossover";
solver_name = method_to_string(root_relax_solved_by);

} else {
root_status = root_status_future.get();
user_objective = root_relax_soln_.user_objective;
iter = root_relax_soln_.iterations;
solver_name = "Dual Simplex";
root_status = root_status_future.get();
user_objective = root_relax_soln_.user_objective;
iter = root_relax_soln_.iterations;
root_relax_solved_by = DualSimplex;
solver_name = "Dual Simplex";
}
} else {
root_status = root_status_future.get();
user_objective = root_relax_soln_.user_objective;
iter = root_relax_soln_.iterations;
solver_name = "Dual Simplex";
root_status = root_status_future.get();
user_objective = root_relax_soln_.user_objective;
iter = root_relax_soln_.iterations;
root_relax_solved_by = DualSimplex;
solver_name = "Dual Simplex";
}

settings_.log.printf("\n");
Expand Down
7 changes: 6 additions & 1 deletion cpp/src/branch_and_bound/branch_and_bound.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <utilities/work_limit_context.hpp>
#include <utilities/work_unit_scheduler.hpp>

#include <cuopt/linear_programming/pdlp/solver_settings.hpp>

#include <omp.h>

#include <atomic>
Expand Down Expand Up @@ -89,7 +91,8 @@ class branch_and_bound_t {
const std::vector<f_t>& reduced_costs,
f_t objective,
f_t user_objective,
i_t iterations)
i_t iterations,
method_t method)
{
if (!is_root_solution_set) {
root_crossover_soln_.x = primal;
Expand All @@ -99,6 +102,7 @@ class branch_and_bound_t {
root_crossover_soln_.objective = objective;
root_crossover_soln_.user_objective = user_objective;
root_crossover_soln_.iterations = iterations;
root_relax_solved_by = method;
root_crossover_solution_set_.store(true, std::memory_order_release);
}
}
Expand Down Expand Up @@ -218,6 +222,7 @@ class branch_and_bound_t {
f_t root_objective_;
lp_solution_t<i_t, f_t> root_relax_soln_;
lp_solution_t<i_t, f_t> root_crossover_soln_;
method_t root_relax_solved_by{Unset};
std::vector<f_t> edge_norms_;
std::atomic<bool> root_crossover_solution_set_{false};
omp_atomic_t<f_t> root_lp_current_lower_bound_;
Expand Down
10 changes: 5 additions & 5 deletions cpp/src/dual_simplex/crossover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ i_t dual_push(const lp_problem_t<i_t, f_t>& lp,
return TIME_LIMIT_RETURN;
}
if (settings.concurrent_halt != nullptr && *settings.concurrent_halt == 1) {
settings.log.printf("Concurrent halt\n");
if (!settings.inside_mip) { settings.log.printf("Concurrent halt\n"); }
return CONCURRENT_HALT_RETURN;
}
}
Expand Down Expand Up @@ -989,7 +989,7 @@ i_t primal_push(const lp_problem_t<i_t, f_t>& lp,
return TIME_LIMIT_RETURN;
}
if (settings.concurrent_halt != nullptr && *settings.concurrent_halt == 1) {
settings.log.printf("Concurrent halt\n");
if (!settings.inside_mip) { settings.log.printf("Concurrent halt\n"); }
return CONCURRENT_HALT_RETURN;
}
}
Expand Down Expand Up @@ -1353,7 +1353,7 @@ crossover_status_t crossover(const lp_problem_t<i_t, f_t>& lp,
return crossover_status_t::TIME_LIMIT;
}
if (settings.concurrent_halt != nullptr && *settings.concurrent_halt == 1) {
settings.log.printf("Concurrent halt\n");
if (!settings.inside_mip) { settings.log.printf("Concurrent halt\n"); }
return crossover_status_t::CONCURRENT_LIMIT;
}

Expand Down Expand Up @@ -1415,7 +1415,7 @@ crossover_status_t crossover(const lp_problem_t<i_t, f_t>& lp,
return crossover_status_t::TIME_LIMIT;
}
if (settings.concurrent_halt != nullptr && *settings.concurrent_halt == 1) {
settings.log.printf("Concurrent halt\n");
if (!settings.inside_mip) { settings.log.printf("Concurrent halt\n"); }
return crossover_status_t::CONCURRENT_LIMIT;
}
primal_infeas = primal_infeasibility(lp, settings, vstatus, solution.x);
Expand Down Expand Up @@ -1577,7 +1577,7 @@ crossover_status_t crossover(const lp_problem_t<i_t, f_t>& lp,
return crossover_status_t::TIME_LIMIT;
}
if (settings.concurrent_halt != nullptr && *settings.concurrent_halt == 1) {
settings.log.printf("Concurrent halt\n");
if (!settings.inside_mip) { settings.log.printf("Concurrent halt\n"); }
return crossover_status_t::CONCURRENT_LIMIT;
}
solution.iterations += iter;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/dual_simplex/right_looking_lu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ i_t right_looking_lu_row_permutation_only(const csc_matrix_t<i_t, f_t>& A,
}
if (toc(start_time) > settings.time_limit) { return TIME_LIMIT_RETURN; }
if (settings.concurrent_halt != nullptr && *settings.concurrent_halt == 1) {
settings.log.printf("Concurrent halt\n");
if (!settings.inside_mip) { settings.log.printf("Concurrent halt\n"); }
return CONCURRENT_HALT_RETURN;
}
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/grpc/cuopt_remote.proto
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ message LPSolution {
double gap = 24;
int32 nb_iterations = 25;
double solve_time = 26;
bool solved_by_pdlp = 27;
int32 solved_by = 27;
}

enum PDLPTerminationStatus {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/grpc/cuopt_remote_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ message ChunkedResultHeader {
double gap = 16;
int32 nb_iterations = 17;
double solve_time = 18;
bool solved_by_pdlp = 19;
int32 solved_by = 19;

// MIP result scalars
MIPTerminationStatus mip_termination_status = 30;
Expand Down
Loading
Loading