Skip to content

Commit 98f670f

Browse files
authored
Merge branch 'main' into adjust-bnb-logs
2 parents 9effdc8 + 8a08824 commit 98f670f

File tree

17 files changed

+55
-28
lines changed

17 files changed

+55
-28
lines changed

conda/environments/all_cuda-129_arch-aarch64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dependencies:
4444
- myst-parser
4545
- ninja
4646
- notebook
47-
- numba-cuda>=0.19.1,<0.20.0a0
47+
- numba-cuda>=0.22.1,<0.23.0
4848
- numba>=0.60.0
4949
- numpy>=1.23.5,<3.0a0
5050
- numpydoc

conda/environments/all_cuda-129_arch-x86_64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dependencies:
4444
- myst-parser
4545
- ninja
4646
- notebook
47-
- numba-cuda>=0.19.1,<0.20.0a0
47+
- numba-cuda>=0.22.1,<0.23.0
4848
- numba>=0.60.0
4949
- numpy>=1.23.5,<3.0a0
5050
- numpydoc

conda/environments/all_cuda-130_arch-aarch64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dependencies:
4444
- myst-parser
4545
- ninja
4646
- notebook
47-
- numba-cuda>=0.19.1,<0.20.0a0
47+
- numba-cuda>=0.22.1,<0.23.0
4848
- numba>=0.60.0
4949
- numpy>=1.23.5,<3.0a0
5050
- numpydoc

conda/environments/all_cuda-130_arch-x86_64.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dependencies:
4444
- myst-parser
4545
- ninja
4646
- notebook
47-
- numba-cuda>=0.19.1,<0.20.0a0
47+
- numba-cuda>=0.22.1,<0.23.0
4848
- numba>=0.60.0
4949
- numpy>=1.23.5,<3.0a0
5050
- numpydoc

conda/recipes/cuopt/recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ requirements:
7777
- h5py
7878
- libcuopt =${{ version }}
7979
- numba >=0.60.0
80-
- numba-cuda>=0.19.1,<0.20.0a0
80+
- numba-cuda>=0.22.1,<0.23.0
8181
- numpy >=1.23,<3.0a0
8282
- pandas >=2.0
8383
- pylibraft =${{ minor_version }}

cpp/include/cuopt/linear_programming/pdlp/solver_settings.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class pdlp_solver_settings_t {
212212
method_t method{method_t::Concurrent};
213213
bool inside_mip{false};
214214
// For concurrent termination
215-
volatile int* concurrent_halt{nullptr};
215+
std::atomic<int>* concurrent_halt{nullptr};
216216
static constexpr f_t minimal_absolute_tolerance = 1.0e-12;
217217

218218
private:

cpp/src/dual_simplex/branch_and_bound.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ void branch_and_bound_t<i_t, f_t>::diving_thread(const csr_matrix_t<i_t, f_t>& A
11471147
if (get_upper_bound() < start_node->node.lower_bound) { continue; }
11481148

11491149
bool recompute_bounds_and_basis = true;
1150+
i_t nodes_explored = 0;
11501151
search_tree_t<i_t, f_t> subtree(std::move(start_node->node));
11511152
std::deque<mip_node_t<i_t, f_t>*> stack;
11521153
stack.push_front(&subtree.root);
@@ -1164,6 +1165,8 @@ void branch_and_bound_t<i_t, f_t>::diving_thread(const csr_matrix_t<i_t, f_t>& A
11641165

11651166
if (toc(exploration_stats_.start_time) > settings_.time_limit) { return; }
11661167

1168+
if (nodes_explored >= 1000) { break; }
1169+
11671170
node_solve_info_t status = solve_node(node_ptr,
11681171
subtree,
11691172
leaf_problem,
@@ -1177,6 +1180,8 @@ void branch_and_bound_t<i_t, f_t>::diving_thread(const csr_matrix_t<i_t, f_t>& A
11771180
start_node->upper,
11781181
log);
11791182

1183+
nodes_explored++;
1184+
11801185
recompute_bounds_and_basis = !has_children(status);
11811186

11821187
if (status == node_solve_info_t::TIME_LIMIT) {

cpp/src/dual_simplex/branch_and_bound.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class branch_and_bound_t {
113113
f_t get_lower_bound();
114114
i_t get_heap_size();
115115
bool enable_concurrent_lp_root_solve() const { return enable_concurrent_lp_root_solve_; }
116-
volatile int* get_root_concurrent_halt() { return &root_concurrent_halt_; }
116+
std::atomic<int>* get_root_concurrent_halt() { return &root_concurrent_halt_; }
117117
void set_root_concurrent_halt(int value) { root_concurrent_halt_ = value; }
118118
lp_status_t solve_root_relaxation(simplex_solver_settings_t<i_t, f_t> const& lp_settings);
119119

@@ -170,7 +170,7 @@ class branch_and_bound_t {
170170
std::vector<f_t> edge_norms_;
171171
std::atomic<bool> root_crossover_solution_set_{false};
172172
bool enable_concurrent_lp_root_solve_{false};
173-
volatile int root_concurrent_halt_{0};
173+
std::atomic<int> root_concurrent_halt_{0};
174174

175175
// Pseudocosts
176176
pseudo_costs_t<i_t, f_t> pc_;

cpp/src/dual_simplex/simplex_solver_settings.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ struct simplex_solver_settings_t {
145145
std::function<void()> heuristic_preemption_callback;
146146
std::function<void(std::vector<f_t>&, std::vector<f_t>&, f_t)> set_simplex_solution_callback;
147147
mutable logger_t log;
148-
volatile int* concurrent_halt; // if nullptr ignored, if !nullptr, 0 if solver should
149-
// continue, 1 if solver should halt
148+
std::atomic<int>* concurrent_halt; // if nullptr ignored, if !nullptr, 0 if solver should
149+
// continue, 1 if solver should halt
150150
};
151151

152152
} // namespace cuopt::linear_programming::dual_simplex

cpp/src/linear_programming/solve.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ void setup_device_symbols(rmm::cuda_stream_view stream_view)
306306
detail::set_pdlp_hyper_parameters(stream_view);
307307
}
308308

309-
volatile int global_concurrent_halt;
309+
std::atomic<int> global_concurrent_halt{0};
310310

311311
template <typename i_t, typename f_t>
312312
optimization_problem_solution_t<i_t, f_t> convert_dual_simplex_sol(

0 commit comments

Comments
 (0)