Skip to content
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

routing-solver / constraint-solver: profile_propagation crashes (on official example) #3912

Open
sschnug opened this issue Sep 6, 2023 · 1 comment
Assignees
Labels
Bug Lang: C++ Native implementation issue Solver: Routing Uses the Routing library and the original CP solver
Milestone

Comments

@sschnug
Copy link

sschnug commented Sep 6, 2023

What version of OR-Tools and what language are you using?
Version: 9.7 (shown) + 9.6.
Language: C++ (bazel)

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
Routing Solver

What operating system (Linux, Windows, ...) and version?
Linux Ubuntu 22 LTS

I'm interested in some propagation-related timings similar to the output of print_local_search_profile which is very helpful. I don't know what to expect howewer as i did not succeed yet.

Let's use 9.7 + some official example and turn this on:

diff --git a/ortools/constraint_solver/samples/vrp_time_windows.cc b/ortools/constraint_solver/samples/vrp_time_windows.cc
index e69d3a4230..becb76eca8 100644
--- a/ortools/constraint_solver/samples/vrp_time_windows.cc
+++ b/ortools/constraint_solver/samples/vrp_time_windows.cc
@@ -121,7 +121,12 @@ void VrpTimeWindows() {
 
   // Create Routing Model.
   // [START routing_model]
-  RoutingModel routing(manager);
+
+  auto params = operations_research::DefaultRoutingModelParameters();
+  params.mutable_solver_parameters()->set_profile_propagation(true);
+  params.mutable_solver_parameters()->set_profile_file("profile_propagation");
+
+  RoutingModel routing(manager, params);
   // [END routing_model]
 
   // Create and register a transit callback.

This crashes with:

sascha@jimny:~/Dev/or_tools_vanilla/or-tools$ bazel-bin/ortools/constraint_solver/samples/vrp_time_windows_cc
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1694002316.168684   93886 constraint_solver.cc:2311] Exporting profile to profile_propagation
I0000 00:00:1694002316.171353   93886 constraint_solver.cc:2311] Exporting profile to profile_propagation
F0000 00:00:1694002316.171671   93886 demon_profiler.cc:351] Check failed: *demons == demons_per_constraint_[constraint].size() (1 vs. 2) 
*** Check failure stack trace: ***
    @     0x55a471afe7cd  absl::lts_20230125::log_internal::LogMessageFatal::~LogMessageFatal()
    @     0x55a47194f7fe  operations_research::DemonProfiler::ExportInformation()
    @     0x55a47194fbd7  operations_research::DemonProfiler::PrintOverview()
    @     0x55a471441beb  operations_research::Solver::EndSearch()
    @     0x55a47191cdaf  operations_research::Solver::Solve()
    @     0x55a47148f5d0  operations_research::RoutingModel::AppendAssignmentIfFeasible()
    @     0x55a4714aaaf4  operations_research::RoutingModel::SolveFromAssignmentsWithParameters()
    @     0x55a4714aad4b  operations_research::RoutingModel::SolveFromAssignmentWithParameters()
    @     0x55a471463158  operations_research::VrpTimeWindows()
    @     0x55a47145a9dd  main
    @     0x7fcf21153d90  (unknown)
Aborted

Remarks:

  • The actual assertion-cardinalities failing also can look different (for my full size problem)
  • Also turning on trace_propagation does not help
  • File profile_propagation is created, but empty

Are there any special considerations on how to use this feature?

@Mizux Mizux self-assigned this Sep 6, 2023
@Mizux Mizux added Bug Lang: C++ Native implementation issue Solver: Routing Uses the Routing library and the original CP solver labels Sep 6, 2023
@Mizux Mizux added this to the v9.8 milestone Sep 6, 2023
@Mizux Mizux modified the milestones: v9.8, v9.9 Oct 13, 2023
@Mizux Mizux modified the milestones: v9.9, v10.0 Feb 14, 2024
@iShallEatCode
Copy link

What does DemonProfiler do? Can you please explain?

@Mizux Mizux modified the milestones: v10.0, Backlog Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Lang: C++ Native implementation issue Solver: Routing Uses the Routing library and the original CP solver
Projects
None yet
Development

No branches or pull requests

3 participants