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

I use Solver of AmplNLWriter with some errors. #183

Closed
Aijunly opened this issue Sep 16, 2024 · 3 comments · Fixed by #184
Closed

I use Solver of AmplNLWriter with some errors. #183

Aijunly opened this issue Sep 16, 2024 · 3 comments · Fixed by #184

Comments

@Aijunly
Copy link

Aijunly commented Sep 16, 2024

* Solver : AmplNLWriter

* Status
  Result count       : 0
  Termination status : OTHER_ERROR
  Message from the solver:
  "Error calling the solver. Failed with: SystemError("opening file \"C:\\\\Users\\\\USER_NAME\\\\AppData\\\\Local\\\\Temp\\\\jl_FlGPBt\\\\model.sol\"", 2, nothing)"

* Candidate solution (result #1)
  Primal status      : NO_SOLUTION
  Dual status        : NO_SOLUTION

* Work counters
  Solve time (sec)   : 1.25000e-01
@show value(x)
ERROR: Result index of attribute MathOptInterface.VariablePrimal(1) out of bounds. There are currently 0 solution(s) in the model.
@odow
Copy link
Member

odow commented Sep 16, 2024

The solver did not produce a solution.

Do you have a reproducible example?

@odow
Copy link
Member

odow commented Sep 16, 2024

Since the missing sol file is a reasonably common cause, we could add a better error message:

sol_file = call_solver(
model.solver_command,
nl_file,
options,
model.stdin,
model.stdout,
)
model.results = MOI.FileFormats.NL.SolFileResults(sol_file, model.inner)

@odow
Copy link
Member

odow commented Sep 17, 2024

I've improved the error message in #184.

It typically means that your problem was infeasible, or that there was some other problem with the formulation.

If you can supply a reproducible example, please make a post on our community forum https://discourse.julialang.org/c/domain/opt/13 and we can chat over there 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants