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

[solvers] IpoptSolver doesn't hard-code the linear solver #22275

Merged

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented Dec 5, 2024

Towards #21476. This will simplify the work of changing which linear solver(s) the build system provides.


This change is Reviewable

@jwnimmer-tri jwnimmer-tri added priority: low release notes: none This pull request should not be mentioned in the release notes labels Dec 5, 2024
@jwnimmer-tri
Copy link
Collaborator Author

+@rpoyner-tri for (low priority) feature review, please.

Copy link
Contributor

@rpoyner-tri rpoyner-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: question

Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: 1 unresolved discussion, needs at least two assigned reviewers


solvers/ipopt_solver.cc line 157 at r1 (raw file):

  const std::vector<std::string_view> linear_solvers =
      internal::GetSupportedIpoptLinearSolvers();
  if (!linear_solvers.empty()) {

nit is empty string a legal value for default_linear_solver_ ? If so, cool. If not, shouldn't there be an else ?

Copy link
Collaborator Author

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 unresolved discussion, needs at least two assigned reviewers


solvers/ipopt_solver.cc line 157 at r1 (raw file):

Previously, rpoyner-tri (Rick Poyner (rico)) wrote…

nit is empty string a legal value for default_linear_solver_ ? If so, cool. If not, shouldn't there be an else ?

Yes, empty is a legal value. When empty, these lines earlier in this file ...

  if (!default_linear_solver.empty()) {
    set_string_option("linear_solver", default_linear_solver);
  }

... will not try to set any Drake-specific default, instead allowing IPOPT's built-in upstream default to remain unchanged.

This could happen if the user is building Drake as a Bazel external and has replaced our build of @ipopt with their own customized build.

@jwnimmer-tri
Copy link
Collaborator Author

+@SeanCurtis-TRI for platform review per schedule, please.

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:LGTM:

Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignees rpoyner-tri(platform),SeanCurtis-TRI(platform)

@SeanCurtis-TRI SeanCurtis-TRI merged commit f996225 into RobotLocomotion:master Dec 9, 2024
10 checks passed
@jwnimmer-tri jwnimmer-tri deleted the ipopt-probe-solver branch December 9, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low release notes: none This pull request should not be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants