-
Notifications
You must be signed in to change notification settings - Fork 160
Fix thrust tuple includes + more timer checks #902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,6 +134,14 @@ solution_t<i_t, f_t> mip_solver_t<i_t, f_t>::run_solver() | |
| return sol; | ||
| } | ||
|
|
||
| if (timer_.check_time_limit()) { | ||
| CUOPT_LOG_INFO("Time limit reached after presolve"); | ||
| solution_t<i_t, f_t> sol(*context.problem_ptr); | ||
| context.stats.total_solve_time = timer_.elapsed_time(); | ||
| context.problem_ptr->post_process_solution(sol); | ||
| return sol; | ||
| } | ||
|
Comment on lines
+137
to
+143
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# First, find the post_process_solution implementation
rg -n "post_process_solution" --include="*.{cu,cuh,cpp,hpp,h}" -A 5 | head -100Repository: NVIDIA/cuopt Length of output: 497 🏁 Script executed: #!/bin/bash
# Find all call sites of post_process_solution and the context around them
rg -n "post_process_solution" --include="*.{cu,cuh,cpp,hpp,h}" -B 2 -A 1Repository: NVIDIA/cuopt Length of output: 497 🏁 Script executed: #!/bin/bash
# Check the specific file and lines mentioned in the review
cat -n cpp/src/mip_heuristics/solver.cu | sed -n '100,150p'Repository: NVIDIA/cuopt Length of output: 2752 🏁 Script executed: #!/bin/bash
# Also check the other time-limit path mentioned
cat -n cpp/src/mip_heuristics/solver.cu | sed -n '290,310p'Repository: NVIDIA/cuopt Length of output: 1207 🏁 Script executed: #!/bin/bash
# Search for post_process_solution method definition using ast-grep
ast-grep --pattern 'post_process_solution($_) {
$$$
}'Repository: NVIDIA/cuopt Length of output: 38 🏁 Script executed: #!/bin/bash
# Search for post_process_solution using rg with correct syntax (without --include)
rg "post_process_solution" -t cpp -t cuda -B 2 -A 5Repository: NVIDIA/cuopt Length of output: 84 🏁 Script executed: #!/bin/bash
# Find the definition in the problem class
fd -e cu -e cuh -e cpp -e hpp -e h | xargs grep -l "post_process_solution" | head -5Repository: NVIDIA/cuopt Length of output: 269 🏁 Script executed: #!/bin/bash
# Count occurrences of the 4-line pattern: sol construction + elapsed_time + post_process + return
# Look for the exact pattern in the file
rg "solution_t.*sol.*context\.problem_ptr" cpp/src/mip_heuristics/solver.cu -A 3 | grep -c "post_process_solution"Repository: NVIDIA/cuopt Length of output: 57 🏁 Script executed: #!/bin/bash
# Look for post_process_solution definition in problem files
cat cpp/src/mip_heuristics/problem/problem.cuh | grep -n "post_process_solution" -A 10 | head -30Repository: NVIDIA/cuopt Length of output: 736 🏁 Script executed: #!/bin/bash
# Check problem.cu for the implementation
cat cpp/src/mip_heuristics/problem/problem.cu | grep -n "post_process_solution" -A 15 | head -50Repository: NVIDIA/cuopt Length of output: 816 🏁 Script executed: #!/bin/bash
# Find all instances of sol construction + post_process_solution pattern in solver.cu
grep -n "solution_t.*sol.*context\.problem_ptr" cpp/src/mip_heuristics/solver.cu -A 3Repository: NVIDIA/cuopt Length of output: 1440 🏁 Script executed: #!/bin/bash
# Find the presolve_data.post_process_solution implementation
cat cpp/src/mip_heuristics/problem/presolve_data.cu | grep -n "post_process_solution" -A 20 | head -80Repository: NVIDIA/cuopt Length of output: 1146 🏁 Script executed: #!/bin/bash
# Also check the header for the declaration
cat cpp/src/mip_heuristics/problem/presolve_data.cuh | grep -n "post_process_solution" -A 5Repository: NVIDIA/cuopt Length of output: 454 🏁 Script executed: #!/bin/bash
# Count the actual occurrences of the 4-line duplication pattern more precisely
# Pattern: solution_t creation + elapsed_time + post_process + return on consecutive lines
awk '/solution_t.*sol.*context\.problem_ptr/ {
getline; line1=$0;
getline; line2=$0;
getline; line3=$0;
getline; line4=$0;
if (line1 ~ /elapsed_time/ && line2 ~ /post_process_solution/ && line3 ~ /return/) {
print NR-4 ": Found pattern"
print $0; print line1; print line2; print line3
}
}' cpp/src/mip_heuristics/solver.cuRepository: NVIDIA/cuopt Length of output: 367
Both time-limit early returns (lines 137–143 and 298–302) call 🤖 Prompt for AI Agents |
||
|
|
||
| // if the problem was reduced to a LP: run concurrent LP | ||
| if (run_presolve && context.problem_ptr->n_integer_vars == 0) { | ||
| CUOPT_LOG_INFO("Problem reduced to a LP, running concurrent LP"); | ||
|
|
@@ -285,6 +293,14 @@ solution_t<i_t, f_t> mip_solver_t<i_t, f_t>::run_solver() | |
| std::placeholders::_5, | ||
| std::placeholders::_6); | ||
|
|
||
| if (timer_.check_time_limit()) { | ||
| CUOPT_LOG_INFO("Time limit reached during B&B setup"); | ||
| solution_t<i_t, f_t> sol(*context.problem_ptr); | ||
| context.stats.total_solve_time = timer_.elapsed_time(); | ||
| context.problem_ptr->post_process_solution(sol); | ||
| return sol; | ||
| } | ||
|
|
||
| // Fork a thread for branch and bound | ||
| // std::async and std::future allow us to get the return value of bb::solve() | ||
| // without having to manually manage the thread | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.