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
25 changes: 18 additions & 7 deletions benchmarks/linear_programming/cuopt/run_mip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ int run_single_file(std::string file_path,
int num_cpu_threads,
bool write_log_file,
bool log_to_console,
int reliability_branching,
double time_limit)
{
const raft::handle_t handle_{};
Expand Down Expand Up @@ -196,14 +197,14 @@ int run_single_file(std::string file_path,
}
}
}

settings.time_limit = time_limit;
settings.heuristics_only = heuristics_only;
settings.num_cpu_threads = num_cpu_threads;
settings.log_to_console = log_to_console;
settings.tolerances.relative_tolerance = 1e-12;
settings.tolerances.absolute_tolerance = 1e-6;
settings.presolve = true;
settings.reliability_branching = reliability_branching;
cuopt::linear_programming::benchmark_info_t benchmark_info;
settings.benchmark_info_ptr = &benchmark_info;
auto start_run_solver = std::chrono::high_resolution_clock::now();
Expand Down Expand Up @@ -256,6 +257,7 @@ void run_single_file_mp(std::string file_path,
int num_cpu_threads,
bool write_log_file,
bool log_to_console,
int reliability_branching,
double time_limit)
{
std::cout << "running file " << file_path << " on gpu : " << device << std::endl;
Expand All @@ -271,6 +273,7 @@ void run_single_file_mp(std::string file_path,
num_cpu_threads,
write_log_file,
log_to_console,
reliability_branching,
time_limit);
// this is a bad design to communicate the result but better than adding complexity of IPC or
// pipes
Expand Down Expand Up @@ -354,6 +357,11 @@ int main(int argc, char* argv[])
.help("track allocations (t/f)")
.default_value(std::string("f"));

program.add_argument("--reliability-branching")
.help("reliability branching: -1 (automatic), 0 (disable) or k > 0 (use k)")
.scan<'i', int>()
.default_value(-1);

// Parse arguments
try {
program.parse_args(argc, argv);
Expand All @@ -376,12 +384,13 @@ int main(int argc, char* argv[])
std::string result_file;
int batch_num = -1;

bool heuristics_only = program.get<std::string>("--heuristics-only")[0] == 't';
int num_cpu_threads = program.get<int>("--num-cpu-threads");
bool write_log_file = program.get<std::string>("--write-log-file")[0] == 't';
bool log_to_console = program.get<std::string>("--log-to-console")[0] == 't';
double memory_limit = program.get<double>("--memory-limit");
bool track_allocations = program.get<std::string>("--track-allocations")[0] == 't';
bool heuristics_only = program.get<std::string>("--heuristics-only")[0] == 't';
int num_cpu_threads = program.get<int>("--num-cpu-threads");
bool write_log_file = program.get<std::string>("--write-log-file")[0] == 't';
bool log_to_console = program.get<std::string>("--log-to-console")[0] == 't';
double memory_limit = program.get<double>("--memory-limit");
bool track_allocations = program.get<std::string>("--track-allocations")[0] == 't';
int reliability_branching = program.get<int>("--reliability-branching");

if (num_cpu_threads < 0) { num_cpu_threads = omp_get_max_threads() / n_gpus; }

Expand Down Expand Up @@ -469,6 +478,7 @@ int main(int argc, char* argv[])
num_cpu_threads,
write_log_file,
log_to_console,
reliability_branching,
time_limit);
} else if (sys_pid < 0) {
std::cerr << "Fork failed!" << std::endl;
Expand Down Expand Up @@ -509,6 +519,7 @@ int main(int argc, char* argv[])
num_cpu_threads,
write_log_file,
log_to_console,
reliability_branching,
time_limit);
}

Expand Down
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 @@ -57,6 +57,7 @@
#define CUOPT_MIP_HEURISTICS_ONLY "mip_heuristics_only"
#define CUOPT_MIP_SCALING "mip_scaling"
#define CUOPT_MIP_PRESOLVE "mip_presolve"
#define CUOPT_MIP_RELIABILITY_BRANCHING "mip_reliability_branching"
#define CUOPT_MIP_CUT_PASSES "mip_cut_passes"
#define CUOPT_MIP_MIXED_INTEGER_ROUNDING_CUTS "mip_mixed_integer_rounding_cuts"
#define CUOPT_MIP_MIXED_INTEGER_GOMORY_CUTS "mip_mixed_integer_gomory_cuts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class mip_solver_settings_t {
f_t time_limit = std::numeric_limits<f_t>::infinity();
i_t node_limit = std::numeric_limits<i_t>::max();
bool heuristics_only = false;
i_t reliability_branching = -1;
i_t num_cpu_threads = -1; // -1 means use default number of threads in branch and bound
i_t max_cut_passes = 10; // number of cut passes to make
i_t mir_cuts = -1;
Expand Down
5 changes: 5 additions & 0 deletions cpp/src/dual_simplex/basis_updates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ class basis_update_mpf_t {
reset_stats();
}

basis_update_mpf_t(const basis_update_mpf_t& other) = default;
basis_update_mpf_t& operator=(const basis_update_mpf_t& other) = default;

void print_stats() const
{
i_t total_L_transpose_calls = total_sparse_L_transpose_ + total_dense_L_transpose_;
Expand Down Expand Up @@ -381,6 +384,8 @@ class basis_update_mpf_t {
std::vector<i_t>& nonbasic_list,
std::vector<variable_status_t>& vstatus);

void set_refactor_frequency(i_t new_frequency) { refactor_frequency_ = new_frequency; }

private:
void clear()
{
Expand Down
Loading
Loading