Skip to content

Commit 1e208da

Browse files
authored
Parallel Branch-and-Bound (NVIDIA#412)
This PR implement a parallel branch-and-bound procedure, which is split into two phases. In the first phase, the algorithm will greedily expand the search tree until a certain depth and then add the bottom nodes to a global heap. The parallel expansion is implemented using `omp task`. In the second phase, some threads will explore the tree using best first search with plunging, i.e., they take the first node from the global heap and then explore the entire branch that starts on this node. Any unexplored node are insert into the heap. The remaining threads will perform deep dives in order to find feasible solutions. The solver keep a small heap contains the most promising nodes to perform the dives, which is keep in sync with the global heap. This PR also - Replace the `std::thread`-based parallelization in the strong branching with OpenMP in order to use dynamic scheduling. This ensures that all threads have similar amount of work and improve parallel performance. - Fixed invalid memory access when trying to access the status of a fathomed node. - Replaced `std::mutex` with `omp atomic` whatever applicable. - Added dedicated classes `dive_queue_t` and `search_tree_t` to store the diving heap and the search tree, respectively. This is an extension of NVIDIA#305. Closes NVIDIA#320. Closes NVIDIA#417. ## Benchmark results (MIPLIB2017): master branch (53d6e74) ``` Average Gap: 0.2174861712 ``` This PR: ``` Average Gap: 0.1989485546 ``` i.e., a `1.8%` improvement. In terms of the geomean of the gap ratio, this is equal to `1.62x`. Authors: - Nicolas L. Guidotti (https://github.com/nguidotti) Approvers: - Rajesh Gandham (https://github.com/rg20) - Chris Maes (https://github.com/chris-maes) URL: NVIDIA#412
1 parent 3824f96 commit 1e208da

File tree

15 files changed

+1002
-598
lines changed

15 files changed

+1002
-598
lines changed

benchmarks/linear_programming/cuopt/run_mip.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <rmm/mr/device/owning_wrapper.hpp>
3737

3838
#include <fcntl.h>
39+
#include <omp.h>
3940
#include <sys/file.h>
4041
#include <sys/wait.h>
4142
#include <unistd.h>
@@ -382,6 +383,8 @@ int main(int argc, char* argv[])
382383
double memory_limit = program.get<double>("--memory-limit");
383384
bool track_allocations = program.get<std::string>("--track-allocations")[0] == 't';
384385

386+
if (num_cpu_threads < 0) { num_cpu_threads = omp_get_max_threads() / n_gpus; }
387+
385388
if (program.is_used("--out-dir")) {
386389
out_dir = program.get<std::string>("--out-dir");
387390
result_file = out_dir + "/final_result.csv";

0 commit comments

Comments
 (0)