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

Solver timeout (and other config) #123

Open
tomerarnon opened this issue Jul 21, 2020 · 2 comments
Open

Solver timeout (and other config) #123

tomerarnon opened this issue Jul 21, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@tomerarnon
Copy link
Collaborator

It would be great to be able to configure solver parameters like a timeout (in terms of cpu time, clock time, etc) as mentioned in #97. Other configuration options could be useful as well. Solvers that call library functions from JuMP, etc, should pass parameters like timeout along.

@tomerarnon tomerarnon added the enhancement New feature or request label Jul 21, 2020
@AvrahamRaviv
Copy link

Hi
I spent a lot of time trying to make a timeout using Julia, but I failed.
Finally, I used python's subprocess library, but it's not ideal. My code is:
`

             try:
                max_time = 150 # 150 Sec
                output = subprocess.check_output(['Julia', 'juliafile.jl'], timeout=max_time).splitlines()
                # do something
            except subprocess.TimeoutExpired:
                print("the process was too long")

`

@tomerarnon
Copy link
Collaborator Author

Thanks!
I think what we will ultimately do is something along the lines of adding a SolverConfig struct with the relevant fields (TBD). For solvers that call JuMP, we can pass time limits along to JuMP.set_time_limit_sec. For other solvers we may have to keep track of time ourselves.
Although I've never looked into it, I think also calling yield() in the solvers can allow them to be run asynchronously and terminated externally after a set amount of time. This could also be a direction to look at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants