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

Catch SCIP errors / throw Python errors #610

Open
VonAlphaBisZulu opened this issue Sep 1, 2022 · 3 comments
Open

Catch SCIP errors / throw Python errors #610

VonAlphaBisZulu opened this issue Sep 1, 2022 · 3 comments

Comments

@VonAlphaBisZulu
Copy link

PySCIPOpt's error management should be improved. There are many situations in which very simple problems resolve in uncaught errors and crash the parent python program.

Here is one simple example: Create an empty model, solve it, call freeReoptSolve, solve again.

from pyscipopt import Model

m = Model()
print('first optimization')
m.optimize()
print('change state')
m.freeReoptSolve()
print('state changed, 2nd optimization')
m.optimize()
print('done')

This goes into a segmentation fault that ends the Python thread. This should rather throw an error in Python with some more explanation on how to avoid it.

Just to be clear: I do not need help with the particular problem mentioned above. I just suggest catching errors and forwarding them to the python error stream.

@VonAlphaBisZulu VonAlphaBisZulu changed the title Catch if SCIP in wrong state and throw Python error Catch SCIP errors / throw Python errors Sep 1, 2022
@VonAlphaBisZulu
Copy link
Author

Throwing the error in Python and showing the original error message would (1) help identify the problem (2) allow making use of Python debugging mode

@CGraczyk
Copy link
Collaborator

CGraczyk commented Sep 2, 2022

Hi, that does sound like a useful extension of the code! If you have a workaround for this issue or extended the code base on your side, please feel free to create a merge request and we can have a look to integrate this into the master.

Thanks for letting us know.

@VonAlphaBisZulu
Copy link
Author

VonAlphaBisZulu commented Sep 2, 2022

I wish I had, but unfortunately, I never dived deep enough into PySCIPOpt's code. Maybe someone can tag this issue as enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

3 participants