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

Support passing options #35

Closed
odow opened this issue Feb 17, 2022 · 4 comments · Fixed by #43
Closed

Support passing options #35

odow opened this issue Feb 17, 2022 · 4 comments · Fixed by #43

Comments

@odow
Copy link
Member

odow commented Feb 17, 2022

https://github.com/odow/NEOSServer.jl/blob/0d8f635df8049d90b78c5e9f177e3915906cd7ec/src/NEOSServer.jl#L229

@avinashresearch1
Copy link

avinashresearch1 commented Mar 8, 2023

@odow Thanks for the excellent package! Since time limits are so crucial for NEOS, I was wondering if there is a general way to set them. I see that we can pass a kwarg but the time limit setting is solver dependent and I can't find any information on how to set a limit for say OCTERACT.

I assumed sth like:

model = Model() do
    NEOSServer.Optimizer(email=NEOS_email, solver=NEOS_solver, solver_args = ["octeract_engine.time_limit=10.0"]) 
end

with this ammendment to add solver_args

function Optimizer(; email::String, solver::String, solver_args = String[], kwargs...)
    category = get(_SUPPORTED_SOLVERS, solver, nothing)
    if category === nothing
        error(
            "NEOS.Optimizer only supports the following solvers: " *
            join(collect(keys(_SUPPORTED_SOLVERS)), ", "),
        )
    end
    cmd = _SolverCommand(solver, category, Server(email))
    return AmplNLWriter.Optimizer(cmd, solver_args; kwargs...)
end

But I realize that options are neglected in formulating the XML file.

@odow
Copy link
Member Author

odow commented Mar 8, 2023

It's been a while since I looked at this, so I don't remember why options weren't trivial. Not sure if I have an ETA to implement this sorry.

@gnowzil
Copy link

gnowzil commented Sep 12, 2023

@odow can you check if options are working now? had to change option processing on the NEOS end for NL and it's a bit tricky so let me know if it's not working properly. thanks!

@odow odow closed this as completed in #43 Sep 12, 2023
@odow
Copy link
Member Author

odow commented Sep 12, 2023

Thanks @gnowzil, added here: #43.

Tests check that passing options work (for Ipopt, at least).

We currently pass them as they would be written in a .opt file. So option value separated by a space, with new lines separating multiple options.

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.

3 participants