From b4eab6c83f8b93f9129814e68637024a531a6f8d Mon Sep 17 00:00:00 2001 From: Christopher Maes Date: Mon, 19 May 2025 09:06:13 -0700 Subject: [PATCH] Fix LP termination status 9 errors in batch LP solves These errors were caused by all LPs in the batch sharing the same concurrent halt variable. This meant that the first LP to solve, forced all other LPs to halt. So it was possible that both PDLP and Dual Simplex solves returned with a ConcurrentLimit termination status. This should never happen normally. For now, we fix this by disabling the Concurrent method in batch mode. We set the method to PDLP, if Concurrent was chosen, and tell the user to choose PDLP or Dual Simplex to avoid this warning in the future. --- cpp/src/linear_programming/utilities/cython_solve.cu | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpp/src/linear_programming/utilities/cython_solve.cu b/cpp/src/linear_programming/utilities/cython_solve.cu index 4a2941c84e..f176db781f 100644 --- a/cpp/src/linear_programming/utilities/cython_solve.cu +++ b/cpp/src/linear_programming/utilities/cython_solve.cu @@ -274,6 +274,14 @@ std::pair>, double> call_batch_solve( // Limit parallelism as too much stream overlap gets too slow const int max_thread = compute_max_thread(data_models); + if (solver_settings->get_parameter(CUOPT_METHOD) == CUOPT_METHOD_CONCURRENT) { + CUOPT_LOG_INFO("Concurrent mode not supported for batch solve. Using PDLP instead. "); + CUOPT_LOG_INFO( + "Set the CUOPT_METHOD parameter to CUOPT_METHOD_PDLP or CUOPT_METHOD_DUAL_SIMPLEX to avoid " + "this warning."); + solver_settings->set_parameter(CUOPT_METHOD, CUOPT_METHOD_PDLP); + } + #pragma omp parallel for num_threads(max_thread) for (std::size_t i = 0; i < size; ++i) list[i] = std::move(call_solve(data_models[i], solver_settings));